diff mbox series

[3/3] arm64: dts: qcom: sm7225-fairphone-fp4: Add AW8695 haptics

Message ID 20220408115311.237039-3-luca.weiss@fairphone.com
State Accepted
Commit 413821b7777d062b57f8dc66ab088ed390cbc3ec
Headers show
Series None | expand

Commit Message

Luca Weiss April 8, 2022, 11:53 a.m. UTC
Add a node for the haptics driver found on the phone.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
This patch depends on the i2c10 node introduced in this patch:
https://lore.kernel.org/linux-arm-msm/20220408114205.234635-2-luca.weiss@fairphone.com/

For reference, the dt properties are based on the following properties
from the original vendor driver:

vib_f0_pre = < 2350 >;
=> awinic,f0-preset = <2350>;

vib_f0_coeff = < 260 >;
=> awinic,f0-coefficient = <260>;

vib_f0_cali_percen = < 7 >;
=> awinic,f0-calibration-percent = <7>;

vib_cont_drv_lev = < 125 >;
=> awinic,drive-level = <125>;

vib_f0_trace_parameter = < 0x05 0x03 0x02 0x0f >;
=> awinic,f0-detection-play-time = <5>;
=> awinic,f0-detection-wait-time = <3>;
=> awinic,f0-detection-repeat = <2>;
=> awinic,f0-detection-trace = <15>;

vib_bstdbg = < 0x30 0xeb 0xd4 0 0 0 >;
=> awinic,boost-debug = /bits/ 8 <0x30 0xeb 0xd4>;

vib_tset = < 0x12 >;
=> awinic,tset = /bits/ 8 <0x12>;

vib_r_spare = < 0x68 >;
=> awinic,r-spare = /bits/ 8 <0x68>;

vib_bemf_config = < 0x10 0x08 0x03 0xf8 >;
                                 (0x10 << 8) | 0x08
=> awinic,bemf-upper-threshold = <4104>;
                                 (0x03 << 8) | 0xf8
=> awinic,bemf-lower-threshold = <1016>;

 .../boot/dts/qcom/sm7225-fairphone-fp4.dts    | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
index 67d14bda3797..4691a5e5c8e5 100644
--- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
+++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
@@ -296,6 +296,35 @@  &cdsp {
 	firmware-name = "qcom/sm7225/fairphone4/cdsp.mdt";
 };
 
+&i2c10 {
+	status = "okay";
+	clock-frequency = <400000>;
+
+	haptics@5a {
+		compatible = "awinic,aw8695";
+		reg = <0x5a>;
+		interrupts-extended = <&tlmm 85 IRQ_TYPE_EDGE_FALLING>;
+		reset-gpios = <&tlmm 90 GPIO_ACTIVE_HIGH>;
+
+		awinic,f0-preset = <2350>;
+		awinic,f0-coefficient = <260>;
+		awinic,f0-calibration-percent = <7>;
+		awinic,drive-level = <125>;
+
+		awinic,f0-detection-play-time = <5>;
+		awinic,f0-detection-wait-time = <3>;
+		awinic,f0-detection-repeat = <2>;
+		awinic,f0-detection-trace = <15>;
+
+		awinic,boost-debug = /bits/ 8 <0x30 0xeb 0xd4>;
+		awinic,tset = /bits/ 8 <0x12>;
+		awinic,r-spare = /bits/ 8 <0x68>;
+
+		awinic,bemf-upper-threshold = <4104>;
+		awinic,bemf-lower-threshold = <1016>;
+	};
+};
+
 &mpss {
 	status = "okay";
 	firmware-name = "qcom/sm7225/fairphone4/modem.mdt";