Skip to contentSkip to conversation

Input/misc: add support for Advantech software defined button

PATCH New Andrea Ho 1 participant 1 message Sep 10, 2020 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]

Andrea Ho

author
#1 lore raw

PATCH v4 1/1 Input/misc: add support for Advantech software defined button

From: "Andrea.Ho" <[email protected]>

Advantech sw_button is a ACPI event trigger button.

With this driver, we can report KEY_EVENT on the Advantech Tabletop Network Appliances products and it has been tested in FWA1112VC.

Add the software define button support to report EV_REP key_event (BTN_TRIGGER_HAPPY) by pressing button that cloud be get on user interface and trigger the customized actions.

v2:
- remove fix-patch in patch
- fix build WARNING on format string.
- using linux kernel sort function
v3:
- remove X86 dependency
- License only for GPL 2.0 and remove redundancy paragraphs
- remove version and prefix
- remove printk message
- remove double click and long press event check
- remove MODULE_PARAM
v4:
- match MODULE_LICENSE and SPDX header
- rename the device name
- move driver name and class as macros to open-code
- remove the forward declarations of the functions
- replace fucntions acpi_button_init() and acpi_button_exit() by module_acpi_driver()
- replace kzalloc() by devm_kzalloc()
- replace input_allocate_device() by devm_input_allocate_device()

---
 MAINTAINERS                       |   5 +
 drivers/input/misc/Kconfig        |  11 ++
 drivers/input/misc/Makefile       |   2 +-
 drivers/input/misc/adv_swbutton.c | 190 ++++++++++++++++++++++++++++++
 4 files changed, 207 insertions(+), 1 deletion(-)
 create mode 100644 drivers/input/misc/adv_swbutton.c
MAINTAINERS +5 -0
index d7e3eab852d3..02c818161aab 100644
@@ -561,6 +561,11 @@ S: Maintained
 F:     Documentation/scsi/advansys.rst
 F:     drivers/scsi/advansys.c
 
+ADVANTECH SWBTN DRIVER
+M:     Andrea Ho <[email protected]>
+S:     Maintained
+F:     drivers/input/misc/adv_swbutton.c
+
 ADXL34X THREE-AXIS DIGITAL ACCELEROMETER DRIVER (ADXL345/ADXL346)
 M:     Michael Hennerich <[email protected]>
 S:     Supported
drivers/input/misc/Kconfig +11 -0
index 362e8a01980c..f88d1490ae40 100644
@@ -869,4 +869,15 @@ config INPUT_STPMIC1_ONKEY
          To compile this driver as a module, choose M here: the
          module will be called stpmic1_onkey.
 
+config INPUT_ADV_SWBUTTON
+        tristate "Advantech ACPI Software button Driver"
+        depends on ACPI
+        help
+          Say Y here to enable support for Advantech software defined
+          button feature. More information can be fount at
+          <http://www.advantech.com.tw/products/>
+
+          To compile this driver as a module, choose M here. The module will
+          be called adv_swbutton.
+
 endif
drivers/input/misc/Makefile +1 -1
index a48e5f2d859d..a03430f5ee9d 100644
@@ -84,4 +84,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_ADV_SWBUTTON)    += adv_swbutton.o
(quoted diff) +0 -0

b/drivers/input/misc/adv_swbutton.c
new file mode 100644
index 000000000000..09e5a83c61a9

drivers/input/misc/adv_swbutton.c new file +190 -0

190 lines not on this page · raw message

--
2.17.1