input: Add support for ECI (multimedia) accessories
Subsystems (2)
v5 cover input: Add support for ECI (multimedia) accessories
From: Tapio Vihuri <[email protected]>
Thank you for comments.
ECI input driver changes:
- Use sparse_keymap_setup() properly, remove unneeded input set_bits
ECI controller driver changes:
- Added "button" debugfs entry for input driver buttons handling testing
Created against linux-2.6.38-rc1 at:
12fcdba Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux
--- v4 message ---
Thank you for comments.
ECI input driver changes:
- Use driver name in debugfs
- reject accessory stating more than maximum 31 buttons
- clean out couple comments
ECI controller driver changes:
- name change, from ecibus to eci_xxx_ctrl
- location change, from drivers/ecibus to drivers/input/misc
- major rework from platform driver to i2c-driver
- removed mrst platform dependency
Checkpatch warn about Kconfig, but I think it is false positive, and I will report it to the maintainer.
Platform code changes:
- medfield_ prefix changed to mrst_
- added ECI controller needed power control
- remover ECI controller platform driver stuff
- added i2c stuff for ECI controller driver
Created against linux-2.6.37-rc8 at:
a25cecc Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
--- v3 message ---
Thank you for comments.
ECI input driver changes:
- Makefile and Kconfig sorted alphabetically
- using sparse keymap library, much cleaner solution
- correct string aligment with 80 column
- debugfs initialization fix
- sysfs cable entry using just 0/1
- using cheaper __set_bit
- insane comments fixed
- remove unneeded misc device
Created against linux-2.6.37-rc8 at:
989d873 Merge master.kernel.org:/home/rmk/linux-2.6-arm
--- v2 message ---
Thank you for comments.
In series two there Kconfig dependency problem fixed, preventing compilation if X86_MRST (Intel Moorestown) or INPUT_MISC is not selected.
Also created against linux-2.6.37-rc8
--- v1 message ---
Hi all
This patch set introduce Multimedia Headset Accessory support for Nokia phones. Technically those are known as ECI (Enhancement Control Interface)
If headset has many buttons, like play, vol+, vol- etc. then it is propably ECI accessory.
Among several buttons ECI accessories contains memory for storing several parameters.
This ECI input driver provides the following features:
- reading ECI configuration memory
- ECI buttons as input events
Drive is constructed as follows:
- ECI accessory input driver deals with headset accessory
- ECI bus control driver deals the HW transfering data to/from headset
- platform data match used HW
In the future accessory detection logic will be added using ALSA jack reporting.
Created against linux-2.6.37-rc6
Please review.
Tapio Vihuri (3):
ECI: input: introduce ECI accessory input driver
ECI: introducing ECI controller driver
ECI: adding platform data for ECI driver
arch/x86/platform/mrst/mrst.c | 49 ++ drivers/input/misc/Kconfig | 60 +++ drivers/input/misc/Makefile | 3 +- drivers/input/misc/eci.c | 931 ++++++++++++++++++++++++++++++++++++ drivers/input/misc/eci_at20_ctrl.c | 569 ++++++++++++++++++++++ include/linux/input/eci.h | 179 +++++++ 6 files changed, 1790 insertions(+), 1 deletions(-) create mode 100644 drivers/input/misc/eci.c create mode 100644 drivers/input/misc/eci_at20_ctrl.c create mode 100644 include/linux/input/eci.h
PATCH v5 1/3 ECI: input: introduce ECI accessory input driver
From: Tapio Vihuri <[email protected]>
ECI stands for (Enhancement Control Interface).
ECI is better known as Multimedia Headset for Nokia phones.
If headset has many buttons, like play, vol+, vol- etc. then it is propably ECI accessory.
Among several buttons ECI accessory contains memory for storing several parameters.
ECI input driver provides the following features:
- reading ECI configuration memory
- ECI buttons as input events
--- drivers/input/misc/Kconfig | 19 + drivers/input/misc/Makefile | 2 +- drivers/input/misc/eci.c | 931 +++++++++++++++++++++++++++++++++++++++++++ include/linux/input/eci.h | 157 ++++++++ 4 files changed, 1108 insertions(+), 1 deletions(-) create mode 100644 drivers/input/misc/eci.c create mode 100644 include/linux/input/eci.h
drivers/input/misc/Kconfig +19 -0
@@ -114,6 +114,25 @@ config INPUT_APANEL To compile this driver as a module, choose M here: the module will be called apanel. +config INPUT_ECI + tristate "AV ECI (Enhancement Control Interface) input driver" + select INPUT_SPARSEKMAP + help + The Enhancement Control Interface functionality + ECI is better known as Multimedia Headset for Nokia phones. + If headset has many buttons, like play, vol+, vol- etc. then + it is propably ECI accessory. + Among several buttons ECI accessory contains memory for storing + several parameters. + + ECI input driver provides the following features: + - reading ECI configuration memory + - ECI buttons as input events + + Say 'y' here to statically link this module into the kernel or 'm' + to build it as a dynamically loadable module. The module will be + called eci.ko + config INPUT_IXP4XX_BEEPER tristate "IXP4XX Beeper support" depends on ARCH_IXP4XX
drivers/input/misc/Makefile +1 -1
@@ -23,6 +23,7 @@ obj-$(CONFIG_INPUT_CMA3000_I2C) += cma3000_d0x_i2c.o obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o +obj-$(CONFIG_INPUT_ECI) += eci.o obj-$(CONFIG_INPUT_IXP4XX_BEEPER) += ixp4xx-beeper.o obj-$(CONFIG_INPUT_KEYSPAN_REMOTE) += keyspan_remote.o obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
@@ -43,4 +44,3 @@ obj-$(CONFIG_INPUT_UINPUT) += uinput.o obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o obj-$(CONFIG_INPUT_WM831X_ON) += wm831x-on.o obj-$(CONFIG_INPUT_YEALINK) += yealink.o -
drivers/input/misc/eci.c new file +931 -0
931 lines not on this page · raw message
include/linux/input/eci.h new file +157 -0
157 lines not on this page · raw message
Signature · 1 line
1.6.5
PATCH v5 2/3 ECI: introducing ECI controller driver
From: Tapio Vihuri <[email protected]>
ECI controller is kind of bridge between host CPU I2C and ECI accessory ECI communication.
--- drivers/input/misc/Kconfig | 41 +++ drivers/input/misc/Makefile | 1 + drivers/input/misc/eci_at20_ctrl.c | 569 ++++++++++++++++++++++++++++++++++++ include/linux/input/eci.h | 24 ++- 4 files changed, 634 insertions(+), 1 deletions(-) create mode 100644 drivers/input/misc/eci_at20_ctrl.c
drivers/input/misc/Kconfig +41 -0
@@ -114,6 +114,23 @@ config INPUT_APANEL To compile this driver as a module, choose M here: the module will be called apanel. +menuconfig ECI + bool "ECI support" + help + ECI (Enhancement Control Interface) accessory support + + The Enhancement Control Interface functionality + ECI is better known as Multimedia Headset for Nokia phones. + If headset has many buttons, like play, vol+, vol- etc. then + it is propably ECI accessory. + Among several buttons ECI accessory contains memory for storing + several parameters. + + Enable ECI support in terminal so that ECI input driver is able + to communicate with ECI accessory + +if ECI + config INPUT_ECI tristate "AV ECI (Enhancement Control Interface) input driver" select INPUT_SPARSEKMAP
@@ -129,10 +146,34 @@ config INPUT_ECI - reading ECI configuration memory - ECI buttons as input events + ECI input driver needs some ECI controller driver, select + suitable controlelr driver(s) below. + Say 'y' here to statically link this module into the kernel or 'm' to build it as a dynamically loadable module. The module will be called eci.ko +config ECI_CTRL_DEBUG + bool "ECI controller debug" + depends on INPUT_ECI_AT20 + help + Say Y here to enable debugging messages for ECI controller driver. + +config INPUT_ECI_AT20 + tristate "ECI controller driver" + select INPUT_ECI + depends on X86_MRST && INPUT_MISC + help + This selects a driver for the ECI controller + + ECI controller is kind of bridge between host CPU I2C and + ECI accessory ECI communication. + + Say 'y' here to statically link this module into the kernel or 'm' + to build it as a dynamically loadable module. The module will be + called eci_at20_ctrl.ko +endif # ECI + config INPUT_IXP4XX_BEEPER tristate "IXP4XX Beeper support" depends on ARCH_IXP4XX
drivers/input/misc/Makefile +1 -0
@@ -24,6 +24,7 @@ obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o obj-$(CONFIG_INPUT_ECI) += eci.o +obj-$(CONFIG_INPUT_ECI_AT20) += eci_at20_ctrl.o obj-$(CONFIG_INPUT_IXP4XX_BEEPER) += ixp4xx-beeper.o obj-$(CONFIG_INPUT_KEYSPAN_REMOTE) += keyspan_remote.o obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o
drivers/input/misc/eci_at20_ctrl.c new file +569 -0
569 lines not on this page · raw message
include/linux/input/eci.h +23 -1
@@ -1,7 +1,7 @@/* * This file is part of ECI (Enhancement Control Interface) driver * -* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Tapio Vihuri <[email protected]> *
@@ -35,6 +35,21 @@#define ECI_REAL_BUTTONS 0#define ECI_FORCE_BUTTONS_UP 1 +/* +* VPROG2CNT - VPROG2 Control Register +* 2.5V | normal | normal +* 10 | 111 | 111 +* 2.5V | off | off +* 10 | 100 | 100 +*/ +#define AvP_MSIC_VPROG2 0xd7 +#define AvP_MSIC_VPROG2_2V5_ON 0xbf +#define AvP_MSIC_VPROG2_2V5_OFF 0xa4 + +#define GPIO_ECI_RSTn 126/* GP_CORE_030 + 96 */ +#define GPIO_ECI_SW_CTRL 178/* GP_CORE_082 + 96 */ +#define GPIO_ECI_INT 16/* GP_AON_016 */ +/* fixed in ECI HW, do not change */ enum {ECICMD_HWID ,
@@ -154,4 +169,11 @@ struct eci_data { };struct eci_cb *eci_register (struct eci_hw_ops *eci_ops); + +/* eci controller data */ +struct eci_ctrl_platform_data { +int eci_ctrl_rst_gpio; +int eci_ctrl_sw_ctrl_gpio; +int eci_ctrl_int_gpio; +};#endif
Signature · 1 line
1.6.5
PATCH v5 3/3 ECI: adding platform data for ECI driver
From: Tapio Vihuri <[email protected]>
Gives platform data for ECI accessory input driver and ECI controller driver.
--- arch/x86/platform/mrst/mrst.c | 49 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-)
arch/x86/platform/mrst/mrst.c +49 -0
@@ -24,6 +24,7 @@#include <linux/platform_device.h> #include <linux/irq.h> #include <linux/module.h> +#include <linux/input/eci.h> #include <asm/setup.h> #include <asm/mpspec_def.h>
@@ -478,6 +479,16 @@ static void __init *no_platform_data(void *info)return NULL ; } +static void *eci_ctrl_platform_data_init (void *info) +{ +static struct eci_ctrl_platform_data mrst_eci_ctrl_data = { + .eci_ctrl_rst_gpio = GPIO_ECI_RSTn, + .eci_ctrl_sw_ctrl_gpio =GPIO_ECI_SW_CTRL , + .eci_ctrl_int_gpio =GPIO_ECI_INT , + }; +return &mrst_eci_ctrl_data; +} +static const struct devs_id __initconst device_ids[] = { {"pmic_gpio" ,SFI_DEV_TYPE_SPI ,1 , &pmic_gpio_platform_data}, {"spi_max3111" ,SFI_DEV_TYPE_SPI ,0 , &max3111_platform_data},
@@ -487,6 +498,7 @@ static const struct devs_id __initconst device_ids[] = { {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, {"msic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, + {"eci_ctrl", SFI_DEV_TYPE_I2C, 0, &eci_ctrl_platform_data_init}, {}, };
@@ -807,3 +819,40 @@ static int __init pb_keys_init(void)return 0 ; }late_initcall (pb_keys_init); + +/* +* This is just example, should be used in platform audio driver +* hsmic_event->event(hsmic_event->private, true) +*/ +static void mrst_register_hsmic_event_cb (struct audio_hsmic_event *event) +{ +struct audio_hsmic_event *hsmic_event; + + hsmic_event = event; +} + +static struct eci_platform_data mrst_eci_data = { + .register_hsmic_event_cb = mrst_register_hsmic_event_cb, +}; + +static struct platform_device mrst_eci_device = { + .name ="ECI_accessory" , + .dev = { + .platform_data = &mrst_eci_data, + }, +}; + +static int __init mrst_eci_init (void ) +{ +int retval; + + retval =platform_device_register (&mrst_eci_device); +if (retval <0 ) +return retval; + +/* Turn on vprog2 */ +intel_scu_ipc_iowrite8 (AvP_MSIC_VPROG2, AvP_MSIC_VPROG2_2V5_ON); + +return retval; +} +device_initcall (mrst_eci_init);
Signature · 1 line
1.6.5