mbox series

[v4,0/6] input: pm8941-pwrkey: Add support for reboot reason

Message ID 20180627115301.21330-1-vkoul@kernel.org
Headers show
Series input: pm8941-pwrkey: Add support for reboot reason | expand

Message

Vinod Koul June 27, 2018, 11:52 a.m. UTC
To add support for reboot reason there have been some attempts [1], [2]
in past. Based on these discussions we added a new pon driver and made
pwrkey and resin as child nodes to pon.

Since the pwrkey and resin are similar, abstract pwrkey driver
and then add support for resin in the same driver.

Since the patches touch reset and input subsystems, it would be nice if
folks can ACK and we carry thru one subsystem, I would prefer that to be
input, other way would work fine too.

[1]: https://patchwork.kernel.org/patch/9751627/
[2]: https://patchwork.kernel.org/patch/10381801/

Changes in v4:
 - Add Rob's ack
 - Fix typo and description in pon binding
 - Separate out resin binding to an independent patch

Changes in v3:
 - Add Bjorn's ack
 - Make variable for event code u32

Changes in v2:
 - Add Bjorn's ack
 - Fix power binding by removing reg property
 - Use single block for parent check in pm8941-pwrkey as suggested by
   Dimitry

Vinod Koul (6):
  dt-bindings: power: reset: Add qcom pon binding
  power: reset: qcom-pon: Add Qcom PON driver
  dt-bindings: Input: Add additional property to qcom pwrkey
  input: pm8941-pwrkey: Abstract register offsets and event code
  dt-bindings: power: reset: qcom: Add resin binding
  input: pm8941-pwrkey: Add resin entry

 .../bindings/input/qcom,pm8941-pwrkey.txt          | 10 +++
 .../devicetree/bindings/power/reset/qcom,pon.txt   | 45 +++++++++++
 drivers/input/misc/pm8941-pwrkey.c                 | 69 ++++++++++++----
 drivers/power/reset/Kconfig                        |  8 ++
 drivers/power/reset/Makefile                       |  1 +
 drivers/power/reset/qcom-pon.c                     | 91 ++++++++++++++++++++++
 6 files changed, 211 insertions(+), 13 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/power/reset/qcom,pon.txt
 create mode 100644 drivers/power/reset/qcom-pon.c

Comments

Sebastian Reichel June 28, 2018, 11:59 a.m. UTC | #1
Hi,

On Wed, Jun 27, 2018 at 05:22:57PM +0530, Vinod Koul wrote:
> Add support Qualcomm PM8xxx PON which is responsible for reboot
> mode support.
> 
> Co-developed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---
>  drivers/power/reset/Kconfig    |  8 ++++
>  drivers/power/reset/Makefile   |  1 +
>  drivers/power/reset/qcom-pon.c | 91 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 100 insertions(+)
>  create mode 100644 drivers/power/reset/qcom-pon.c
> 
> diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
> index df58fc878b3e..1572b2d3ad3d 100644
> --- a/drivers/power/reset/Kconfig
> +++ b/drivers/power/reset/Kconfig
> @@ -104,6 +104,14 @@ config POWER_RESET_MSM
>  	help
>  	  Power off and restart support for Qualcomm boards.
>  
> +config POWER_RESET_QCOM_PON
> +	bool "Qualcomm power-on driver"

tristate?

Otherwise driver looks fine to me.

-- Sebastian
Vinod Koul June 28, 2018, 12:59 p.m. UTC | #2
Hi Sebastian,

On 28-06-18, 13:59, Sebastian Reichel wrote:
> On Wed, Jun 27, 2018 at 05:22:57PM +0530, Vinod Koul wrote:
> > Add support Qualcomm PM8xxx PON which is responsible for reboot
> > mode support.
> > 
> > Co-developed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > Signed-off-by: Vinod Koul <vkoul@kernel.org>
> > ---
> >  drivers/power/reset/Kconfig    |  8 ++++
> >  drivers/power/reset/Makefile   |  1 +
> >  drivers/power/reset/qcom-pon.c | 91 ++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 100 insertions(+)
> >  create mode 100644 drivers/power/reset/qcom-pon.c
> > 
> > diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
> > index df58fc878b3e..1572b2d3ad3d 100644
> > --- a/drivers/power/reset/Kconfig
> > +++ b/drivers/power/reset/Kconfig
> > @@ -104,6 +104,14 @@ config POWER_RESET_MSM
> >  	help
> >  	  Power off and restart support for Qualcomm boards.
> >  
> > +config POWER_RESET_QCOM_PON
> > +	bool "Qualcomm power-on driver"
> 
> tristate?

Hmmm I dont think there is a reason for this not being a module, though
looking at reset driver, bunch of them seem to be inbuilt only.

Bjorn, do you think we can be module or only inbuilt?

> 
> Otherwise driver looks fine to me.

Thanks
Sebastian Reichel June 28, 2018, 1:16 p.m. UTC | #3
Hi,

On Thu, Jun 28, 2018 at 06:29:58PM +0530, Vinod wrote:
> On 28-06-18, 13:59, Sebastian Reichel wrote:
> > On Wed, Jun 27, 2018 at 05:22:57PM +0530, Vinod Koul wrote:
> > > Add support Qualcomm PM8xxx PON which is responsible for reboot
> > > mode support.
> > > 
> > > Co-developed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > > Signed-off-by: Vinod Koul <vkoul@kernel.org>
> > > ---
> > >  drivers/power/reset/Kconfig    |  8 ++++
> > >  drivers/power/reset/Makefile   |  1 +
> > >  drivers/power/reset/qcom-pon.c | 91 ++++++++++++++++++++++++++++++++++++++++++
> > >  3 files changed, 100 insertions(+)
> > >  create mode 100644 drivers/power/reset/qcom-pon.c
> > > 
> > > diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
> > > index df58fc878b3e..1572b2d3ad3d 100644
> > > --- a/drivers/power/reset/Kconfig
> > > +++ b/drivers/power/reset/Kconfig
> > > @@ -104,6 +104,14 @@ config POWER_RESET_MSM
> > >  	help
> > >  	  Power off and restart support for Qualcomm boards.
> > >  
> > > +config POWER_RESET_QCOM_PON
> > > +	bool "Qualcomm power-on driver"
> > 
> > tristate?
> 
> Hmmm I dont think there is a reason for this not being a module, though
> looking at reset driver, bunch of them seem to be inbuilt only.
> 
> Bjorn, do you think we can be module or only inbuilt?

Note: If the result is inbuilt only, then you should update the
code accordingly (drop MODULE_*, use builtin_platform_driver instead
of module_platform_driver, ...

-- Sebastian
Vinod Koul June 28, 2018, 1:27 p.m. UTC | #4
Hi Sebastian,

On 28-06-18, 15:16, Sebastian Reichel wrote:
> On Thu, Jun 28, 2018 at 06:29:58PM +0530, Vinod wrote:
> > > >  
> > > > +config POWER_RESET_QCOM_PON
> > > > +	bool "Qualcomm power-on driver"
> > > 
> > > tristate?
> > 
> > Hmmm I dont think there is a reason for this not being a module, though
> > looking at reset driver, bunch of them seem to be inbuilt only.
> > 
> > Bjorn, do you think we can be module or only inbuilt?
> 
> Note: If the result is inbuilt only, then you should update the
> code accordingly (drop MODULE_*, use builtin_platform_driver instead
> of module_platform_driver, ...

Agreed, either way I will send an update shortly.
Vinod Koul June 28, 2018, 3:03 p.m. UTC | #5
On 28-06-18, 18:57, Vinod wrote:
> Hi Sebastian,
> 
> On 28-06-18, 15:16, Sebastian Reichel wrote:
> > On Thu, Jun 28, 2018 at 06:29:58PM +0530, Vinod wrote:
> > > > >  
> > > > > +config POWER_RESET_QCOM_PON
> > > > > +	bool "Qualcomm power-on driver"
> > > > 
> > > > tristate?
> > > 
> > > Hmmm I dont think there is a reason for this not being a module, though
> > > looking at reset driver, bunch of them seem to be inbuilt only.
> > > 
> > > Bjorn, do you think we can be module or only inbuilt?
> > 
> > Note: If the result is inbuilt only, then you should update the
> > code accordingly (drop MODULE_*, use builtin_platform_driver instead
> > of module_platform_driver, ...
> 
> Agreed, either way I will send an update shortly.

Okay discussed with Bjorn and made it tristate. Will send updated
shortly