All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec_rpmsg: Add host command AP sleep state support
@ 2019-08-14  8:17 Yilun Lin
  2019-08-22 19:36 ` Enric Balletbo i Serra
  2019-08-28  7:54 ` Enric Balletbo i Serra
  0 siblings, 2 replies; 4+ messages in thread
From: Yilun Lin @ 2019-08-14  8:17 UTC (permalink / raw)
  To: LKML
  Cc: pihsun, Yilun Lin, Enric Balletbo i Serra, Guenter Roeck, Benson Leung

Add EC host command to inform EC of AP suspend/resume status.

Signed-off-by: Yilun Lin <yllin@chromium.org>
---

 drivers/platform/chrome/cros_ec_rpmsg.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_rpmsg.c b/drivers/platform/chrome/cros_ec_rpmsg.c
index 5d3fb2abad1d..6f34fe629e2c 100644
--- a/drivers/platform/chrome/cros_ec_rpmsg.c
+++ b/drivers/platform/chrome/cros_ec_rpmsg.c
@@ -236,6 +236,25 @@ static void cros_ec_rpmsg_remove(struct rpmsg_device *rpdev)
 	cancel_work_sync(&ec_rpmsg->host_event_work);
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int cros_ec_rpmsg_suspend(struct device *dev)
+{
+	struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
+
+	return cros_ec_suspend(ec_dev);
+}
+
+static int cros_ec_rpmsg_resume(struct device *dev)
+{
+	struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
+
+	return cros_ec_resume(ec_dev);
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(cros_ec_rpmsg_pm_ops, cros_ec_rpmsg_suspend,
+			 cros_ec_rpmsg_resume);
+
 static const struct of_device_id cros_ec_rpmsg_of_match[] = {
 	{ .compatible = "google,cros-ec-rpmsg", },
 	{ }
@@ -246,6 +265,7 @@ static struct rpmsg_driver cros_ec_driver_rpmsg = {
 	.drv = {
 		.name   = "cros-ec-rpmsg",
 		.of_match_table = cros_ec_rpmsg_of_match,
+		.pm	= &cros_ec_rpmsg_pm_ops,
 	},
 	.probe		= cros_ec_rpmsg_probe,
 	.remove		= cros_ec_rpmsg_remove,
-- 
2.23.0.rc1.153.gdeed80330f-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] platform/chrome: cros_ec_rpmsg: Add host command AP sleep state support
  2019-08-14  8:17 [PATCH] platform/chrome: cros_ec_rpmsg: Add host command AP sleep state support Yilun Lin
@ 2019-08-22 19:36 ` Enric Balletbo i Serra
  2019-08-27  4:01   ` Pi-Hsun Shih
  2019-08-28  7:54 ` Enric Balletbo i Serra
  1 sibling, 1 reply; 4+ messages in thread
From: Enric Balletbo i Serra @ 2019-08-22 19:36 UTC (permalink / raw)
  To: Yilun Lin, LKML; +Cc: pihsun, Guenter Roeck, Benson Leung, Laurent Pinchart

Hi,

On 14/8/19 10:17, Yilun Lin wrote:
> Add EC host command to inform EC of AP suspend/resume status.
> 
> Signed-off-by: Yilun Lin <yllin@chromium.org>

The patch looks good to me but as I don't have the hardware to test this, could
I get a Tested-by Pi-Hsun if possible before queuing in chrome-platform-5.4

Thanks,
Enric

> ---
> 
>  drivers/platform/chrome/cros_ec_rpmsg.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/platform/chrome/cros_ec_rpmsg.c b/drivers/platform/chrome/cros_ec_rpmsg.c
> index 5d3fb2abad1d..6f34fe629e2c 100644
> --- a/drivers/platform/chrome/cros_ec_rpmsg.c
> +++ b/drivers/platform/chrome/cros_ec_rpmsg.c
> @@ -236,6 +236,25 @@ static void cros_ec_rpmsg_remove(struct rpmsg_device *rpdev)
>  	cancel_work_sync(&ec_rpmsg->host_event_work);
>  }
>  
> +#ifdef CONFIG_PM_SLEEP
> +static int cros_ec_rpmsg_suspend(struct device *dev)
> +{
> +	struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
> +
> +	return cros_ec_suspend(ec_dev);
> +}
> +
> +static int cros_ec_rpmsg_resume(struct device *dev)
> +{
> +	struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
> +
> +	return cros_ec_resume(ec_dev);
> +}
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(cros_ec_rpmsg_pm_ops, cros_ec_rpmsg_suspend,
> +			 cros_ec_rpmsg_resume);
> +
>  static const struct of_device_id cros_ec_rpmsg_of_match[] = {
>  	{ .compatible = "google,cros-ec-rpmsg", },
>  	{ }
> @@ -246,6 +265,7 @@ static struct rpmsg_driver cros_ec_driver_rpmsg = {
>  	.drv = {
>  		.name   = "cros-ec-rpmsg",
>  		.of_match_table = cros_ec_rpmsg_of_match,
> +		.pm	= &cros_ec_rpmsg_pm_ops,
>  	},
>  	.probe		= cros_ec_rpmsg_probe,
>  	.remove		= cros_ec_rpmsg_remove,
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] platform/chrome: cros_ec_rpmsg: Add host command AP sleep state support
  2019-08-22 19:36 ` Enric Balletbo i Serra
@ 2019-08-27  4:01   ` Pi-Hsun Shih
  0 siblings, 0 replies; 4+ messages in thread
From: Pi-Hsun Shih @ 2019-08-27  4:01 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: Yilun Lin, LKML, Guenter Roeck, Benson Leung, Laurent Pinchart

Tested that with this patch, SCP does receive host command from AP
while AP goes to suspend and back.

Tested-by: Pi-Hsun Shih <pihsun@chromium.org>

On Fri, Aug 23, 2019 at 3:36 AM Enric Balletbo i Serra
<enric.balletbo@collabora.com> wrote:
>
> Hi,
>
> On 14/8/19 10:17, Yilun Lin wrote:
> > Add EC host command to inform EC of AP suspend/resume status.
> >
> > Signed-off-by: Yilun Lin <yllin@chromium.org>
>
> The patch looks good to me but as I don't have the hardware to test this, could
> I get a Tested-by Pi-Hsun if possible before queuing in chrome-platform-5.4
>
> Thanks,
> Enric
>
> > ---
> >
> >  drivers/platform/chrome/cros_ec_rpmsg.c | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/drivers/platform/chrome/cros_ec_rpmsg.c b/drivers/platform/chrome/cros_ec_rpmsg.c
> > index 5d3fb2abad1d..6f34fe629e2c 100644
> > --- a/drivers/platform/chrome/cros_ec_rpmsg.c
> > +++ b/drivers/platform/chrome/cros_ec_rpmsg.c
> > @@ -236,6 +236,25 @@ static void cros_ec_rpmsg_remove(struct rpmsg_device *rpdev)
> >       cancel_work_sync(&ec_rpmsg->host_event_work);
> >  }
> >
> > +#ifdef CONFIG_PM_SLEEP
> > +static int cros_ec_rpmsg_suspend(struct device *dev)
> > +{
> > +     struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
> > +
> > +     return cros_ec_suspend(ec_dev);
> > +}
> > +
> > +static int cros_ec_rpmsg_resume(struct device *dev)
> > +{
> > +     struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
> > +
> > +     return cros_ec_resume(ec_dev);
> > +}
> > +#endif
> > +
> > +static SIMPLE_DEV_PM_OPS(cros_ec_rpmsg_pm_ops, cros_ec_rpmsg_suspend,
> > +                      cros_ec_rpmsg_resume);
> > +
> >  static const struct of_device_id cros_ec_rpmsg_of_match[] = {
> >       { .compatible = "google,cros-ec-rpmsg", },
> >       { }
> > @@ -246,6 +265,7 @@ static struct rpmsg_driver cros_ec_driver_rpmsg = {
> >       .drv = {
> >               .name   = "cros-ec-rpmsg",
> >               .of_match_table = cros_ec_rpmsg_of_match,
> > +             .pm     = &cros_ec_rpmsg_pm_ops,
> >       },
> >       .probe          = cros_ec_rpmsg_probe,
> >       .remove         = cros_ec_rpmsg_remove,
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] platform/chrome: cros_ec_rpmsg: Add host command AP sleep state support
  2019-08-14  8:17 [PATCH] platform/chrome: cros_ec_rpmsg: Add host command AP sleep state support Yilun Lin
  2019-08-22 19:36 ` Enric Balletbo i Serra
@ 2019-08-28  7:54 ` Enric Balletbo i Serra
  1 sibling, 0 replies; 4+ messages in thread
From: Enric Balletbo i Serra @ 2019-08-28  7:54 UTC (permalink / raw)
  To: Yilun Lin, LKML; +Cc: pihsun, Guenter Roeck, Benson Leung

Hi,

On 14/8/19 10:17, Yilun Lin wrote:
> Add EC host command to inform EC of AP suspend/resume status.
> 
> Signed-off-by: Yilun Lin <yllin@chromium.org>

Applied for 5.4. Thanks,

 Enric

> ---
> 
>  drivers/platform/chrome/cros_ec_rpmsg.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/platform/chrome/cros_ec_rpmsg.c b/drivers/platform/chrome/cros_ec_rpmsg.c
> index 5d3fb2abad1d..6f34fe629e2c 100644
> --- a/drivers/platform/chrome/cros_ec_rpmsg.c
> +++ b/drivers/platform/chrome/cros_ec_rpmsg.c
> @@ -236,6 +236,25 @@ static void cros_ec_rpmsg_remove(struct rpmsg_device *rpdev)
>  	cancel_work_sync(&ec_rpmsg->host_event_work);
>  }
>  
> +#ifdef CONFIG_PM_SLEEP
> +static int cros_ec_rpmsg_suspend(struct device *dev)
> +{
> +	struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
> +
> +	return cros_ec_suspend(ec_dev);
> +}
> +
> +static int cros_ec_rpmsg_resume(struct device *dev)
> +{
> +	struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
> +
> +	return cros_ec_resume(ec_dev);
> +}
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(cros_ec_rpmsg_pm_ops, cros_ec_rpmsg_suspend,
> +			 cros_ec_rpmsg_resume);
> +
>  static const struct of_device_id cros_ec_rpmsg_of_match[] = {
>  	{ .compatible = "google,cros-ec-rpmsg", },
>  	{ }
> @@ -246,6 +265,7 @@ static struct rpmsg_driver cros_ec_driver_rpmsg = {
>  	.drv = {
>  		.name   = "cros-ec-rpmsg",
>  		.of_match_table = cros_ec_rpmsg_of_match,
> +		.pm	= &cros_ec_rpmsg_pm_ops,
>  	},
>  	.probe		= cros_ec_rpmsg_probe,
>  	.remove		= cros_ec_rpmsg_remove,
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-28  7:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14  8:17 [PATCH] platform/chrome: cros_ec_rpmsg: Add host command AP sleep state support Yilun Lin
2019-08-22 19:36 ` Enric Balletbo i Serra
2019-08-27  4:01   ` Pi-Hsun Shih
2019-08-28  7:54 ` Enric Balletbo i Serra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.