mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Teresa Gamez <T.Gamez@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH] mx2 GPIO OCRx register
Date: Tue, 08 Jun 2010 12:03:02 +0200	[thread overview]
Message-ID: <1275991382.18173.37.camel@lws-gamez> (raw)

The GPIO OCRx register has to be set correct or the output is not set as expected.

Signed-off-by: Teresa Gámez <T.Gamez@phytec.de> 
---
Index: barebox-2010.06.0/arch/arm/mach-imx/gpio.c
===================================================================
--- barebox-2010.06.0/arch/arm/mach-imx/gpio.c	2010-06-02 10:36:28.000000000 +0200
+++ barebox-2010.06.0/arch/arm/mach-imx/gpio.c	2010-06-08 11:02:31.282473877 +0200
@@ -31,6 +31,8 @@
 #if defined CONFIG_ARCH_IMX1 || defined CONFIG_ARCH_IMX21 || defined CONFIG_ARCH_IMX27
 #define GPIO_DR		0x1c
 #define GPIO_GDIR	0x00
+#define GPIO_OCR1	0x04
+#define GPIO_OCR2	0x08
 #define GPIO_PSR	0x24
 #define GPIO_ICR1	0x28
 #define GPIO_ICR2	0x2C
@@ -103,6 +105,18 @@
 	if (!base)
 		return -EINVAL;
 
+#if defined GPIO_OCR1 && defined GPIO_OCR2
+	if (shift < 16) {
+		val = readl(base + GPIO_OCR1);
+		val |= (3 << (shift * 2));
+		writel(val, base + GPIO_OCR1);
+	} else {
+		val = readl(base + GPIO_OCR2);
+		val |= (3 << ((shift - 16) * 2));
+		writel(val, base + GPIO_OCR2);
+	}
+#endif
+
 	gpio_set_value(gpio, value);
 
 	val = readl(base + GPIO_GDIR);


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2010-06-08 10:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08 10:03 Teresa Gamez [this message]
2010-06-10 11:54 ` Sascha Hauer
2010-06-18 11:41   ` Teresa Gamez
2010-06-18 12:48     ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1275991382.18173.37.camel@lws-gamez \
    --to=t.gamez@phytec.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox