Skip to contentSkip to conversation

Onkey: DA9055 Onkey driver

PATCH Superseded Ashish Jangam 2 participants 3 messages Oct 11, 2012 – Oct 12, 2012

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 7/7 Onkey: DA9055 Onkey driver

This is the ONKEY driver of the Dialog DA9055 PMIC and depends on the DA9055 MFD core driver.

This patch is functionally tested on SMDK6410 board.

---
changes since v3:
- used of module_platform_driver macro
- add regmap virtual irq function
changes since v2:
- add support for button release
- use of devm_request_threaded_irq API

---
 drivers/input/misc/Kconfig        |   10 ++
 drivers/input/misc/Makefile       |    1 +
 drivers/input/misc/da9055_onkey.c |  167 +++++++++++++++++++++++++++++++++++++
 3 files changed, 178 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/misc/da9055_onkey.c
drivers/input/misc/Kconfig +10 -0
index 7c0f1ec..6a45cb8 100644
@@ -486,6 +486,16 @@ config INPUT_DA9052_ONKEY
 	  To compile this driver as a module, choose M here: the
 	  module will be called da9052_onkey.
 
+config INPUT_DA9055_ONKEY
+	tristate "Dialog Semiconductor DA9055 ONKEY"
+	depends on MFD_DA9055
+	help
+	  Support the ONKEY of DA9055 PMICs as an input device
+	  reporting power button status.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called da9055_onkey.
+
 config INPUT_DM355EVM
 	tristate "TI DaVinci DM355 EVM Keypad and IR Remote"
 	depends on MFD_DM355EVM_MSP
drivers/input/misc/Makefile +1 -0
index 83fe6f5..23347e3 100644
@@ -23,6 +23,7 @@ obj-$(CONFIG_INPUT_CMA3000)		+= cma3000_d0x.o
 obj-$(CONFIG_INPUT_CMA3000_I2C)		+= cma3000_d0x_i2c.o
 obj-$(CONFIG_INPUT_COBALT_BTNS)		+= cobalt_btns.o
 obj-$(CONFIG_INPUT_DA9052_ONKEY)	+= da9052_onkey.o
+obj-$(CONFIG_INPUT_DA9055_ONKEY)	+= da9055_onkey.o
 obj-$(CONFIG_INPUT_DM355EVM)		+= dm355evm_keys.o
 obj-$(CONFIG_INPUT_GP2A)		+= gp2ap002a00f.o
 obj-$(CONFIG_INPUT_GPIO_TILT_POLLED)	+= gpio_tilt_polled.o
drivers/input/misc/da9055_onkey.c new file +167 -0

167 lines not on this page · raw message

Signature · 1 line
1.7.0.4
maintainer
#1 lore raw

Hi Ashish,

Quoted 7 lines · Ashish Jangam

This is the ONKEY driver of the Dialog DA9055 PMIC and depends on the DA9055 MFD core driver.

This patch is functionally tested on SMDK6410 board.

Quoted 7 lines

---
changes since v3:
- used of module_platform_driver macro
- add regmap virtual irq function
changes since v2:
- add support for button release
- use of devm_request_threaded_irq API

This API does not make any sense for your driver as you are scheduling delayed work from the IRQ handler. In such cases you need _first_ free IRQ and _then_ cancel the work but with devm_* you do it in opposite order.

Also, I think I mentioned this before - this driver looks like twin brother for da9055_onkey.c. How many of such parts do you have (or will you have)? Is there way to unify them?

Thanks.

Signature · 1 line
Dmitry
#2 lore raw
Quoted 18 lines · Dmitry Torokhov

Hi Ashish,

Quoted 7 lines · Ashish Jangam

This is the ONKEY driver of the Dialog DA9055 PMIC and depends on the DA9055 MFD core driver.

This patch is functionally tested on SMDK6410 board.

Quoted 7 lines

---
changes since v3:
- used of module_platform_driver macro
- add regmap virtual irq function
changes since v2:
- add support for button release
- use of devm_request_threaded_irq API

Quoted 4 lines

This API does not make any sense for your driver as you are scheduling delayed work from the IRQ handler. In such cases you need _first_ free IRQ and _then_ cancel the work but with devm_* you do it in opposite order.

I miss on this, will correct it.

Quoted 4 lines

Also, I think I mentioned this before - this driver looks like twin brother for da9055_onkey.c. How many of such parts do you have (or will you have)? Is there way to unify them?

Well, DA9052 and DA9055 register sets are entirely different even there bit position are different and also few of its components have slight different behaviour. Device components functional difference can be managed programmatic but, to unify these two different sets of register will be impractical. In case of DA9052 I managed to club the DA9053 functionality within it but it was not possible for DA9055.

Quoted 3 lines

Thanks.