linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Weiss <luca.weiss@fairphone.com>
To: linux-input@vger.kernel.org
Cc: ~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org,
	Luca Weiss <luca.weiss@fairphone.com>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: Add AW8695 haptics
Date: Fri,  8 Apr 2022 13:53:10 +0200	[thread overview]
Message-ID: <20220408115311.237039-3-luca.weiss@fairphone.com> (raw)
In-Reply-To: <20220408115311.237039-1-luca.weiss@fairphone.com>

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 --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";
-- 
2.35.1


  parent reply	other threads:[~2022-04-08 11:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 11:53 [PATCH 1/3] dt-bindings: input: Add bindings for Awinic " Luca Weiss
2022-04-08 11:53 ` [PATCH 2/3] Input - aw8695: Add driver for " Luca Weiss
2022-04-08 17:25   ` kernel test robot
2022-04-09 21:15   ` Jeff LaBundy
2022-04-11  9:57     ` Luca Weiss
2022-04-12  2:44       ` Jeff LaBundy
2022-04-08 11:53 ` Luca Weiss [this message]
2022-04-08 19:49   ` [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: Add " kernel test robot
2022-04-08 15:05 ` [PATCH 1/3] dt-bindings: input: Add bindings for Awinic " Krzysztof Kozlowski
2022-04-11  8:15   ` Luca Weiss
2022-04-11 12:52     ` Krzysztof Kozlowski
2022-04-11 15:11       ` Luca Weiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220408115311.237039-3-luca.weiss@fairphone.com \
    --to=luca.weiss@fairphone.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    --subject='Re: [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: Add AW8695 haptics' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).