diff mbox

[4/4] gpio: mxc: read output value from GPIO_DR register

Message ID 1430321701-13758-5-git-send-email-vladimir_zapolskiy@mentor.com
State New
Headers show

Commit Message

Vladimir Zapolskiy April 29, 2015, 3:35 p.m. UTC
All supported iMX GPIO controllers store configured GPIO output value
in GPIO_DR data register, which is represented by GPIO generic reg_set.
Provide a BGPIOF_READ_OUTPUT_REG_SET flag to bgpio_init() to allow
correct getting of previously set output value.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
---
 drivers/gpio/gpio-mxc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Linus Walleij May 11, 2015, 9:54 a.m. UTC | #1
On Wed, Apr 29, 2015 at 5:35 PM, Vladimir Zapolskiy
<vladimir_zapolskiy@mentor.com> wrote:

> All supported iMX GPIO controllers store configured GPIO output value
> in GPIO_DR data register, which is represented by GPIO generic reg_set.
> Provide a BGPIOF_READ_OUTPUT_REG_SET flag to bgpio_init() to allow
> correct getting of previously set output value.
>
> Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>

Patch applied, unless Shawn has some issue with it.
Add Shawn to CC when patching this driver.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 9f7446a..38daa64 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -450,7 +450,8 @@  static int mxc_gpio_probe(struct platform_device *pdev)
 	err = bgpio_init(&port->bgc, &pdev->dev, 4,
 			 port->base + GPIO_PSR,
 			 port->base + GPIO_DR, NULL,
-			 port->base + GPIO_GDIR, NULL, 0);
+			 port->base + GPIO_GDIR, NULL,
+			 BGPIOF_READ_OUTPUT_REG_SET);
 	if (err)
 		goto out_bgio;