aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf537/boards/stamp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/mach-bf537/boards/stamp.c')
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c684
1 files changed, 639 insertions, 45 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index ac9b52e0087c..9eaf5b05c11e 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -20,10 +20,12 @@
20#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 20#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
21#include <linux/usb/isp1362.h> 21#include <linux/usb/isp1362.h>
22#endif 22#endif
23#include <linux/i2c.h>
24#include <linux/i2c/adp5588.h>
25#include <linux/etherdevice.h>
23#include <linux/ata_platform.h> 26#include <linux/ata_platform.h>
24#include <linux/irq.h> 27#include <linux/irq.h>
25#include <linux/interrupt.h> 28#include <linux/interrupt.h>
26#include <linux/i2c.h>
27#include <linux/usb/sl811.h> 29#include <linux/usb/sl811.h>
28#include <linux/spi/mmc_spi.h> 30#include <linux/spi/mmc_spi.h>
29#include <linux/leds.h> 31#include <linux/leds.h>
@@ -33,6 +35,14 @@
33#include <asm/reboot.h> 35#include <asm/reboot.h>
34#include <asm/portmux.h> 36#include <asm/portmux.h>
35#include <asm/dpmc.h> 37#include <asm/dpmc.h>
38#ifdef CONFIG_REGULATOR_ADP_SWITCH
39#include <linux/regulator/adp_switch.h>
40#endif
41#ifdef CONFIG_REGULATOR_AD5398
42#include <linux/regulator/ad5398.h>
43#endif
44#include <linux/regulator/consumer.h>
45#include <linux/regulator/userspace-consumer.h>
36 46
37/* 47/*
38 * Name the Board for the /proc/cpuinfo 48 * Name the Board for the /proc/cpuinfo
@@ -208,8 +218,8 @@ static struct resource sl811_hcd_resources[] = {
208 .end = 0x20340004, 218 .end = 0x20340004,
209 .flags = IORESOURCE_MEM, 219 .flags = IORESOURCE_MEM,
210 }, { 220 }, {
211 .start = CONFIG_USB_SL811_BFIN_IRQ, 221 .start = IRQ_PF4,
212 .end = CONFIG_USB_SL811_BFIN_IRQ, 222 .end = IRQ_PF4,
213 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 223 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
214 }, 224 },
215}; 225};
@@ -454,6 +464,9 @@ static struct physmap_flash_data stamp_flash_data = {
454 .width = 2, 464 .width = 2,
455 .parts = stamp_partitions, 465 .parts = stamp_partitions,
456 .nr_parts = ARRAY_SIZE(stamp_partitions), 466 .nr_parts = ARRAY_SIZE(stamp_partitions),
467#ifdef CONFIG_ROMKERNEL
468 .probe_type = "map_rom",
469#endif
457}; 470};
458 471
459static struct resource stamp_flash_resource = { 472static struct resource stamp_flash_resource = {
@@ -515,20 +528,19 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = {
515}; 528};
516#endif 529#endif
517 530
518#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \ 531#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
519 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE) 532 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
520static struct bfin5xx_spi_chip ad1836_spi_chip_info = { 533static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
521 .enable_dma = 0, 534 .enable_dma = 0,
522 .bits_per_word = 16, 535 .bits_per_word = 16,
523}; 536};
524#endif 537#endif
525 538
526#if defined(CONFIG_SND_BF5XX_SOC_AD1938) \ 539#if defined(CONFIG_SND_BF5XX_SOC_AD193X) \
527 || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE) 540 || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
528static struct bfin5xx_spi_chip ad1938_spi_chip_info = { 541static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
529 .enable_dma = 0, 542 .enable_dma = 0,
530 .bits_per_word = 8, 543 .bits_per_word = 8,
531 .cs_gpio = GPIO_PF5,
532}; 544};
533#endif 545#endif
534 546
@@ -644,6 +656,42 @@ static struct ad714x_platform_data ad7142_i2c_platform_data = {
644}; 656};
645#endif 657#endif
646 658
659#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
660static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {
661 .enable_dma = 0,
662 .bits_per_word = 16,
663};
664#endif
665
666#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
667unsigned short ad2s120x_platform_data[] = {
668 /* used as SAMPLE and RDVEL */
669 GPIO_PF5, GPIO_PF6, 0
670};
671
672static struct bfin5xx_spi_chip ad2s120x_spi_chip_info = {
673 .enable_dma = 0,
674 .bits_per_word = 16,
675};
676#endif
677
678#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
679unsigned short ad2s1210_platform_data[] = {
680 /* use as SAMPLE, A0, A1 */
681 GPIO_PF7, GPIO_PF8, GPIO_PF9,
682# if defined(CONFIG_AD2S1210_GPIO_INPUT) || defined(CONFIG_AD2S1210_GPIO_OUTPUT)
683 /* the RES0 and RES1 pins */
684 GPIO_PF4, GPIO_PF5,
685# endif
686 0,
687};
688
689static struct bfin5xx_spi_chip ad2s1210_spi_chip_info = {
690 .enable_dma = 0,
691 .bits_per_word = 8,
692};
693#endif
694
647#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 695#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
648#define MMC_SPI_CARD_DETECT_INT IRQ_PF5 696#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
649 697
@@ -686,11 +734,11 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
686 .y_plate_ohms = 486, 734 .y_plate_ohms = 486,
687 .pressure_max = 1000, 735 .pressure_max = 1000,
688 .pressure_min = 0, 736 .pressure_min = 0,
689 .stopacq_polarity = 1, 737 .stopacq_polarity = 1,
690 .first_conversion_delay = 3, 738 .first_conversion_delay = 3,
691 .acquisition_time = 1, 739 .acquisition_time = 1,
692 .averaging = 1, 740 .averaging = 1,
693 .pen_down_acc_interval = 1, 741 .pen_down_acc_interval = 1,
694}; 742};
695#endif 743#endif
696 744
@@ -701,13 +749,13 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {
701 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */ 749 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
702 .pressure_max = 10000, 750 .pressure_max = 10000,
703 .pressure_min = 0, 751 .pressure_min = 0,
704 .first_conversion_delay = 3, /* wait 512us before do a first conversion */ 752 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
705 .acquisition_time = 1, /* 4us acquisition time per sample */ 753 .acquisition_time = 1, /* 4us acquisition time per sample */
706 .median = 2, /* do 8 measurements */ 754 .median = 2, /* do 8 measurements */
707 .averaging = 1, /* take the average of 4 middle samples */ 755 .averaging = 1, /* take the average of 4 middle samples */
708 .pen_down_acc_interval = 255, /* 9.4 ms */ 756 .pen_down_acc_interval = 255, /* 9.4 ms */
709 .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */ 757 .gpio_export = 1, /* Export GPIO to gpiolib */
710 .gpio_default = 1, /* During initialization set GPIO = HIGH */ 758 .gpio_base = -1, /* Dynamic allocation */
711}; 759};
712#endif 760#endif
713 761
@@ -742,6 +790,11 @@ static const struct adxl34x_platform_data adxl34x_info = {
742/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */ 790/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
743 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK, 791 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
744 .fifo_mode = ADXL_FIFO_STREAM, 792 .fifo_mode = ADXL_FIFO_STREAM,
793 .orientation_enable = ADXL_EN_ORIENTATION_3D,
794 .deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,
795 .divisor_length = ADXL_LP_FILTER_DIVISOR_16,
796 /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
797 .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},
745}; 798};
746#endif 799#endif
747 800
@@ -813,6 +866,35 @@ static struct adf702x_platform_data adf7021_platform_data = {
813 .adf702x_regs = adf7021_regs, 866 .adf702x_regs = adf7021_regs,
814 .tx_reg = TXREG, 867 .tx_reg = TXREG,
815}; 868};
869static inline void adf702x_mac_init(void)
870{
871 random_ether_addr(adf7021_platform_data.mac_addr);
872}
873#else
874static inline void adf702x_mac_init(void) {}
875#endif
876
877#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
878#include <linux/spi/ads7846.h>
879static struct bfin5xx_spi_chip ad7873_spi_chip_info = {
880 .bits_per_word = 8,
881};
882
883static int ads7873_get_pendown_state(void)
884{
885 return gpio_get_value(GPIO_PF6);
886}
887
888static struct ads7846_platform_data __initdata ad7873_pdata = {
889 .model = 7873, /* AD7873 */
890 .x_max = 0xfff,
891 .y_max = 0xfff,
892 .x_plate_ohms = 620,
893 .debounce_max = 1,
894 .debounce_rep = 0,
895 .debounce_tol = (~0),
896 .get_pendown_state = ads7873_get_pendown_state,
897};
816#endif 898#endif
817 899
818#if defined(CONFIG_MTD_DATAFLASH) \ 900#if defined(CONFIG_MTD_DATAFLASH) \
@@ -893,24 +975,25 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
893 }, 975 },
894#endif 976#endif
895 977
896#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \ 978#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
897 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE) 979 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
898 { 980 {
899 .modalias = "ad1836", 981 .modalias = "ad183x",
900 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 982 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
901 .bus_num = 0, 983 .bus_num = 0,
902 .chip_select = 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */ 984 .chip_select = 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
985 .platform_data = "ad1836", /* only includes chip name for the moment */
903 .controller_data = &ad1836_spi_chip_info, 986 .controller_data = &ad1836_spi_chip_info,
904 .mode = SPI_MODE_3, 987 .mode = SPI_MODE_3,
905 }, 988 },
906#endif 989#endif
907 990
908#if defined(CONFIG_SND_BF5XX_SOC_AD1938) || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE) 991#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
909 { 992 {
910 .modalias = "ad1938", 993 .modalias = "ad193x",
911 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 994 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
912 .bus_num = 0, 995 .bus_num = 0,
913 .chip_select = 0,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */ 996 .chip_select = 5,
914 .controller_data = &ad1938_spi_chip_info, 997 .controller_data = &ad1938_spi_chip_info,
915 .mode = SPI_MODE_3, 998 .mode = SPI_MODE_3,
916 }, 999 },
@@ -929,6 +1012,37 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
929 }, 1012 },
930#endif 1013#endif
931 1014
1015#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
1016 {
1017 .modalias = "ad2s90",
1018 .bus_num = 0,
1019 .chip_select = 3, /* change it for your board */
1020 .platform_data = NULL,
1021 .controller_data = &ad2s90_spi_chip_info,
1022 },
1023#endif
1024
1025#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
1026 {
1027 .modalias = "ad2s120x",
1028 .bus_num = 0,
1029 .chip_select = 4, /* CS, change it for your board */
1030 .platform_data = ad2s120x_platform_data,
1031 .controller_data = &ad2s120x_spi_chip_info,
1032 },
1033#endif
1034
1035#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
1036 {
1037 .modalias = "ad2s1210",
1038 .max_speed_hz = 8192000,
1039 .bus_num = 0,
1040 .chip_select = 4, /* CS, change it for your board */
1041 .platform_data = ad2s1210_platform_data,
1042 .controller_data = &ad2s1210_spi_chip_info,
1043 },
1044#endif
1045
932#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 1046#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
933 { 1047 {
934 .modalias = "mmc_spi", 1048 .modalias = "mmc_spi",
@@ -1016,7 +1130,18 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1016 .mode = SPI_MODE_0, 1130 .mode = SPI_MODE_0,
1017 }, 1131 },
1018#endif 1132#endif
1019 1133#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
1134 {
1135 .modalias = "ads7846",
1136 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1137 .bus_num = 0,
1138 .irq = IRQ_PF6,
1139 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1140 .controller_data = &ad7873_spi_chip_info,
1141 .platform_data = &ad7873_pdata,
1142 .mode = SPI_MODE_0,
1143 },
1144#endif
1020}; 1145};
1021 1146
1022#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 1147#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
@@ -1132,9 +1257,10 @@ static struct platform_device bfin_fb_device = {
1132#include <asm/bfin-lq035q1.h> 1257#include <asm/bfin-lq035q1.h>
1133 1258
1134static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = { 1259static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
1135 .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB, 1260 .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
1136 .use_bl = 0, /* let something else control the LCD Blacklight */ 1261 .ppi_mode = USE_RGB565_16_BIT_PPI,
1137 .gpio_bl = GPIO_PF7, 1262 .use_bl = 0, /* let something else control the LCD Blacklight */
1263 .gpio_bl = GPIO_PF7,
1138}; 1264};
1139 1265
1140static struct resource bfin_lq035q1_resources[] = { 1266static struct resource bfin_lq035q1_resources[] = {
@@ -1148,8 +1274,8 @@ static struct resource bfin_lq035q1_resources[] = {
1148static struct platform_device bfin_lq035q1_device = { 1274static struct platform_device bfin_lq035q1_device = {
1149 .name = "bfin-lq035q1", 1275 .name = "bfin-lq035q1",
1150 .id = -1, 1276 .id = -1,
1151 .num_resources = ARRAY_SIZE(bfin_lq035q1_resources), 1277 .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
1152 .resource = bfin_lq035q1_resources, 1278 .resource = bfin_lq035q1_resources,
1153 .dev = { 1279 .dev = {
1154 .platform_data = &bfin_lq035q1_data, 1280 .platform_data = &bfin_lq035q1_data,
1155 }, 1281 },
@@ -1157,30 +1283,105 @@ static struct platform_device bfin_lq035q1_device = {
1157#endif 1283#endif
1158 1284
1159#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 1285#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1160static struct resource bfin_uart_resources[] = {
1161#ifdef CONFIG_SERIAL_BFIN_UART0 1286#ifdef CONFIG_SERIAL_BFIN_UART0
1287static struct resource bfin_uart0_resources[] = {
1162 { 1288 {
1163 .start = 0xFFC00400, 1289 .start = UART0_THR,
1164 .end = 0xFFC004FF, 1290 .end = UART0_GCTL+2,
1165 .flags = IORESOURCE_MEM, 1291 .flags = IORESOURCE_MEM,
1166 }, 1292 },
1293 {
1294 .start = IRQ_UART0_RX,
1295 .end = IRQ_UART0_RX+1,
1296 .flags = IORESOURCE_IRQ,
1297 },
1298 {
1299 .start = IRQ_UART0_ERROR,
1300 .end = IRQ_UART0_ERROR,
1301 .flags = IORESOURCE_IRQ,
1302 },
1303 {
1304 .start = CH_UART0_TX,
1305 .end = CH_UART0_TX,
1306 .flags = IORESOURCE_DMA,
1307 },
1308 {
1309 .start = CH_UART0_RX,
1310 .end = CH_UART0_RX,
1311 .flags = IORESOURCE_DMA,
1312 },
1313#ifdef CONFIG_BFIN_UART0_CTSRTS
1314 { /* CTS pin */
1315 .start = GPIO_PG7,
1316 .end = GPIO_PG7,
1317 .flags = IORESOURCE_IO,
1318 },
1319 { /* RTS pin */
1320 .start = GPIO_PG6,
1321 .end = GPIO_PG6,
1322 .flags = IORESOURCE_IO,
1323 },
1324#endif
1325};
1326
1327unsigned short bfin_uart0_peripherals[] = {
1328 P_UART0_TX, P_UART0_RX, 0
1329};
1330
1331static struct platform_device bfin_uart0_device = {
1332 .name = "bfin-uart",
1333 .id = 0,
1334 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
1335 .resource = bfin_uart0_resources,
1336 .dev = {
1337 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
1338 },
1339};
1167#endif 1340#endif
1168#ifdef CONFIG_SERIAL_BFIN_UART1 1341#ifdef CONFIG_SERIAL_BFIN_UART1
1342static struct resource bfin_uart1_resources[] = {
1169 { 1343 {
1170 .start = 0xFFC02000, 1344 .start = UART1_THR,
1171 .end = 0xFFC020FF, 1345 .end = UART1_GCTL+2,
1172 .flags = IORESOURCE_MEM, 1346 .flags = IORESOURCE_MEM,
1173 }, 1347 },
1174#endif 1348 {
1349 .start = IRQ_UART1_RX,
1350 .end = IRQ_UART1_RX+1,
1351 .flags = IORESOURCE_IRQ,
1352 },
1353 {
1354 .start = IRQ_UART1_ERROR,
1355 .end = IRQ_UART1_ERROR,
1356 .flags = IORESOURCE_IRQ,
1357 },
1358 {
1359 .start = CH_UART1_TX,
1360 .end = CH_UART1_TX,
1361 .flags = IORESOURCE_DMA,
1362 },
1363 {
1364 .start = CH_UART1_RX,
1365 .end = CH_UART1_RX,
1366 .flags = IORESOURCE_DMA,
1367 },
1368};
1369
1370unsigned short bfin_uart1_peripherals[] = {
1371 P_UART1_TX, P_UART1_RX, 0
1175}; 1372};
1176 1373
1177static struct platform_device bfin_uart_device = { 1374static struct platform_device bfin_uart1_device = {
1178 .name = "bfin-uart", 1375 .name = "bfin-uart",
1179 .id = 1, 1376 .id = 1,
1180 .num_resources = ARRAY_SIZE(bfin_uart_resources), 1377 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
1181 .resource = bfin_uart_resources, 1378 .resource = bfin_uart1_resources,
1379 .dev = {
1380 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
1381 },
1182}; 1382};
1183#endif 1383#endif
1384#endif
1184 1385
1185#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1386#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1186#ifdef CONFIG_BFIN_SIR0 1387#ifdef CONFIG_BFIN_SIR0
@@ -1260,7 +1461,6 @@ static struct platform_device i2c_bfin_twi_device = {
1260#endif 1461#endif
1261 1462
1262#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE) 1463#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1263#include <linux/i2c/adp5588.h>
1264static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = { 1464static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1265 [0] = KEY_GRAVE, 1465 [0] = KEY_GRAVE,
1266 [1] = KEY_1, 1466 [1] = KEY_1,
@@ -1457,7 +1657,6 @@ static struct adp5520_platform_data adp5520_pdev_data = {
1457#endif 1657#endif
1458 1658
1459#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE) 1659#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1460#include <linux/i2c/adp5588.h>
1461static struct adp5588_gpio_platform_data adp5588_gpio_data = { 1660static struct adp5588_gpio_platform_data adp5588_gpio_data = {
1462 .gpio_start = 50, 1661 .gpio_start = 50,
1463 .pullup_dis_mask = 0, 1662 .pullup_dis_mask = 0,
@@ -1516,6 +1715,101 @@ static struct adp8870_backlight_platform_data adp8870_pdata = {
1516}; 1715};
1517#endif 1716#endif
1518 1717
1718#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
1719#include <linux/i2c/adp8860.h>
1720static struct led_info adp8860_leds[] = {
1721 {
1722 .name = "adp8860-led7",
1723 .default_trigger = "none",
1724 .flags = ADP8860_LED_D7 | ADP8860_LED_OFFT_600ms,
1725 },
1726};
1727
1728static struct adp8860_backlight_platform_data adp8860_pdata = {
1729 .bl_led_assign = ADP8860_BL_D1 | ADP8860_BL_D2 | ADP8860_BL_D3 |
1730 ADP8860_BL_D4 | ADP8860_BL_D5 | ADP8860_BL_D6, /* 1 = Backlight 0 = Individual LED */
1731
1732 .bl_fade_in = ADP8860_FADE_T_1200ms, /* Backlight Fade-In Timer */
1733 .bl_fade_out = ADP8860_FADE_T_1200ms, /* Backlight Fade-Out Timer */
1734 .bl_fade_law = ADP8860_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
1735
1736 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
1737 .abml_filt = ADP8860_BL_AMBL_FILT_320ms, /* Light sensor filter time */
1738
1739 .l1_daylight_max = ADP8860_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1740 .l1_daylight_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1741 .l2_office_max = ADP8860_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1742 .l2_office_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1743 .l3_dark_max = ADP8860_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1744 .l3_dark_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1745
1746 .l2_trip = ADP8860_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1747 .l2_hyst = ADP8860_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1748 .l3_trip = ADP8860_L3_COMP_CURR_uA(43), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1749 .l3_hyst = ADP8860_L3_COMP_CURR_uA(11), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1750
1751 .leds = adp8860_leds,
1752 .num_leds = ARRAY_SIZE(adp8860_leds),
1753 .led_fade_law = ADP8860_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
1754 .led_fade_in = ADP8860_FADE_T_600ms,
1755 .led_fade_out = ADP8860_FADE_T_600ms,
1756 .led_on_time = ADP8860_LED_ONT_200ms,
1757};
1758#endif
1759
1760#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
1761static struct regulator_consumer_supply ad5398_consumer = {
1762 .supply = "current",
1763};
1764
1765static struct regulator_init_data ad5398_regulator_data = {
1766 .constraints = {
1767 .name = "current range",
1768 .max_uA = 120000,
1769 .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
1770 },
1771 .num_consumer_supplies = 1,
1772 .consumer_supplies = &ad5398_consumer,
1773};
1774
1775static struct ad5398_platform_data ad5398_i2c_platform_data = {
1776 .current_bits = 10,
1777 .current_offset = 4,
1778 .regulator_data = &ad5398_regulator_data,
1779};
1780
1781#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
1782 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
1783static struct platform_device ad5398_virt_consumer_device = {
1784 .name = "reg-virt-consumer",
1785 .id = 0,
1786 .dev = {
1787 .platform_data = "current", /* Passed to driver */
1788 },
1789};
1790#endif
1791#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
1792 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
1793static struct regulator_bulk_data ad5398_bulk_data = {
1794 .supply = "current",
1795};
1796
1797static struct regulator_userspace_consumer_data ad5398_userspace_comsumer_data = {
1798 .name = "ad5398",
1799 .num_supplies = 1,
1800 .supplies = &ad5398_bulk_data,
1801};
1802
1803static struct platform_device ad5398_userspace_consumer_device = {
1804 .name = "reg-userspace-consumer",
1805 .id = 0,
1806 .dev = {
1807 .platform_data = &ad5398_userspace_comsumer_data,
1808 },
1809};
1810#endif
1811#endif
1812
1519static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 1813static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1520#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE) 1814#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
1521 { 1815 {
@@ -1524,6 +1818,52 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1524 .platform_data = (void *)&ad7142_i2c_platform_data, 1818 .platform_data = (void *)&ad7142_i2c_platform_data,
1525 }, 1819 },
1526#endif 1820#endif
1821
1822#if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
1823 {
1824 I2C_BOARD_INFO("ad7150", 0x48),
1825 .irq = IRQ_PG5, /* fixme: use real interrupt number */
1826 },
1827#endif
1828
1829#if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
1830 {
1831 I2C_BOARD_INFO("ad7152", 0x48),
1832 },
1833#endif
1834
1835#if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
1836 {
1837 I2C_BOARD_INFO("ad774x", 0x48),
1838 },
1839#endif
1840
1841#if defined(CONFIG_AD7414) || defined(CONFIG_AD7414_MODULE)
1842 {
1843 I2C_BOARD_INFO("ad7414", 0x9),
1844 .irq = IRQ_PG5,
1845 /*
1846 * platform_data pointer is borrwoed by the driver to
1847 * store custimer defined IRQ ALART level mode.
1848 * only IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW are valid.
1849 */
1850 .platform_data = (void *)IRQF_TRIGGER_LOW,
1851 },
1852#endif
1853
1854#if defined(CONFIG_AD7416) || defined(CONFIG_AD7416_MODULE)
1855 {
1856 I2C_BOARD_INFO("ad7417", 0xb),
1857 .irq = IRQ_PG5,
1858 /*
1859 * platform_data pointer is borrwoed by the driver to
1860 * store custimer defined IRQ ALART level mode.
1861 * only IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW are valid.
1862 */
1863 .platform_data = (void *)IRQF_TRIGGER_LOW,
1864 },
1865#endif
1866
1527#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 1867#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1528 { 1868 {
1529 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 1869 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
@@ -1595,24 +1935,105 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1595 I2C_BOARD_INFO("adau1761", 0x38), 1935 I2C_BOARD_INFO("adau1761", 0x38),
1596 }, 1936 },
1597#endif 1937#endif
1938#if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE)
1939 {
1940 I2C_BOARD_INFO("adau1361", 0x38),
1941 },
1942#endif
1598#if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE) 1943#if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
1599 { 1944 {
1600 I2C_BOARD_INFO("ad5258", 0x18), 1945 I2C_BOARD_INFO("ad5258", 0x18),
1601 }, 1946 },
1602#endif 1947#endif
1948#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
1949 {
1950 I2C_BOARD_INFO("ssm2602", 0x1b),
1951 },
1952#endif
1953#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
1954 {
1955 I2C_BOARD_INFO("ad5398", 0xC),
1956 .platform_data = (void *)&ad5398_i2c_platform_data,
1957 },
1958#endif
1959#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
1960 {
1961 I2C_BOARD_INFO("adp8860", 0x2A),
1962 .platform_data = (void *)&adp8860_pdata,
1963 },
1964#endif
1603}; 1965};
1604 1966
1605#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 1967#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1968#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1969static struct resource bfin_sport0_uart_resources[] = {
1970 {
1971 .start = SPORT0_TCR1,
1972 .end = SPORT0_MRCS3+4,
1973 .flags = IORESOURCE_MEM,
1974 },
1975 {
1976 .start = IRQ_SPORT0_RX,
1977 .end = IRQ_SPORT0_RX+1,
1978 .flags = IORESOURCE_IRQ,
1979 },
1980 {
1981 .start = IRQ_SPORT0_ERROR,
1982 .end = IRQ_SPORT0_ERROR,
1983 .flags = IORESOURCE_IRQ,
1984 },
1985};
1986
1987unsigned short bfin_sport0_peripherals[] = {
1988 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
1989 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
1990};
1991
1606static struct platform_device bfin_sport0_uart_device = { 1992static struct platform_device bfin_sport0_uart_device = {
1607 .name = "bfin-sport-uart", 1993 .name = "bfin-sport-uart",
1608 .id = 0, 1994 .id = 0,
1995 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
1996 .resource = bfin_sport0_uart_resources,
1997 .dev = {
1998 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
1999 },
2000};
2001#endif
2002#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2003static struct resource bfin_sport1_uart_resources[] = {
2004 {
2005 .start = SPORT1_TCR1,
2006 .end = SPORT1_MRCS3+4,
2007 .flags = IORESOURCE_MEM,
2008 },
2009 {
2010 .start = IRQ_SPORT1_RX,
2011 .end = IRQ_SPORT1_RX+1,
2012 .flags = IORESOURCE_IRQ,
2013 },
2014 {
2015 .start = IRQ_SPORT1_ERROR,
2016 .end = IRQ_SPORT1_ERROR,
2017 .flags = IORESOURCE_IRQ,
2018 },
2019};
2020
2021unsigned short bfin_sport1_peripherals[] = {
2022 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
2023 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
1609}; 2024};
1610 2025
1611static struct platform_device bfin_sport1_uart_device = { 2026static struct platform_device bfin_sport1_uart_device = {
1612 .name = "bfin-sport-uart", 2027 .name = "bfin-sport-uart",
1613 .id = 1, 2028 .id = 1,
2029 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
2030 .resource = bfin_sport1_uart_resources,
2031 .dev = {
2032 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
2033 },
1614}; 2034};
1615#endif 2035#endif
2036#endif
1616 2037
1617#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 2038#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
1618#define CF_IDE_NAND_CARD_USE_HDD_INTERFACE 2039#define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
@@ -1701,13 +2122,121 @@ static struct platform_device bfin_dpmc = {
1701 }, 2122 },
1702}; 2123};
1703 2124
2125#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2126static struct platform_device bfin_i2s = {
2127 .name = "bfin-i2s",
2128 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2129 /* TODO: add platform data here */
2130};
2131#endif
2132
1704#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 2133#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1705static struct platform_device bfin_tdm = { 2134static struct platform_device bfin_tdm = {
1706 .name = "bfin-tdm", 2135 .name = "bfin-tdm",
2136 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1707 /* TODO: add platform data here */ 2137 /* TODO: add platform data here */
1708}; 2138};
1709#endif 2139#endif
1710 2140
2141#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2142static struct platform_device bfin_ac97 = {
2143 .name = "bfin-ac97",
2144 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2145 /* TODO: add platform data here */
2146};
2147#endif
2148
2149#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
2150#define REGULATOR_ADP122 "adp122"
2151#define REGULATOR_ADP150 "adp150"
2152
2153static struct regulator_consumer_supply adp122_consumers = {
2154 .supply = REGULATOR_ADP122,
2155};
2156
2157static struct regulator_consumer_supply adp150_consumers = {
2158 .supply = REGULATOR_ADP150,
2159};
2160
2161static struct regulator_init_data adp_switch_regulator_data[] = {
2162 {
2163 .constraints = {
2164 .name = REGULATOR_ADP122,
2165 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
2166 .min_uA = 0,
2167 .max_uA = 300000,
2168 },
2169 .num_consumer_supplies = 1, /* only 1 */
2170 .consumer_supplies = &adp122_consumers,
2171 .driver_data = (void *)GPIO_PF2, /* gpio port only */
2172 },
2173 {
2174 .constraints = {
2175 .name = REGULATOR_ADP150,
2176 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
2177 .min_uA = 0,
2178 .max_uA = 150000,
2179 },
2180 .num_consumer_supplies = 1, /* only 1 */
2181 .consumer_supplies = &adp150_consumers,
2182 .driver_data = (void *)GPIO_PF3, /* gpio port only */
2183 },
2184};
2185
2186static struct adp_switch_platform_data adp_switch_pdata = {
2187 .regulator_num = ARRAY_SIZE(adp_switch_regulator_data),
2188 .regulator_data = adp_switch_regulator_data,
2189};
2190
2191static struct platform_device adp_switch_device = {
2192 .name = "adp_switch",
2193 .id = 0,
2194 .dev = {
2195 .platform_data = &adp_switch_pdata,
2196 },
2197};
2198
2199#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2200 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2201static struct regulator_bulk_data adp122_bulk_data = {
2202 .supply = REGULATOR_ADP122,
2203};
2204
2205static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data = {
2206 .name = REGULATOR_ADP122,
2207 .num_supplies = 1,
2208 .supplies = &adp122_bulk_data,
2209};
2210
2211static struct platform_device adp122_userspace_consumer_device = {
2212 .name = "reg-userspace-consumer",
2213 .id = 0,
2214 .dev = {
2215 .platform_data = &adp122_userspace_comsumer_data,
2216 },
2217};
2218
2219static struct regulator_bulk_data adp150_bulk_data = {
2220 .supply = REGULATOR_ADP150,
2221};
2222
2223static struct regulator_userspace_consumer_data adp150_userspace_comsumer_data = {
2224 .name = REGULATOR_ADP150,
2225 .num_supplies = 1,
2226 .supplies = &adp150_bulk_data,
2227};
2228
2229static struct platform_device adp150_userspace_consumer_device = {
2230 .name = "reg-userspace-consumer",
2231 .id = 1,
2232 .dev = {
2233 .platform_data = &adp150_userspace_comsumer_data,
2234 },
2235};
2236#endif
2237#endif
2238
2239
1711static struct platform_device *stamp_devices[] __initdata = { 2240static struct platform_device *stamp_devices[] __initdata = {
1712 2241
1713 &bfin_dpmc, 2242 &bfin_dpmc,
@@ -1771,7 +2300,12 @@ static struct platform_device *stamp_devices[] __initdata = {
1771#endif 2300#endif
1772 2301
1773#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 2302#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1774 &bfin_uart_device, 2303#ifdef CONFIG_SERIAL_BFIN_UART0
2304 &bfin_uart0_device,
2305#endif
2306#ifdef CONFIG_SERIAL_BFIN_UART1
2307 &bfin_uart1_device,
2308#endif
1775#endif 2309#endif
1776 2310
1777#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 2311#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
@@ -1788,9 +2322,13 @@ static struct platform_device *stamp_devices[] __initdata = {
1788#endif 2322#endif
1789 2323
1790#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 2324#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
2325#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1791 &bfin_sport0_uart_device, 2326 &bfin_sport0_uart_device,
2327#endif
2328#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1792 &bfin_sport1_uart_device, 2329 &bfin_sport1_uart_device,
1793#endif 2330#endif
2331#endif
1794 2332
1795#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 2333#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
1796 &bfin_pata_device, 2334 &bfin_pata_device,
@@ -1808,18 +2346,46 @@ static struct platform_device *stamp_devices[] __initdata = {
1808 &stamp_flash_device, 2346 &stamp_flash_device,
1809#endif 2347#endif
1810 2348
2349#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2350 &bfin_i2s,
2351#endif
2352
1811#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) 2353#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1812 &bfin_tdm, 2354 &bfin_tdm,
1813#endif 2355#endif
2356
2357#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2358 &bfin_ac97,
2359#endif
2360#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2361#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2362 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2363 &ad5398_virt_consumer_device,
2364#endif
2365#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2366 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2367 &ad5398_userspace_consumer_device,
2368#endif
2369#endif
2370
2371#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
2372 &adp_switch_device,
2373#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2374 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2375 &adp122_userspace_consumer_device,
2376 &adp150_userspace_consumer_device,
2377#endif
2378#endif
1814}; 2379};
1815 2380
1816static int __init stamp_init(void) 2381static int __init stamp_init(void)
1817{ 2382{
1818 printk(KERN_INFO "%s(): registering device resources\n", __func__); 2383 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1819 i2c_register_board_info(0, bfin_i2c_board_info,
1820 ARRAY_SIZE(bfin_i2c_board_info));
1821 bfin_plat_nand_init(); 2384 bfin_plat_nand_init();
2385 adf702x_mac_init();
1822 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); 2386 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
2387 i2c_register_board_info(0, bfin_i2c_board_info,
2388 ARRAY_SIZE(bfin_i2c_board_info));
1823 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 2389 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
1824 2390
1825 return 0; 2391 return 0;
@@ -1827,6 +2393,34 @@ static int __init stamp_init(void)
1827 2393
1828arch_initcall(stamp_init); 2394arch_initcall(stamp_init);
1829 2395
2396
2397static struct platform_device *stamp_early_devices[] __initdata = {
2398#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
2399#ifdef CONFIG_SERIAL_BFIN_UART0
2400 &bfin_uart0_device,
2401#endif
2402#ifdef CONFIG_SERIAL_BFIN_UART1
2403 &bfin_uart1_device,
2404#endif
2405#endif
2406
2407#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2408#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2409 &bfin_sport0_uart_device,
2410#endif
2411#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2412 &bfin_sport1_uart_device,
2413#endif
2414#endif
2415};
2416
2417void __init native_machine_early_platform_add_devices(void)
2418{
2419 printk(KERN_INFO "register early platform devices\n");
2420 early_platform_add_devices(stamp_early_devices,
2421 ARRAY_SIZE(stamp_early_devices));
2422}
2423
1830void native_machine_restart(char *cmd) 2424void native_machine_restart(char *cmd)
1831{ 2425{
1832 /* workaround reboot hang when booting from SPI */ 2426 /* workaround reboot hang when booting from SPI */