Skip to content

Commit

Permalink
ARM: imx: dynamically register imx-uart devices (imx21)
Browse files Browse the repository at this point in the history
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
  • Loading branch information
Uwe Kleine-König committed Jun 30, 2010
1 parent d112f4e commit 3c5227f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-imx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ comment "MX21 platforms:"

config MACH_MX21ADS
bool "MX21ADS platform"
select IMX_HAVE_PLATFORM_IMX_UART
select IMX_HAVE_PLATFORM_MXC_NAND
help
Include support for MX21ADS platform. This includes specific
Expand Down
9 changes: 9 additions & 0 deletions arch/arm/mach-imx/devices-imx21.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
#define imx21_add_i2c_imx(pdata) \
imx_add_imx_i2c(0, MX2x_I2C_BASE_ADDR, SZ_4K, MX2x_INT_I2C, pdata)

#define imx21_add_imx_uart0(pdata) \
imx_add_imx_uart_1irq(0, MX21_UART1_BASE_ADDR, SZ_4K, MX21_INT_UART1, pdata)
#define imx21_add_imx_uart1(pdata) \
imx_add_imx_uart_1irq(1, MX21_UART2_BASE_ADDR, SZ_4K, MX21_INT_UART2, pdata)
#define imx21_add_imx_uart2(pdata) \
imx_add_imx_uart_1irq(2, MX21_UART3_BASE_ADDR, SZ_4K, MX21_INT_UART3, pdata)
#define imx21_add_imx_uart3(pdata) \
imx_add_imx_uart_1irq(3, MX21_UART4_BASE_ADDR, SZ_4K, MX21_INT_UART4, pdata)

#define imx21_add_mxc_nand(pdata) \
imx_add_mxc_nand_v1(MX21_NFC_BASE_ADDR, MX21_INT_NANDFC, pdata)

Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-imx/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ struct platform_device mxc_usbh2 = {
DEFINE_IMX_SSI_DEVICE(0, 1, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1);
DEFINE_IMX_SSI_DEVICE(1, 2, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1);

#ifdef CONFIG_MACH_MX27
#define DEFINE_IMX2x_UART_DEVICE(n, baseaddr, irq) \
static struct resource imx2x_uart_resources ## n[] = { \
{ \
Expand All @@ -507,8 +508,6 @@ DEFINE_IMX2x_UART_DEVICE(0, MX2x_UART1_BASE_ADDR, MX2x_INT_UART1);
DEFINE_IMX2x_UART_DEVICE(1, MX2x_UART2_BASE_ADDR, MX2x_INT_UART2);
DEFINE_IMX2x_UART_DEVICE(2, MX2x_UART3_BASE_ADDR, MX2x_INT_UART3);
DEFINE_IMX2x_UART_DEVICE(3, MX2x_UART4_BASE_ADDR, MX2x_INT_UART4);

#ifdef CONFIG_MACH_MX27
DEFINE_IMX2x_UART_DEVICE(4, MX27_UART5_BASE_ADDR, MX27_INT_UART5);
DEFINE_IMX2x_UART_DEVICE(5, MX27_UART6_BASE_ADDR, MX27_INT_UART6);
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ extern struct platform_device mxc_gpt4;
extern struct platform_device mxc_gpt5;
#endif
extern struct platform_device mxc_wdt;
#ifdef CONFIG_MACH_MX27
extern struct platform_device imx2x_uart_device0;
extern struct platform_device imx2x_uart_device1;
extern struct platform_device imx2x_uart_device2;
extern struct platform_device imx2x_uart_device3;
#ifdef CONFIG_MACH_MX27
extern struct platform_device imx2x_uart_device4;
extern struct platform_device imx2x_uart_device5;
#endif
Expand Down
12 changes: 5 additions & 7 deletions arch/arm/mach-imx/mach-mx21ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/mach/map.h>
#include <mach/imx-uart.h>
#include <mach/imxfb.h>
#include <mach/iomux-mx21.h>
#include <mach/mxc_nand.h>
Expand Down Expand Up @@ -164,14 +163,13 @@ static struct platform_device mx21ads_nor_mtd_device = {
.resource = &mx21ads_flash_resource,
};

static struct imxuart_platform_data uart_pdata = {
static const struct imxuart_platform_data uart_pdata_rts __initconst = {
.flags = IMXUART_HAVE_RTSCTS,
};

static struct imxuart_platform_data uart_norts_pdata = {
static const struct imxuart_platform_data uart_pdata_norts __initconst = {
};


static int mx21ads_fb_init(struct platform_device *pdev)
{
u16 tmp;
Expand Down Expand Up @@ -295,9 +293,9 @@ static void __init mx21ads_board_init(void)
mxc_gpio_setup_multiple_pins(mx21ads_pins, ARRAY_SIZE(mx21ads_pins),
"mx21ads");

mxc_register_device(&imx2x_uart_device0, &uart_pdata);
mxc_register_device(&imx2x_uart_device2, &uart_norts_pdata);
mxc_register_device(&imx2x_uart_device3, &uart_pdata);
imx21_add_imx_uart0(&uart_pdata_rts);
imx21_add_imx_uart2(&uart_pdata_norts);
imx21_add_imx_uart3(&uart_pdata_rts);
mxc_register_device(&mxc_fb_device, &mx21ads_fb_data);
mxc_register_device(&mxc_sdhc_device0, &mx21ads_sdhc_pdata);
imx21_add_mxc_nand(&mx21ads_nand_board_info);
Expand Down

0 comments on commit 3c5227f

Please sign in to comment.