linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add support for Awinic AW86938 haptic driver
@ 2025-12-04 12:28 Griffin Kroah-Hartman
  2025-12-04 12:29 ` [PATCH 1/3] dt-bindings: input: Add Awinic AW86938 Griffin Kroah-Hartman
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Griffin Kroah-Hartman @ 2025-12-04 12:28 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Luca Weiss
  Cc: linux-input, devicetree, linux-kernel, linux-arm-msm,
	Griffin Kroah-Hartman

Add devicetree bindings and a driver for the AW86938 haptic driver chip,
and add it to the devicetree for the Fairphone 6 smartphone.

This driver is very similar to the AW86927, and shares many core
features.

Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
---
Griffin Kroah-Hartman (3):
      dt-bindings: input: Add Awinic AW86938
      Input: aw86938 - add driver for Awinic AW86938
      arm64: dts: qcom: milos-fairphone-fp6: Add vibrator support

 .../devicetree/bindings/input/awinic,aw86927.yaml       |  4 +++-
 arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts        | 17 +++++++++++++++++
 drivers/input/misc/aw86927.c                            | 14 ++++++++++++--
 3 files changed, 32 insertions(+), 3 deletions(-)
---
base-commit: 1cc3747c5a6764ddc6b2d1d8fadb654493ac4ea0
change-id: 20251113-aw86938-driver-b4fa0d3228a2

Best regards,
-- 
Griffin Kroah-Hartman <griffin.kroah@fairphone.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] dt-bindings: input: Add Awinic AW86938
  2025-12-04 12:28 [PATCH 0/3] Add support for Awinic AW86938 haptic driver Griffin Kroah-Hartman
@ 2025-12-04 12:29 ` Griffin Kroah-Hartman
  2025-12-04 13:09   ` Krzysztof Kozlowski
  2025-12-04 12:29 ` [PATCH 2/3] Input: aw86938 - add driver for " Griffin Kroah-Hartman
  2025-12-04 12:29 ` [PATCH 3/3] arm64: dts: qcom: milos-fairphone-fp6: Add vibrator support Griffin Kroah-Hartman
  2 siblings, 1 reply; 8+ messages in thread
From: Griffin Kroah-Hartman @ 2025-12-04 12:29 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Luca Weiss
  Cc: linux-input, devicetree, linux-kernel, linux-arm-msm,
	Griffin Kroah-Hartman

Add bindings for the Awinic AW86938 haptic chip which can be found in
smartphones.

Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
---
 Documentation/devicetree/bindings/input/awinic,aw86927.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/awinic,aw86927.yaml b/Documentation/devicetree/bindings/input/awinic,aw86927.yaml
index b7252916bd727486c1a98913d4ec3ef12422e4bd..c3dee660422192720da3cf63851cea27db819742 100644
--- a/Documentation/devicetree/bindings/input/awinic,aw86927.yaml
+++ b/Documentation/devicetree/bindings/input/awinic,aw86927.yaml
@@ -11,7 +11,9 @@ maintainers:
 
 properties:
   compatible:
-    const: awinic,aw86927
+    enum:
+      - awinic,aw86927
+      - awinic,aw86938
 
   reg:
     maxItems: 1

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] Input: aw86938 - add driver for Awinic AW86938
  2025-12-04 12:28 [PATCH 0/3] Add support for Awinic AW86938 haptic driver Griffin Kroah-Hartman
  2025-12-04 12:29 ` [PATCH 1/3] dt-bindings: input: Add Awinic AW86938 Griffin Kroah-Hartman
@ 2025-12-04 12:29 ` Griffin Kroah-Hartman
  2025-12-04 12:29 ` [PATCH 3/3] arm64: dts: qcom: milos-fairphone-fp6: Add vibrator support Griffin Kroah-Hartman
  2 siblings, 0 replies; 8+ messages in thread
From: Griffin Kroah-Hartman @ 2025-12-04 12:29 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Luca Weiss
  Cc: linux-input, devicetree, linux-kernel, linux-arm-msm,
	Griffin Kroah-Hartman

