diff mbox

[RESEND,V4,2/3] devicetree: Add bindings for DA9063 OnKey

Message ID 72933a3c053b445e7998c818b7a73317fa1e2d8a.1432031565.git.stwiss.opensource@diasemi.com
State Superseded, archived
Headers show

Commit Message

Steve Twiss May 19, 2015, 10:32 a.m. UTC
From: Steve Twiss <stwiss.opensource@diasemi.com>

Add device tree bindings for the DA9063 OnKey driver

Acked-by: Lee Jones <lee.jones@linaro.org>

Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>

---
Version History

Changes in V4
 - No change

Changes in V3
 - No change

Changes in V2
 - Remove the circular dependency comment linking patches in the main e-mail
 - Search and replace 'keyword' with 'property' in onkey sub-node description
 - Reformat onkey sub-node content to move the description for key-power into
   a new optional properties sub-section so it has a more promiment position

This patch applies against linux-next and v4.1-rc3 


 Documentation/devicetree/bindings/mfd/da9063.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Rob Herring May 20, 2015, 1:44 p.m. UTC | #1
On Tue, May 19, 2015 at 5:32 AM, S Twiss <stwiss.opensource@diasemi.com> wrote:
> From: Steve Twiss <stwiss.opensource@diasemi.com>
>
> Add device tree bindings for the DA9063 OnKey driver
>
> Acked-by: Lee Jones <lee.jones@linaro.org>
>

nit: remove blank line here.

I would think a long key press would be a h/w powerdown rather than a
key event as how do you poweroff/reset a hung system? That doesn't
really affect the binding though, so:

Acked-by: Rob Herring <robh@kernel.org>

Rob

> Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>
>
> ---
> Version History
>
> Changes in V4
>  - No change
>
> Changes in V3
>  - No change
>
> Changes in V2
>  - Remove the circular dependency comment linking patches in the main e-mail
>  - Search and replace 'keyword' with 'property' in onkey sub-node description
>  - Reformat onkey sub-node content to move the description for key-power into
>    a new optional properties sub-section so it has a more promiment position
>
> This patch applies against linux-next and v4.1-rc3
>
>
>  Documentation/devicetree/bindings/mfd/da9063.txt | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mfd/da9063.txt b/Documentation/devicetree/bindings/mfd/da9063.txt
> index 42c6fa6..05b21bc 100644
> --- a/Documentation/devicetree/bindings/mfd/da9063.txt
> +++ b/Documentation/devicetree/bindings/mfd/da9063.txt
> @@ -5,6 +5,7 @@ DA9093 consists of a large and varied group of sub-devices (I2C Only):
>  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 property
> +  with the value "dlg,da9063-onkey".
> +
> +  Optional onkey properties:
> +
> +  - dlg,disable-key-power : Disable power-down using a long key-press. If this
> +    entry exists the OnKey driver will remove support for the KEY_POWER key
> +    press. If this entry does not exist then by default the key-press
> +    triggered power down is enabled and the OnKey will support both KEY_POWER
> +    and KEY_SLEEP.
> +
>  - 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";
> --
> end-of-patch for RESEND PATCH V4
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Twiss May 20, 2015, 2:27 p.m. UTC | #2
On 20 May 2015 14:44 Rob Herring wrote:

> To: Opensource [Steve Twiss]

> Cc: Ian Campbell; Kumar Gala; Lee Jones; Mark Rutland; Pawel Moll; Rob

> Herring; DT; David Dajun Chen; Dmitry Torokhov; INPUT; LKML; Samuel Ortiz;

> Support Opensource

> Subject: Re: [RESEND PATCH V4 2/3] devicetree: Add bindings for DA9063

> OnKey

> 

> On Tue, May 19, 2015 at 5:32 AM, S Twiss

> <stwiss.opensource@diasemi.com> wrote:

> > From: Steve Twiss <stwiss.opensource@diasemi.com>

> >

> > Add device tree bindings for the DA9063 OnKey driver

> >

> > Acked-by: Lee Jones <lee.jones@linaro.org>

> >


Hi Rob,

Thanks for the Ack.

> I would think a long key press would be a h/w powerdown rather than a

