Skip to contentSkip to conversation

AW86224 haptic driver

PATCH Superseded Gergo Koteles 4 participants 7 messages Oct 28 – Oct 29

Subsystems (5)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover AW86224 haptic driver

Hi,

This series enables the haptics of the Motorola Edge 30.

The first patch adds the binding documentation for the AW86224, which is compatible with the AW86927 haptic driver.

The second one contains the driver. The AW86224 differs from the AW86927 in many respects, so writing a new driver seemed the simpler approach.

The third one enables it in the sm7325-motorola-dubai-common DTS.

I removed Enrico from the v2 recipient list because his email address is not working.

Gergo Koteles (3):
dt-bindings: input: Add compatibility for Awinic AW86224
Input: aw86224 - add driver for Awinic AW86224
arm64: dts: qcom: sm7325-motorola-dubai: Add vibrator support

 .../bindings/input/awinic,aw86927.yaml        |   4 +-
 .../qcom/sm7325-motorola-dubai-common.dtsi    |  11 +
 drivers/input/misc/Kconfig                    |  12 +
 drivers/input/misc/Makefile                   |   1 +
 drivers/input/misc/aw86224.c                  | 582 ++++++++++++++++++
 5 files changed, 609 insertions(+), 1 deletion(-)
 create mode 100644 drivers/input/misc/aw86224.c
Signature · 1 line
2.56.0
#1 lore raw

PATCH v2 1/3 dt-bindings: input: Add compatibility for Awinic AW86224

Add the AW86224 haptic device to the binding documentation for the AW86927 and AW86938, as this binding needs the same properties.

They are not compatible though, because the chip identification works differently compared to the 86927/86938

---
Changes in v2:
- add only the new element (Krzysztof)

---
 Documentation/devicetree/bindings/input/awinic,aw86927.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/input/awinic,aw86927.yaml +3 -1
index bd74b81488f6..264c4c8f7a65 100644
@@ -12,7 +12,9 @@ maintainers:
 properties:
   compatible:
     oneOf:
-      - const: awinic,aw86927
+      - enum:
+          - awinic,aw86224
+          - awinic,aw86927
       - items:
           - enum:
               - awinic,aw86938
Signature · 1 line
2.56.0
Acked-by on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] dt-bindings: input: Add compatibility for Awinic AW86224

Quoted 7 lines · Gergo Koteles

Add the AW86224 haptic device to the binding documentation for the AW86927 and AW86938, as this binding needs the same properties.

They are not compatible though, because the chip identification works differently compared to the 86927/86938

Best regards,
Krzysztof

#3 lore raw

PATCH v2 2/3 Input: aw86224 - add driver for Awinic AW86224

In reply to Gergo Koteles

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

The chip supports multiple modes of which only RAM mode is implemented.

---
Changes in v2:
- rename AW86224_BASEADDR{H,L}_VAL to AW86224_RAM_BASE_ADDR_{H,L}
- calculate AW86224_RAM_BASE_ADDR_{H,L} with code

---
 drivers/input/misc/Kconfig   |  12 +
 drivers/input/misc/Makefile  |   1 +
 drivers/input/misc/aw86224.c | 582 +++++++++++++++++++++++++++++++++++
 3 files changed, 595 insertions(+)
 create mode 100644 drivers/input/misc/aw86224.c
drivers/input/misc/Kconfig +12 -0
index 169768e3d5bb..f96972176c0b 100644
@@ -126,6 +126,18 @@ config INPUT_ATMEL_CAPTOUCH
 	  To compile this driver as a module, choose M here: the
 	  module will be called atmel_captouch.
 
+config INPUT_AW86224
+	tristate "Awinic AW86224 Haptic Driver Support"
+	depends on I2C && INPUT
+	select INPUT_FF_MEMLESS
+	select REGMAP_I2C
+	help
+	  Say Y here if you have an Awinic AW86224 haptic chip.
+	  One should find "awinic,aw86224" node in the board specific DTS.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called aw86224.
+
 config INPUT_AW86927
 	tristate "Awinic AW86927 Haptic Driver Support"
 	depends on I2C && INPUT
