Skip to contentSkip to conversation

input: misc: Add driver for Intel Bay Trail GPIO buttons

PATCH In review Zhu, Lejun 2 participants 2 messages Mar 27, 2014 – Mar 28, 2014 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Zhu, Lejun

author
#1 lore raw

PATCH v2 1/1 input: misc: Add driver for Intel Bay Trail GPIO buttons

This patch adds support for the GPIO buttons on some Intel Bay Trail tablets originally running Windows 8. The ACPI description of these buttons follows "Windows ACPI Design Guide for SoC Platforms". v2:
- Change the driver name to "SoC button array".
- Use platform_device_alloc() instead of static devices. Unbind then rebind works fine now.

---
 drivers/input/misc/Kconfig            |  10 ++
 drivers/input/misc/Makefile           |   1 +
 drivers/input/misc/soc_button_array.c | 209
++++++++++++++++++++++++++++++++++
 3 files changed, 220 insertions(+)
 create mode 100644 drivers/input/misc/soc_button_array.c
drivers/input/misc/Kconfig +10 -0
index 7904ab0..c1298af 100644
@@ -666,4 +666,14 @@ config INPUT_IDEAPAD_SLIDEBAR
 	  To compile this driver as a module, choose M here: the
 	  module will be called ideapad_slidebar.
 
+config INPUT_SOC_BUTTON_ARRAY
+	tristate "Windows-compatible SoC Button Array"
+	depends on KEYBOARD_GPIO
+	help
+	  Say Y here if you have a SoC-based tablet that originally
+	  runs Windows 8.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called soc_button_array.
+
 endif
drivers/input/misc/Makefile +1 -0
index cda71fc..850a6cd 100644
@@ -63,3 +63,4 @@ obj-$(CONFIG_INPUT_WM831X_ON)		+= wm831x-on.o
 obj-$(CONFIG_INPUT_XEN_KBDDEV_FRONTEND)	+= xen-kbdfront.o
 obj-$(CONFIG_INPUT_YEALINK)		+= yealink.o
 obj-$(CONFIG_INPUT_IDEAPAD_SLIDEBAR)	+= ideapad_slidebar.o
+obj-$(CONFIG_INPUT_SOC_BUTTON_ARRAY)	+= soc_button_array.o
(quoted diff) +0 -0

b/drivers/input/misc/soc_button_array.c
new file mode 100644
index 0000000..e8f19e0

drivers/input/misc/soc_button_array.c new file +209 -0

209 lines not on this page · raw message

Signature · 1 line
1.8.3.2
maintainer
#2 lore raw

Hi Lejun,

Review

Quoted 7 lines · Lejun
(quoted diff) +7 -0
+
+static struct soc_button_info soc_button_tbl[] = {
+	{"power", 0, KEY_POWER, 0, 1, -1},
+	{"home", 1, KEY_HOME, 0, 1, -1},
+	{"volume_up", 2, KEY_VOLUMEUP, 1, 0, -1},
+	{"volume_down", 3, KEY_VOLUMEDOWN, 1, 0, -1},
+	{"rotation_lock", 4, KEY_RO, 0, 0, -1},

KEY_RO is not for rotating but rather for switching one of Japanese layouts. I think we shoudl allow using switchws and use SW_ROTATE_LOCK for that.

Also I do not quite like so many static structures, what do you think about the version below?

Thanks!

Signature · 18 lines
Dmitry

Input: misc - Add driver for Intel Bay Trail GPIO buttons

From: Lejun Zhu <[email protected]>

This patch adds support for the GPIO buttons on some Intel Bay Trail
tablets originally running Windows 8. The ACPI description of these
buttons follows "Windows ACPI Design Guide for SoC Platforms".

Signed-off-by: Lejun Zhu <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
---
 drivers/input/misc/Kconfig            |   10 ++
 drivers/input/misc/Makefile           |    1 
 drivers/input/misc/soc_button_array.c |  216 +++++++++++++++++++++++++++++++++
 3 files changed, 227 insertions(+)
 create mode 100644 drivers/input/misc/soc_button_array.c
drivers/input/misc/Kconfig +10 -0
index 7674f05..f772981 100644
@@ -666,4 +666,14 @@ config INPUT_IDEAPAD_SLIDEBAR
 	  To compile this driver as a module, choose M here: the
 	  module will be called ideapad_slidebar.
 
+config INPUT_SOC_BUTTON_ARRAY
+	tristate "Windows-compatible SoC Button Array"
+	depends on KEYBOARD_GPIO
+	help
+	  Say Y here if you have a SoC-based tablet that originally
+	  runs Windows 8.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called soc_button_array.
+
 endif
drivers/input/misc/Makefile +1 -0
index cda71fc..4955ad3 100644
@@ -53,6 +53,7 @@ obj-$(CONFIG_INPUT_RETU_PWRBUTTON)	+= retu-pwrbutton.o
 obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER)	+= rotary_encoder.o
 obj-$(CONFIG_INPUT_SGI_BTNS)		+= sgi_btns.o
 obj-$(CONFIG_INPUT_SIRFSOC_ONKEY)	+= sirfsoc-onkey.o
+obj-$(CONFIG_INPUT_SOC_BUTTON_ARRAY)	+= soc_button_array.o
 obj-$(CONFIG_INPUT_SPARCSPKR)		+= sparcspkr.o
 obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON)	+= twl4030-pwrbutton.o
 obj-$(CONFIG_INPUT_TWL4030_VIBRA)	+= twl4030-vibra.o
drivers/input/misc/soc_button_array.c new file +216 -0

216 lines not on this page · raw message