[lkml]   [2014]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/3] mfd: twl6040: Select i2c fast mode as default with regmap patch
On 02/27/2014 08:33 AM, Peter Ujfalusi wrote:
> On 02/27/2014 04:24 PM, Nishanth Menon wrote:
>> we should ideally have been using highspeed for i2c bus.
>> is'nt it better if i2c_check_functionality (and adding required flags
>> for func) be used to check the adapter speed and decide this in the
>> driver instead of hardcoding the bus speed within TWL6040 -
>> considering that 6040 can infact do max high speed as well?
> Yeah, I was thinking of something similar. Just did not found the API to get
> the speed the i2c bus has been configured to.
> I'll check this.

The other option might be to blindly configure 6040 to max speed ->
but then you do have an issue with that single register write
operation to configure the speed?

TWL6040 is by default at 100KHz, bus_speed is configured (via dts or
otherwise) is 400KHz/3.4MHz, the register write for configuring 6040
to max speed will occur at 400KHz/3.4MHz, which implies 6040 register
write operation might not actually take place (as 6040 still expects
to talk 100KHz till the mentioned register write takes place).

Ideally, the behavior you need is as follows:
talk at 100KHz for the first register write(of configuring speed),
followed by 400KHz/3.4 MHz for the subsequent operations on the bus
(assuming 400KHz/3.4 is the least common denominator speed on the bus).

I am not sure if the i2c framework has ability to do that.

Nishanth Menon

 \ /
  Last update: 2014-02-27 16:42    [W:0.103 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site