> key event as how do you poweroff/reset a hung system? That doesn't

> really affect the binding though, so:


yep.. 

That H/W controlled shutdown is not covered in the device driver because
it is defaulted by the hardware PMIC.

The  DA9063 OnKey has are four modes of operation -- and one of them is
a H/W controlled shutdown (to reset a hung system).  Holding down the
OnKey for a "long-long" key-press, if there is no software intervention,
then the PMIC will chop the power.

The other three modes are ...
(a) Short key press
(b) Long-key press
(c) Long-long key press

These modes *are* handled by the S/W driver.
(a) The short key-press being the usual sleep/suspend.
(b) Long key press is the KEY_POWER (bringing up a dialog on Android to ask if
the user wants to shutdown the device) -- this is the one that can be disabled
by the device tree binding.
(c) Long-long key press -- this is the software equivalent to the H/W shutdown
for a hung system. Instead of the hardware pulling the plug, the software sends
a command to tell the PMIC to pull the plug.

If that last one sounds like a repeat of the H/W shutdown, then that is because
it almost is.

It covers the use case when the user decides to shutdown their device by doing
a long-long key press. The difference here is that the software is still able to
respond, and so there is space for any important house-keeping (say to save
important data) before the software sends a command to tell the PMIC to pull
the plug.

The fail-safe at this point is: if the S/W really isn't responding, then the hardware
monitors the long-long key-press and if there is no intervention by software, the 
PMIC pulls the power plug 1 second later.

Regards,
Steve
Lee Jones May 26, 2015, 1:58 p.m. UTC | #3
On Tue, 19 May 2015, S Twiss wrote:

> From: Steve Twiss <stwiss.opensource@diasemi.com>
> 
> Add device tree bindings for the DA9063 OnKey driver
> 
> Acked-by: Lee Jones <lee.jones@linaro.org>
> 
> Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>
> 
> ---
> Version History
> 
> Changes in V4
>  - No change
> 
> Changes in V3
>  - No change
> 
> Changes in V2
>  - Remove the circular dependency comment linking patches in the main e-mail
>  - Search and replace 'keyword' with 'property' in onkey sub-node description
>  - Reformat onkey sub-node content to move the description for key-power into
>    a new optional properties sub-section so it has a more promiment position
> 
> This patch applies against linux-next and v4.1-rc3 
> 
> 
>  Documentation/devicetree/bindings/mfd/da9063.txt | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)

Applied with Rob's Ack.

> diff --git a/Documentation/devicetree/bindings/mfd/da9063.txt b/Documentation/devicetree/bindings/mfd/da9063.txt
> index 42c6fa6..05b21bc 100644
> --- a/Documentation/devicetree/bindings/mfd/da9063.txt
> +++ b/Documentation/devicetree/bindings/mfd/da9063.txt
> @@ -5,6 +5,7 @@ DA9093 consists of a large and varied group of sub-devices (I2C Only):
>  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 property
> +  with the value "dlg,da9063-onkey".
> +
> +  Optional onkey properties:
> +
> +  - dlg,disable-key-power : Disable power-down using a long key-press. If this
> +    entry exists the OnKey driver will remove support for the KEY_POWER key
> +    press. If this entry does not exist then by default the key-press
> +    triggered power down is enabled and the OnKey will support both KEY_POWER
> +    and KEY_SLEEP.
> +
>  - 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";
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/mfd/da9063.txt b/Documentation/devicetree/bindings/mfd/da9063.txt
index 42c6fa6..05b21bc 100644
--- a/Documentation/devicetree/bindings/mfd/da9063.txt
+++ b/Documentation/devicetree/bindings/mfd/da9063.txt
@@ -5,6 +5,7 @@  DA9093 consists of a large and varied group of sub-devices (I2C Only):
 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 property
+  with the value "dlg,da9063-onkey".
+
+  Optional onkey properties:
+
+  - dlg,disable-key-power : Disable power-down using a long key-press. If this
+    entry exists the OnKey driver will remove support for the KEY_POWER key
+    press. If this entry does not exist then by default the key-press
+    triggered power down is enabled and the OnKey will support both KEY_POWER
+    and KEY_SLEEP.
+
 - 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";