From cd4a05f9df859e7cd2efa96e035444a3decb427a Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 2 Apr 2009 22:32:10 +0200 Subject: MXC: rename mxc_map_io to architecture specific versions This allows us to have more mapping functions for more than one i.MX architecture in the kernel. As this is the earliest board specific hook we have, also use it to set the cpu type. Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/mx27ads.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-mx2/mx27ads.c') diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c index 4a3b097adc1..f4ad932ba24 100644 --- a/arch/arm/mach-mx2/mx27ads.c +++ b/arch/arm/mach-mx2/mx27ads.c @@ -277,7 +277,7 @@ static struct map_desc mx27ads_io_desc[] __initdata = { static void __init mx27ads_map_io(void) { - mxc_map_io(); + mx27_map_io(); iotable_init(mx27ads_io_desc, ARRAY_SIZE(mx27ads_io_desc)); } -- cgit v1.2.3 From fde364742a1afec9e71e705e863d029295282fe5 Mon Sep 17 00:00:00 2001 From: Holger Schurig Date: Mon, 30 Mar 2009 14:35:39 +0100 Subject: imx: exit functions can/should be void Signed-off-by: Holger Schurig Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/mx27ads.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'arch/arm/mach-mx2/mx27ads.c') diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c index f4ad932ba24..ab389c22f4d 100644 --- a/arch/arm/mach-mx2/mx27ads.c +++ b/arch/arm/mach-mx2/mx27ads.c @@ -71,11 +71,10 @@ static int uart_mxc_port0_init(struct platform_device *pdev) ARRAY_SIZE(mxc_uart0_pins), "UART0"); } -static int uart_mxc_port0_exit(struct platform_device *pdev) +static void uart_mxc_port0_exit(struct platform_device *pdev) { mxc_gpio_release_multiple_pins(mxc_uart0_pins, ARRAY_SIZE(mxc_uart0_pins)); - return 0; } static int mxc_uart1_pins[] = { @@ -91,11 +90,10 @@ static int uart_mxc_port1_init(struct platform_device *pdev) ARRAY_SIZE(mxc_uart1_pins), "UART1"); } -static int uart_mxc_port1_exit(struct platform_device *pdev) +static void uart_mxc_port1_exit(struct platform_device *pdev) { mxc_gpio_release_multiple_pins(mxc_uart1_pins, ARRAY_SIZE(mxc_uart1_pins)); - return 0; } static int mxc_uart2_pins[] = { @@ -111,11 +109,10 @@ static int uart_mxc_port2_init(struct platform_device *pdev) ARRAY_SIZE(mxc_uart2_pins), "UART2"); } -static int uart_mxc_port2_exit(struct platform_device *pdev) +static void uart_mxc_port2_exit(struct platform_device *pdev) { mxc_gpio_release_multiple_pins(mxc_uart2_pins, ARRAY_SIZE(mxc_uart2_pins)); - return 0; } static int mxc_uart3_pins[] = { @@ -131,11 +128,10 @@ static int uart_mxc_port3_init(struct platform_device *pdev) ARRAY_SIZE(mxc_uart3_pins), "UART3"); } -static int uart_mxc_port3_exit(struct platform_device *pdev) +static void uart_mxc_port3_exit(struct platform_device *pdev) { mxc_gpio_release_multiple_pins(mxc_uart3_pins, ARRAY_SIZE(mxc_uart3_pins)); - return 0; } static int mxc_uart4_pins[] = { @@ -151,11 +147,10 @@ static int uart_mxc_port4_init(struct platform_device *pdev) ARRAY_SIZE(mxc_uart4_pins), "UART4"); } -static int uart_mxc_port4_exit(struct platform_device *pdev) +static void uart_mxc_port4_exit(struct platform_device *pdev) { mxc_gpio_release_multiple_pins(mxc_uart4_pins, ARRAY_SIZE(mxc_uart4_pins)); - return 0; } static int mxc_uart5_pins[] = { @@ -171,11 +166,10 @@ static int uart_mxc_port5_init(struct platform_device *pdev) ARRAY_SIZE(mxc_uart5_pins), "UART5"); } -static int uart_mxc_port5_exit(struct platform_device *pdev) +static void uart_mxc_port5_exit(struct platform_device *pdev) { mxc_gpio_release_multiple_pins(mxc_uart5_pins, ARRAY_SIZE(mxc_uart5_pins)); - return 0; } static struct platform_device *platform_devices[] __initdata = { -- cgit v1.2.3 From c1a6f12383c79b28dd7c40a4e7293c80db265f59 Mon Sep 17 00:00:00 2001 From: Vladimir Barinov Date: Wed, 29 Apr 2009 04:00:48 +0400 Subject: MX27ADS: setup all pins at once in one table Setup all pins at once in one table Signed-off-by: Vladimir Barinov Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/mx27ads.c | 186 ++++++++++---------------------------------- 1 file changed, 43 insertions(+), 143 deletions(-) (limited to 'arch/arm/mach-mx2/mx27ads.c') diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c index ab389c22f4d..13accbed888 100644 --- a/arch/arm/mach-mx2/mx27ads.c +++ b/arch/arm/mach-mx2/mx27ads.c @@ -36,148 +36,38 @@ #include "devices.h" -/* ADS's NOR flash */ -static struct physmap_flash_data mx27ads_flash_data = { - .width = 2, -}; - -static struct resource mx27ads_flash_resource = { - .start = 0xc0000000, - .end = 0xc0000000 + 0x02000000 - 1, - .flags = IORESOURCE_MEM, - -}; - -static struct platform_device mx27ads_nor_mtd_device = { - .name = "physmap-flash", - .id = 0, - .dev = { - .platform_data = &mx27ads_flash_data, - }, - .num_resources = 1, - .resource = &mx27ads_flash_resource, -}; - -static int mxc_uart0_pins[] = { +static unsigned int mx27ads_pins[] = { + /* UART0 */ PE12_PF_UART1_TXD, PE13_PF_UART1_RXD, PE14_PF_UART1_CTS, - PE15_PF_UART1_RTS -}; - -static int uart_mxc_port0_init(struct platform_device *pdev) -{ - return mxc_gpio_setup_multiple_pins(mxc_uart0_pins, - ARRAY_SIZE(mxc_uart0_pins), "UART0"); -} - -static void uart_mxc_port0_exit(struct platform_device *pdev) -{ - mxc_gpio_release_multiple_pins(mxc_uart0_pins, - ARRAY_SIZE(mxc_uart0_pins)); -} - -static int mxc_uart1_pins[] = { + PE15_PF_UART1_RTS, + /* UART1 */ PE3_PF_UART2_CTS, PE4_PF_UART2_RTS, PE6_PF_UART2_TXD, - PE7_PF_UART2_RXD -}; - -static int uart_mxc_port1_init(struct platform_device *pdev) -{ - return mxc_gpio_setup_multiple_pins(mxc_uart1_pins, - ARRAY_SIZE(mxc_uart1_pins), "UART1"); -} - -static void uart_mxc_port1_exit(struct platform_device *pdev) -{ - mxc_gpio_release_multiple_pins(mxc_uart1_pins, - ARRAY_SIZE(mxc_uart1_pins)); -} - -static int mxc_uart2_pins[] = { + PE7_PF_UART2_RXD, + /* UART2 */ PE8_PF_UART3_TXD, PE9_PF_UART3_RXD, PE10_PF_UART3_CTS, - PE11_PF_UART3_RTS -}; - -static int uart_mxc_port2_init(struct platform_device *pdev) -{ - return mxc_gpio_setup_multiple_pins(mxc_uart2_pins, - ARRAY_SIZE(mxc_uart2_pins), "UART2"); -} - -static void uart_mxc_port2_exit(struct platform_device *pdev) -{ - mxc_gpio_release_multiple_pins(mxc_uart2_pins, - ARRAY_SIZE(mxc_uart2_pins)); -} - -static int mxc_uart3_pins[] = { + PE11_PF_UART3_RTS, + /* UART3 */ PB26_AF_UART4_RTS, PB28_AF_UART4_TXD, PB29_AF_UART4_CTS, - PB31_AF_UART4_RXD -}; - -static int uart_mxc_port3_init(struct platform_device *pdev) -{ - return mxc_gpio_setup_multiple_pins(mxc_uart3_pins, - ARRAY_SIZE(mxc_uart3_pins), "UART3"); -} - -static void uart_mxc_port3_exit(struct platform_device *pdev) -{ - mxc_gpio_release_multiple_pins(mxc_uart3_pins, - ARRAY_SIZE(mxc_uart3_pins)); -} - -static int mxc_uart4_pins[] = { + PB31_AF_UART4_RXD, + /* UART4 */ PB18_AF_UART5_TXD, PB19_AF_UART5_RXD, PB20_AF_UART5_CTS, - PB21_AF_UART5_RTS -}; - -static int uart_mxc_port4_init(struct platform_device *pdev) -{ - return mxc_gpio_setup_multiple_pins(mxc_uart4_pins, - ARRAY_SIZE(mxc_uart4_pins), "UART4"); -} - -static void uart_mxc_port4_exit(struct platform_device *pdev) -{ - mxc_gpio_release_multiple_pins(mxc_uart4_pins, - ARRAY_SIZE(mxc_uart4_pins)); -} - -static int mxc_uart5_pins[] = { + PB21_AF_UART5_RTS, + /* UART5 */ PB10_AF_UART6_TXD, PB12_AF_UART6_CTS, PB11_AF_UART6_RXD, - PB13_AF_UART6_RTS -}; - -static int uart_mxc_port5_init(struct platform_device *pdev) -{ - return mxc_gpio_setup_multiple_pins(mxc_uart5_pins, - ARRAY_SIZE(mxc_uart5_pins), "UART5"); -} - -static void uart_mxc_port5_exit(struct platform_device *pdev) -{ - mxc_gpio_release_multiple_pins(mxc_uart5_pins, - ARRAY_SIZE(mxc_uart5_pins)); -} - -static struct platform_device *platform_devices[] __initdata = { - &mx27ads_nor_mtd_device, - &mxc_fec_device, -}; - -static int mxc_fec_pins[] = { + PB13_AF_UART6_RTS, + /* FEC */ PD0_AIN_FEC_TXD0, PD1_AIN_FEC_TXD1, PD2_AIN_FEC_TXD2, @@ -195,46 +85,56 @@ static int mxc_fec_pins[] = { PD14_AOUT_FEC_RX_CLK, PD15_AOUT_FEC_COL, PD16_AIN_FEC_TX_ER, - PF23_AIN_FEC_TX_EN + PF23_AIN_FEC_TX_EN, }; -static void gpio_fec_active(void) -{ - mxc_gpio_setup_multiple_pins(mxc_fec_pins, - ARRAY_SIZE(mxc_fec_pins), "FEC"); -} +/* ADS's NOR flash */ +static struct physmap_flash_data mx27ads_flash_data = { + .width = 2, +}; + +static struct resource mx27ads_flash_resource = { + .start = 0xc0000000, + .end = 0xc0000000 + 0x02000000 - 1, + .flags = IORESOURCE_MEM, + +}; + +static struct platform_device mx27ads_nor_mtd_device = { + .name = "physmap-flash", + .id = 0, + .dev = { + .platform_data = &mx27ads_flash_data, + }, + .num_resources = 1, + .resource = &mx27ads_flash_resource, +}; + +static struct platform_device *platform_devices[] __initdata = { + &mx27ads_nor_mtd_device, + &mxc_fec_device, +}; static struct imxuart_platform_data uart_pdata[] = { { - .init = uart_mxc_port0_init, - .exit = uart_mxc_port0_exit, .flags = IMXUART_HAVE_RTSCTS, }, { - .init = uart_mxc_port1_init, - .exit = uart_mxc_port1_exit, .flags = IMXUART_HAVE_RTSCTS, }, { - .init = uart_mxc_port2_init, - .exit = uart_mxc_port2_exit, .flags = IMXUART_HAVE_RTSCTS, }, { - .init = uart_mxc_port3_init, - .exit = uart_mxc_port3_exit, .flags = IMXUART_HAVE_RTSCTS, }, { - .init = uart_mxc_port4_init, - .exit = uart_mxc_port4_exit, .flags = IMXUART_HAVE_RTSCTS, }, { - .init = uart_mxc_port5_init, - .exit = uart_mxc_port5_exit, .flags = IMXUART_HAVE_RTSCTS, }, }; static void __init mx27ads_board_init(void) { - gpio_fec_active(); + mxc_gpio_setup_multiple_pins(mx27ads_pins, ARRAY_SIZE(mx27ads_pins), + "mx27ads"); mxc_register_device(&mxc_uart_device0, &uart_pdata[0]); mxc_register_device(&mxc_uart_device1, &uart_pdata[1]); -- cgit v1.2.3 From 8d4fd258f9b0bee1ef5f1508bfed4d138a252891 Mon Sep 17 00:00:00 2001 From: Vladimir Barinov Date: Wed, 29 Apr 2009 04:00:49 +0400 Subject: MX27ADS: Add NAND support Add NAND support for MX27ADS board Signed-off-by: Vladimir Barinov Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/mx27ads.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch/arm/mach-mx2/mx27ads.c') diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c index 13accbed888..ee8f3d986ff 100644 --- a/arch/arm/mach-mx2/mx27ads.c +++ b/arch/arm/mach-mx2/mx27ads.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "devices.h" @@ -88,6 +89,11 @@ static unsigned int mx27ads_pins[] = { PF23_AIN_FEC_TX_EN, }; +static struct mxc_nand_platform_data mx27ads_nand_board_info = { + .width = 1, + .hw_ecc = 1, +}; + /* ADS's NOR flash */ static struct physmap_flash_data mx27ads_flash_data = { .width = 2, @@ -142,6 +148,7 @@ static void __init mx27ads_board_init(void) mxc_register_device(&mxc_uart_device3, &uart_pdata[3]); mxc_register_device(&mxc_uart_device4, &uart_pdata[4]); mxc_register_device(&mxc_uart_device5, &uart_pdata[5]); + mxc_register_device(&mxc_nand_device, &mx27ads_nand_board_info); platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); } -- cgit v1.2.3 From c981214ac4a304d784a290b3714cc73a39589af0 Mon Sep 17 00:00:00 2001 From: Vladimir Barinov Date: Wed, 29 Apr 2009 04:00:50 +0400 Subject: MX27ADS: Add I2C support Add I2C support for MX27ADS board Signed-off-by: Vladimir Barinov Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/mx27ads.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'arch/arm/mach-mx2/mx27ads.c') diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c index ee8f3d986ff..bf131457c0e 100644 --- a/arch/arm/mach-mx2/mx27ads.c +++ b/arch/arm/mach-mx2/mx27ads.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ #include #include #include +#include #include "devices.h" @@ -87,6 +89,9 @@ static unsigned int mx27ads_pins[] = { PD15_AOUT_FEC_COL, PD16_AIN_FEC_TX_ER, PF23_AIN_FEC_TX_EN, + /* I2C2 */ + PC5_PF_I2C2_SDA, + PC6_PF_I2C2_SCL, }; static struct mxc_nand_platform_data mx27ads_nand_board_info = { @@ -116,6 +121,13 @@ static struct platform_device mx27ads_nor_mtd_device = { .resource = &mx27ads_flash_resource, }; +static struct imxi2c_platform_data mx27ads_i2c_data = { + .bitrate = 100000, +}; + +static struct i2c_board_info mx27ads_i2c_devices[] = { +}; + static struct platform_device *platform_devices[] __initdata = { &mx27ads_nor_mtd_device, &mxc_fec_device, @@ -150,6 +162,11 @@ static void __init mx27ads_board_init(void) mxc_register_device(&mxc_uart_device5, &uart_pdata[5]); mxc_register_device(&mxc_nand_device, &mx27ads_nand_board_info); + /* only the i2c master 1 is used on this CPU card */ + i2c_register_board_info(1, mx27ads_i2c_devices, + ARRAY_SIZE(mx27ads_i2c_devices)); + mxc_register_device(&mxc_i2c_device1, &mx27ads_i2c_data); + platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); } -- cgit v1.2.3 From 11cda13d48a29ff81fe7bc2e0b767e164991c094 Mon Sep 17 00:00:00 2001 From: Vladimir Barinov Date: Wed, 29 Apr 2009 04:00:51 +0400 Subject: MX27ADS: Add framebuffer support Add Sharp-QVGA panel support for MX27ADS board Signed-off-by: Vladimir Barinov Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/mx27ads.c | 70 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'arch/arm/mach-mx2/mx27ads.c') diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c index bf131457c0e..41d67f2ba39 100644 --- a/arch/arm/mach-mx2/mx27ads.c +++ b/arch/arm/mach-mx2/mx27ads.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "devices.h" @@ -92,6 +93,34 @@ static unsigned int mx27ads_pins[] = { /* I2C2 */ PC5_PF_I2C2_SDA, PC6_PF_I2C2_SCL, + /* FB */ + PA5_PF_LSCLK, + PA6_PF_LD0, + PA7_PF_LD1, + PA8_PF_LD2, + PA9_PF_LD3, + PA10_PF_LD4, + PA11_PF_LD5, + PA12_PF_LD6, + PA13_PF_LD7, + PA14_PF_LD8, + PA15_PF_LD9, + PA16_PF_LD10, + PA17_PF_LD11, + PA18_PF_LD12, + PA19_PF_LD13, + PA20_PF_LD14, + PA21_PF_LD15, + PA22_PF_LD16, + PA23_PF_LD17, + PA24_PF_REV, + PA25_PF_CLS, + PA26_PF_PS, + PA27_PF_SPL_SPR, + PA28_PF_HSYNC, + PA29_PF_VSYNC, + PA30_PF_CONTRAST, + PA31_PF_OE_ACD, }; static struct mxc_nand_platform_data mx27ads_nand_board_info = { @@ -128,6 +157,46 @@ static struct imxi2c_platform_data mx27ads_i2c_data = { static struct i2c_board_info mx27ads_i2c_devices[] = { }; +void lcd_power(int on) +{ + if (on) + __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_SET_REG); + else + __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG); +} + +static struct imx_fb_platform_data mx27ads_fb_data = { + .pixclock = 188679, + .xres = 240, + .yres = 320, + + .bpp = 16, + .hsync_len = 1, + .left_margin = 9, + .right_margin = 16, + + .vsync_len = 1, + .upper_margin = 7, + .lower_margin = 9, + .fixed_screen_cpu = 0, + + /* + * - HSYNC active high + * - VSYNC active high + * - clk notenabled while idle + * - clock inverted + * - data not inverted + * - data enable low active + * - enable sharp mode + */ + .pcr = 0xFB008BC0, + .pwmr = 0x00A903FF, + .lscr1 = 0x00120300, + .dmacr = 0x00020010, + + .lcd_power = lcd_power, +}; + static struct platform_device *platform_devices[] __initdata = { &mx27ads_nor_mtd_device, &mxc_fec_device, @@ -166,6 +235,7 @@ static void __init mx27ads_board_init(void) i2c_register_board_info(1, mx27ads_i2c_devices, ARRAY_SIZE(mx27ads_i2c_devices)); mxc_register_device(&mxc_i2c_device1, &mx27ads_i2c_data); + mxc_register_device(&mxc_fb_device, &mx27ads_fb_data); platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); } -- cgit v1.2.3 From 9366d8f67c234815e99bc8518a92da7f0fa3e026 Mon Sep 17 00:00:00 2001 From: Vladimir Barinov Date: Wed, 29 Apr 2009 04:00:52 +0400 Subject: MX27ADS: Add 1-wire support Add 1-wire support for MX27ADS board Signed-off-by: Vladimir Barinov Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/mx27ads.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/arm/mach-mx2/mx27ads.c') diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c index 41d67f2ba39..90268a51f1f 100644 --- a/arch/arm/mach-mx2/mx27ads.c +++ b/arch/arm/mach-mx2/mx27ads.c @@ -121,6 +121,8 @@ static unsigned int mx27ads_pins[] = { PA29_PF_VSYNC, PA30_PF_CONTRAST, PA31_PF_OE_ACD, + /* OWIRE */ + PE16_AF_OWIRE, }; static struct mxc_nand_platform_data mx27ads_nand_board_info = { @@ -200,6 +202,7 @@ static struct imx_fb_platform_data mx27ads_fb_data = { static struct platform_device *platform_devices[] __initdata = { &mx27ads_nor_mtd_device, &mxc_fec_device, + &mxc_w1_master_device, }; static struct imxuart_platform_data uart_pdata[] = { -- cgit v1.2.3 From 60c24dc79f01edfaa14290ada39a9074050ffbcc Mon Sep 17 00:00:00 2001 From: Vladimir Barinov Date: Thu, 30 Apr 2009 15:31:20 +0400 Subject: MX27ADS: Add SDHC support Add SDHC support for MX27ADS board Signed-off-by: Vladimir Barinov Signed-off-by: Sascha Hauer --- arch/arm/mach-mx2/mx27ads.c | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'arch/arm/mach-mx2/mx27ads.c') diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c index 90268a51f1f..02daddac699 100644 --- a/arch/arm/mach-mx2/mx27ads.c +++ b/arch/arm/mach-mx2/mx27ads.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include #include "devices.h" @@ -123,6 +125,20 @@ static unsigned int mx27ads_pins[] = { PA31_PF_OE_ACD, /* OWIRE */ PE16_AF_OWIRE, + /* SDHC1*/ + PE18_PF_SD1_D0, + PE19_PF_SD1_D1, + PE20_PF_SD1_D2, + PE21_PF_SD1_D3, + PE22_PF_SD1_CMD, + PE23_PF_SD1_CLK, + /* SDHC2*/ + PB4_PF_SD2_D0, + PB5_PF_SD2_D1, + PB6_PF_SD2_D2, + PB7_PF_SD2_D3, + PB8_PF_SD2_CMD, + PB9_PF_SD2_CLK, }; static struct mxc_nand_platform_data mx27ads_nand_board_info = { @@ -199,6 +215,40 @@ static struct imx_fb_platform_data mx27ads_fb_data = { .lcd_power = lcd_power, }; +static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq, + void *data) +{ + return request_irq(IRQ_GPIOE(21), detect_irq, IRQF_TRIGGER_RISING, + "sdhc1-card-detect", data); +} + +static int mx27ads_sdhc2_init(struct device *dev, irq_handler_t detect_irq, + void *data) +{ + return request_irq(IRQ_GPIOB(7), detect_irq, IRQF_TRIGGER_RISING, + "sdhc2-card-detect", data); +} + +static void mx27ads_sdhc1_exit(struct device *dev, void *data) +{ + free_irq(IRQ_GPIOE(21), data); +} + +static void mx27ads_sdhc2_exit(struct device *dev, void *data) +{ + free_irq(IRQ_GPIOB(7), data); +} + +static struct imxmmc_platform_data sdhc1_pdata = { + .init = mx27ads_sdhc1_init, + .exit = mx27ads_sdhc1_exit, +}; + +static struct imxmmc_platform_data sdhc2_pdata = { + .init = mx27ads_sdhc2_init, + .exit = mx27ads_sdhc2_exit, +}; + static struct platform_device *platform_devices[] __initdata = { &mx27ads_nor_mtd_device, &mxc_fec_device, @@ -239,6 +289,8 @@ static void __init mx27ads_board_init(void) ARRAY_SIZE(mx27ads_i2c_devices)); mxc_register_device(&mxc_i2c_device1, &mx27ads_i2c_data); mxc_register_device(&mxc_fb_device, &mx27ads_fb_data); + mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); + mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata); platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); } -- cgit v1.2.3