[U-Boot] [PATCH V4, 1/6] dm: gpio: add a default gpio xlate routine

Simon Glass
2016-05-07T19:03:33Z

On 27 April 2016 at 09:12, Simon Glass <sjg@chromium.org> wrote:
> On 24 April 2016 at 17:32, Eric Nelson <eric@nelint.com> wrote:
>> Many drivers use a common form of offset + flags for device
>> tree nodes. e.g.:
>> <&gpio1 2 GPIO_ACTIVE_LOW>
>>
>> This patch adds a common implementation of this type of parsing
>> and calls it when a gpio driver doesn't supply its' own xlate
>> routine.
>>
>> This will allow removal of the driver-specific versions in a
>> handful of drivers and simplify the addition of new drivers.
>>
>> Signed-off-by: Eric Nelson <eric@nelint.com>
>> Reviewed-by: Stephen Warren <swarren@nvidia.com>
>> ---
>> V2 removes parsing of offset from the gpio_find_and_xlate routine,
>> and only parses the offset and GPIO_ACTIVE_LOW flag when a
>> driver-specific xlate is unavailable.
>>
>> V3 re-works tests of the argument count as suggested by Stephen Warren
>> and will allow parsing of nodes with no flags field:
>> <&gpio1 2>
>>
>> V4 fixes an indent with spaces instead of tabs
>>
>> drivers/gpio/gpio-uclass.c | 30 +++++++++++++++++++++++-------
>> include/asm-generic/gpio.h | 19 ++++++++++++++-----
>> 2 files changed, 37 insertions(+), 12 deletions(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm, thanks!