summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMinkyu Kang <mk7.kang@samsung.com>2010-04-28 18:56:39 +0900
committerMinkyu Kang <mk7.kang@samsung.com>2010-04-28 18:56:39 +0900
commitc3900ef1851063da9c468cc4f901cc527602e715 (patch)
tree37cecee990533564d9a13f60f33c929b23db495f /drivers
parent6bb7c92cda55cd4e373b56f77b6d144a1acc7543 (diff)
parent655ef2595244346744f5e790f7b103d0b9c9d110 (diff)
downloadu-boot-imx-c3900ef1851063da9c468cc4f901cc527602e715.zip
u-boot-imx-c3900ef1851063da9c468cc4f901cc527602e715.tar.gz
u-boot-imx-c3900ef1851063da9c468cc4f901cc527602e715.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/mx31_gpio.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpio/mx31_gpio.c b/drivers/gpio/mx31_gpio.c
index 737aafa..b07f038 100644
--- a/drivers/gpio/mx31_gpio.c
+++ b/drivers/gpio/mx31_gpio.c
@@ -71,3 +71,18 @@ void mx31_gpio_set(unsigned int gpio, unsigned int value)
l &= ~(1 << gpio);
__REG(gpio_ports[port] + GPIO_DR) = l;
}
+
+int mx31_gpio_get(unsigned int gpio)
+{
+ unsigned int port = gpio >> 5;
+ u32 l;
+
+ if (port >= ARRAY_SIZE(gpio_ports))
+ return -1;
+
+ gpio &= 0x1f;
+
+ l = (__REG(gpio_ports[port] + GPIO_DR) >> gpio) & 0x01;
+
+ return l;
+}