OSDN Git Service

ARM: dts: msm: Add stmVL53L0 device entry
authorBikas Gurung <bgurung@codeaurora.org>
Wed, 7 Dec 2016 21:05:48 +0000 (13:05 -0800)
committerGerrit - the friendly Code Review server <code-review@localhost>
Wed, 22 Feb 2017 23:48:34 +0000 (15:48 -0800)
Add dts entry for stmvl53l0 laser sensor for
MSM8998. stmvl53l0 is accessed through CCI
interface and is used for time-of-flight autofocus.

CRs-fixed: 1051771
Change-Id: I177000efba35344fa1f1fb595d4635c8d0024a69
Signed-off-by: Bikas Gurung <bgurung@codeaurora.org>
Documentation/devicetree/bindings/media/video/laser-sensor.txt [new file with mode: 0644]
arch/arm/boot/dts/qcom/msm8998-camera-sensor-cdp.dtsi
arch/arm/boot/dts/qcom/msm8998-camera-sensor-mtp.dtsi
arch/arm/boot/dts/qcom/msm8998-interposer-pm660.dtsi
arch/arm/boot/dts/qcom/msm8998-pinctrl.dtsi

diff --git a/Documentation/devicetree/bindings/media/video/laser-sensor.txt b/Documentation/devicetree/bindings/media/video/laser-sensor.txt
new file mode 100644 (file)
index 0000000..1bcb0b9
--- /dev/null
@@ -0,0 +1,28 @@
+Laser Sensor Device Tree Bindings.
+========================================
+
+Boards with the Laser Sensor connected to CCI shall have the following
+properties:
+
+Required node properties:
+       - cell-index: cci hardware core index
+    - compatible:
+               - "st,stmvl53l0" : STMiecroelectronics VL53L0 Laser sensor.
+       - reg : offset and length of the register set for the device
+       - qcom, cci-master: cci master the sensor connected to
+       - cam_cci-supply : cci voltage regulator used
+       - cam_laser-supply: laser sensor voltage regulator
+       - qcom,cam-vreg-name: voltage regulators name
+       - qcom, cam-vreg-min-voltage: specify minimum voltage level for
+               regulators used
+       - qcom, cam-vreg-max-voltage: specify maximum voltage level for
+               regulators used
+       - pinctrl-names : should specify the pin control groups followed by
+               the definition of each group
+       - gpios : should contain phandle to gpio controller node and array of
+               #gpio-cells specifying specific gpio (controller specific)
+       - qcom,gpio-req-tbl-num : contains index to gpios specific to the sensor
+       - qcom,gpio-req-tbl-flags : should contain direction of gpios present in
+               qcom,gpio-req-tbl-num property (in the same order)
+       - qcom,gpio-req-tbl-label : should contain name of gpios present in
+               qcom,gpio-req-tbl-num property (in the same order)
index 2cb08e1..e7a61f4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
                status = "disabled";
        };
 
+       tof0:qcom,tof@0{
+               cell-index = <0>;
+               reg = <0x29>;
+               compatible = "st,stmvl53l0";
+               qcom,cci-master = <0>;
+               cam_cci-supply = <&pm8998_lvs1>;
+               cam_laser-supply = <&pmi8998_bob>;
+               qcom,cam-vreg-name = "cam_cci", "cam_laser";
+               qcom,cam-vreg-min-voltage = <0 0>;
+               qcom,cam-vreg-max-voltage = <0 3600000>;
+               pinctrl-names = "cam_default", "cam_suspend";
+               pinctrl-0 = <&cam_tof_active>;
+               pinctrl-1 = <&cam_tof_suspend>;
+               gpios = <&tlmm 27 0>,
+                               <&tlmm 126 0>;
+               qcom,gpio-req-tbl-num = <0 1>;
+               qcom,gpio-req-tbl-flags = <0 0>;
+               qcom,gpio-req-tbl-label = "CAM_TOF", "CAM_CE";
+       };
+
        eeprom0: qcom,eeprom@0 {
                cell-index = <0>;
                reg = <0>;
index 0a41383..c5384ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
                pinctrl-0 = <&cam_actuator_vaf_active>;
                pinctrl-1 = <&cam_actuator_vaf_suspend>;
        };
-
+       tof0:qcom,tof@0{
+               cell-index = <0>;
+               reg = <0x29>;
+               compatible = "st,stmvl53l0";
+               qcom,cci-master = <0>;
+               cam_cci-supply = <&pm8998_lvs1>;
+               cam_laser-supply = <&pmi8998_bob>;
+               qcom,cam-vreg-name = "cam_cci", "cam_laser";
+               qcom,cam-vreg-min-voltage = <0 0>;
+               qcom,cam-vreg-max-voltage = <0 3600000>;
+               pinctrl-names = "cam_default", "cam_suspend";
+               pinctrl-0 = <&cam_tof_active>;
+               pinctrl-1 = <&cam_tof_suspend>;
+               gpios = <&tlmm 27 0>, <&tlmm 126 0>;
+               qcom,gpio-req-tbl-num = <0 1>;
+               qcom,gpio-req-tbl-flags = <0 0>;
+               qcom,gpio-req-tbl-label = "CAM_TOF", "CAM_CE";
+       };
        ois0: qcom,ois@0 {
                cell-index = <0>;
                reg = <0x0>;
index c952215..f4ff7c4 100644 (file)
        /delete-property/gpios;
 };
 
+&tof0 {
+       /delete-property/cam_cci-supply;
+       /delete-property/cam_laser-supply;
+       /delete-property/gpios;
+};
+
+
 &cci {
        /delete-node/qcom,camera@1;
        /delete-node/qcom,camera@2;
index 19b227f..4914363 100644 (file)
                        };
                };
 
+               cam_tof_active: cam_tof_active {
+                       mux {
+                               pins = "gpio27", "gpio126";
+                               function = "gpio";
+                       };
+
+                       config {
+                               pins = "gpio27", "gpio126";
+                               bias-disable;
+                               drive-strength = <2>; /* 2 MA */
+                       };
+               };
+
+               cam_tof_suspend: cam_tof_suspend {
+                       mux {
+                               pins = "gpio27", "gpio126";
+                               function = "gpio";
+                       };
+
+                       config {
+                               pins = "gpio27", "gpio126";
+                               bias-pull-down; /* PULL DOWN */
+                               drive-strength = <2>; /* 2 MA */
+                       };
+               };
+
                cam_sensor_mclk0_active: cam_sensor_mclk0_active {
                        /* MCLK0 */
                        mux {