Skip to contentSkip to conversation

devicetree: bindings: Update gpio-keys-polled with support

PATCH Superseded Hans de Goede 1 participant 2 messages Sep 12, 2015

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

v2 cover devicetree: bindings: Update gpio-keys-polled with support

Hi All,

Here is v2 of the patch adding support for EV_ABS/EV_REL to the' gpio-keys-polled devicetree bindings. This version addresses Rob's comments.

Dmitry, I believe it makes the most sense if you merge this together with the patch actually implementing support for this in the gpio_keys_polled.c driver. Let me know if you've any remarks on that driver and I need to respin it.

I will prepare a new patch-set to deal with making the evdev defines available for use in dts files. The plan is to split out a file with just the defines out of the existing linux/input.h, and make include/dt-bindings/input.h a symlink to this split-out file.

Regards,

Hans

#1 lore raw

PATCH v2 1/1 devicetree: bindings: Update gpio-keys-polled with support for abs/rel axis

The devicetree binding for gpio-keys-polled already allows specifying what type of events (key / rel / abs) a button generates when pressed.

But for rel / abs axis we also need to specify which value this specific gpio represents.

One usecase is digital joysticks / direction-pads which are hooked up to gpio, in this case we've left and right buttons which we want to map to EV_ABS, ABS_X and we want generate events for left with a value of -1 and for right with a value of +1 (and similar for up / down and ABS_Y).

---
Changes in v2:
-Add Rob's ack
-s/send/sent/
-Make the remarks of axis reporting a value of 0 when all buttons tied to
that axis are released also apply to EV_REL axis

---
 Documentation/devicetree/bindings/input/gpio-keys-polled.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/input/gpio-keys-polled.txt +6 -1
index 313abef..283f85e 100644
@@ -13,11 +13,16 @@ Subnode properties:
 
 	- gpios: OF device-tree gpio specification.
 	- label: Descriptive name of the key.
-	- linux,code: Keycode to emit.
+	- linux,code: Key / Axis code to emit.
 
 Optional subnode-properties:
 	- linux,input-type: Specify event type this button/key generates.
 	  If not specified defaults to <1> == EV_KEY.
+	- linux,input-value: If linux,input-type is EV_ABS or EV_REL then this
+	  value is sent for events this button generates when pressed.
+	  EV_ABS/EV_REL axis will generate an event with a value of 0 when
+	  all buttons with linux,input-type == type and linux,code == axis
+	  are released.
 	- debounce-interval: Debouncing interval time in milliseconds.
 	  If not specified defaults to 5.
 	- gpio-key,wakeup: Boolean, button can wake-up the system.
Signature · 1 line
2.4.3