On 28 September 2012 12:57, Uwe Kleine-König
<[email protected]> wrote:
> Why do you default to GPIOF_OUT_INIT_LOW? The idle state of scl is high.
> Using low here introduces an additional clk pulse.
Went deep into the code i wrote ages ago to check why i did so :)
My initial idea was, because the idle state of scl is high, giving another high
initially with gpio would be a waste. As the slave will not notice a change.
So, i will do it low and then following code will run with delay before setting
gpio again. This will ensure, the initial gpio-set is used as clock.
for (i = 0; i < bri->clock_cnt * 2; i++, val = !val) {
ndelay(delay);
gpio_set_value(bri->scl_gpio, val);
...
}
Yes, you are correct in saying that i have generated 9 *2 + 1 = 19
half-clocks...
or 9.5 clocks. Will fix it by making initial value of i as 1.
Also, will take care of this when user sends his own flags :)
--
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html