lkml.org 
[lkml]   [2012]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] gpio: twl4030: Correct status reporting when the GPIO is used as output
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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-12-06 12:41    [W:0.056 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site