[PATCH 4/8] arm64: dts: qcom: msm8916-samsung-gt510: Add Vibrator
From: Nikita Travkin
Date: Thu Jan 05 2023 - 07:51:52 EST
gt510 uses a PWM controllable vibrator, that uses a general purpose
clock output for it's control. Set up the pwm, supply and the vibrator.
Signed-off-by: Nikita Travkin <nikita@xxxxxxx>
---
.../boot/dts/qcom/msm8916-samsung-gt510.dts | 47 +++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts
index e9916199e5a3..44d527b3f1f6 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts
@@ -8,4 +8,51 @@ / {
model = "Samsung Galaxy Tab A 9.7 (2015)";
compatible = "samsung,gt510", "qcom,msm8916";
chassis-type = "tablet";
+
+ clk_pwm: pwm {
+ compatible = "clk-pwm";
+ #pwm-cells = <2>;
+
+ clocks = <&gcc GCC_GP2_CLK>;
+
+ pinctrl-0 = <&motor_pwm_default>;
+ pinctrl-names = "default";
+ };
+
+ 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-0 = <&motor_en_default>;
+ pinctrl-names = "default";
+ };
+
+ vibrator {
+ compatible = "pwm-vibrator";
+
+ pwms = <&clk_pwm 0 100000>;
+ pwm-names = "enable";
+
+ vcc-supply = <®_motor_vdd>;
+ };
+};
+
+&msmgpio {
+ motor_en_default: motor-en-default-state {
+ pins = "gpio76";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ motor_pwm_default: motor-pwm-default-state {
+ pins = "gpio50";
+ function = "gcc_gp2_clk_a";
+ };
};
--
2.38.1