Re: [PATCH 1/2] i2c: stu300: use clk_prepare/unprepare

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

 



On Wed, Jun 13, 2012 at 8:22 AM, Shubhrajyoti Datta
<omaplinuxkernel@xxxxxxxxx> wrote:
> <linus.walleij@xxxxxxxxxxxxxx> wrote:
>>
>> Make sure we prepare/unprepare the clock for the ST U300
>> I2C driver as is required by the clk API especially if you
>> use common clock.
>
> Not a comment rather a doubt.
>
> The transfer is still using enable and disable?
> Can you help me understand the difference.

Do you mean you want me to explain the difference
between enable/disable and prepare/unprepare?

>>  drivers/i2c/busses/i2c-stu300.c |    4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
>> index 4d44af1..79b7851 100644
>> --- a/drivers/i2c/busses/i2c-stu300.c
>> +++ b/drivers/i2c/busses/i2c-stu300.c
>> @@ -924,7 +924,7 @@ stu300_probe(struct platform_device *pdev)
>>
>>        dev->speed = scl_frequency;
>>
>> -       clk_enable(dev->clk);
>> +       clk_prepare_enable(dev->clk);
>>        ret = stu300_init_hw(dev);
>>        clk_disable(dev->clk);
>>
>> @@ -960,6 +960,7 @@ stu300_probe(struct platform_device *pdev)
>>
>>  err_add_adapter:
>>  err_init_hw:
>> +       clk_unprepare(dev->clk);
>
> So this also fixes an earlier lack of disable also?

No, there was no lack of disable earlier. If you look just a few lines
up in the patch there is a disable immediately after the
stu300_init_hw() call.

Yours,
Linus Walleij
--
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