From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Wed, 27 Apr 2016 09:12:23 -0600 Subject: [U-Boot] [PATCH V4, 1/6] dm: gpio: add a default gpio xlate routine In-Reply-To: <1461540760-3949-1-git-send-email-eric@nelint.com> References: <571907FD.7060005@wwwdotorg.org> <1461540760-3949-1-git-send-email-eric@nelint.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 24 April 2016 at 17:32, Eric Nelson 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 > Reviewed-by: Stephen Warren > --- > 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