diff options
-rw-r--r-- | arch/arm/mach-mx5/iomux.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-mx5/iomux.h | 11 | ||||
-rw-r--r-- | arch/arm/mach-mx5/mx51_ccwmx51js_gpio.c | 8 |
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++) { |