Input: gpio-keys: support for disabling GPIOs
Subsystems (2)
v3 cover Input: gpio-keys: support for disabling GPIOs
Hi Dmitry,
This is third version of the series. Purpose of this patch is to allow userland to disable GPIO buttons interrupting the CPU. There is now sysfs interface that can be used to control the buttons by key code or by switch code.
I merged those previous 2 patches as one. This is because it made little sense of having separate patch for adding the 'can_disable' field.
Changes in v3:
- merged previous 2 patches into one
- buttons have 'can_disable' field instead of irqflags field
Tested with RX-51.
Thanks,
MW
---
Mika Westerberg (1):
Input: gpio-keys - added support for disabling gpios through sysfs
Documentation/ABI/testing/sysfs-platform-gpio-keys | 44 +++ drivers/input/keyboard/gpio_keys.c | 318 +++++++++++++++++++- include/linux/gpio_keys.h | 1 + 3 files changed, 352 insertions(+), 11 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-platform-gpio-keys
PATCH v3 1/1 Input: gpio-keys - added support for disabling gpios through sysfs
Now gpio-keys input driver exports 4 new attributes to userland through sysfs:
/sys/devices/platform/gpio-keys/keys [ro] /sys/devices/platform/gpio-keys/switches [ro] /sys/devices/platform/gpio-keys/disabled_keys [rw] /sys/devices/platform/gpio-keys/disables_switches [rw]
With these attributes, userland program can read which keys and switches can be disabled and then disable/enable them as needed. Keys and switches are exported as stringified bitmap of codes (keycodes or switch codes). For example keys 15, 89, 100, 101, 102 are exported as: '15,89,100-102'.
Description of the attributes:
keys - bitmap of keys which can be disabled switches - bitmap of switches which can be disabled disabled_keys - bitmap of currently disabled keys
(bit 1 means disabled, 0 enabled)
disabled_switches - bitmap of currently disabled switches
(bit 1 means disabled, 0 enabled)
--- Documentation/ABI/testing/sysfs-platform-gpio-keys | 44 +++ drivers/input/keyboard/gpio_keys.c | 318 +++++++++++++++++++- include/linux/gpio_keys.h | 1 + 3 files changed, 352 insertions(+), 11 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-platform-gpio-keys
Documentation/ABI/testing/sysfs-platform-gpio-keys new file +44 -0
@@ -0,0 +1,44 @@ +What: /sys/devices/platform/gpio-keys/keys +Date: November 2009 +KernelVersion: 2.6.33 +Contact: Mika Westerberg <[email protected]> +Description: + This file lists gpio keys (EV_KEY) by key code + which can be disabled. These are formatted as + ASCII encoded bitmap. For example if we have keys + 152, 212, 528 that can be disabled, the file + contains: + 152,212,528 + Consecutive bits are shown as hyphen separated + numbers. For example keys 9, 10, 11 are shown + as: + 9-11 + +What: /sys/devices/platform/gpio-keys/switches +Date: November 2009 +KernelVersion: 2.6.33 +Contact: Mika Westerberg <[email protected]> +Description: + This file lists gpio switches (EV_SW) by switch + code which can be disabled. These are formatted + in similar manner than keys. + +What: /sys/devices/platform/gpio-keys/disabled_keys +Date: November 2009 +KernelVersion: 2.6.33 +Contact: Mika Westerberg <[email protected]> +Description: + This file lists gpio keys (EV_KEY) by key code + which are currently disabled and cannot generate + interrupts. Format is similar than in previous + files. Writing to this file disables given keys. + +What: /sys/devices/platform/gpio-keys/disabled_switches +Date: November 2009 +KernelVersion: 2.6.33 +Contact: Mika Westerberg <[email protected]> +Description: + This file lists gpio switches (EV_SW) by switch code + which are currently disabled and cannot generate + interrupts. Format is similar than in previous + files. Writing to this file disables given switches.
drivers/input/keyboard/gpio_keys.c +307 -11
385 lines not on this page · raw message
include/linux/gpio_keys.h +1 -0
@@ -10,6 +10,7 @@ struct gpio_keys_button {int type;/* input event type (EV_KEY, EV_SW) */ int wakeup;/* configure the button as a wake-up source */ int debounce_interval;/* debounce ticks interval in msecs */ +bool can_disable; };struct gpio_keys_platform_data {
Signature · 1 line
1.5.6.5
Quoted 6 lines · Mika Westerberg
This is third version of the series. Purpose of this patch is to allow userland to disable GPIO buttons interrupting the CPU. There is now sysfs interface that can be used to control the buttons by key code or by switch code.
Quoted 8 lines
I merged those previous 2 patches as one. This is because it made little sense of having separate patch for adding the '
can_disable' field.Changes in v3:
- merged previous 2 patches into one
- buttons have 'can_disable' field instead of irqflags fieldTested with RX-51.
Hi Dmitry,
Any comments on this? Is it OK to be applied or do I need to change something.
Thanks again,
MW
Dmitry Torokhov
maintainerQuoted 14 lines · Mika Westerberg
Quoted 13 lines · Mika Westerberg
This is third version of the series. Purpose of this patch is to allow userland to disable GPIO buttons interrupting the CPU. There is now sysfs interface that can be used to control the buttons by key code or by switch code.
I merged those previous 2 patches as one. This is because it made little sense of having separate patch for adding the '
can_disable' field.Changes in v3:
- merged previous 2 patches into one
- buttons have 'can_disable' field instead of irqflags field
Quoted 7 lines
Quoted 1 line
Tested with RX-51.
Hi Dmitry,
Any comments on this? Is it OK to be applied or do I need to change something.
Hi Mika,
SOrry, I am still pondering how to go about it. I am sure that the sysfs interface is proper, so at this point it is just implementation details that I am not quite sure yet...
Signature · 1 line
Dmitry
Quoted 23 lines · Dmitry Torokhov
Quoted 14 lines · Mika Westerberg
Quoted 13 lines · Mika Westerberg
This is third version of the series. Purpose of this patch is to allow userland to disable GPIO buttons interrupting the CPU. There is now sysfs interface that can be used to control the buttons by key code or by switch code.
I merged those previous 2 patches as one. This is because it made little sense of having separate patch for adding the '
can_disable' field.Changes in v3:
- merged previous 2 patches into one
- buttons have 'can_disable' field instead of irqflags fieldQuoted 7 lines
Quoted 1 line
Tested with RX-51.
Hi Dmitry,
Any comments on this? Is it OK to be applied or do I need to change something.
Quoted 5 lines
Hi Mika,
SOrry, I am still pondering how to go about it. I am sure that the sysfs interface is proper, so at this point it is just implementation details that I am not quite sure yet...
Ok, thanks.
Please let me know if there is need to change something. We would really like this to be merged with .33.
Thanks for your time,
MW
Quoted 23 lines · Dmitry Torokhov
Quoted 14 lines · Mika Westerberg
Quoted 13 lines · Mika Westerberg
This is third version of the series. Purpose of this patch is to allow userland to disable GPIO buttons interrupting the CPU. There is now sysfs interface that can be used to control the buttons by key code or by switch code.
I merged those previous 2 patches as one. This is because it made little sense of having separate patch for adding the '
can_disable' field.Changes in v3:
- merged previous 2 patches into one
- buttons have 'can_disable' field instead of irqflags fieldQuoted 7 lines
Quoted 1 line
Tested with RX-51.
Hi Dmitry,
Any comments on this? Is it OK to be applied or do I need to change something.
Quoted 5 lines
Hi Mika,
SOrry, I am still pondering how to go about it. I am sure that the sysfs interface is proper, so at this point it is just implementation details that I am not quite sure yet...
Hi Dmitry,
Have you decided yet what to do with these patches?
Thanks,
MW
Dmitry Torokhov
maintainerQuoted 26 lines · Mika Westerberg
Quoted 25 lines · Dmitry Torokhov
Quoted 14 lines · Mika Westerberg
Quoted 13 lines · Mika Westerberg
This is third version of the series. Purpose of this patch is to allow userland to disable GPIO buttons interrupting the CPU. There is now sysfs interface that can be used to control the buttons by key code or by switch code.
I merged those previous 2 patches as one. This is because it made little sense of having separate patch for adding the '
can_disable' field.Changes in v3:
- merged previous 2 patches into one
- buttons have 'can_disable' field instead of irqflags fieldQuoted 7 lines
Quoted 1 line
Tested with RX-51.
Hi Dmitry,
Any comments on this? Is it OK to be applied or do I need to change something.
Hi Mika,
Quoted 8 lines
Quoted 3 lines
SOrry, I am still pondering how to go about it. I am sure that the sysfs interface is proper, so at this point it is just implementation details that I am not quite sure yet...
Hi Dmitry,
Have you decided yet what to do with these patches?
Hi Mika,
Sorry, not yet, have been busy with some other stuff ;(
Signature · 1 line
Dmitry
Quoted 31 lines · Dmitry Torokhov
Quoted 30 lines · Mika Westerberg
Quoted 28 lines · Dmitry Torokhov
Quoted 14 lines · Mika Westerberg
Quoted 13 lines · Mika Westerberg
This is third version of the series. Purpose of this patch is to allow userland to disable GPIO buttons interrupting the CPU. There is now sysfs interface that can be used to control the buttons by key code or by switch code.
I merged those previous 2 patches as one. This is because it made little sense of having separate patch for adding the '
can_disable' field.Changes in v3:
- merged previous 2 patches into one
- buttons have 'can_disable' field instead of irqflags fieldQuoted 7 lines
Quoted 1 line
Tested with RX-51.
Hi Dmitry,
Any comments on this? Is it OK to be applied or do I need to change something.
Hi Mika,
SOrry, I am still pondering how to go about it. I am sure that the sysfs interface is proper, so at this point it is just implementation details that I am not quite sure yet...
Quoted 8 lines
Quoted 4 lines
Hi Dmitry,
Have you decided yet what to do with these patches?
Hi Mika,
Sorry, not yet, have been busy with some other stuff ;(
Hi Dmitry,
just a humble reminder.
(We missed .33, would be really cool not to miss .34)
Signature · 7 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий) -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 31 lines · Dmitry Torokhov
Quoted 30 lines · Mika Westerberg
Quoted 28 lines · Dmitry Torokhov
Quoted 14 lines · Mika Westerberg
Quoted 13 lines · Mika Westerberg
This is third version of the series. Purpose of this patch is to allow userland to disable GPIO buttons interrupting the CPU. There is now sysfs interface that can be used to control the buttons by key code or by switch code.
I merged those previous 2 patches as one. This is because it made little sense of having separate patch for adding the '
can_disable' field.Changes in v3:
- merged previous 2 patches into one
- buttons have 'can_disable' field instead of irqflags fieldQuoted 7 lines
Quoted 1 line
Tested with RX-51.
Hi Dmitry,
Any comments on this? Is it OK to be applied or do I need to change something.
Hi Mika,
SOrry, I am still pondering how to go about it. I am sure that the sysfs interface is proper, so at this point it is just implementation details that I am not quite sure yet...
Quoted 8 lines
Quoted 4 lines
Hi Dmitry,
Have you decided yet what to do with these patches?
Hi Mika,
Sorry, not yet, have been busy with some other stuff ;(
Hi Dmitry,
any news? We missed 2.6.33, and the next merge window is coming ...
Signature · 7 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий) -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov
maintainerQuoted 37 lines · Artem Bityutskiy
Quoted 36 lines · Dmitry Torokhov
Quoted 34 lines · Mika Westerberg
Quoted 23 lines · Dmitry Torokhov
Quoted 14 lines · Mika Westerberg
Quoted 13 lines · Mika Westerberg
This is third version of the series. Purpose of this patch is to allow userland to disable GPIO buttons interrupting the CPU. There is now sysfs interface that can be used to control the buttons by key code or by switch code.
I merged those previous 2 patches as one. This is because it made little sense of having separate patch for adding the '
can_disable' field.Changes in v3:
- merged previous 2 patches into one
- buttons have 'can_disable' field instead of irqflags fieldQuoted 7 lines
Quoted 1 line
Tested with RX-51.
Hi Dmitry,
Any comments on this? Is it OK to be applied or do I need to change something.
Quoted 5 lines
Hi Mika,
SOrry, I am still pondering how to go about it. I am sure that the sysfs interface is proper, so at this point it is just implementation details that I am not quite sure yet...
Hi Dmitry,
Have you decided yet what to do with these patches?
Quoted 8 lines
Quoted 3 lines
Hi Mika,
Sorry, not yet, have been busy with some other stuff ;(
Hi Dmitry,
any news? We missed 2.6.33, and the next merge window is coming ...
Artem, Mika,
I was hoping to do something different about the new 'can_disable' flag but unfortunately I don't have enough time and I already sat on the patch for way too long. :(
It is applied to my 'next' branch and should get pulled into 2.6.34.
Thank you for your patience and sorry about the delay.
Signature · 1 line
Dmitry
Quoted 9 lines · Dmitry Torokhov
Artem, Mika,
I was hoping to do something different about the new '
can_disable' flag but unfortunately I don't have enough time and I already sat on the patch for way too long. :(It is applied to my 'next' branch and should get pulled into 2.6.34.
Thank you for your patience and sorry about the delay.
Great, thank you!
Signature · 7 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий) -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Dmitry Torokhov
Artem, Mika,
I was hoping to do something different about the new '
can_disable' flag but unfortunately I don't have enough time and I already sat on the patch for way too long. :(It is applied to my 'next' branch and should get pulled into 2.6.34.
Thank you for your patience and sorry about the delay.
Thank you very much!
Regards,
MW