Re: [PATCH] I2C: add CSR SiRFprimaII on-chip I2C controllers driver

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

 



2011/11/2 Russell King - ARM Linux <linux@xxxxxxxxxxxxxxxx>:
> On Wed, Nov 02, 2011 at 10:39:04AM +0000, Jamie Iles wrote:
>> > +   clk = clk_get(&pdev->dev, NULL);
>> > +   if (IS_ERR(clk)) {
>> > +           err = PTR_ERR(clk);
>> > +           dev_err(&pdev->dev, "Clock get failed\n");
>> > +           goto out;
>> > +   }
>> > +
>> > +   clk_enable(clk);
>>
>> The return value of clk_enable() should really be checked.
>
> Now that the clk_prepare() patch has been enabled, new drivers should be
> written assuming that clk_prepare() will be necessary before clk_enable().
>
> And one may query why it's not possible to use clk_enable()...clk_disable()
> around the transfer itself, so the clock can be turned off while the device
> is idle.  Obviously if its expecting to be operated in slave mode as well
> then you may need to keep the clock enabled.

yes. we can have a clk_enable at the beginning of i2c_sirfsoc_xfer and
clk_disable at the end.
i need some tests to check the hardware is robust enough.
actually, i can add runtime pm as well.

-barry
--
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