Skip to contentSkip to conversation

W86224 haptic driver

PATCH New Gergo Koteles 1 participant 4 messages Oct 29

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v3 cover W86224 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.

Sashiko found a bug in the 3rd patch, which was fixed in v3.

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 v3 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 v3:
- none

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
#2 lore raw

PATCH v3 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 v3:
- none

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
#3 lore raw

PATCH v3 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 v3:
- add &aw86224_reset_default to pinctrl-0 (sashiko)

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..a90407a40451 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>, <&aw86224_reset_default>;
+		pinctrl-names = "default";
+	};
 };
 
 &ipa {
Signature · 1 line
2.56.0