Add support for devicetree to i8042 serio driver
Subsystems (3)
RFC PATCH 1/1 Add support for devicetree to i8042 serio driver
Since this patch may adversely affect a lot of users, I thought I'd post this as an RFC first. I don't think the changes should affect any existing i8042 implementations, but can never be certain.
Limitations:
This patch does not overcome the problem of only being able to select a single i8042 platform at compile-time. If compiling for a multiplatform kernel, all platforms must use the DT version or only one platform can have i8042 support.
The DT version assumes memory-mapped i8042 registers. It can not handle IO-mapped modules (eg. x86)
Tony Prisk (1):
input: i8042: Add support for devicetree to i8042 serio driver
.../devicetree/bindings/input/intel-8042.txt | 29 +++++ drivers/input/serio/Kconfig | 10 +- drivers/input/serio/i8042-dt.h | 127 ++++++++++++++++++++ drivers/input/serio/i8042.c | 15 ++- drivers/input/serio/i8042.h | 4 +- 5 files changed, 181 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/intel-8042.txt create mode 100644 drivers/input/serio/i8042-dt.h
Signature · 1 line
1.7.9.5
RFC PATCH 1/1 input: i8042: Add support for devicetree to i8042 serio driver
This patch adds basic devicetree support for the i8042 controller driver.
Simple properties to specify the register offsets. Optional properties to specify the linux device descriptions.
--- .../devicetree/bindings/input/intel-8042.txt | 29 +++++ drivers/input/serio/Kconfig | 10 +- drivers/input/serio/i8042-dt.h | 127 ++++++++++++++++++++ drivers/input/serio/i8042.c | 15 ++- drivers/input/serio/i8042.h | 4 +- 5 files changed, 181 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/intel-8042.txt create mode 100644 drivers/input/serio/i8042-dt.h
Documentation/devicetree/bindings/input/intel-8042.txt new file +29 -0
@@ -0,0 +1,29 @@ +* Intel 8042 Keyboard controller + +Required properties: +- compatible: should be "intel,8042" +- regs: memory for keyboard controller +- interrupts: two interrupts should be specified (keyboard and aux). +- command-reg: offset in memory for command register +- status-reg: offset in memory for status register +- data-reg: offset in memory for data register + +Optional properties: +- init-reset: Controller should be reset on init and cleanup + +Optional linux specific properties: +- linux,kbd_phys_desc: defaults to i8042/serio0 +- linux,aux_phys_desc: defaults to i8042/serio1 +- linux,mux_phys_desc: defaults to i8042/serio%d + + +Example: + keyboard at d8008800 { + compatible = "intel,8042"; + reg = <0xD8008800 0x100>; + interrupts = <23 4>; + command-reg = <0x04>; + status-reg = <0x04>; + data-reg = <0x00>; + mux-ports = <2>; + };
drivers/input/serio/Kconfig +8 -2
@@ -21,8 +21,9 @@ if SERIO config SERIO_I8042 tristate "i8042 PC Keyboard controller" if EXPERT || !X86 default y - depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \ - (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN + depends on (!PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \ + (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN) || \ + (SERIO_I8042_DT) help i8042 is the chip over which the standard AT keyboard and PS/2 mouse are connected to the computer. If you use these devices,
@@ -33,6 +34,11 @@ config SERIO_I8042 To compile this driver as a module, choose M here: the module will be called i8042. +config SERIO_I8042_DT + tristate "i8042 Keyboard controller DT support" if EXPERT || !X86 + depends on USE_OF + select SERIO_I8042 + config SERIO_SERPORT tristate "Serial port line discipline" default y
drivers/input/serio/i8042-dt.h new file +127 -0
127 lines not on this page · raw message
drivers/input/serio/i8042.c +14 -1
@@ -1447,6 +1447,11 @@ static int i8042_remove(struct platform_device *dev)return 0 ; } +static struct of_device_id i8042_dt_ids[] = { + { .compatible ="intel,8042" }, + {/* Sentinel */ }, +}; +static struct platform_driver i8042_driver = { .driver = { .name ="i8042" ,
@@ -1454,6 +1459,7 @@ static struct platform_driver i8042_driver = {#ifdef CONFIG_PM .pm = &i8042_pm_ops, #endif + .of_match_table = i8042_dt_ids, }, .remove = i8042_remove, .shutdown = i8042_shutdown,
@@ -1461,7 +1467,9 @@ static struct platform_driver i8042_driver = {static int __init i8042_init (void ) { +#ifndef CONFIG_SERIO_I8042_DT struct platform_device *pdev; +#endif int err;dbg_init ();
@@ -1474,12 +1482,17 @@ static int __init i8042_init(void)if (err) goto err_platform_exit; +#ifdef CONFIG_SERIO_I8042_DT + err =platform_driver_probe (&i8042_driver, i8042_probe); +if (err) + goto err_platform_exit; +#else pdev =platform_create_bundle (&i8042_driver, i8042_probe,NULL ,0 ,NULL ,0 );if (IS_ERR (pdev)) { err =PTR_ERR (pdev); goto err_platform_exit; } - +#endif panic_blink = i8042_panic_blink;return 0 ;
drivers/input/serio/i8042.h +3 -1
@@ -14,7 +14,9 @@* Arch-dependent inline functions and defines. */ -#if defined(CONFIG_MACH_JAZZ ) +#if defined(CONFIG_SERIO_I8042_DT ) +#include "i8042-dt.h" +#elif defined(CONFIG_MACH_JAZZ )#include "i8042-jazzio.h" #elif defined(CONFIG_SGI_HAS_I8042 )#include "i8042-ip22io.h"
Signature · 1 line
1.7.9.5