summaryrefslogtreecommitdiffstats
path: root/arch/arm/imx-common
diff options
context:
space:
mode:
authorBhuvanchandra DV <bhuvanchandra.dv@toradex.com>2015-06-01 18:37:16 +0530
committerStefano Babic <sbabic@denx.de>2015-06-08 08:41:54 +0200
commitd348a943e77ed72dd809cecf03365552545382b2 (patch)
treebae29b560def8ca251f63b3ef9b914af830b0a4f /arch/arm/imx-common
parentae89bb0d363eba33074106309c81c02f84b91ef8 (diff)
downloadtalos-obmc-uboot-d348a943e77ed72dd809cecf03365552545382b2.tar.gz
talos-obmc-uboot-d348a943e77ed72dd809cecf03365552545382b2.zip
dm: gpio: vf610: Add GPIO driver support
Add GPIO driver support to Freescale VF610 Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Diffstat (limited to 'arch/arm/imx-common')
-rw-r--r--arch/arm/imx-common/iomux-v3.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c
index e88e6e2a98..7fb23dd027 100644
--- a/arch/arm/imx-common/iomux-v3.c
+++ b/arch/arm/imx-common/iomux-v3.c
@@ -92,3 +92,29 @@ void imx_iomux_set_gpr_register(int group, int start_bit,
reg |= (value << start_bit);
writel(reg, base + group * 4);
}
+
+#ifdef CONFIG_IOMUX_SHARE_CONF_REG
+void imx_iomux_gpio_set_direction(unsigned int gpio,
+ unsigned int direction)
+{
+ u32 reg;
+ /*
+ * Only on Vybrid the input/output buffer enable flags
+ * are part of the shared mux/conf register.
+ */
+ reg = readl(base + (gpio << 2));
+
+ if (direction)
+ reg |= 0x2;
+ else
+ reg &= ~0x2;
+
+ writel(reg, base + (gpio << 2));
+}
+
+void imx_iomux_gpio_get_function(unsigned int gpio, u32 *gpio_state)
+{
+ *gpio_state = readl(base + (gpio << 2)) &
+ ((0X07 << PAD_MUX_MODE_SHIFT) | PAD_CTL_OBE_IBE_ENABLE);
+}
+#endif
OpenPOWER on IntegriCloud