From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko =?iso-8859-15?q?St=FCbner?= Subject: Re: [PATCH 2/2] i2c-s3c2410: Add stub runtime power management Date: Tue, 13 Dec 2011 15:53:48 +0100 Message-ID: <201112131553.49270.heiko@sntech.de> References: <1323093966-9045-1-git-send-email-broonie@opensource.wolfsonmicro.com> <1323093966-9045-2-git-send-email-broonie@opensource.wolfsonmicro.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1323093966-9045-2-git-send-email-broonie@opensource.wolfsonmicro.com> Sender: linux-samsung-soc-owner@vger.kernel.org To: Mark Brown Cc: Jean Delvare , Ben Dooks , Kukjin Kim , linux-samsung-soc@vger.kernel.org, linux-i2c@vger.kernel.org, patches@opensource.wolfsonmicro.com List-Id: linux-i2c@vger.kernel.org Am Montag, 5. Dezember 2011, 15:06:06 schrieb Mark Brown: > Add stub runtime_pm calls which go through the flow of enabling and > disabling but don't actually do anything with the device itself as > there's nothing useful we can do. This provides the core PM framework > with information about when the device is idle, enabling chip wide > power savings. > > Signed-off-by: Mark Brown Acked-by: Heiko Stuebner Kgene, Jean, Ben: could we move this forward please? Thanks Heiko > --- > drivers/i2c/busses/i2c-s3c2410.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-s3c2410.c > b/drivers/i2c/busses/i2c-s3c2410.c index ed62a7f..065c316 100644 > --- a/drivers/i2c/busses/i2c-s3c2410.c > +++ b/drivers/i2c/busses/i2c-s3c2410.c > @@ -31,6 +31,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -563,6 +564,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, > int retry; > int ret; > > + pm_runtime_get_sync(&adap->dev); > clk_enable(i2c->clk); > > for (retry = 0; retry < adap->retries; retry++) { > @@ -571,6 +573,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, > > if (ret != -EAGAIN) { > clk_disable(i2c->clk); > + pm_runtime_put_sync(&adap->dev); > return ret; > } > > @@ -580,6 +583,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, > } > > clk_disable(i2c->clk); > + pm_runtime_put_sync(&adap->dev); > return -EREMOTEIO; > } > > @@ -1012,6 +1016,9 @@ static int s3c24xx_i2c_probe(struct platform_device > *pdev) of_i2c_register_devices(&i2c->adap); > platform_set_drvdata(pdev, i2c); > > + pm_runtime_enable(&pdev->dev); > + pm_runtime_enable(&i2c->adap.dev); > + > dev_info(&pdev->dev, "%s: S3C I2C adapter\n", dev_name(&i2c->adap.dev)); > clk_disable(i2c->clk); > return 0; > @@ -1046,6 +1053,9 @@ static int s3c24xx_i2c_remove(struct platform_device > *pdev) { > struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); > > + pm_runtime_disable(&i2c->adap.dev); > + pm_runtime_disable(&pdev->dev); > + > s3c24xx_i2c_deregister_cpufreq(i2c); > > i2c_del_adapter(&i2c->adap);