[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <944a2523-aa40-eaf2-2c4a-d27254e7cbca@axentia.se>
Date: Mon, 10 Dec 2018 21:52:07 +0000
From: Peter Rosin <peda@...ntia.se>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>,
"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>
CC: "linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>,
Hans de Goede <hdegoede@...hat.com>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@...esas.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC/RFT 10/10] i2c: rcar: add suspend/resume support
On 2018-12-10 22:03, Wolfram Sang wrote:
> Because the adapter will be set up before every transaction anyhow, we
> just need to mark it as adapted to the I2C core.
mark it as "suspended", not "adapted"?
Cheers,
Peter
>
> Signed-off-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@...esas.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
> ---
> drivers/i2c/busses/i2c-rcar.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
> index 254e6219e538..30cff066e0da 100644
> --- a/drivers/i2c/busses/i2c-rcar.c
> +++ b/drivers/i2c/busses/i2c-rcar.c
> @@ -1017,10 +1017,35 @@ static int rcar_i2c_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_PM_SLEEP
> +static int rcar_i2c_suspend(struct device *dev)
> +{
> + struct rcar_i2c_priv *priv = dev_get_drvdata(dev);
> +
> + i2c_mark_adapter_suspended(&priv->adap, true);
> + return 0;
> +}
> +
> +static int rcar_i2c_resume(struct device *dev)
> +{
> + struct rcar_i2c_priv *priv = dev_get_drvdata(dev);
> +
> + i2c_mark_adapter_suspended(&priv->adap, false);
> + return 0;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(rcar_i2c_pm_ops, rcar_i2c_suspend, rcar_i2c_resume);
> +
> +#define DEV_PM_OPS (&rcar_i2c_pm_ops)
> +#else
> +#define DEV_PM_OPS NULL
> +#endif /* CONFIG_PM_SLEEP */
> +
> static struct platform_driver rcar_i2c_driver = {
> .driver = {
> .name = "i2c-rcar",
> .of_match_table = rcar_i2c_dt_ids,
> + .pm = DEV_PM_OPS,
> },
> .probe = rcar_i2c_probe,
> .remove = rcar_i2c_remove,
>
Powered by blists - more mailing lists