diff mbox

thermal: armada: add support for suspend/resume

Message ID 1469097807-17748-1-git-send-email-jaz@semihalf.com (mailing list archive)
State Changes Requested
Delegated to: Zhang Rui
Headers show

Commit Message

Grzegorz Jaszczyk July 21, 2016, 10:43 a.m. UTC
There is no need to implement subroutine for suspend since there is no
data to store before suspending.

Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
---
 drivers/thermal/armada_thermal.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Grzegorz Jaszczyk Aug. 11, 2016, 8:40 a.m. UTC | #1
Hi,

I just wanted to kindly remind about this patch.

Best regards,
Grzegorz

2016-07-21 12:43 GMT+02:00 Grzegorz Jaszczyk <jaz@semihalf.com>:
> There is no need to implement subroutine for suspend since there is no
> data to store before suspending.
>
> Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
> ---
>  drivers/thermal/armada_thermal.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
> index ae75328..65f9838 100644
> --- a/drivers/thermal/armada_thermal.c
> +++ b/drivers/thermal/armada_thermal.c
> @@ -304,12 +304,26 @@ static int armada_thermal_exit(struct platform_device *pdev)
>         return 0;
>  }
>
> +static int armada_thermal_resume(struct device *dev)
> +{
> +       struct thermal_zone_device *thermal =
> +               dev_get_drvdata(dev);
> +       struct armada_thermal_priv *priv = thermal->devdata;
> +
> +       priv->data->init_sensor(to_platform_device(dev), priv);
> +
> +       return 0;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(armada_thermal_pm_ops, NULL, armada_thermal_resume);
> +
>  static struct platform_driver armada_thermal_driver = {
>         .probe = armada_thermal_probe,
>         .remove = armada_thermal_exit,
>         .driver = {
>                 .name = "armada_thermal",
>                 .of_match_table = armada_thermal_id_table,
> +               .pm = &armada_thermal_pm_ops,
>         },
>  };
>
> --
> 1.8.3.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zhang Rui Aug. 19, 2016, 1:06 p.m. UTC | #2
On 四, 2016-07-21 at 12:43 +0200, Grzegorz Jaszczyk wrote:
> There is no need to implement subroutine for suspend since there is
> no
> data to store before suspending.
> 
> Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>

Ezequiel,

what do you think of this patch?

thanks,
rui
> ---
>  drivers/thermal/armada_thermal.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/thermal/armada_thermal.c
> b/drivers/thermal/armada_thermal.c
> index ae75328..65f9838 100644
> --- a/drivers/thermal/armada_thermal.c
> +++ b/drivers/thermal/armada_thermal.c
> @@ -304,12 +304,26 @@ static int armada_thermal_exit(struct
> platform_device *pdev)
>  	return 0;
>  }
>  
> +static int armada_thermal_resume(struct device *dev)
> +{
> +	struct thermal_zone_device *thermal =
> +		dev_get_drvdata(dev);
> +	struct armada_thermal_priv *priv = thermal->devdata;
> +
> +	priv->data->init_sensor(to_platform_device(dev), priv);
> +
> +	return 0;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(armada_thermal_pm_ops, NULL,
> armada_thermal_resume);
> +
>  static struct platform_driver armada_thermal_driver = {
>  	.probe = armada_thermal_probe,
>  	.remove = armada_thermal_exit,
>  	.driver = {
>  		.name = "armada_thermal",
>  		.of_match_table = armada_thermal_id_table,
> +		.pm = &armada_thermal_pm_ops,
>  	},
>  };
>  
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zhang Rui Sept. 6, 2016, 12:36 a.m. UTC | #3
On 五, 2016-08-19 at 21:06 +0800, Zhang Rui wrote:
> On 四, 2016-07-21 at 12:43 +0200, Grzegorz Jaszczyk wrote:
> > 
> > There is no need to implement subroutine for suspend since there is
> > no
> > data to store before suspending.
> > 
> > Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
> Ezequiel,
> 
> what do you think of this patch?
> 
Ezequiel,
As the author of the armada_thermal driver, it would be great if you
can be the goalkeeper for all armada_thermal changes, and I'd prefer to
get your ACK/NAK before applying/dropping any armada thermal patches.
Can you please take a look at this patch?

BTW, Grzegorz, for the PM callbacks, you'd better to either use
__maybe_unused so that gcc can drop it if it's not used, or use #ifdef
to compile them out when CONFIG_PM_SLEEP is not set.
You can also refer to this patch https://patchwork.kernel.org/patch/931
1025/	


thanks,
rui 
> thanks,
> rui
> > 
> > ---
> >  drivers/thermal/armada_thermal.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/drivers/thermal/armada_thermal.c
> > b/drivers/thermal/armada_thermal.c
> > index ae75328..65f9838 100644
> > --- a/drivers/thermal/armada_thermal.c
> > +++ b/drivers/thermal/armada_thermal.c
> > @@ -304,12 +304,26 @@ static int armada_thermal_exit(struct
> > platform_device *pdev)
> >  	return 0;
> >  }
> >  
> > +static int armada_thermal_resume(struct device *dev)
> > +{
> > +	struct thermal_zone_device *thermal =
> > +		dev_get_drvdata(dev);
> > +	struct armada_thermal_priv *priv = thermal->devdata;
> > +
> > +	priv->data->init_sensor(to_platform_device(dev), priv);
> > +
> > +	return 0;
> > +}
> > +
> > +static SIMPLE_DEV_PM_OPS(armada_thermal_pm_ops, NULL,
> > armada_thermal_resume);
> > +
> >  static struct platform_driver armada_thermal_driver = {
> >  	.probe = armada_thermal_probe,
> >  	.remove = armada_thermal_exit,
> >  	.driver = {
> >  		.name = "armada_thermal",
> >  		.of_match_table = armada_thermal_id_table,
> > +		.pm = &armada_thermal_pm_ops,
> >  	},
> >  };
> >  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mason Sept. 7, 2016, 8:05 a.m. UTC | #4
On 21/07/2016 12:43, Grzegorz Jaszczyk wrote:

