summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Gonzalez <alex.gonzalez@digi.com>2010-06-24 16:15:34 +0200
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-06-24 16:15:34 +0200
commit6bef037f0b3e41936980d707284f487df40ab085 (patch)
tree04f8e1a02c7c17dc23800fc8a27448951c9d252b
parenta7ffa03d4fd492441def38a3c770615b342c7e6a (diff)
ccwmx51: Configure user LEDs as GPIOs by default
The LED GPIO pins are muxed with the SPI2 interface which is not configured by default. However the pins were not readable as they were not correctly configured as GPIOs. This commit fixes that. Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
-rw-r--r--arch/arm/mach-mx5/iomux.c15
-rw-r--r--arch/arm/mach-mx5/iomux.h11
-rw-r--r--arch/arm/mach-mx5/mx51_ccwmx51js_gpio.c8
3 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/iomux.c b/arch/arm/mach-mx5/iomux.c
index 2d01d8b55570..319980ad176a 100644
--- a/arch/arm/mach-mx5/iomux.c
+++ b/arch/arm/mach-mx5/iomux.c
@@ -176,6 +176,21 @@ int mxc_request_iomux(iomux_pin_name_t pin, iomux_pin_cfg_t config)
EXPORT_SYMBOL(mxc_request_iomux);
/*!
+ * Configure an IO pin without requesting ownership. The pin needs to be
+ * requested afterwards using gpio_request or through the sysfs.
+ *
+ * @param pin a name defined by \b iomux_pin_name_t
+ * @param config a configuration as defined in \b #iomux_pin_cfg_t
+ *
+ * @return 0 if successful; Non-zero otherwise
+ */
+int mxc_config_iomux(iomux_pin_name_t pin, iomux_pin_cfg_t config)
+{
+ return( iomux_config_mux(pin, config) );
+}
+EXPORT_SYMBOL(mxc_config_iomux);
+
+/*!
* Release ownership for an IO pin
*
* @param pin a name defined by \b iomux_pin_name_t
diff --git a/arch/arm/mach-mx5/iomux.h b/arch/arm/mach-mx5/iomux.h
index 0732f2169e0a..4c45ac6be6c2 100644
--- a/arch/arm/mach-mx5/iomux.h
+++ b/arch/arm/mach-mx5/iomux.h
@@ -174,6 +174,17 @@ int mxc_request_iomux(iomux_pin_name_t pin, iomux_pin_cfg_t config);
void mxc_free_iomux(iomux_pin_name_t pin, iomux_pin_cfg_t config);
/*!
+ * Configure an IO pin without requesting ownership. The pin needs to be
+ * requested afterwards using gpio_request or through the sysfs.
+ *
+ * @param pin a name defined by \b iomux_pin_name_t
+ * @param config a configuration as defined in \b #iomux_pin_cfg_t
+ *
+ * @return 0 if successful; Non-zero otherwise
+ */
+int mxc_config_iomux(iomux_pin_name_t pin, iomux_pin_cfg_t config);
+
+/*!
* This function configures the pad value for a IOMUX pin.
*
* @param pin a pin number as defined in \b #iomux_pin_name_t
diff --git a/arch/arm/mach-mx5/mx51_ccwmx51js_gpio.c b/arch/arm/mach-mx5/mx51_ccwmx51js_gpio.c
index 6e5d0d25e221..7d127a40fd92 100644
--- a/arch/arm/mach-mx5/mx51_ccwmx51js_gpio.c
+++ b/arch/arm/mach-mx5/mx51_ccwmx51js_gpio.c
@@ -672,6 +672,14 @@ void __init ccwmx51_io_init(void)
#endif
#endif
+#ifndef CONFIG_SPI_MXC_SELECT2
+ /* Configure as GPIO to be used to read LED status */
+ mxc_config_iomux(MX51_PIN_NANDF_RB2,IOMUX_CONFIG_ALT3 | IOMUX_CONFIG_SION);
+ mxc_iomux_set_pad(MX51_PIN_NANDF_RB2,PAD_CTL_HYS_ENABLE | PAD_CTL_100K_PU);
+ mxc_config_iomux(MX51_PIN_NANDF_RB1,IOMUX_CONFIG_ALT3 | IOMUX_CONFIG_SION);
+ mxc_iomux_set_pad(MX51_PIN_NANDF_RB1,PAD_CTL_HYS_ENABLE | PAD_CTL_100K_PU);
+#endif
+
#endif
for (i = 0; i < ARRAY_SIZE(ccwmx51_iomux_devices_pins); i++) {