Commit f99bf16d authored by Tony Lindgren's avatar Tony Lindgren

omap: mux: Convert 2420 platform init code to use new mux code

Convert 2420 platform init code to use new mux code
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 58310acd
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include <mach/gpio.h> #include <mach/gpio.h>
#include <plat/led.h> #include <plat/led.h>
#include <plat/mux.h>
#include <plat/usb.h> #include <plat/usb.h>
#include <plat/board.h> #include <plat/board.h>
#include <plat/common.h> #include <plat/common.h>
...@@ -246,7 +245,7 @@ static inline void __init apollon_init_smc91x(void) ...@@ -246,7 +245,7 @@ static inline void __init apollon_init_smc91x(void)
apollon_smc91x_resources[0].end = base + 0x30f; apollon_smc91x_resources[0].end = base + 0x30f;
udelay(100); udelay(100);
omap_cfg_reg(W4__24XX_GPIO74); omap_mux_init_gpio(74, 0);
if (gpio_request(APOLLON_ETHR_GPIO_IRQ, "SMC91x irq") < 0) { if (gpio_request(APOLLON_ETHR_GPIO_IRQ, "SMC91x irq") < 0) {
printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
APOLLON_ETHR_GPIO_IRQ); APOLLON_ETHR_GPIO_IRQ);
...@@ -288,15 +287,15 @@ static void __init omap_apollon_init_irq(void) ...@@ -288,15 +287,15 @@ static void __init omap_apollon_init_irq(void)
static void __init apollon_led_init(void) static void __init apollon_led_init(void)
{ {
/* LED0 - AA10 */ /* LED0 - AA10 */
omap_cfg_reg(AA10_242X_GPIO13); omap_mux_init_signal("vlynq_clk.gpio_13", 0);
gpio_request(LED0_GPIO13, "LED0"); gpio_request(LED0_GPIO13, "LED0");
gpio_direction_output(LED0_GPIO13, 0); gpio_direction_output(LED0_GPIO13, 0);
/* LED1 - AA6 */ /* LED1 - AA6 */
omap_cfg_reg(AA6_242X_GPIO14); omap_mux_init_signal("vlynq_rx1.gpio_14", 0);
gpio_request(LED1_GPIO14, "LED1"); gpio_request(LED1_GPIO14, "LED1");
gpio_direction_output(LED1_GPIO14, 0); gpio_direction_output(LED1_GPIO14, 0);
/* LED2 - AA4 */ /* LED2 - AA4 */
omap_cfg_reg(AA4_242X_GPIO15); omap_mux_init_signal("vlynq_rx0.gpio_15", 0);
gpio_request(LED2_GPIO15, "LED2"); gpio_request(LED2_GPIO15, "LED2");
gpio_direction_output(LED2_GPIO15, 0); gpio_direction_output(LED2_GPIO15, 0);
} }
...@@ -305,7 +304,7 @@ static void __init apollon_usb_init(void) ...@@ -305,7 +304,7 @@ static void __init apollon_usb_init(void)
{ {
/* USB device */ /* USB device */
/* DEVICE_SUSPEND */ /* DEVICE_SUSPEND */
omap_cfg_reg(P21_242X_GPIO12); omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
gpio_request(12, "USB suspend"); gpio_request(12, "USB suspend");
gpio_direction_output(12, 0); gpio_direction_output(12, 0);
omap2_usbfs_init(&apollon_usb_config); omap2_usbfs_init(&apollon_usb_config);
...@@ -330,7 +329,7 @@ static void __init omap_apollon_init(void) ...@@ -330,7 +329,7 @@ static void __init omap_apollon_init(void)
apollon_usb_init(); apollon_usb_init();
/* REVISIT: where's the correct place */ /* REVISIT: where's the correct place */
omap_cfg_reg(W19_24XX_SYS_NIRQ); omap_mux_init_signal("sys_nirq", OMAP_PULL_ENA | OMAP_PULL_UP);
/* LCD PWR_EN */ /* LCD PWR_EN */
omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP); omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP);
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <plat/control.h> #include <plat/control.h>
#include <mach/gpio.h> #include <mach/gpio.h>
#include <plat/mux.h>
#include <plat/usb.h> #include <plat/usb.h>
#include <plat/board.h> #include <plat/board.h>
#include <plat/common.h> #include <plat/common.h>
...@@ -248,7 +247,7 @@ static inline void __init h4_init_debug(void) ...@@ -248,7 +247,7 @@ static inline void __init h4_init_debug(void)
udelay(100); udelay(100);
omap_cfg_reg(M15_24XX_GPIO92); omap_mux_init_gpio(92, 0);
if (debug_card_init(cs_mem_base, H4_ETHR_GPIO_IRQ) < 0) if (debug_card_init(cs_mem_base, H4_ETHR_GPIO_IRQ) < 0)
gpmc_cs_free(eth_cs); gpmc_cs_free(eth_cs);
...@@ -358,8 +357,8 @@ static void __init omap_h4_init(void) ...@@ -358,8 +357,8 @@ static void __init omap_h4_init(void)
* if not needed. * if not needed.
*/ */
#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
omap_cfg_reg(K15_24XX_UART3_TX); omap_mux_init_signal("uart3_tx_irtx.uart3_tx_irtx", 0);
omap_cfg_reg(K14_24XX_UART3_RX); omap_mux_init_signal("uart3_rx_irrx.uart3_rx_irrx", 0);
#endif #endif
#if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE) #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE)
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <plat/control.h> #include <plat/control.h>
#include <plat/tc.h> #include <plat/tc.h>
#include <plat/board.h> #include <plat/board.h>
#include <plat/mux.h>
#include <mach/gpio.h> #include <mach/gpio.h>
#include <plat/mmc.h> #include <plat/mmc.h>
#include <plat/dma.h> #include <plat/dma.h>
...@@ -672,19 +671,19 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, ...@@ -672,19 +671,19 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
OMAP_PIN_INPUT_PULLUP); OMAP_PIN_INPUT_PULLUP);
if (cpu_is_omap2420() && controller_nr == 0) { if (cpu_is_omap2420() && controller_nr == 0) {
omap_cfg_reg(H18_24XX_MMC_CMD); omap_mux_init_signal("sdmmc_cmd", 0);
omap_cfg_reg(H15_24XX_MMC_CLKI); omap_mux_init_signal("sdmmc_clki", 0);
omap_cfg_reg(G19_24XX_MMC_CLKO); omap_mux_init_signal("sdmmc_clko", 0);
omap_cfg_reg(F20_24XX_MMC_DAT0); omap_mux_init_signal("sdmmc_dat0", 0);
omap_cfg_reg(F19_24XX_MMC_DAT_DIR0); omap_mux_init_signal("sdmmc_dat_dir0", 0);
omap_cfg_reg(G18_24XX_MMC_CMD_DIR); omap_mux_init_signal("sdmmc_cmd_dir", 0);
if (mmc_controller->slots[0].wires == 4) { if (mmc_controller->slots[0].wires == 4) {
omap_cfg_reg(H14_24XX_MMC_DAT1); omap_mux_init_signal("sdmmc_dat1", 0);
omap_cfg_reg(E19_24XX_MMC_DAT2); omap_mux_init_signal("sdmmc_dat2", 0);
omap_cfg_reg(D19_24XX_MMC_DAT3); omap_mux_init_signal("sdmmc_dat3", 0);
omap_cfg_reg(E20_24XX_MMC_DAT_DIR1); omap_mux_init_signal("sdmmc_dat_dir1", 0);
omap_cfg_reg(F18_24XX_MMC_DAT_DIR2); omap_mux_init_signal("sdmmc_dat_dir2", 0);
omap_cfg_reg(E18_24XX_MMC_DAT_DIR3); omap_mux_init_signal("sdmmc_dat_dir3", 0);
} }
/* /*
......
...@@ -21,32 +21,19 @@ ...@@ -21,32 +21,19 @@
#include <plat/cpu.h> #include <plat/cpu.h>
#include <plat/i2c.h> #include <plat/i2c.h>
#include <plat/mux.h>
#include "mux.h" #include "mux.h"
void __init omap2_i2c_mux_pins(int bus_id) void __init omap2_i2c_mux_pins(int bus_id)
{ {
if (cpu_is_omap24xx()) { char mux_name[sizeof("i2c2_scl.i2c2_scl")];
const int omap24xx_pins[][2] = {
{ M19_24XX_I2C1_SCL, L15_24XX_I2C1_SDA },
{ J15_24XX_I2C2_SCL, H19_24XX_I2C2_SDA },
};
int scl, sda;
scl = omap24xx_pins[bus_id - 1][0];
sda = omap24xx_pins[bus_id - 1][1];
omap_cfg_reg(sda);
omap_cfg_reg(scl);
}
/* First I2C bus is not muxable */ /* First I2C bus is not muxable */
if (cpu_is_omap34xx() && bus_id > 1) { if (bus_id == 1)
char mux_name[sizeof("i2c2_scl.i2c2_scl")]; return;
sprintf(mux_name, "i2c%i_scl.i2c%i_scl", bus_id, bus_id); sprintf(mux_name, "i2c%i_scl.i2c%i_scl", bus_id, bus_id);
omap_mux_init_signal(mux_name, OMAP_PIN_INPUT); omap_mux_init_signal(mux_name, OMAP_PIN_INPUT);
sprintf(mux_name, "i2c%i_sda.i2c%i_sda", bus_id, bus_id); sprintf(mux_name, "i2c%i_sda.i2c%i_sda", bus_id, bus_id);
omap_mux_init_signal(mux_name, OMAP_PIN_INPUT); omap_mux_init_signal(mux_name, OMAP_PIN_INPUT);
}
} }
...@@ -20,17 +20,18 @@ ...@@ -20,17 +20,18 @@
#include <mach/irqs.h> #include <mach/irqs.h>
#include <plat/dma.h> #include <plat/dma.h>
#include <plat/mux.h>
#include <plat/cpu.h> #include <plat/cpu.h>
#include <plat/mcbsp.h> #include <plat/mcbsp.h>
#include "mux.h"
static void omap2_mcbsp2_mux_setup(void) static void omap2_mcbsp2_mux_setup(void)
{ {
omap_cfg_reg(Y15_24XX_MCBSP2_CLKX); omap_mux_init_signal("eac_ac_sclk.mcbsp2_clkx", OMAP_PULL_ENA);
omap_cfg_reg(R14_24XX_MCBSP2_FSX); omap_mux_init_signal("eac_ac_fs.mcbsp2_fsx", OMAP_PULL_ENA);
omap_cfg_reg(W15_24XX_MCBSP2_DR); omap_mux_init_signal("eac_ac_din.mcbsp2_dr", OMAP_PULL_ENA);
omap_cfg_reg(V15_24XX_MCBSP2_DX); omap_mux_init_signal("eac_ac_dout.mcbsp2_dx", OMAP_PULL_ENA);
omap_cfg_reg(V14_24XX_GPIO117); omap_mux_init_gpio(117, OMAP_PULL_ENA);
/* /*
* TODO: Need to add MUX settings for OMAP 2430 SDP * TODO: Need to add MUX settings for OMAP 2430 SDP
*/ */
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include <linux/usb/musb.h> #include <linux/usb/musb.h>
#include <plat/gpmc.h> #include <plat/gpmc.h>
#include <plat/mux.h>
#include "mux.h"
static u8 async_cs, sync_cs; static u8 async_cs, sync_cs;
static unsigned refclk_psec; static unsigned refclk_psec;
...@@ -325,17 +325,17 @@ tusb6010_setup_interface(struct musb_hdrc_platform_data *data, ...@@ -325,17 +325,17 @@ tusb6010_setup_interface(struct musb_hdrc_platform_data *data,
else { else {
/* assume OMAP 2420 ES2.0 and later */ /* assume OMAP 2420 ES2.0 and later */
if (dmachan & (1 << 0)) if (dmachan & (1 << 0))
omap_cfg_reg(AA10_242X_DMAREQ0); omap_mux_init_signal("sys_ndmareq0", 0);
if (dmachan & (1 << 1)) if (dmachan & (1 << 1))
omap_cfg_reg(AA6_242X_DMAREQ1); omap_mux_init_signal("sys_ndmareq1", 0);
if (dmachan & (1 << 2)) if (dmachan & (1 << 2))
omap_cfg_reg(E4_242X_DMAREQ2); omap_mux_init_signal("sys_ndmareq2", 0);
if (dmachan & (1 << 3)) if (dmachan & (1 << 3))
omap_cfg_reg(G4_242X_DMAREQ3); omap_mux_init_signal("sys_ndmareq3", 0);
if (dmachan & (1 << 4)) if (dmachan & (1 << 4))
omap_cfg_reg(D3_242X_DMAREQ4); omap_mux_init_signal("sys_ndmareq4", 0);
if (dmachan & (1 << 5)) if (dmachan & (1 << 5))
omap_cfg_reg(E3_242X_DMAREQ5); omap_mux_init_signal("sys_ndmareq5", 0);
} }
/* so far so good ... register the device */ /* so far so good ... register the device */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment