Re: [PATCH 2/2] i2c: cadence: Implement save restore

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

 



On Tue, Mar 1, 2016 at 1:04 PM, Michal Simek <michal.simek@xxxxxxxxxx> wrote:
> On 1.3.2016 07:32, Shubhrajyoti Datta wrote:
>> Implement save restore for i2c module.
>> Since we have only a couple of registers
>> an unconditional restore is done.
>>
>> Signed-off-by: Shubhrajyoti Datta <shubhraj@xxxxxxxxxx>
>> ---
>> zynq-mp has the capability of going off.
>> the current kernel does not hit off however some day it will.
>> since the overhead of having the support is not much may be it is better
>> to have it in the kernel.
>>
>>  drivers/i2c/busses/i2c-cadence.c |   32 ++++++++++++++++++--------------
>>  1 files changed, 18 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
>> index a761520..3d50914 100644
>> --- a/drivers/i2c/busses/i2c-cadence.c
>> +++ b/drivers/i2c/busses/i2c-cadence.c
>> @@ -161,6 +161,7 @@ struct cdns_i2c {
>>       struct clk *clk;
>>       struct notifier_block clk_rate_change_nb;
>>       u32 quirks;
>> +     u32 ctrl_reg;
>
> kernel-doc update too.

missed it fixed in v2
>
>>  };
>>
>>  struct cdns_platform_data {
>> @@ -743,12 +744,11 @@ static int cdns_i2c_setclk(unsigned long clk_in, struct cdns_i2c *id)
>>       if (ret)
>>               return ret;
>>
>> -     ctrl_reg = cdns_i2c_readreg(CDNS_I2C_CR_OFFSET);
>> +     ctrl_reg = id->ctrl_reg;
>>       ctrl_reg &= ~(CDNS_I2C_CR_DIVA_MASK | CDNS_I2C_CR_DIVB_MASK);
>>       ctrl_reg |= ((div_a << CDNS_I2C_CR_DIVA_SHIFT) |
>>                       (div_b << CDNS_I2C_CR_DIVB_SHIFT));
>> -     cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
>> -
>> +     id->ctrl_reg = ctrl_reg;
>>       return 0;
>>  }
>>
>> @@ -831,6 +831,18 @@ static int __maybe_unused cdns_i2c_runtime_suspend(struct device *dev)
>>
>>       return 0;
>>  }
>
> You probably want to put empty line here. And most of functions have
> kernel-doc and will be good to follow this up.
>
Agree sent v2 fixing the same.
Thanks for review
--
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