diff mbox

power: reset: msm: Clarify restart and poweroff

Message ID 20180108033313.13538-1-bjorn.andersson@linaro.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Bjorn Andersson Jan. 8, 2018, 3:33 a.m. UTC
When PSHOLD in a Qualcomm platform is deasserted the PMIC will perform
either a power off or a restart of the system. The action to take is
configured in the PON block, which is controlled by a separate driver.

As the configuration logic was added to the pm8941-pwrkey driver the
comment in do_msm_poweroff() is no longer valid and the name
do_msm_restart() is misleading. Update the naming and drop the comment.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 drivers/power/reset/msm-poweroff.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Sebastian Reichel Jan. 9, 2018, 4:20 p.m. UTC | #1
Hi,

On Sun, Jan 07, 2018 at 07:33:13PM -0800, Bjorn Andersson wrote:
> When PSHOLD in a Qualcomm platform is deasserted the PMIC will perform
> either a power off or a restart of the system. The action to take is
> configured in the PON block, which is controlled by a separate driver.
> 
> As the configuration logic was added to the pm8941-pwrkey driver the
> comment in do_msm_poweroff() is no longer valid and the name
> do_msm_restart() is misleading. Update the naming and drop the comment.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/reset/msm-poweroff.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/power/reset/msm-poweroff.c b/drivers/power/reset/msm-poweroff.c
> index 4702efdfe466..01b8c71697cb 100644
> --- a/drivers/power/reset/msm-poweroff.c
> +++ b/drivers/power/reset/msm-poweroff.c
> @@ -23,7 +23,7 @@
>  #include <linux/pm.h>
>  
>  static void __iomem *msm_ps_hold;
> -static int do_msm_restart(struct notifier_block *nb, unsigned long action,
> +static int deassert_pshold(struct notifier_block *nb, unsigned long action,
>  			   void *data)
>  {
>  	writel(0, msm_ps_hold);
> @@ -33,14 +33,13 @@ static int do_msm_restart(struct notifier_block *nb, unsigned long action,
>  }
>  
>  static struct notifier_block restart_nb = {
> -	.notifier_call = do_msm_restart,
> +	.notifier_call = deassert_pshold,
>  	.priority = 128,
>  };
>  
>  static void do_msm_poweroff(void)
>  {
> -	/* TODO: Add poweroff capability */
> -	do_msm_restart(&restart_nb, 0, NULL);
> +	deassert_pshold(&restart_nb, 0, NULL);
>  }
>  
>  static int msm_restart_probe(struct platform_device *pdev)
> -- 
> 2.15.0
>
diff mbox

Patch

diff --git a/drivers/power/reset/msm-poweroff.c b/drivers/power/reset/msm-poweroff.c
index 4702efdfe466..01b8c71697cb 100644
--- a/drivers/power/reset/msm-poweroff.c
+++ b/drivers/power/reset/msm-poweroff.c
@@ -23,7 +23,7 @@ 
 #include <linux/pm.h>
 
 static void __iomem *msm_ps_hold;
-static int do_msm_restart(struct notifier_block *nb, unsigned long action,
+static int deassert_pshold(struct notifier_block *nb, unsigned long action,
 			   void *data)
 {
 	writel(0, msm_ps_hold);
@@ -33,14 +33,13 @@  static int do_msm_restart(struct notifier_block *nb, unsigned long action,
 }
 
 static struct notifier_block restart_nb = {
-	.notifier_call = do_msm_restart,
+	.notifier_call = deassert_pshold,
 	.priority = 128,
 };
 
 static void do_msm_poweroff(void)
 {
-	/* TODO: Add poweroff capability */
-	do_msm_restart(&restart_nb, 0, NULL);
+	deassert_pshold(&restart_nb, 0, NULL);
 }
 
 static int msm_restart_probe(struct platform_device *pdev)