Add OnKey support for DA9063
Subsystems (5)
cover Add OnKey support for DA9063
From: Steve Twiss <[email protected]>
This patch set adds OnKey driver support for the Dialog Semiconductor DA9063 PMIC.
[PATCH V1 1/2]: kernel driver onkey support
[PATCH V1 2/2]: device tree bindings document
Thank you,
Steve Twiss, Dialog Semiconductor Ltd.
S Twiss (2):
input: misc: da9063: OnKey driver
devicetree: Add bindings for DA9063 OnKey
Documentation/devicetree/bindings/mfd/da9063.txt | 22 ++- MAINTAINERS | 2 +- drivers/input/misc/Kconfig | 10 + drivers/input/misc/Makefile | 1 + drivers/input/misc/da9063-onkey.c | 227 +++++++++++++++++++++++ drivers/mfd/da9063-core.c | 55 ++++++ include/linux/mfd/da9063/pdata.h | 1 + 7 files changed, 315 insertions(+), 3 deletions(-) create mode 100644 drivers/input/misc/da9063-onkey.c
Signature · 1 line
end-of-patch for PATCH V1
PATCH 1/2 input: misc: da9063: OnKey driver
From: Steve Twiss <[email protected]>
Add OnKey driver support for DA9063
This patch is dependent on PATCH V1 2/2
---
This patch applies against linux-next and v4.0-rc6
MAINTAINERS | 2 +- drivers/input/misc/Kconfig | 10 ++ drivers/input/misc/Makefile | 1 + drivers/input/misc/da9063-onkey.c | 227 ++++++++++++++++++++++++++++++++++++++ drivers/mfd/da9063-core.c | 55 +++++++++ include/linux/mfd/da9063/pdata.h | 1 + 6 files changed, 295 insertions(+), 1 deletion(-) create mode 100644 drivers/input/misc/da9063-onkey.c
MAINTAINERS +1 -1
@@ -3138,7 +3138,7 @@ S: Supported F: Documentation/hwmon/da90?? F: drivers/gpio/gpio-da90??.c F: drivers/hwmon/da90??-hwmon.c -F: drivers/input/misc/da90??_onkey.c +F: drivers/input/misc/da90???onkey.c F: drivers/input/touchscreen/da9052_tsi.c F: drivers/leds/leds-da90??.c F: drivers/mfd/da903x.c
drivers/input/misc/Kconfig +10 -0
@@ -586,6 +586,16 @@ config INPUT_DA9055_ONKEY To compile this driver as a module, choose M here: the module will be called da9055_onkey. +config INPUT_DA9063_ONKEY + tristate "Dialog DA9063 OnKey" + depends on MFD_DA9063 + help + Support the ONKEY of Dialog DA9063 Power Management IC as an + input device reporting power button statue. + + To compile this driver as a module, choose M here: the module + will be called da9063-onkey. + config INPUT_DM355EVM tristate "TI DaVinci DM355 EVM Keypad and IR Remote" depends on MFD_DM355EVM_MSP
drivers/input/misc/Makefile +1 -0
@@ -25,6 +25,7 @@ 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_DA9063_ONKEY) += da9063-onkey.o obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o obj-$(CONFIG_INPUT_E3X0_BUTTON) += e3x0-button.o obj-$(CONFIG_INPUT_DRV260X_HAPTICS) += drv260x.o
drivers/input/misc/da9063-onkey.c new file +227 -0
227 lines not on this page · raw message
drivers/mfd/da9063-core.c +55 -0
85 lines not on this page · raw message
include/linux/mfd/da9063/pdata.h +1 -0
@@ -103,6 +103,7 @@ struct da9063;struct da9063_pdata {int (*init)(struct da9063 *da9063);int irq_base; +bool key_power;unsigned flags;struct da9063_regulators_pdata *regulators_pdata;struct led_platform_data *leds_pdata;
Signature · 1 line
end-of-patch for PATCH V1
Re: [PATCH V1 1/2] input: misc: da9063: OnKey driver
A license mismatch was all I spotted.
Quoted 5 lines · Steve Twiss
From: Steve Twiss <[email protected]>
Add OnKey driver support for DA9063
This patch is dependent on PATCH V1 2/2
(But I also spotted this line. And then I checked 2/2, which has:
This patch is dependent on PATCH V1 1/2
Which makes it all rather confusing.
Anyhow, neither patch should need to carry such a line. The 1/2 and 2/2 in the Subject: line should suffice.)
Quoted 11 lines
Signed-off-by Steve Twiss <[email protected]>---
This patch applies against linux-next and v4.0-rc6drivers/input/misc/da9063-onkey.c new file +3
-0@@ -0,0 +1,227 @@ +/* da9063-onkey.c - Onkey device driver for DA9063 +* Copyright (C) 2013 Dialog Semiconductor Ltd. +*
drivers/input/misc/da9063-onkey.c line 13
Quoted 10 lines
drivers/input/misc/da9063-onkey.c new file +10
-0+* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Library General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Library General Public License for more details. +*/
This states the license is GPL v2 or later.
drivers/input/misc/da9063-onkey.c line 226
Quoted 1 line
drivers/input/misc/da9063-onkey.c new file +1
-0+MODULE_LICENSE ("GPL v2" );
And (according to include/linux/module.h) this states the license is (just) GPL v2.
Paul Bolle
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH V1 1/2] input: misc: da9063: OnKey driver
Quoted 3 lines · On 09 April 2015 09:48 Paul Bolle wrote:
Quoted 1 line
This patch is dependent on PATCH V1 2/2
This patch is dependent on PATCH V1 1/2
Which makes it all rather confusing.
It is a bit circular, I'll take that out for the next patch
Quoted 17 lines
drivers/input/misc/da9063-onkey.c line 11
Quoted 13 lines
+++
b/drivers/input/misc/da9063-onkey.cdrivers/input/misc/da9063-onkey.c new file +11
-0@@ -0,0 +1,227 @@ +/* da9063-onkey.c - Onkey device driver for DA9063 +* Copyright (C) 2013 Dialog Semiconductor Ltd. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Library General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Review line 13
Quoted 2 lines
(quoted diff) +2
-0+ * Library General Public License for more details. + */
Quoted 6 lines
This states the license is GPL v2 or later.
drivers/input/misc/da9063-onkey.c line 226
Quoted 1 line
drivers/input/misc/da9063-onkey.c new file +1
-0+MODULE_LICENSE ("GPL v2" );And (according to
include/linux/module.h) this states the license is (just) GPL v2.
Ah, I'll fix that for the future.
Thanks for the comments,
Regards,
Steve
Re: [PATCH V1 1/2] input: misc: da9063: OnKey driver
Quoted 25 lines · Opensource [Steve Twiss]
Quoted 3 lines · On 09 April 2015 09:48 Paul Bolle wrote:
Quoted 1 line
This patch is dependent on PATCH V1 2/2
This patch is dependent on PATCH V1 1/2
Which makes it all rather confusing.It is a bit circular, I'll take that out for the next patch
Quoted 17 lines
drivers/input/misc/da9063-onkey.c line 11
Quoted 13 lines
+++
b/drivers/input/misc/da9063-onkey.cdrivers/input/misc/da9063-onkey.c new file +11
-0@@ -0,0 +1,227 @@ +/* da9063-onkey.c - Onkey device driver for DA9063 +* Copyright (C) 2013 Dialog Semiconductor Ltd. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Library General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Quoted 2 lines
(quoted diff) +2
-0+ * Library General Public License for more details. + */
Quoted 8 lines
Quoted 6 lines
This states the license is GPL v2 or later.
drivers/input/misc/da9063-onkey.c line 226
Quoted 1 line
drivers/input/misc/da9063-onkey.c new file +1
-0+MODULE_LICENSE ("GPL v2" );And (according to
include/linux/module.h) this states the license is (just) GPL v2.Ah, I'll fix that for the future.
My reading comprehension is declining. Because I only now noticed that the comment at the top of this file states the license is LGPL v2 or later (note the L).
Grepping the tree for "Library General" gave over 100 hits, a few of them even in drivers/, so I suppose LPGL v2 is fine for the kernel. It _feels_ a bit odd to use it for a driver, but that might just be me.
Paul Bolle
PATCH 2/2 devicetree: Add bindings for DA9063 OnKey
In reply to Steve TwissFrom: Steve Twiss <[email protected]>
Add device tree bindings for the DA9063 OnKey driver
This patch is dependent on PATCH V1 1/2
---
This patch applies against linux-next and v4.0-rc6
Documentation/devicetree/bindings/mfd/da9063.txt | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mfd/da9063.txt +20 -2
@@ -2,9 +2,10 @@ DA9093 consists of a large and varied group of sub-devices (I2C Only): -Device Supply Names Description ------- ------------ ----------- +Device Supply Names Description +------ ------------ ----------- da9063-regulator : : LDOs & BUCKs +da9063-onkey : : On Key da9063-rtc : : Real-Time Clock da9063-watchdog : : Watchdog
@@ -51,6 +52,18 @@ Sub-nodes: the DA9063. There are currently no entries in this binding, however compatible = "dlg,da9063-rtc" should be added if a node is created. +- onkey : This node defines the OnKey settings for controlling the key + functionality of the device. The node should contain the compatible keyword + with the value "dlg,da9063-onkey". + + The platform data needs to match the OTP content of high address register + DA9063_REG_CONFIG_I and the device tree entry "dlg,disable-key-power" can + be used to control this. If the onkey node contains "dlg,disable-key-power" + then the power down using a long key-press is disabled. If this entry is + missing then by default the key-press triggered power down is enabled. + By toggling this key-power keyword the OnKey driver will support KEY_POWER + and KEY_SLEEP key presses. + - watchdog : This node defines settings for the Watchdog timer associated with the DA9063. There are currently no entries in this binding, however compatible = "dlg,da9063-watchdog" should be added if a node is created.
@@ -73,6 +86,11 @@ Example: compatible = "dlg,da9063-watchdog"; }; + onkey { + compatible = "dlg,da9063-onkey"; + dlg,disable-key-power; + }; + regulators { DA9063_BCORE1: bcore1 { regulator-name = "BCORE1";
Signature · 1 line
end-of-patch for PATCH V1
Re: [PATCH V1 2/2] devicetree: Add bindings for DA9063 OnKey
Quoted 1 line · Steve Twiss
From: Steve Twiss <[email protected]>
What format is this? Why aren't you using git send-email?
Quoted 3 lines
Add device tree bindings for the DA9063 OnKey driver
This patch is dependent on PATCH V1 1/2
How can there be dependencies between a binding document and a driver patch?
Quoted 27 lines
Signed-off-by Steve Twiss <[email protected]>---
This patch applies against linux-next and v4.0-rc6Documentation/devicetree/bindings/mfd/da9063.txt | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)Documentation/devicetree/bindings/mfd/da9063.txt +3
-2@@ -2,9 +2,10 @@ DA9093 consists of a large and varied group of sub-devices (I2C Only): -Device Supply Names Description ------- ------------ ----------- +Device Supply Names Description +------ ------------ ----------- da9063-regulator : : LDOs & BUCKs +da9063-onkey : : On Key da9063-rtc : : Real-Time Clock da9063-watchdog : : Watchdog
Documentation/devicetree/bindings/mfd/da9063.txt Sub-nodes: · line 56
Quoted 5 lines
Documentation/devicetree/bindings/mfd/da9063.txt +2
-0@@ -51,6 +52,18 @@ Sub-nodes: the DA9063. There are currently no entries in this binding, however compatible = "dlg,da9063-rtc" should be added if a node is created. +- onkey : This node defines the OnKey settings for controlling the key + functionality of the device. The node should contain the compatible keyword
s/keyword/property/
Documentation/devicetree/bindings/mfd/da9063.txt Sub-nodes: · line 59
Quoted 3 lines
Documentation/devicetree/bindings/mfd/da9063.txt +3
-0+ with the value "dlg,da9063-onkey". + + The platform data needs to match the OTP content of high address register
It's wrong to mention platform data here. Just tell us what the property is for.
Documentation/devicetree/bindings/mfd/da9063.txt Sub-nodes: · line 60
Quoted 1 line
Documentation/devicetree/bindings/mfd/da9063.txt +1
-0+ DA9063_REG_CONFIG_I and the device tree entry "dlg,disable-key-power" can
I feel like you're burying the dlg,disable-key-power documentation in side a long winded paragraph. It's better to start the line with it, like:
Optional Properties:
dlg,disable-key-power: Disable power-down using a long key-press. If
absent <blah> ...
Quoted 21 lines
Documentation/devicetree/bindings/mfd/da9063.txt +11
-0+ be used to control this. If the onkey node contains "dlg,disable-key-power" + then the power down using a long key-press is disabled. If this entry is + missing then by default the key-press triggered power down is enabled. + By toggling this key-power keyword the OnKey driver will support KEY_POWER + and KEY_SLEEP key presses. + - watchdog : This node defines settings for the Watchdog timer associated with the DA9063. There are currently no entries in this binding, however compatible = "dlg,da9063-watchdog" should be added if a node is created.@@ -73,6 +86,11 @@ Example: compatible = "dlg,da9063-watchdog"; }; + onkey { + compatible = "dlg,da9063-onkey"; + dlg,disable-key-power; + }; + regulators { DA9063_BCORE1: bcore1 { regulator-name = "BCORE1";
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
RE: [PATCH V1 2/2] devicetree: Add bindings for DA9063 OnKey
On 09 April 2015 10:22 Lee Jones wrote
Quoted 2 lines
Quoted 1 line
From: Steve Twiss <[email protected]>
What format is this? Why aren't you using
git send-email?
I am using a git format-patch to generate the patches but our in-house IT department complications disallow the use of git send-email.
Quoted 3 lines
Quoted 1 line
This patch is dependent on PATCH V1 1/2
How can there be dependencies between a binding document and a driver patch?
I'll remove those circular dependencies for the next patch
Quoted 5 lines
Quoted 2 lines
+- onkey : This node defines the OnKey settings for controlling the key + functionality of the device. The node should contain the compatiblekeyword
s/keyword/property/
... will do that search and replace
Quoted 12 lines
Quoted 1 line
+
DA9063_REG_CONFIG_Iand the device tree entry "dlg,disable-key-power" can
I feel like you're burying the dlg,disable-key-power documentation in side a long winded paragraph. It's better to start the line with it, like:
Optional Properties:
dlg,disable-key-power: Disable power-down using a long key-press. If
absent <blah> ...
okay, I'll make that change.
Thanks for the comments,
I'll send PATCH V2 after I make the changes requested by yourself and Paul Bolle (see https://lkml.org/lkml/2015/4/9/150).
Regards,
Steve