drivers/input/misc/Makefile +1 -0
index 1339619f0769..3bcdc8ea4b53 100644
@@ -23,6 +23,7 @@ obj-$(CONFIG_INPUT_ATC260X_ONKEY)	+= atc260x-onkey.o
 obj-$(CONFIG_INPUT_ATI_REMOTE2)		+= ati_remote2.o
 obj-$(CONFIG_INPUT_ATLAS_BTNS)		+= atlas_btns.o
 obj-$(CONFIG_INPUT_ATMEL_CAPTOUCH)	+= atmel_captouch.o
+obj-$(CONFIG_INPUT_AW86224)		+= aw86224.o
 obj-$(CONFIG_INPUT_AW86927)		+= aw86927.o
 obj-$(CONFIG_INPUT_BBNSM_PWRKEY)	+= nxp-bbnsm-pwrkey.o
 obj-$(CONFIG_INPUT_BMA150)		+= bma150.o
drivers/input/misc/aw86224.c new file +582 -0

582 lines not on this page · raw message

Signature · 1 line
2.56.0
#4 lore raw

PATCH v2 3/3 arm64: dts: qcom: sm7325-motorola-dubai: Add vibrator support

In reply to Gergo Koteles

Add the required node for haptic playback (Awinic AW86224).

---
Changes in v2:
- rebased on mainline (Krzysztof)
- order by address (Konrad)

---
 .../boot/dts/qcom/sm7325-motorola-dubai-common.dtsi   | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi +11 -0
index 3860ab8508a0..df2cb58e95d0 100644
@@ -721,6 +721,17 @@ fsa4480_sbu_mux: endpoint {
 			};
 		};
 	};
+
+	vibrator@58 {
+		compatible = "awinic,aw86224";
+		reg = <0x58>;
+
+		interrupts-extended = <&tlmm 47 IRQ_TYPE_EDGE_FALLING>;
+		reset-gpios = <&tlmm 46 GPIO_ACTIVE_LOW>;
+
+		pinctrl-0 = <&aw86224_int_default>;
+		pinctrl-names = "default";
+	};
 };
 
 &ipa {
Signature · 1 line
2.56.0
#5 lore raw

Re: [PATCH v2 3/3] arm64: dts: qcom: sm7325-motorola-dubai: Add vibrator support

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] arm64: dts: qcom: missing aw86224_reset_default in vibrator@58 pinctrl-0 --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] arm64: dts: qcom: missing aw86224_reset_default in vibrator@58 pinctrl-0 --

commit 0c4fc157858ecc13c8cc7fb55e5af412993c27bd
Author: Gergo Koteles <[email protected]>

arm64: dts: qcom: sm7325-motorola-dubai: Add vibrator support

This commit adds the device tree node for the Awinic AW86224 haptic controller on sm7325-motorola-dubai boards.

Quoted 8 lines
arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi +0 -0
index 3860ab8508a09..df2cb58e95d06 100644
@@ -721,6 +721,17 @@ fsa4480_sbu_mux: endpoint {
 			};
 		};
 	};

arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi fsa4480_sbu_mux: endpoint { · line 733

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi +10 -0
+
+	vibrator@58 {
+		compatible = "awinic,aw86224";
+		reg = <0x58>;
+
+		interrupts-extended = <&tlmm 47 IRQ_TYPE_EDGE_FALLING>;
+		reset-gpios = <&tlmm 46 GPIO_ACTIVE_LOW>;
+
+		pinctrl-0 = <&aw86224_int_default>;
+		pinctrl-names = "default";

[Severity: Medium]
Should pinctrl-0 in vibrator@58 also include &aw86224_reset_default?

The node consumes gpio46 via reset-gpios, and &tlmm in arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi defines a dedicated pin configuration state for it:

	aw86224_reset_default: aw86224-reset-default-state {
		pins = "gpio46";
		function = "gpio";
		drive-strength = <2>;
		bias-pull-down;
	};

Without &aw86224_reset_default in pinctrl-0, this pinctrl node remains unreferenced and the pinmux, drive-strength, and pull-down bias for gpio46 are not applied when the device probes.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3