Add support for the I2C-connected Awinic AW86938 LRA haptic driver.

This driver is functionally similar to the AW86927. but suffers from
distortion with higher gain values.
Its vendor driver sets this value to 0x45, which fixes the problem and
does not noticeably effect the AW86927's playback.

Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
---
 drivers/input/misc/aw86927.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/input/misc/aw86927.c b/drivers/input/misc/aw86927.c
index abd117bb309478b3049f74e53582f06989f74e90..39e22dbdeeb7494ba1a8d4ca8fc40b5580c304f9 100644
--- a/drivers/input/misc/aw86927.c
+++ b/drivers/input/misc/aw86927.c
@@ -166,6 +166,7 @@
 #define AW86927_BASEADDRH_VAL			0x08
 #define AW86927_BASEADDRL_VAL			0x00
 
+#define AW86938_CHIPID				0x9380
 enum aw86927_work_mode {
 	AW86927_STANDBY_MODE,
 	AW86927_RAM_MODE,
@@ -372,7 +373,7 @@ static int aw86927_play_sine(struct aw86927_data *haptics)
 		return err;
 
 	/* set gain to value lower than 0x80 to avoid distorted playback */
-	err = regmap_write(haptics->regmap, AW86927_PLAYCFG2_REG, 0x7c);
+	err = regmap_write(haptics->regmap, AW86927_PLAYCFG2_REG, 0x45);
 	if (err)
 		return err;
 
@@ -602,6 +603,9 @@ static int aw86927_ram_init(struct aw86927_data *haptics)
 			FIELD_PREP(AW86927_SYSCTRL3_EN_RAMINIT_MASK,
 				   AW86927_SYSCTRL3_EN_RAMINIT_ON));
 
