25 Jul
2012
25 Jul
'12
8:19 a.m.
On 24.07.2012 23:01, Timur Tabi wrote:
Also, I have a gut feeling that if someone else needs to do the same thing, then this code:
devm_gpio_request_one(&i2c_client->dev, reset_gpio, reset_gpio_flags & OF_GPIO_ACTIVE_LOW ? GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH, "cs4270 reset")
won't work for him, because it's not generic enough.
Why is that? The GPIO in the spec can be located anywhere on the board, either directly driven by the SoC or by any arbitrary other part on on the board that exposes itself as GPIO chip. And with the ACTIVE_LOW flag, it's even possible to compensate external circuitry that changes the polarity.
Which case can you imagine where that flexibility wouldn't suffice?
Daniel