On 12/05/2012 11:48 PM, Grant Likely wrote:
>> -    base = REG_GPIODATAIN1 + d_bnk;
>> +    direction = gpio_twl4030_read(REG_GPIODATADIR1 + d_bnk);
>> +    if (direction > 0 && (direction >> d_off) & 0x1)
>> +            base = REG_SETGPIODATAOUT1 + d_bnk;
>> +    else
>> +            base = REG_GPIODATAIN1 + d_bnk;
>> +
> 
> This is probably quite expensive considering that reads need to go out
> the i2c bus. Things like the output state and the pin direction should
> be cached by the driver in its private data structure so that you don't
> add an additional i2c round trip.

True. I have sent the v2, which grown a bit since I did not wanted to add more
global variable to this driver.

-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to