+	/* AW86938 wants a 1ms delay here */
+	usleep_range(1000, 1500);
+
 	/* Set base address for the start of the SRAM waveforms */
 	err = regmap_write(haptics->regmap,
 			   AW86927_BASEADDRH_REG,
@@ -724,7 +728,12 @@ static int aw86927_detect(struct aw86927_data *haptics)
 
 	chip_id = be16_to_cpu(read_buf);
 
-	if (chip_id != AW86927_CHIPID) {
+	switch (chip_id) {
+	case AW86927_CHIPID:
+		break;
+	case AW86938_CHIPID:
+		break;
+	default:
 		dev_err(haptics->dev, "Unexpected CHIPID value 0x%x\n", chip_id);
 		return -ENODEV;
 	}
@@ -834,6 +843,7 @@ static int aw86927_probe(struct i2c_client *client)
 
 static const struct of_device_id aw86927_of_id[] = {
 	{ .compatible = "awinic,aw86927" },
+	{ .compatible = "awinic,aw86938" },
 	{ /* sentinel */ }
 };
 

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] arm64: dts: qcom: milos-fairphone-fp6: Add vibrator support
  2025-12-04 12:28 [PATCH 0/3] Add support for Awinic AW86938 haptic driver Griffin Kroah-Hartman
  2025-12-04 12:29 ` [PATCH 1/3] dt-bindings: input: Add Awinic AW86938 Griffin Kroah-Hartman
  2025-12-04 12:29 ` [PATCH 2/3] Input: aw86938 - add driver for " Griffin Kroah-Hartman
@ 2025-12-04 12:29 ` Griffin Kroah-Hartman
  2025-12-04 13:34   ` Konrad Dybcio
  2 siblings, 1 reply; 8+ messages in thread
From: Griffin Kroah-Hartman @ 2025-12-04 12:29 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio, Luca Weiss
  Cc: linux-input, devicetree, linux-kernel, linux-arm-msm,
	Griffin Kroah-Hartman

Add the required node for haptic playback (Awinic AW86938)

Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
---
 arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts b/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts
index 0a758fb7f4d413a84cdae695c38616fc6075db67..8c43bc9c1d8312f22ad0aeed84b23d52910e0ca6 100644
--- a/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts
+++ b/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts
@@ -717,6 +717,16 @@ vreg_l7p: ldo7 {
 
 	/* VL53L3 ToF @ 0x29 */
 	/* AW86938FCR vibrator @ 0x5a */
+	vibrator@5a {
+		compatible = "awinic,aw86938";
+		reg = <0x5a>;
+
+		interrupts-extended = <&tlmm 80 IRQ_TYPE_EDGE_FALLING>;
+		reset-gpios = <&tlmm 78 GPIO_ACTIVE_LOW>;
+
+		pinctrl-0 = <&aw86938_int_default>;
+		pinctrl-names = "default";
+	};
 };
 
 &ipa {
@@ -907,6 +917,13 @@ sdc2_card_det_n: sdc2-card-det-state {
 		bias-pull-up;
 	};
 
+	aw86938_int_default: aw86938-int-default-state {
+		pins = "gpio80";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
 	pm8008_int_default: pm8008-int-default-state {
 		pins = "gpio125";
 		function = "gpio";

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] dt-bindings: input: Add Awinic AW86938
  2025-12-04 12:29 ` [PATCH 1/3] dt-bindings: input: Add Awinic AW86938 Griffin Kroah-Hartman
@ 2025-12-04 13:09   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-04 13:09 UTC (permalink / raw)
  To: Griffin Kroah-Hartman, Dmitry Torokhov, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Luca Weiss
  Cc: linux-input, devicetree, linux-kernel, linux-arm-msm

On 04/12/2025 13:29, Griffin Kroah-Hartman wrote:
> Add bindings for the Awinic AW86938 haptic chip which can be found in
> smartphones.
> 
> Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
> ---
>  Documentation/devicetree/bindings/input/awinic,aw86927.yaml | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/awinic,aw86927.yaml b/Documentation/devicetree/bindings/input/awinic,aw86927.yaml
> index b7252916bd727486c1a98913d4ec3ef12422e4bd..c3dee660422192720da3cf63851cea27db819742 100644
> --- a/Documentation/devicetree/bindings/input/awinic,aw86927.yaml
> +++ b/Documentation/devicetree/bindings/input/awinic,aw86927.yaml
> @@ -11,7 +11,9 @@ maintainers:
>  
>  properties:
>    compatible:
> -    const: awinic,aw86927
> +    enum:
> +      - awinic,aw86927
> +      - awinic,aw86938


Your driver change suggests these are compatible, so please express it
here with compatibility and fallback (see exampe-schema or most of other
bindings) or explain in commit msg why devices are not compatible.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: milos-fairphone-fp6: Add vibrator support
  2025-12-04 12:29 ` [PATCH 3/3] arm64: dts: qcom: milos-fairphone-fp6: Add vibrator support Griffin Kroah-Hartman
@ 2025-12-04 13:34   ` Konrad Dybcio
  2025-12-04 13:43     ` David Heidelberg
  0 siblings, 1 reply; 8+ messages in thread
From: Konrad Dybcio @ 2025-12-04 13:34 UTC (permalink / raw)
  To: Griffin Kroah-Hartman, Dmitry Torokhov, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
	Luca Weiss
  Cc: linux-input, devicetree, linux-kernel, linux-arm-msm

On 12/4/25 1:29 PM, Griffin Kroah-Hartman wrote:
> Add the required node for haptic playback (Awinic AW86938)
> 
> Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
> ---
>  arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts | 17 +++++++++++++++++

The DTS is unfortunately still not merged :/

Please arrange with Luca and either squash this into the resubmission
(depending on how the driver changes go for the vibrator) or resend it
afterwards

>  1 file changed, 17 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts b/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts
> index 0a758fb7f4d413a84cdae695c38616fc6075db67..8c43bc9c1d8312f22ad0aeed84b23d52910e0ca6 100644
> --- a/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts
> +++ b/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts
> @@ -717,6 +717,16 @@ vreg_l7p: ldo7 {
>  
>  	/* VL53L3 ToF @ 0x29 */
>  	/* AW86938FCR vibrator @ 0x5a */

You can remove this comment now

The remainder of the patch lgtm

Konrad

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: milos-fairphone-fp6: Add vibrator support
  2025-12-04 13:34   ` Konrad Dybcio
@ 2025-12-04 13:43     ` David Heidelberg
  2025-12-04 13:45       ` Konrad Dybcio
  0 siblings, 1 reply; 8+ messages in thread
From: David Heidelberg @ 2025-12-04 13:43 UTC (permalink / raw)
  To: Konrad Dybcio, Griffin Kroah-Hartman, Dmitry Torokhov,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
	Konrad Dybcio, Luca Weiss
  Cc: linux-input, devicetree, linux-kernel, linux-arm-msm

On 04/12/2025 14:34, Konrad Dybcio wrote:
> On 12/4/25 1:29 PM, Griffin Kroah-Hartman wrote:
>> Add the required node for haptic playback (Awinic AW86938)
>>
>> Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
>> ---
>>   arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts | 17 +++++++++++++++++
> 
> The DTS is unfortunately still not merged :/
> 
> Please arrange with Luca and either squash this into the resubmission
> (depending on how the driver changes go for the vibrator) or resend it
> afterwards

would be enough to provide dependency on the Luca patchset trough the 
amazing

b4 prep --edit-deps

here?

David

> 
>>   1 file changed, 17 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts b/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts
>> index 0a758fb7f4d413a84cdae695c38616fc6075db67..8c43bc9c1d8312f22ad0aeed84b23d52910e0ca6 100644
>> --- a/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts
>> +++ b/arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts
>> @@ -717,6 +717,16 @@ vreg_l7p: ldo7 {
>>   
>>   	/* VL53L3 ToF @ 0x29 */
>>   	/* AW86938FCR vibrator @ 0x5a */
> 
> You can remove this comment now
> 
> The remainder of the patch lgtm
> 
> Konrad
> 

-- 
David Heidelberg


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: milos-fairphone-fp6: Add vibrator support
  2025-12-04 13:43     ` David Heidelberg
@ 2025-12-04 13:45       ` Konrad Dybcio
  0 siblings, 0 replies; 8+ messages in thread
From: Konrad Dybcio @ 2025-12-04 13:45 UTC (permalink / raw)
  To: David Heidelberg, Griffin Kroah-Hartman, Dmitry Torokhov,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
	Konrad Dybcio, Luca Weiss
  Cc: linux-input, devicetree, linux-kernel, linux-arm-msm

On 12/4/25 2:43 PM, David Heidelberg wrote:
> On 04/12/2025 14:34, Konrad Dybcio wrote:
>> On 12/4/25 1:29 PM, Griffin Kroah-Hartman wrote:
>>> Add the required node for haptic playback (Awinic AW86938)
>>>
>>> Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
>>> ---
>>>   arch/arm64/boot/dts/qcom/milos-fairphone-fp6.dts | 17 +++++++++++++++++
>>
>> The DTS is unfortunately still not merged :/
>>
>> Please arrange with Luca and either squash this into the resubmission
>> (depending on how the driver changes go for the vibrator) or resend it
>> afterwards
> 
> would be enough to provide dependency on the Luca patchset trough the amazing
> 
> b4 prep --edit-deps
> 
> here?

This makes sense for patches that are predicted to be merged without
obstacles - IIRC Luca's original series still may have some dependencies
on various subsystem maintainers for oneliner compatibles

Konrad

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-12-04 13:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-04 12:28 [PATCH 0/3] Add support for Awinic AW86938 haptic driver Griffin Kroah-Hartman
2025-12-04 12:29 ` [PATCH 1/3] dt-bindings: input: Add Awinic AW86938 Griffin Kroah-Hartman
2025-12-04 13:09   ` Krzysztof Kozlowski
2025-12-04 12:29 ` [PATCH 2/3] Input: aw86938 - add driver for " Griffin Kroah-Hartman
2025-12-04 12:29 ` [PATCH 3/3] arm64: dts: qcom: milos-fairphone-fp6: Add vibrator support Griffin Kroah-Hartman
2025-12-04 13:34   ` Konrad Dybcio
2025-12-04 13:43     ` David Heidelberg
2025-12-04 13:45       ` Konrad Dybcio

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).