dt-bindings: input: Add PixArt PAJ7620 gesture sensor
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
v3 cover Add PixArt PAJ7620 gesture sensor support
This series adds support for the PixArt PAJ7620 gesture sensor. The first patch provides the DT bindings, and the second patch implements the input driver.
Changes in v3:
- Moved sensor power-up and paj7620_init() to input open/close callbacks
- Implemented dynamic keymap support via 'linux,keycodes' DT property and enabled userspace adjustment via EVIOCSKEYCODE.
- Updated YAML bindings to include mandatory vdd, vbus, and vled supplies.
- Added gpio-controller properties to YAML for hardware completeness.
- Verified with dt_binding_check and checkpatch.pl --strict.
Harpreet Saini (2):
dt-bindings: input: Add PixArt PAJ7620 gesture sensor
input: misc: Add PixArt PAJ7620 gesture sensor driver
.../bindings/input/pixart,paj7620.yaml | 79 ++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + drivers/input/misc/Kconfig | 12 + drivers/input/misc/Makefile | 1 + drivers/input/misc/paj7620.c | 338 ++++++++++++++++++ 5 files changed, 432 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/ pixart,paj7620.yaml create mode 100644 drivers/input/misc/paj7620.c
Signature · 1 line
2.43.0
PATCH v3 1/2 dt-bindings: input: Add PixArt PAJ7620 gesture sensor
Add Device Tree bindings for Pixart PAJ7620 gesture sensor. The sensor supports 9 hand gestures via I2C interface.
The binding include mandatory power supplies (vdd, vbus, vled) and optional GPIO controller properties to describe the hardware's ability to repurpose SPI pins opeating in I2C mode.
--- .../bindings/input/pixart,paj7620.yaml | 79 +++++++++++++++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + 2 files changed, 81 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/pixart,paj7620.yaml
Documentation/devicetree/bindings/input/pixart,paj7620.yaml new file +79 -0
@@ -0,0 +1,79 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/pixart,paj7620.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: PixArt PAJ7620 Gesture Sensor + +maintainers: + - Harpreet Saini <[email protected]> + +description: | + The PixArt PAJ7620 is a gesture recognition sensor with an integrated + infrared LED and CMOS array. It communicates over an I2C interface and + provides gesture data via a dedicated interrupt pin. + +properties: + compatible: + const: pixart,paj7620 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: + description: Main power supply. + + vbus-supply: + description: I/O and I2C bus power supply. + + vled-supply: + description: Power for the integrated IR LED. + + linux,keycodes: + minItems: 9 + maxItems: 9 + description: | + List of keycodes mapping to the 9 supported gestures. + + gpio-controller: true + + "#gpio-cells": + const: 2 + +required: + - compatible + - reg + - interrupts + - vdd-supply + - vbus-supply + - vled-supply + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/input/input.h> + i2c { + #address-cells = <1>; + #size-cells = <0>; + + gesture@73 { + compatible = "pixart,paj7620"; + reg = <0x73>; + interrupt-parent = <&gpio>; + interrupts = <4 IRQ_TYPE_EDGE_FALLING>; + vdd-supply = <®_3v3>; + vbus-supply = <®_1v8>; + vled-supply = <®_3v3>; + linux,keycodes = <KEY_UP KEY_DOWN KEY_LEFT KEY_RIGHT + KEY_ENTER KEY_BACK KEY_NEXT KEY_PREVIOUS + KEY_MENU>; + gpio-controller; + #gpio-cells = <2>; + }; + };
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1273,6 +1273,8 @@ patternProperties: description: Pine64 "^pineriver,.*": description: Shenzhen PineRiver Designs Co., Ltd. + "^pixart,.*": + description: PixArt Imaging Inc. "^pixcir,.*": description: PIXCIR MICROELECTRONICS Co., Ltd "^plantower,.*":
Signature · 1 line
2.43.0
Quoted 1 line · Harpreet Saini
The binding include mandatory power supplies (vdd, vbus, vled)
Drop this part
Quoted 2 lines
and optional GPIO controller properties to describe the hardware's ability to repurpose SPI pins opeating in I2C mode.
And just explain what is the purpose of GPIO controller - is this a GPIO controller?
Plus language typo, run spell check.
Quoted 16 lines
Signed-off-by Harpreet Saini <[email protected]>--- .../bindings/input/pixart,paj7620.yaml | 79 +++++++++++++++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + 2 files changed, 81 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/pixart,paj7620.yamlDocumentation/devicetree/bindings/input/pixart,paj7620.yaml new file +2
-0@@ -0,0 +1,79 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2
Documentation/devicetree/bindings/input/pixart,paj7620.yaml line 12
Quoted 10 lines
Documentation/devicetree/bindings/input/pixart,paj7620.yaml new file +10
-0+--- +$id: http://devicetree.org/schemas/input/pixart,paj7620.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: PixArt PAJ7620 Gesture Sensor + +maintainers: + - Harpreet Saini <[email protected]> + +description: |
Do not need '|' unless you need to preserve formatting.
Quoted 17 lines
Documentation/devicetree/bindings/input/pixart,paj7620.yaml new file +17
-0+ The PixArt PAJ7620 is a gesture recognition sensor with an integrated + infrared LED and CMOS array. It communicates over an I2C interface and + provides gesture data via a dedicated interrupt pin. + +properties: + compatible: + const: pixart,paj7620 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: + description: Main power supply. +
Documentation/devicetree/bindings/input/pixart,paj7620.yaml line 39
Quoted 10 lines
Documentation/devicetree/bindings/input/pixart,paj7620.yaml new file +10
-0+ vbus-supply: + description: I/O and I2C bus power supply. + + vled-supply: + description: Power for the integrated IR LED. + + linux,keycodes: + minItems: 9 + maxItems: 9 + description: |
Do not need '|' unless you need to preserve formatting.
Quoted 5 lines
Documentation/devicetree/bindings/input/pixart,paj7620.yaml new file +5
-0+ List of keycodes mapping to the 9 supported gestures. + + gpio-controller: true + + "#gpio-cells":
Documentation/devicetree/bindings/input/pixart,paj7620.yaml line 54
Quoted 10 lines
Documentation/devicetree/bindings/input/pixart,paj7620.yaml new file +10
-0+ const: 2 + +required: + - compatible + - reg + - interrupts + - vdd-supply + - vbus-supply + - vled-supply +
Missing allOf: with $ref to input.yaml schema. You use its properties.
Commit description said SPI, so missing ref to spi-peripheral-props.
Documentation/devicetree/bindings/input/pixart,paj7620.yaml line 55
Quoted 1 line
Documentation/devicetree/bindings/input/pixart,paj7620.yaml new file +1
-0+additionalProperties: false
And this should be then unevaluatedProperties: false.
Best regards,
Krzysztof
PATCH v3 2/2 input: misc: Add PixArt PAJ7620 gesture sensor driver
In reply to Harpreet SainiThis driver adds support for the PixArt PAJ7620 gesture sensor. It implements hand gesture recognition (up, down, left, right, etc.) and reports them as standard input key events. The driver includes power management support via Runtime PM.
--- drivers/input/misc/Kconfig | 12 ++ drivers/input/misc/Makefile | 1 + drivers/input/misc/paj7620.c | 338 +++++++++++++++++++++++++++++++++++ 3 files changed, 351 insertions(+) create mode 100644 drivers/input/misc/paj7620.c
drivers/input/misc/Kconfig +12 -0
@@ -453,6 +453,18 @@ config INPUT_KXTJ9 To compile this driver as a module, choose M here: the module will be called kxtj9. +config INPUT_PAJ7620 + tristate "PixArt PAJ7620 Gesture Sensor" + depends on I2C + select REGMAP_I2C + help + Say Y here if you want to support the PixArt PAJ7620 gesture + sensor. This sensor supports 9 hand gestures and communicates + over the I2C bus. + + To compile this driver as a module, choose M here: the + module will be called paj7620. + config INPUT_POWERMATE tristate "Griffin PowerMate and Contour Jog support" depends on USB_ARCH_HAS_HCD
drivers/input/misc/Makefile +1 -0
@@ -67,6 +67,7 @@ obj-$(CONFIG_INPUT_PF1550_ONKEY) += pf1550-onkey.o obj-$(CONFIG_INPUT_PM8941_PWRKEY) += pm8941-pwrkey.o obj-$(CONFIG_INPUT_PM8XXX_VIBRATOR) += pm8xxx-vibrator.o obj-$(CONFIG_INPUT_PMIC8XXX_PWRKEY) += pmic8xxx-pwrkey.o +obj-$(CONFIG_INPUT_PAJ7620) += paj7620.o obj-$(CONFIG_INPUT_POWERMATE) += powermate.o obj-$(CONFIG_INPUT_PWM_BEEPER) += pwm-beeper.o obj-$(CONFIG_INPUT_PWM_VIBRA) += pwm-vibra.o
drivers/input/misc/paj7620.c new file +338 -0
338 lines not on this page · raw message
Signature · 1 line
2.43.0