Re: [RFC] i2c: rcar: reinit hardware on resume

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

 



Hi Wolfram

> On resume, reinit hardware to ensure state machine and clock settings
> are proper. This code assumes:
> 
> * bus clock is a fixed value, so no need to recalculate timings after probe
> * handling RuntimePM is not needed, because register content is kept
>   when disabling the IP core clock
> 
> Tested with r8a7796 (M3-W) and r8a7790 (H2).
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> ---
(snip)
> +static int rcar_i2c_resume(struct device *dev)
> +{
> +	struct rcar_i2c_priv *priv = dev_get_drvdata(dev);
> +
> +	rcar_i2c_init(priv);
> +
> +	return 0;
> +}

Current i2c-rcar driver probe is doing

static int rcar_i2c_probe(xxx)
{
	...
	pm_runtime_get_sync(dev);
	...
	rcar_i2c_init(priv);
	...
	pm_runtime_put(dev);
	...
}

Thus, just calling rcar_i2c_init() is not enough ?

Current driver is calling pm_runtime_get/put probe timing,
transfer timing, and more for register settings purpose.
But in my opinion, all register settings should be merged in one please
(= transfer function) and call pm_runtime_get/put there only.
R-Car I2C is not related, but I2C power domain might be
power OFF if SoC has power domain control feature (SH-Mobile has it).
In such case, register value which was set on probe timing doesn't
exist when transfer timing.
This can be increasing patch or something like that.

Best regards
---
Kuninori Morimoto



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux