OSDN Git Service

arm64: dts: imx8mq-librem5: describe power supply for cameras
authorMartin Kepplinger <martin.kepplinger@puri.sm>
Thu, 4 Nov 2021 13:22:11 +0000 (14:22 +0100)
committerShawn Guo <shawnguo@kernel.org>
Mon, 22 Nov 2021 01:10:23 +0000 (09:10 +0800)
CAMERA_PWR_EN controls two different power supplies that cameras will use.
The hardware killswitch controls a third one. Describe that appropriately.

The pinctrl that describes the gpio that is used in 2 places here is added
to the pmic. This is done because pmic is powered early enough to make
sure this will work.

When we would have put the same pinctrl property into the 2 regulator nodes
(instead of the pmic), we'd get:

imx8mq-pinctrl 30330000.pinctrl: pin MX8MQ_IOMUXC_GPIO1_IO00 already requested by regulator-csi-1v8; cannot claim for regulator-vcam-2v8
imx8mq-pinctrl 30330000.pinctrl: pin-10 (regulator-vcam-2v8) status -22
imx8mq-pinctrl 30330000.pinctrl: could not request pin 10 (MX8MQ_IOMUXC_GPIO1_IO00) from group camerapwrgrp  on device 30330000.pinctrl

Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi

index 515446e..0c0e260 100644 (file)
                enable-active-high;
        };
 
+       /*
+        * the pinctrl for reg_csi_1v8 and reg_vcam_1v8 is added to the PMIC
+        * since we can't have it twice in the 2 different regulator nodes.
+        */
+       reg_csi_1v8: regulator-csi-1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "CAMERA_VDDIO_1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&reg_vdd_3v3>;
+               gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
+       /* controlled by the CAMERA_POWER_KEY HKS */
+       reg_vcam_1v2: regulator-vcam-1v2 {
+               compatible = "regulator-fixed";
+               regulator-name = "CAMERA_VDDD_1V2";
+               regulator-min-microvolt = <1200000>;
+               regulator-max-microvolt = <1200000>;
+               vin-supply = <&reg_vdd_1v8>;
+               enable-active-high;
+       };
+
+       reg_vcam_2v8: regulator-vcam-2v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "CAMERA_VDDA_2V8";
+               regulator-min-microvolt = <2800000>;
+               regulator-max-microvolt = <2800000>;
+               vin-supply = <&reg_vdd_3v3>;
+               gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
        reg_gnss: regulator-gnss {
                compatible = "regulator-fixed";
                pinctrl-names = "default";
                >;
        };
 
+       pinctrl_camera_pwr: camerapwrgrp {
+               fsl,pins = <
+                       /* CAMERA_PWR_EN_3V3 */
+                       MX8MQ_IOMUXC_GPIO1_IO00_GPIO1_IO0       0x83
+               >;
+       };
+
+       pinctrl_csi1: csi1grp {
+               fsl,pins = <
+                       /* CSI1_NRST */
+                       MX8MQ_IOMUXC_ENET_RXC_GPIO1_IO25        0x83
+               >;
+       };
+
        pinctrl_charger_in: chargeringrp {
                fsl,pins = <
                        /* CHRG_INT */
                compatible = "rohm,bd71837";
                reg = <0x4b>;
                pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_pmic>;
+               pinctrl-0 = <&pinctrl_pmic>, <&pinctrl_camera_pwr>;
                clocks = <&pmic_osc>;
                clock-names = "osc";
                clock-output-names = "pmic_clk";