arm64: dts: qcom: msm8916-samsung-a2015: Add vibrator
authorNikita Travkin <nikita@trvn.ru>
Thu, 20 Oct 2022 11:56:08 +0000 (11:56 +0000)
committerBjorn Andersson <andersson@kernel.org>
Fri, 28 Oct 2022 21:25:54 +0000 (16:25 -0500)
Both a2015 devices use motor drivers controlled with PWM signal.
A5 additionally has a fixed regulator that powers the driver and is
controlled by enable signal. A3 routes that enable signal to the
motor driver itself.
To simplify the description, add the motor to the common dtsi and
assume a regulator is used for both.

Signed-off-by: Nikita Travkin <nikita@trvn.ru>
[Rename the nodes to be reusable in msm8916-sansung-e2015]
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221020115255.2026-1-linmengbo0689@protonmail.com
arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts
arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts
arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi

index 5f7cec347a4fe70d62f9e9c679a5b52fff3d3b87..2a074e70c4da305f37986410919f5a951052ccb9 100644 (file)
                };
        };
 
+       clk_pwm: pwm {
+               compatible = "clk-pwm";
+               #pwm-cells = <2>;
+
+               clocks = <&gcc GCC_GP2_CLK>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&motor_pwm_default>;
+               status = "disabled";
+       };
+
        gpio-keys {
                compatible = "gpio-keys";
 
                };
        };
 
+       /*
+        * NOTE: A5 connects GPIO 76 to a reglator powering the motor
+        * driver IC but A3 connects the same signal to an ENABLE pin of
+        * the driver.
+        */
+       reg_motor_vdd: regulator-motor-vdd {
+               compatible = "regulator-fixed";
+               regulator-name = "motor_vdd";
+               regulator-min-microvolt = <3000000>;
+               regulator-max-microvolt = <3000000>;
+
+               gpio = <&msmgpio 76 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&motor_en_default>;
+       };
+
        reg_vdd_tsp_a: regulator-vdd-tsp-a {
                compatible = "regulator-fixed";
                regulator-name = "vdd_tsp_a";
                        pinctrl-0 = <&nfc_default &nfc_clk_req>;
                };
        };
+
+       vibrator: vibrator {
+               compatible = "pwm-vibrator";
+
+               pwms = <&clk_pwm 0 100000>;
+               pwm-names = "enable";
+
+               vcc-supply = <&reg_motor_vdd>;
+               status = "disabled";
+       };
 };
 
 &blsp_i2c2 {
                };
        };
 
+       motor_en_default: motor-en-default {
+               pins = "gpio76";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-disable;
+       };
+
+       motor_pwm_default: motor-pwm-default {
+               pins = "gpio50";
+               function = "gcc_gp2_clk_a";
+       };
+
        muic_i2c_default: muic-i2c-default {
                pins = "gpio105", "gpio106";
                function = "gpio";
index 6db5f78ca286fdeba597bac89f4455849b44302c..d495d5ae5cc3068089a6a32134425a6433197800 100644 (file)
        };
 };
 
+&clk_pwm {
+       status = "okay";
+};
+
 &dsi0 {
        panel@0 {
                reg = <0>;
        remote-endpoint = <&panel_in>;
 };
 
+&vibrator {
+       status = "okay";
+};
+
 &msmgpio {
        panel_vdd3_default: panel-vdd3-default {
                pins = "gpio9";
index 5fb8ecd0c9ca33feedd022748edd50eaebbf1e95..c03504ab27b7293388e15143f4a05577180254fd 100644 (file)
        };
 };
 
+&clk_pwm {
+       status = "okay";
+};
+
 &pronto {
        iris {
                compatible = "qcom,wcn3660b";
        vdd-supply = <&reg_touch_key>;
 };
 
+&vibrator {
+       status = "okay";
+};
+
 &msmgpio {
        tkey_en_default: tkey-en-default {
                pins = "gpio97";
index 542010fdfb8a687d7ea951cc22608dad49fec967..edd24b597a150e82458f2ea547d7059202b62675 100644 (file)
                };
        };
 
-       reg_motor_vdd: regulator-motor-vdd {
-               compatible = "regulator-fixed";
-               regulator-name = "motor_vdd";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-
-               gpio = <&msmgpio 76 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
-
-               pinctrl-names = "default";
-               pinctrl-0 = <&motor_en_default>;
-       };
-
        reg_touch_key: regulator-touch-key {
                compatible = "regulator-fixed";
                regulator-name = "touch_key";
        /delete-node/ magnetometer@12;
 };
 
+&reg_motor_vdd {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+};
+
 &touchkey {
        vcc-supply = <&reg_touch_key>;
        vdd-supply = <&reg_touch_key>;
 };
 
 &msmgpio {
-       motor_en_default: motor-en-default {
-               pins = "gpio76";
-               function = "gpio";
-
-               drive-strength = <2>;
-               bias-disable;
-       };
-
        tkey_en_default: tkey-en-default {
                pins = "gpio97";
                function = "gpio";