Skip to contentSkip to conversation

AW86224 haptic driver

PATCH Superseded Gergo Koteles 3 participants 9 messages Oct 27 – Oct 28

Subsystems (5)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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.

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        |   6 +-
 .../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, 608 insertions(+), 4 deletions(-)
 create mode 100644 drivers/input/misc/aw86224.c
Signature · 1 line
2.56.0
#1 lore raw

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

Add the AW86224 haptic driver 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

---
 Documentation/devicetree/bindings/input/awinic,aw86927.yaml | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/input/awinic,aw86927.yaml +2 -4
index bd74b81488f6..655633527c01 100644
@@ -12,11 +12,9 @@ maintainers:
 properties:
   compatible:
     oneOf:
+      - const: awinic,aw86224
       - const: awinic,aw86927
-      - items:
-          - enum:
-              - awinic,aw86938
-          - const: awinic,aw86927
+      - const: awinic,aw86938
 
   reg:
     maxItems: 1
Signature · 1 line
2.56.0
#4 lore raw

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

---
 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 1f6c57dba030..aa14417154ff 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 2281d6803fce..f0cd6a40790d 100644
@@ -22,6 +22,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
#5 lore raw

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

---
 .../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 ef91986a1fb9..434846be51d9 100644
@@ -924,6 +924,17 @@ &i2c4 {
 
 	status = "okay";
 
+	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";
+	};
+
 	wl2864c@29 {
 		compatible = "willsemi,wl2864c";
 		reg = <0x29>;
Signature · 1 line
2.56.0
#2 lore raw

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

In reply to Gergo Koteles
Quoted 16 lines · Gergo Koteles

Add the AW86224 haptic driver 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

---
 Documentation/devicetree/bindings/input/awinic,aw86927.yaml | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/input/awinic,aw86927.yaml +0 -0
index bd74b81488f6..655633527c01 100644

Documentation/devicetree/bindings/input/awinic,aw86927.yaml maintainers: · line 17

Quoted 10 lines
Documentation/devicetree/bindings/input/awinic,aw86927.yaml +2 -4
@@ -12,11 +12,9 @@ maintainers:
 properties:
   compatible:
     oneOf:
+      - const: awinic,aw86224
       - const: awinic,aw86927
-      - items:
-          - enum:
-              - awinic,aw86938
-          - const: awinic,aw86927
+      - const: awinic,aw86938

I do not understand why you are changing this and commit msg is not explaining that. You only say that new device is not compatible, but how is that relevant for existing binding? Anyway, separate commits with separate reasoning.

Best regards,
Krzysztof

#6 lore raw

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

In reply to Gergo Koteles
Quoted 17 lines · Gergo Koteles

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

---
 .../boot/dts/qcom/sm7325-motorola-dubai-common.dtsi   | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi +2 -0
index ef91986a1fb9..434846be51d9 100644
@@ -924,6 +924,17 @@ &i2c4 {
 
 	status = "okay";
 
+	vibrator@58 {
+		compatible = "awinic,aw86224";

arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi &i2c4 { · line 938

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi +9 -0
+		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";
+	};
+
 	wl2864c@29 {

There is no such code.

Please work on mainline, not some fork.

Best regards,
Krzysztof

#7 lore raw

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

Quoted 31 lines · Krzysztof Kozlowski
Quoted 17 lines · Gergo Koteles

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

---
 .../boot/dts/qcom/sm7325-motorola-dubai-common.dtsi   | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi +2 -0
index ef91986a1fb9..434846be51d9 100644
@@ -924,6 +924,17 @@ &i2c4 {
 
 	status = "okay";
 
+	vibrator@58 {
+		compatible = "awinic,aw86224";

arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi &i2c4 { · line 938

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi +9 -0
+		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";
+	};
+
 	wl2864c@29 {

There is no such code.

Quoted 1 line

Please work on mainline, not some fork.

+ please keep the entries sorted

Konrad

#3 lore raw

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

In reply to Krzysztof Kozlowski

Hi Krzysztof,

Quoted 24 lines · Krzysztof Kozlowski
Quoted 23 lines · Gergo Koteles

Add the AW86224 haptic driver 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

---
 Documentation/devicetree/bindings/input/awinic,aw86927.yaml | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/input/awinic,aw86927.yaml +1 -2
index bd74b81488f6..655633527c01 100644
@@ -12,11 +12,9 @@ maintainers:
 properties:
   compatible:
     oneOf:
+      - const: awinic,aw86224
       - const: awinic,aw86927
-      - items:
-          - enum:
Quoted 9 lines

Documentation/devicetree/bindings/input/awinic,aw86927.yaml maintainers: · line 17

Quoted 3 lines
Documentation/devicetree/bindings/input/awinic,aw86927.yaml +1 -2
-              - awinic,aw86938
-          - const: awinic,aw86927
+      - const: awinic,aw86938

I do not understand why you are changing this and commit msg is not explaining that. You only say that new device is not compatible, but how is that relevant for existing binding? Anyway, separate commits with separate reasoning.

Thanks for the review.

There was some confusion regarding this in my head, but I now understand that it validates the entire compatible array. I will add it accordingly in v2.

Best regards,
Gergo

#8 lore raw

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

In reply to Konrad Dybcio

Hi Konrad,

Quoted 32 lines · Konrad Dybcio
Quoted 31 lines · Krzysztof Kozlowski
Quoted 17 lines · Gergo Koteles

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

---
 .../boot/dts/qcom/sm7325-motorola-dubai-common.dtsi   | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi +2 -0
index ef91986a1fb9..434846be51d9 100644
@@ -924,6 +924,17 @@ &i2c4 {
 
 	status = "okay";
 
+	vibrator@58 {
+		compatible = "awinic,aw86224";

arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi &i2c4 { · line 938

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi +9 -0
+		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";
+	};
+
 	wl2864c@29 {

There is no such code.

Quoted 5 lines
Quoted 1 line

Please work on mainline, not some fork.

+ please keep the entries sorted

Konrad

Thanks for the review.

I will sort it by address in the v2.

Best regards,
Gergo