diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-04-10 02:10:05 -0400 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-05-25 11:04:33 -0400 |
commit | 2b348e2f82f532e3aff8e0ce9293033b3294c1e0 (patch) | |
tree | 771e08a36011c6010962de74bc54b7299466a588 /arch/arm | |
parent | dd41d3216b05200cf01381927804a35315352a35 (diff) |
atmel_serial: keep the platform_device unchanged
specify the port num via platform_data this will allow to match the clock
with the plaform_dev staticaly
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-at91/at572d940hf_devices.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91cap9_devices.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91rm9200_devices.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9260_devices.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9261_devices.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263_devices.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45_devices.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl_devices.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/board.h | 1 |
9 files changed, 25 insertions, 8 deletions
diff --git a/arch/arm/mach-at91/at572d940hf_devices.c b/arch/arm/mach-at91/at572d940hf_devices.c index 0fc20a240782..e52c8e078b0f 100644 --- a/arch/arm/mach-at91/at572d940hf_devices.c +++ b/arch/arm/mach-at91/at572d940hf_devices.c | |||
@@ -822,6 +822,7 @@ struct platform_device *atmel_default_console_device; /* the serial console devi | |||
822 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 822 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
823 | { | 823 | { |
824 | struct platform_device *pdev; | 824 | struct platform_device *pdev; |
825 | struct atmel_uart_data *pdata; | ||
825 | 826 | ||
826 | switch (id) { | 827 | switch (id) { |
827 | case 0: /* DBGU */ | 828 | case 0: /* DBGU */ |
@@ -847,7 +848,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | |||
847 | default: | 848 | default: |
848 | return; | 849 | return; |
849 | } | 850 | } |
850 | pdev->id = portnr; /* update to mapped ID */ | 851 | pdata = pdev->dev.platform_data; |
852 | pdata->num = portnr; /* update to mapped ID */ | ||
851 | 853 | ||
852 | if (portnr < ATMEL_MAX_UART) | 854 | if (portnr < ATMEL_MAX_UART) |
853 | at91_uarts[portnr] = pdev; | 855 | at91_uarts[portnr] = pdev; |
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c index 21020ceb2f3a..ffda9099f6fa 100644 --- a/arch/arm/mach-at91/at91cap9_devices.c +++ b/arch/arm/mach-at91/at91cap9_devices.c | |||
@@ -1199,6 +1199,7 @@ struct platform_device *atmel_default_console_device; /* the serial console devi | |||
1199 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 1199 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
1200 | { | 1200 | { |
1201 | struct platform_device *pdev; | 1201 | struct platform_device *pdev; |
1202 | struct atmel_uart_data *pdata; | ||
1202 | 1203 | ||
1203 | switch (id) { | 1204 | switch (id) { |
1204 | case 0: /* DBGU */ | 1205 | case 0: /* DBGU */ |
@@ -1224,7 +1225,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | |||
1224 | default: | 1225 | default: |
1225 | return; | 1226 | return; |
1226 | } | 1227 | } |
1227 | pdev->id = portnr; /* update to mapped ID */ | 1228 | pdata = pdev->dev.platform_data; |
1229 | pdata->num = portnr; /* update to mapped ID */ | ||
1228 | 1230 | ||
1229 | if (portnr < ATMEL_MAX_UART) | 1231 | if (portnr < ATMEL_MAX_UART) |
1230 | at91_uarts[portnr] = pdev; | 1232 | at91_uarts[portnr] = pdev; |
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 7b539228e0ef..761559e589a3 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
@@ -1109,6 +1109,7 @@ struct platform_device *atmel_default_console_device; /* the serial console devi | |||
1109 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 1109 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
1110 | { | 1110 | { |
1111 | struct platform_device *pdev; | 1111 | struct platform_device *pdev; |
1112 | struct atmel_uart_data *pdata; | ||
1112 | 1113 | ||
1113 | switch (id) { | 1114 | switch (id) { |
1114 | case 0: /* DBGU */ | 1115 | case 0: /* DBGU */ |
@@ -1139,7 +1140,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | |||
1139 | default: | 1140 | default: |
1140 | return; | 1141 | return; |
1141 | } | 1142 | } |
1142 | pdev->id = portnr; /* update to mapped ID */ | 1143 | pdata = pdev->dev.platform_data; |
1144 | pdata->num = portnr; /* update to mapped ID */ | ||
1143 | 1145 | ||
1144 | if (portnr < ATMEL_MAX_UART) | 1146 | if (portnr < ATMEL_MAX_UART) |
1145 | at91_uarts[portnr] = pdev; | 1147 | at91_uarts[portnr] = pdev; |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 07eb7b07e442..6f8ec8d16d5a 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -1139,6 +1139,7 @@ struct platform_device *atmel_default_console_device; /* the serial console devi | |||
1139 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 1139 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
1140 | { | 1140 | { |
1141 | struct platform_device *pdev; | 1141 | struct platform_device *pdev; |
1142 | struct atmel_uart_data *pdata; | ||
1142 | 1143 | ||
1143 | switch (id) { | 1144 | switch (id) { |
1144 | case 0: /* DBGU */ | 1145 | case 0: /* DBGU */ |
@@ -1179,7 +1180,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | |||
1179 | default: | 1180 | default: |
1180 | return; | 1181 | return; |
1181 | } | 1182 | } |
1182 | pdev->id = portnr; /* update to mapped ID */ | 1183 | pdata = pdev->dev.platform_data; |
1184 | pdata->num = portnr; /* update to mapped ID */ | ||
1183 | 1185 | ||
1184 | if (portnr < ATMEL_MAX_UART) | 1186 | if (portnr < ATMEL_MAX_UART) |
1185 | at91_uarts[portnr] = pdev; | 1187 | at91_uarts[portnr] = pdev; |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 59fc48311fb0..8792f9bfb6b0 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -989,6 +989,7 @@ struct platform_device *atmel_default_console_device; /* the serial console devi | |||
989 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 989 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
990 | { | 990 | { |
991 | struct platform_device *pdev; | 991 | struct platform_device *pdev; |
992 | struct atmel_uart_data *pdata; | ||
992 | 993 | ||
993 | switch (id) { | 994 | switch (id) { |
994 | case 0: /* DBGU */ | 995 | case 0: /* DBGU */ |
@@ -1014,7 +1015,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | |||
1014 | default: | 1015 | default: |
1015 | return; | 1016 | return; |
1016 | } | 1017 | } |
1017 | pdev->id = portnr; /* update to mapped ID */ | 1018 | pdata = pdev->dev.platform_data; |
1019 | pdata->num = portnr; /* update to mapped ID */ | ||
1018 | 1020 | ||
1019 | if (portnr < ATMEL_MAX_UART) | 1021 | if (portnr < ATMEL_MAX_UART) |
1020 | at91_uarts[portnr] = pdev; | 1022 | at91_uarts[portnr] = pdev; |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index fb5c23af1017..47a9f965bbb5 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -1370,6 +1370,7 @@ struct platform_device *atmel_default_console_device; /* the serial console devi | |||
1370 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 1370 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
1371 | { | 1371 | { |
1372 | struct platform_device *pdev; | 1372 | struct platform_device *pdev; |
1373 | struct atmel_uart_data *pdata; | ||
1373 | 1374 | ||
1374 | switch (id) { | 1375 | switch (id) { |
1375 | case 0: /* DBGU */ | 1376 | case 0: /* DBGU */ |
@@ -1395,7 +1396,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | |||
1395 | default: | 1396 | default: |
1396 | return; | 1397 | return; |
1397 | } | 1398 | } |
1398 | pdev->id = portnr; /* update to mapped ID */ | 1399 | pdata = pdev->dev.platform_data; |
1400 | pdata->num = portnr; /* update to mapped ID */ | ||
1399 | 1401 | ||
1400 | if (portnr < ATMEL_MAX_UART) | 1402 | if (portnr < ATMEL_MAX_UART) |
1401 | at91_uarts[portnr] = pdev; | 1403 | at91_uarts[portnr] = pdev; |
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index 5e9f8a4c38df..eee27eed9133 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -1527,6 +1527,7 @@ struct platform_device *atmel_default_console_device; /* the serial console devi | |||
1527 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 1527 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
1528 | { | 1528 | { |
1529 | struct platform_device *pdev; | 1529 | struct platform_device *pdev; |
1530 | struct atmel_uart_data *pdata; | ||
1530 | 1531 | ||
1531 | switch (id) { | 1532 | switch (id) { |
1532 | case 0: /* DBGU */ | 1533 | case 0: /* DBGU */ |
@@ -1557,7 +1558,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | |||
1557 | default: | 1558 | default: |
1558 | return; | 1559 | return; |
1559 | } | 1560 | } |
1560 | pdev->id = portnr; /* update to mapped ID */ | 1561 | pdata = pdev->dev.platform_data; |
1562 | pdata->num = portnr; /* update to mapped ID */ | ||
1561 | 1563 | ||
1562 | if (portnr < ATMEL_MAX_UART) | 1564 | if (portnr < ATMEL_MAX_UART) |
1563 | at91_uarts[portnr] = pdev; | 1565 | at91_uarts[portnr] = pdev; |
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index c49262bddd85..d194b085848e 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -1141,6 +1141,7 @@ struct platform_device *atmel_default_console_device; /* the serial console devi | |||
1141 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 1141 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
1142 | { | 1142 | { |
1143 | struct platform_device *pdev; | 1143 | struct platform_device *pdev; |
1144 | struct atmel_uart_data *pdata; | ||
1144 | 1145 | ||
1145 | switch (id) { | 1146 | switch (id) { |
1146 | case 0: /* DBGU */ | 1147 | case 0: /* DBGU */ |
@@ -1171,7 +1172,8 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | |||
1171 | default: | 1172 | default: |
1172 | return; | 1173 | return; |
1173 | } | 1174 | } |
1174 | pdev->id = portnr; /* update to mapped ID */ | 1175 | pdata = pdev->dev.platform_data; |
1176 | pdata->num = portnr; /* update to mapped ID */ | ||
1175 | 1177 | ||
1176 | if (portnr < ATMEL_MAX_UART) | 1178 | if (portnr < ATMEL_MAX_UART) |
1177 | at91_uarts[portnr] = pdev; | 1179 | at91_uarts[portnr] = pdev; |
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index 2b499eb343a1..c44e94e22857 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h | |||
@@ -140,6 +140,7 @@ extern void __init at91_set_serial_console(unsigned portnr); | |||
140 | extern struct platform_device *atmel_default_console_device; | 140 | extern struct platform_device *atmel_default_console_device; |
141 | 141 | ||
142 | struct atmel_uart_data { | 142 | struct atmel_uart_data { |
143 | int num; /* port num */ | ||
143 | short use_dma_tx; /* use transmit DMA? */ | 144 | short use_dma_tx; /* use transmit DMA? */ |
144 | short use_dma_rx; /* use receive DMA? */ | 145 | short use_dma_rx; /* use receive DMA? */ |
145 | void __iomem *regs; /* virt. base address, if any */ | 146 | void __iomem *regs; /* virt. base address, if any */ |