u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] dm: gpio: da8xx_gpio: Add support for GPIO_ACTIVE_LOW/HIGH
@ 2018-08-17  4:21 Adam Ford
  2018-09-18 21:24 ` [U-Boot] " Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Ford @ 2018-08-17  4:21 UTC (permalink / raw)
  To: u-boot

With DM and device tree support, let's use the GPIO_ACTIVE_HIGH
and GPIO_ACTIVE_LOW from the device tree as they are intended.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/gpio/da8xx_gpio.c b/drivers/gpio/da8xx_gpio.c
index 3e95f039f0..f80bc6baf6 100644
--- a/drivers/gpio/da8xx_gpio.c
+++ b/drivers/gpio/da8xx_gpio.c
@@ -493,12 +493,25 @@ static int davinci_gpio_get_function(struct udevice *dev, unsigned int offset)
 	return GPIOF_OUTPUT;
 }
 
+static int davinci_gpio_xlate(struct udevice *dev, struct gpio_desc *desc,
+			      struct ofnode_phandle_args *args)
+{
+	desc->offset = args->args[0];
+
+	if (args->args[1] & GPIO_ACTIVE_LOW)
+		desc->flags = GPIOD_ACTIVE_LOW;
+	else
+		desc->flags = 0;
+	return 0;
+}
+
 static const struct dm_gpio_ops gpio_davinci_ops = {
 	.direction_input	= davinci_gpio_direction_input,
 	.direction_output	= davinci_gpio_direction_output,
 	.get_value		= davinci_gpio_get_value,
 	.set_value		= davinci_gpio_set_value,
 	.get_function		= davinci_gpio_get_function,
+	.xlate			= davinci_gpio_xlate,
 };
 
 static int davinci_gpio_probe(struct udevice *dev)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] dm: gpio: da8xx_gpio: Add support for GPIO_ACTIVE_LOW/HIGH
  2018-08-17  4:21 [U-Boot] [PATCH] dm: gpio: da8xx_gpio: Add support for GPIO_ACTIVE_LOW/HIGH Adam Ford
@ 2018-09-18 21:24 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2018-09-18 21:24 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 16, 2018 at 11:21:57PM -0500, Adam Ford wrote:

> With DM and device tree support, let's use the GPIO_ACTIVE_HIGH
> and GPIO_ACTIVE_LOW from the device tree as they are intended.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
> 
> diff --git a/drivers/gpio/da8xx_gpio.c b/drivers/gpio/da8xx_gpio.c
> index 3e95f039f0..f80bc6baf6 100644

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180918/13c97d44/attachment.sig>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-18 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-17  4:21 [U-Boot] [PATCH] dm: gpio: da8xx_gpio: Add support for GPIO_ACTIVE_LOW/HIGH Adam Ford
2018-09-18 21:24 ` [U-Boot] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).