> There is no need to implement subroutine for suspend since there is no
> data to store before suspending.
> 
> Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
> ---
>  drivers/thermal/armada_thermal.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
> index ae75328..65f9838 100644
> --- a/drivers/thermal/armada_thermal.c
> +++ b/drivers/thermal/armada_thermal.c
> @@ -304,12 +304,26 @@ static int armada_thermal_exit(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static int armada_thermal_resume(struct device *dev)
> +{
> +	struct thermal_zone_device *thermal =
> +		dev_get_drvdata(dev);
> +	struct armada_thermal_priv *priv = thermal->devdata;
> +
> +	priv->data->init_sensor(to_platform_device(dev), priv);
> +
> +	return 0;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(armada_thermal_pm_ops, NULL, armada_thermal_resume);
> +
>  static struct platform_driver armada_thermal_driver = {
>  	.probe = armada_thermal_probe,
>  	.remove = armada_thermal_exit,
>  	.driver = {
>  		.name = "armada_thermal",
>  		.of_match_table = armada_thermal_id_table,
> +		.pm = &armada_thermal_pm_ops,
>  	},
>  };

gcc might warn about 'armada_thermal_resume' defined but not used
when CONFIG_PM_SLEEP is not defined, I think?

(I have a similar patch, Arnd suggested using __maybe_unused tag.)

Regards.

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Zhang Rui Sept. 27, 2016, 1:51 a.m. UTC | #5
On 三, 2016-09-07 at 10:05 +0200, Mason wrote:
> On 21/07/2016 12:43, Grzegorz Jaszczyk wrote:
> 
> > 
> > There is no need to implement subroutine for suspend since there is
> > no
> > data to store before suspending.
> > 
> > Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
> > ---
> >  drivers/thermal/armada_thermal.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/drivers/thermal/armada_thermal.c
> > b/drivers/thermal/armada_thermal.c
> > index ae75328..65f9838 100644
> > --- a/drivers/thermal/armada_thermal.c
> > +++ b/drivers/thermal/armada_thermal.c
> > @@ -304,12 +304,26 @@ static int armada_thermal_exit(struct
> > platform_device *pdev)
> >  	return 0;
> >  }
> >  
> > +static int armada_thermal_resume(struct device *dev)
> > +{
> > +	struct thermal_zone_device *thermal =
> > +		dev_get_drvdata(dev);
> > +	struct armada_thermal_priv *priv = thermal->devdata;
> > +
> > +	priv->data->init_sensor(to_platform_device(dev), priv);
> > +
> > +	return 0;
> > +}
> > +
> > +static SIMPLE_DEV_PM_OPS(armada_thermal_pm_ops, NULL,
> > armada_thermal_resume);
> > +
> >  static struct platform_driver armada_thermal_driver = {
> >  	.probe = armada_thermal_probe,
> >  	.remove = armada_thermal_exit,
> >  	.driver = {
> >  		.name = "armada_thermal",
> >  		.of_match_table = armada_thermal_id_table,
> > +		.pm = &armada_thermal_pm_ops,
> >  	},
> >  };
> gcc might warn about 'armada_thermal_resume' defined but not used
> when CONFIG_PM_SLEEP is not defined, I think?
> 
> (I have a similar patch, Arnd suggested using __maybe_unused tag.)
> 
right.
Grzegorz, you can use this one as a reference. https://patchwork.kernel
.org/patch/9318621/

thanks,
rui

> Regards.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index ae75328..65f9838 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -304,12 +304,26 @@  static int armada_thermal_exit(struct platform_device *pdev)
 	return 0;
 }
 
+static int armada_thermal_resume(struct device *dev)
+{
+	struct thermal_zone_device *thermal =
+		dev_get_drvdata(dev);
+	struct armada_thermal_priv *priv = thermal->devdata;
+
+	priv->data->init_sensor(to_platform_device(dev), priv);
+
+	return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(armada_thermal_pm_ops, NULL, armada_thermal_resume);
+
 static struct platform_driver armada_thermal_driver = {
 	.probe = armada_thermal_probe,
 	.remove = armada_thermal_exit,
 	.driver = {
 		.name = "armada_thermal",
 		.of_match_table = armada_thermal_id_table,
+		.pm = &armada_thermal_pm_ops,
 	},
 };