Re: [PATCH] i2c-s3c2410: Add stub runtime power management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 22, 2012 at 01:59:25PM +0100, Sylwester Nawrocki wrote:
> On 01/21/2012 07:46 PM, Mark Brown wrote:

> > +	pm_runtime_get_sync(&adap->dev);

> IMHO it's more appropriate to use i2c->dev here instead, i.e. to reference
> the platform device we've enabled runtime PM for.

Oh, bah humbug.  Now that I notice this I think that's the reason I
enabled runtime PM for the adaptor - it's easier to get hold of.

> How about the following patch (untested) ? It might be a better start for 
> proper power management implementation and would still allow the driver 
> to work on platforms that don't support runtime PM. 

It's not really a platform issue - the platform bus by default does the
right thing and the runtime PM core is pure software, the only platform
dependency is if users have bothered truning runtime PM on.

> +static inline int s3c24xx_pm_runtime_put(struct s3c24xx_i2c *i2c)
> +{
> +	if (!pm_runtime_enabled(i2c->dev)) {
> +		clk_disable(i2c->clk);
> +		return 0;
> +	}
> +
> +	return pm_runtime_put(i2c->dev);
> +}

To be honest I don't think this is worth it.  Either we just keep the
clock management outside of runtime PM or we push it in but trying to
support both simultaneously adds complication and doesn't actually do
all that much in practical terms.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux