diff mbox series

Input: gpio-keys - add support for linux,input-value dts property

Message ID 20230116215947.354660-1-soyer@irl.hu
State Superseded
Headers show
Series Input: gpio-keys - add support for linux,input-value dts property | expand

Commit Message

Gergo Koteles Jan. 16, 2023, 9:59 p.m. UTC
Allows setting the value of EV_ABS events from dts.

Signed-off-by: Gergo Koteles <soyer@irl.hu>
---
 drivers/input/keyboard/gpio_keys.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Dmitry Torokhov Jan. 16, 2023, 10:52 p.m. UTC | #1
Hi,

On Mon, Jan 16, 2023 at 10:59:47PM +0100, Gergo Koteles wrote:
> Allows setting the value of EV_ABS events from dts.

This needs adjustment to the binding documentation.

Thanks.
Gergo Koteles Jan. 17, 2023, 1:04 a.m. UTC | #2
Hi,

On 2023. 01. 16. 23:52, Dmitry Torokhov wrote:
> Hi,
> 
> On Mon, Jan 16, 2023 at 10:59:47PM +0100, Gergo Koteles wrote:
>> Allows setting the value of EV_ABS events from dts.
> 
> This needs adjustment to the binding documentation.
> 
> Thanks.
> 

Do you mean Documentation/devicetree/bindings/input/gpio-keys.yaml?
The linux,input-value is already there.

Thanks
diff mbox series

Patch

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 5496482a38c1..c42f86ad0766 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -770,6 +770,9 @@  gpio_keys_get_devtree_pdata(struct device *dev)
 					     &button->type))
 			button->type = EV_KEY;
 
+		fwnode_property_read_u32(child, "linux,input-value",
+					 (u32 *)&button->value);
+
 		button->wakeup =
 			fwnode_property_read_bool(child, "wakeup-source") ||
 			/* legacy name */