blob: 328f002f76a02b9a51253f0762a030f455327c5a [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Copyright 2004-2009 Analog Devices Inc.
3 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
Bryan Wu1394f032007-05-06 14:50:22 -07005 *
Robin Getz96f10502009-09-24 14:11:24 +00006 * Licensed under the GPL-2 or later.
Bryan Wu1394f032007-05-06 14:50:22 -07007 */
8
9#include <linux/device.h>
Mike Frysingerfc689112008-06-25 11:41:42 +080010#include <linux/kernel.h>
Bryan Wu1394f032007-05-06 14:50:22 -070011#include <linux/platform_device.h>
Barry Song6e364752009-09-29 03:01:40 +000012#include <linux/io.h>
Bryan Wu1394f032007-05-06 14:50:22 -070013#include <linux/mtd/mtd.h>
Mike Frysingerfc689112008-06-25 11:41:42 +080014#include <linux/mtd/nand.h>
Bryan Wu1394f032007-05-06 14:50:22 -070015#include <linux/mtd/partitions.h>
Mike Frysingerfc689112008-06-25 11:41:42 +080016#include <linux/mtd/plat-ram.h>
Mike Frysingerde8c43f2008-01-24 17:14:04 +080017#include <linux/mtd/physmap.h>
Bryan Wu1394f032007-05-06 14:50:22 -070018#include <linux/spi/spi.h>
19#include <linux/spi/flash.h>
20#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
Mike Frysingerf02bcec2007-11-15 21:29:15 +080021#include <linux/usb/isp1362.h>
Bryan Wu1394f032007-05-06 14:50:22 -070022#endif
Sonic Zhang7a9cc482009-12-22 04:47:04 +000023#include <linux/i2c.h>
24#include <linux/i2c/adp5588.h>
Mike Frysinger0531c462010-01-19 07:04:29 +000025#include <linux/etherdevice.h>
Jeff Garzik0a87e3e2008-02-01 18:02:30 -050026#include <linux/ata_platform.h>
Bryan Wu1394f032007-05-06 14:50:22 -070027#include <linux/irq.h>
28#include <linux/interrupt.h>
David Brownell27f5d752007-10-04 18:06:16 -070029#include <linux/usb/sl811.h>
Yi Lif79ea4c2009-01-07 23:14:38 +080030#include <linux/spi/mmc_spi.h>
Michael Hennerich78756c62009-10-13 15:28:33 +000031#include <linux/leds.h>
32#include <linux/input.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080033#include <asm/dma.h>
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080034#include <asm/bfin5xx_spi.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080035#include <asm/reboot.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080036#include <asm/portmux.h>
Michael Hennerich14b03202008-05-07 11:41:26 +080037#include <asm/dpmc.h>
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +000038#ifdef CONFIG_REGULATOR_ADP_SWITCH
39#include <linux/regulator/adp_switch.h>
40#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +000041#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>
Bryan Wu1394f032007-05-06 14:50:22 -070046
47/*
48 * Name the Board for the /proc/cpuinfo
49 */
Mike Frysingerfe85cad2008-11-18 17:48:22 +080050const char bfin_board_name[] = "ADI BF537-STAMP";
Bryan Wu1394f032007-05-06 14:50:22 -070051
52/*
53 * Driver needs to know address, irq and flag pin.
54 */
55
Bryan Wu1394f032007-05-06 14:50:22 -070056#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
Michael Hennerich3f375692008-11-18 17:48:22 +080057#include <linux/usb/isp1760.h>
58static struct resource bfin_isp1760_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -070059 [0] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080060 .start = 0x203C0000,
61 .end = 0x203C0000 + 0x000fffff,
Bryan Wu1394f032007-05-06 14:50:22 -070062 .flags = IORESOURCE_MEM,
63 },
64 [1] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080065 .start = IRQ_PF7,
66 .end = IRQ_PF7,
Michael Hennerich6a6be3d2009-01-07 23:14:39 +080067 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Bryan Wu1394f032007-05-06 14:50:22 -070068 },
69};
70
Michael Hennerich3f375692008-11-18 17:48:22 +080071static struct isp1760_platform_data isp1760_priv = {
72 .is_isp1761 = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080073 .bus_width_16 = 1,
74 .port1_otg = 0,
75 .analog_oc = 0,
76 .dack_polarity_high = 0,
77 .dreq_polarity_high = 0,
78};
79
80static struct platform_device bfin_isp1760_device = {
Michael Hennerichc6feb762009-10-15 10:37:33 +000081 .name = "isp1760",
Bryan Wu1394f032007-05-06 14:50:22 -070082 .id = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080083 .dev = {
84 .platform_data = &isp1760_priv,
85 },
86 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
87 .resource = bfin_isp1760_resources,
Bryan Wu1394f032007-05-06 14:50:22 -070088};
Bryan Wu1394f032007-05-06 14:50:22 -070089#endif
90
Michael Hennerich2463ef22008-01-27 16:49:48 +080091#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
Michael Hennerich2463ef22008-01-27 16:49:48 +080092#include <linux/gpio_keys.h>
93
94static struct gpio_keys_button bfin_gpio_keys_table[] = {
95 {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
96 {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
97 {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
98 {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
99};
100
101static struct gpio_keys_platform_data bfin_gpio_keys_data = {
102 .buttons = bfin_gpio_keys_table,
103 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
104};
105
106static struct platform_device bfin_device_gpiokeys = {
107 .name = "gpio-keys",
108 .dev = {
109 .platform_data = &bfin_gpio_keys_data,
110 },
111};
112#endif
113
Bryan Wu1394f032007-05-06 14:50:22 -0700114#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
115static struct resource bfin_pcmcia_cf_resources[] = {
116 {
117 .start = 0x20310000, /* IO PORT */
118 .end = 0x20312000,
119 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800120 }, {
Simon Arlottd2d50aa2007-06-11 15:31:30 +0800121 .start = 0x20311000, /* Attribute Memory */
Bryan Wu1394f032007-05-06 14:50:22 -0700122 .end = 0x20311FFF,
123 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800124 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700125 .start = IRQ_PF4,
126 .end = IRQ_PF4,
127 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800128 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700129 .start = 6, /* Card Detect PF6 */
130 .end = 6,
131 .flags = IORESOURCE_IRQ,
132 },
133};
134
135static struct platform_device bfin_pcmcia_cf_device = {
136 .name = "bfin_cf_pcmcia",
137 .id = -1,
138 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
139 .resource = bfin_pcmcia_cf_resources,
140};
141#endif
142
143#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
144static struct platform_device rtc_device = {
145 .name = "rtc-bfin",
146 .id = -1,
147};
148#endif
149
150#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Michael Hennerich61f09b52009-07-24 08:48:31 +0000151#include <linux/smc91x.h>
152
153static struct smc91x_platdata smc91x_info = {
154 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
155 .leda = RPC_LED_100_10,
156 .ledb = RPC_LED_TX_RX,
157};
158
Bryan Wu1394f032007-05-06 14:50:22 -0700159static struct resource smc91x_resources[] = {
160 {
161 .name = "smc91x-regs",
162 .start = 0x20300300,
163 .end = 0x20300300 + 16,
164 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800165 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700166
167 .start = IRQ_PF7,
168 .end = IRQ_PF7,
169 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
170 },
171};
172static struct platform_device smc91x_device = {
173 .name = "smc91x",
174 .id = 0,
175 .num_resources = ARRAY_SIZE(smc91x_resources),
176 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +0000177 .dev = {
178 .platform_data = &smc91x_info,
179 },
Bryan Wu1394f032007-05-06 14:50:22 -0700180};
181#endif
182
Alex Landauf40d24d2007-07-12 12:11:48 +0800183#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
184static struct resource dm9000_resources[] = {
185 [0] = {
186 .start = 0x203FB800,
Barry Songb3dec4a2009-07-27 06:42:50 +0000187 .end = 0x203FB800 + 1,
Alex Landauf40d24d2007-07-12 12:11:48 +0800188 .flags = IORESOURCE_MEM,
189 },
190 [1] = {
Barry Songb3dec4a2009-07-27 06:42:50 +0000191 .start = 0x203FB804,
192 .end = 0x203FB804 + 1,
193 .flags = IORESOURCE_MEM,
194 },
195 [2] = {
Alex Landauf40d24d2007-07-12 12:11:48 +0800196 .start = IRQ_PF9,
197 .end = IRQ_PF9,
198 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
199 },
200};
201
202static struct platform_device dm9000_device = {
203 .name = "dm9000",
204 .id = -1,
205 .num_resources = ARRAY_SIZE(dm9000_resources),
206 .resource = dm9000_resources,
207};
208#endif
209
Bryan Wu1394f032007-05-06 14:50:22 -0700210#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
211static struct resource sl811_hcd_resources[] = {
212 {
213 .start = 0x20340000,
214 .end = 0x20340000,
215 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800216 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700217 .start = 0x20340004,
218 .end = 0x20340004,
219 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800220 }, {
Mike Frysinger01218652009-12-21 15:07:43 +0000221 .start = IRQ_PF4,
222 .end = IRQ_PF4,
Bryan Wu1394f032007-05-06 14:50:22 -0700223 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
224 },
225};
226
227#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
228void sl811_port_power(struct device *dev, int is_on)
229{
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800230 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
Michael Hennerichacbcd262008-01-22 18:36:20 +0800231 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
Bryan Wu1394f032007-05-06 14:50:22 -0700232}
233#endif
234
235static struct sl811_platform_data sl811_priv = {
236 .potpg = 10,
237 .power = 250, /* == 500mA */
238#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
239 .port_power = &sl811_port_power,
240#endif
241};
242
243static struct platform_device sl811_hcd_device = {
244 .name = "sl811-hcd",
245 .id = 0,
246 .dev = {
247 .platform_data = &sl811_priv,
248 },
249 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
250 .resource = sl811_hcd_resources,
251};
252#endif
253
254#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
255static struct resource isp1362_hcd_resources[] = {
256 {
257 .start = 0x20360000,
258 .end = 0x20360000,
259 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800260 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700261 .start = 0x20360004,
262 .end = 0x20360004,
263 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800264 }, {
Mike Frysinger21b03cf2009-09-24 05:44:36 +0000265 .start = IRQ_PF3,
266 .end = IRQ_PF3,
Michael Hennerich9e758942010-03-18 12:51:49 +0000267 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
Bryan Wu1394f032007-05-06 14:50:22 -0700268 },
269};
270
271static struct isp1362_platform_data isp1362_priv = {
272 .sel15Kres = 1,
273 .clknotstop = 0,
274 .oc_enable = 0,
275 .int_act_high = 0,
276 .int_edge_triggered = 0,
277 .remote_wakeup_connected = 0,
278 .no_power_switching = 1,
279 .power_switching_mode = 0,
280};
281
282static struct platform_device isp1362_hcd_device = {
283 .name = "isp1362-hcd",
284 .id = 0,
285 .dev = {
286 .platform_data = &isp1362_priv,
287 },
288 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
289 .resource = isp1362_hcd_resources,
290};
291#endif
292
Barry Song706a01b2009-11-02 07:29:07 +0000293#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
294unsigned short bfin_can_peripherals[] = {
295 P_CAN0_RX, P_CAN0_TX, 0
296};
297
298static struct resource bfin_can_resources[] = {
299 {
300 .start = 0xFFC02A00,
301 .end = 0xFFC02FFF,
302 .flags = IORESOURCE_MEM,
303 },
304 {
305 .start = IRQ_CAN_RX,
306 .end = IRQ_CAN_RX,
307 .flags = IORESOURCE_IRQ,
308 },
309 {
310 .start = IRQ_CAN_TX,
311 .end = IRQ_CAN_TX,
312 .flags = IORESOURCE_IRQ,
313 },
314 {
315 .start = IRQ_CAN_ERROR,
316 .end = IRQ_CAN_ERROR,
317 .flags = IORESOURCE_IRQ,
318 },
319};
320
321static struct platform_device bfin_can_device = {
322 .name = "bfin_can",
323 .num_resources = ARRAY_SIZE(bfin_can_resources),
324 .resource = bfin_can_resources,
325 .dev = {
326 .platform_data = &bfin_can_peripherals, /* Passed to driver */
327 },
328};
329#endif
330
Bryan Wu1394f032007-05-06 14:50:22 -0700331#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800332static struct platform_device bfin_mii_bus = {
333 .name = "bfin_mii_bus",
334};
335
Bryan Wu1394f032007-05-06 14:50:22 -0700336static struct platform_device bfin_mac_device = {
337 .name = "bfin_mac",
Graf Yang65319622009-02-04 16:49:45 +0800338 .dev.platform_data = &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700339};
340#endif
341
342#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
343static struct resource net2272_bfin_resources[] = {
344 {
345 .start = 0x20300000,
346 .end = 0x20300000 + 0x100,
347 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800348 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700349 .start = IRQ_PF7,
350 .end = IRQ_PF7,
351 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
352 },
353};
354
355static struct platform_device net2272_bfin_device = {
356 .name = "net2272",
357 .id = -1,
358 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
359 .resource = net2272_bfin_resources,
360};
361#endif
362
Mike Frysingerfc689112008-06-25 11:41:42 +0800363#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
364#ifdef CONFIG_MTD_PARTITIONS
365const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
366
367static struct mtd_partition bfin_plat_nand_partitions[] = {
368 {
Robin Getzaa582972008-08-05 17:47:29 +0800369 .name = "linux kernel(nand)",
Mike Frysingerfc689112008-06-25 11:41:42 +0800370 .size = 0x400000,
371 .offset = 0,
372 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800373 .name = "file system(nand)",
Mike Frysingerfc689112008-06-25 11:41:42 +0800374 .size = MTDPART_SIZ_FULL,
375 .offset = MTDPART_OFS_APPEND,
376 },
377};
378#endif
379
380#define BFIN_NAND_PLAT_CLE 2
381#define BFIN_NAND_PLAT_ALE 1
382static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
383{
384 struct nand_chip *this = mtd->priv;
385
386 if (cmd == NAND_CMD_NONE)
387 return;
388
389 if (ctrl & NAND_CLE)
390 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
391 else
392 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
393}
394
395#define BFIN_NAND_PLAT_READY GPIO_PF3
396static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
397{
398 return gpio_get_value(BFIN_NAND_PLAT_READY);
399}
400
401static struct platform_nand_data bfin_plat_nand_data = {
402 .chip = {
Marek Vasutef566092010-08-12 03:53:54 +0100403 .nr_chips = 1,
Mike Frysingerfc689112008-06-25 11:41:42 +0800404 .chip_delay = 30,
405#ifdef CONFIG_MTD_PARTITIONS
406 .part_probe_types = part_probes,
407 .partitions = bfin_plat_nand_partitions,
408 .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
409#endif
410 },
411 .ctrl = {
412 .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
413 .dev_ready = bfin_plat_nand_dev_ready,
414 },
415};
416
417#define MAX(x, y) (x > y ? x : y)
418static struct resource bfin_plat_nand_resources = {
419 .start = 0x20212000,
420 .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
Mike Frysinger67d99632010-03-16 14:28:44 +0000421 .flags = IORESOURCE_MEM,
Mike Frysingerfc689112008-06-25 11:41:42 +0800422};
423
424static struct platform_device bfin_async_nand_device = {
425 .name = "gen_nand",
426 .id = -1,
427 .num_resources = 1,
428 .resource = &bfin_plat_nand_resources,
429 .dev = {
430 .platform_data = &bfin_plat_nand_data,
431 },
432};
433
434static void bfin_plat_nand_init(void)
435{
436 gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
437}
438#else
439static void bfin_plat_nand_init(void) {}
440#endif
441
Mike Frysinger793dc272008-03-26 08:09:12 +0800442#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800443static struct mtd_partition stamp_partitions[] = {
444 {
Robin Getzaa582972008-08-05 17:47:29 +0800445 .name = "bootloader(nor)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800446 .size = 0x40000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800447 .offset = 0,
448 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800449 .name = "linux kernel(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800450 .size = 0x180000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800451 .offset = MTDPART_OFS_APPEND,
452 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800453 .name = "file system(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800454 .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800455 .offset = MTDPART_OFS_APPEND,
456 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800457 .name = "MAC Address(nor)",
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800458 .size = MTDPART_SIZ_FULL,
459 .offset = 0x3F0000,
460 .mask_flags = MTD_WRITEABLE,
461 }
462};
463
464static struct physmap_flash_data stamp_flash_data = {
465 .width = 2,
466 .parts = stamp_partitions,
467 .nr_parts = ARRAY_SIZE(stamp_partitions),
Barry Song38e76732010-01-15 03:24:39 +0000468#ifdef CONFIG_ROMKERNEL
469 .probe_type = "map_rom",
470#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800471};
472
473static struct resource stamp_flash_resource = {
474 .start = 0x20000000,
475 .end = 0x203fffff,
476 .flags = IORESOURCE_MEM,
477};
478
479static struct platform_device stamp_flash_device = {
480 .name = "physmap-flash",
481 .id = 0,
482 .dev = {
483 .platform_data = &stamp_flash_data,
484 },
485 .num_resources = 1,
486 .resource = &stamp_flash_resource,
487};
Mike Frysinger793dc272008-03-26 08:09:12 +0800488#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800489
Bryan Wu1394f032007-05-06 14:50:22 -0700490#if defined(CONFIG_MTD_M25P80) \
491 || defined(CONFIG_MTD_M25P80_MODULE)
492static struct mtd_partition bfin_spi_flash_partitions[] = {
493 {
Robin Getzaa582972008-08-05 17:47:29 +0800494 .name = "bootloader(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800495 .size = 0x00040000,
Bryan Wu1394f032007-05-06 14:50:22 -0700496 .offset = 0,
497 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800498 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800499 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800500 .size = 0x180000,
Mike Frysingeredf05642008-02-25 11:38:11 +0800501 .offset = MTDPART_OFS_APPEND,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800502 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800503 .name = "file system(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800504 .size = MTDPART_SIZ_FULL,
505 .offset = MTDPART_OFS_APPEND,
Bryan Wu1394f032007-05-06 14:50:22 -0700506 }
507};
508
509static struct flash_platform_data bfin_spi_flash_data = {
510 .name = "m25p80",
511 .parts = bfin_spi_flash_partitions,
512 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
Michael Hennerich88a80782008-11-18 17:48:22 +0800513 /* .type = "m25p64", */
Bryan Wu1394f032007-05-06 14:50:22 -0700514};
515
516/* SPI flash chip (m25p64) */
517static struct bfin5xx_spi_chip spi_flash_chip_info = {
518 .enable_dma = 0, /* use dma transfer with this chip*/
519 .bits_per_word = 8,
520};
521#endif
522
Mike Frysingera261eec2009-05-20 14:05:36 +0000523#if defined(CONFIG_BFIN_SPI_ADC) \
524 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700525/* SPI ADC chip */
526static struct bfin5xx_spi_chip spi_adc_chip_info = {
527 .enable_dma = 1, /* use dma transfer with this chip*/
528 .bits_per_word = 16,
529};
530#endif
531
Barry Songd40bd712010-02-22 10:31:06 +0000532#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
533 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700534static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
535 .enable_dma = 0,
536 .bits_per_word = 16,
537};
538#endif
539
Barry Song3b827902010-01-27 09:01:36 +0000540#if defined(CONFIG_SND_BF5XX_SOC_AD193X) \
541 || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +0000542static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
543 .enable_dma = 0,
544 .bits_per_word = 8,
Barry Songd4b834c2009-06-04 10:14:17 +0000545};
546#endif
547
Yi Lia65912c2010-04-06 05:53:16 +0000548#if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) \
549 || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
550static struct bfin5xx_spi_chip adav801_spi_chip_info = {
551 .enable_dma = 0,
552 .bits_per_word = 8,
553};
554#endif
555
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000556#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000557#include <linux/input/ad714x.h>
558static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
559 .enable_dma = 0,
560 .bits_per_word = 16,
561};
562
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000563static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000564 {
565 .start_stage = 0,
566 .end_stage = 7,
567 .max_coord = 128,
568 },
569};
570
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000571static struct ad714x_button_plat ad7147_spi_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000572 {
573 .keycode = BTN_FORWARD,
574 .l_mask = 0,
575 .h_mask = 0x600,
576 },
577 {
578 .keycode = BTN_LEFT,
579 .l_mask = 0,
580 .h_mask = 0x500,
581 },
582 {
583 .keycode = BTN_MIDDLE,
584 .l_mask = 0,
585 .h_mask = 0x800,
586 },
587 {
588 .keycode = BTN_RIGHT,
589 .l_mask = 0x100,
590 .h_mask = 0x400,
591 },
592 {
593 .keycode = BTN_BACK,
594 .l_mask = 0x200,
595 .h_mask = 0x400,
596 },
597};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000598static struct ad714x_platform_data ad7147_spi_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000599 .slider_num = 1,
600 .button_num = 5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000601 .slider = ad7147_spi_slider_plat,
602 .button = ad7147_spi_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000603 .stage_cfg_reg = {
604 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
605 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
606 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
607 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
608 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
609 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
610 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
611 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
612 {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
613 {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
614 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
615 {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
616 },
617 .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
618};
619#endif
620
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000621#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000622#include <linux/input/ad714x.h>
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000623static struct ad714x_button_plat ad7142_i2c_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000624 {
625 .keycode = BTN_1,
626 .l_mask = 0,
627 .h_mask = 0x1,
628 },
629 {
630 .keycode = BTN_2,
631 .l_mask = 0,
632 .h_mask = 0x2,
633 },
634 {
635 .keycode = BTN_3,
636 .l_mask = 0,
637 .h_mask = 0x4,
638 },
639 {
640 .keycode = BTN_4,
641 .l_mask = 0x0,
642 .h_mask = 0x8,
643 },
644};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000645static struct ad714x_platform_data ad7142_i2c_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000646 .button_num = 4,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000647 .button = ad7142_i2c_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000648 .stage_cfg_reg = {
649 /* fixme: figure out right setting for all comoponent according
650 * to hardware feature of EVAL-AD7142EB board */
651 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
652 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
653 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
654 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
655 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
656 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
657 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
658 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
659 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
660 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
661 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
662 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
663 },
664 .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
665};
666#endif
667
Graf Yangf5f95312010-02-10 07:15:59 +0000668#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
669static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {
670 .enable_dma = 0,
671 .bits_per_word = 16,
672};
673#endif
674
Graf Yangdf6a9492010-02-21 10:23:07 +0000675#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
676unsigned short ad2s120x_platform_data[] = {
677 /* used as SAMPLE and RDVEL */
678 GPIO_PF5, GPIO_PF6, 0
679};
680
681static struct bfin5xx_spi_chip ad2s120x_spi_chip_info = {
682 .enable_dma = 0,
683 .bits_per_word = 16,
684};
685#endif
686
Graf Yang848c51c2010-02-26 11:49:52 +0000687#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
688unsigned short ad2s1210_platform_data[] = {
689 /* use as SAMPLE, A0, A1 */
690 GPIO_PF7, GPIO_PF8, GPIO_PF9,
691# if defined(CONFIG_AD2S1210_GPIO_INPUT) || defined(CONFIG_AD2S1210_GPIO_OUTPUT)
692 /* the RES0 and RES1 pins */
693 GPIO_PF4, GPIO_PF5,
694# endif
695 0,
696};
697
698static struct bfin5xx_spi_chip ad2s1210_spi_chip_info = {
699 .enable_dma = 0,
700 .bits_per_word = 8,
701};
702#endif
703
Michael Hennerich0891bae2010-03-08 11:58:53 +0000704#if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE)
705static struct bfin5xx_spi_chip ad7314_spi_chip_info = {
706 .enable_dma = 0,
707 .bits_per_word = 16,
708};
709#endif
710
711#if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE)
712static unsigned short ad7816_platform_data[] = {
713 GPIO_PF4, /* rdwr_pin */
714 GPIO_PF5, /* convert_pin */
715 GPIO_PF7, /* busy_pin */
716 0,
717};
718
719static struct bfin5xx_spi_chip ad7816_spi_chip_info = {
720 .enable_dma = 0,
721 .bits_per_word = 8,
722};
723#endif
724
725#if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE)
726static unsigned long adt7310_platform_data[3] = {
727/* INT bound temperature alarm event. line 1 */
728 IRQ_PG4, IRQF_TRIGGER_LOW,
729/* CT bound temperature alarm event irq_flags. line 0 */
730 IRQF_TRIGGER_LOW,
731};
732
733static struct bfin5xx_spi_chip adt7310_spi_chip_info = {
734 .enable_dma = 0,
735 .bits_per_word = 8,
736};
737#endif
738
739#if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE)
740static unsigned short ad7298_platform_data[] = {
741 GPIO_PF7, /* busy_pin */
742 0,
743};
744
745static struct bfin5xx_spi_chip ad7298_spi_chip_info = {
746 .enable_dma = 0,
747 .bits_per_word = 16,
748};
749#endif
750
751#if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE)
752static unsigned long adt7316_spi_data[2] = {
753 IRQF_TRIGGER_LOW, /* interrupt flags */
754 GPIO_PF7, /* ldac_pin, 0 means DAC/LDAC registers control DAC update */
755};
756
757static struct bfin5xx_spi_chip adt7316_spi_chip_info = {
758 .enable_dma = 0,
759 .bits_per_word = 8,
760};
761#endif
762
Yi Lif79ea4c2009-01-07 23:14:38 +0800763#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
764#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
765
766static int bfin_mmc_spi_init(struct device *dev,
767 irqreturn_t (*detect_int)(int, void *), void *data)
768{
769 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
770 IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
771}
772
773static void bfin_mmc_spi_exit(struct device *dev, void *data)
774{
775 free_irq(MMC_SPI_CARD_DETECT_INT, data);
776}
777
778static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
779 .init = bfin_mmc_spi_init,
780 .exit = bfin_mmc_spi_exit,
781 .detect_delay = 100, /* msecs */
782};
783
784static struct bfin5xx_spi_chip mmc_spi_chip_info = {
785 .enable_dma = 0,
786 .bits_per_word = 8,
Yi Lie68d1eb2009-06-03 09:46:22 +0000787 .pio_interrupt = 0,
Yi Lif79ea4c2009-01-07 23:14:38 +0800788};
789#endif
790
Bryan Wu1394f032007-05-06 14:50:22 -0700791#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800792#include <linux/spi/ad7877.h>
Bryan Wu1394f032007-05-06 14:50:22 -0700793static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700794 .enable_dma = 0,
795 .bits_per_word = 16,
796};
797
798static const struct ad7877_platform_data bfin_ad7877_ts_info = {
799 .model = 7877,
800 .vref_delay_usecs = 50, /* internal, no capacitor */
801 .x_plate_ohms = 419,
802 .y_plate_ohms = 486,
803 .pressure_max = 1000,
804 .pressure_min = 0,
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000805 .stopacq_polarity = 1,
806 .first_conversion_delay = 3,
807 .acquisition_time = 1,
808 .averaging = 1,
809 .pen_down_acc_interval = 1,
Bryan Wu1394f032007-05-06 14:50:22 -0700810};
811#endif
812
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800813#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
814#include <linux/spi/ad7879.h>
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800815static const struct ad7879_platform_data bfin_ad7879_ts_info = {
816 .model = 7879, /* Model = AD7879 */
817 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
818 .pressure_max = 10000,
819 .pressure_min = 0,
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000820 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
821 .acquisition_time = 1, /* 4us acquisition time per sample */
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800822 .median = 2, /* do 8 measurements */
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000823 .averaging = 1, /* take the average of 4 middle samples */
824 .pen_down_acc_interval = 255, /* 9.4 ms */
Michael Hennerich244d3422009-12-18 09:29:39 +0000825 .gpio_export = 1, /* Export GPIO to gpiolib */
826 .gpio_base = -1, /* Dynamic allocation */
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800827};
828#endif
829
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000830#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000831#include <linux/input/adxl34x.h>
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000832static const struct adxl34x_platform_data adxl34x_info = {
833 .x_axis_offset = 0,
834 .y_axis_offset = 0,
835 .z_axis_offset = 0,
836 .tap_threshold = 0x31,
837 .tap_duration = 0x10,
838 .tap_latency = 0x60,
839 .tap_window = 0xF0,
840 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
841 .act_axis_control = 0xFF,
842 .activity_threshold = 5,
843 .inactivity_threshold = 3,
844 .inactivity_time = 4,
845 .free_fall_threshold = 0x7,
846 .free_fall_time = 0x20,
847 .data_rate = 0x8,
848 .data_range = ADXL_FULL_RES,
849
850 .ev_type = EV_ABS,
851 .ev_code_x = ABS_X, /* EV_REL */
852 .ev_code_y = ABS_Y, /* EV_REL */
853 .ev_code_z = ABS_Z, /* EV_REL */
854
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000855 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000856
857/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
858/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
859 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
860 .fifo_mode = ADXL_FIFO_STREAM,
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000861 .orientation_enable = ADXL_EN_ORIENTATION_3D,
862 .deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,
863 .divisor_length = ADXL_LP_FILTER_DIVISOR_16,
864 /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
865 .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000866};
867#endif
868
Michael Hennerichf5150152008-10-16 23:23:18 +0800869#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
870static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
871 .enable_dma = 0,
872 .bits_per_word = 16,
873};
874#endif
875
Michael Hennerich6e668932008-02-09 01:54:09 +0800876#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
877static struct bfin5xx_spi_chip spidev_chip_info = {
878 .enable_dma = 0,
879 .bits_per_word = 8,
880};
881#endif
882
Michael Hennerich2043f3f2008-10-13 14:46:30 +0800883#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
884static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
885 .enable_dma = 0,
886 .bits_per_word = 8,
887};
888#endif
889
Michael Hennerich85a192e2009-01-07 23:14:38 +0800890#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
891static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
892 .enable_dma = 1,
893 .bits_per_word = 8,
Michael Hennerich85a192e2009-01-07 23:14:38 +0800894};
895#endif
896
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000897#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
898static struct bfin5xx_spi_chip adf7021_spi_chip_info = {
899 .bits_per_word = 16,
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000900};
901
902#include <linux/spi/adf702x.h>
903#define TXREG 0x0160A470
904static const u32 adf7021_regs[] = {
905 0x09608FA0,
906 0x00575011,
907 0x00A7F092,
908 0x2B141563,
909 0x81F29E94,
910 0x00003155,
911 0x050A4F66,
912 0x00000007,
913 0x00000008,
914 0x000231E9,
915 0x3296354A,
916 0x891A2B3B,
917 0x00000D9C,
918 0x0000000D,
919 0x0000000E,
920 0x0000000F,
921};
922
923static struct adf702x_platform_data adf7021_platform_data = {
924 .regs_base = (void *)SPORT1_TCR1,
925 .dma_ch_rx = CH_SPORT1_RX,
926 .dma_ch_tx = CH_SPORT1_TX,
927 .irq_sport_err = IRQ_SPORT1_ERROR,
928 .gpio_int_rfs = GPIO_PF8,
929 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_RFS, P_SPORT1_DRPRI,
930 P_SPORT1_RSCLK, P_SPORT1_TSCLK, 0},
931 .adf702x_model = MODEL_ADF7021,
932 .adf702x_regs = adf7021_regs,
933 .tx_reg = TXREG,
934};
Mike Frysinger0531c462010-01-19 07:04:29 +0000935static inline void adf702x_mac_init(void)
936{
937 random_ether_addr(adf7021_platform_data.mac_addr);
938}
939#else
940static inline void adf702x_mac_init(void) {}
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000941#endif
942
Michael Hennerichfe5b25c2010-02-04 14:41:39 +0000943#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
944#include <linux/spi/ads7846.h>
945static struct bfin5xx_spi_chip ad7873_spi_chip_info = {
946 .bits_per_word = 8,
947};
948
949static int ads7873_get_pendown_state(void)
950{
951 return gpio_get_value(GPIO_PF6);
952}
953
954static struct ads7846_platform_data __initdata ad7873_pdata = {
955 .model = 7873, /* AD7873 */
956 .x_max = 0xfff,
957 .y_max = 0xfff,
958 .x_plate_ohms = 620,
959 .debounce_max = 1,
960 .debounce_rep = 0,
961 .debounce_tol = (~0),
962 .get_pendown_state = ads7873_get_pendown_state,
963};
964#endif
965
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800966#if defined(CONFIG_MTD_DATAFLASH) \
967 || defined(CONFIG_MTD_DATAFLASH_MODULE)
Michael Hennerichceac2652008-08-25 17:39:11 +0800968
969static struct mtd_partition bfin_spi_dataflash_partitions[] = {
970 {
971 .name = "bootloader(spi)",
972 .size = 0x00040000,
973 .offset = 0,
974 .mask_flags = MTD_CAP_ROM
975 }, {
976 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800977 .size = 0x180000,
Michael Hennerichceac2652008-08-25 17:39:11 +0800978 .offset = MTDPART_OFS_APPEND,
979 }, {
980 .name = "file system(spi)",
981 .size = MTDPART_SIZ_FULL,
982 .offset = MTDPART_OFS_APPEND,
983 }
984};
985
986static struct flash_platform_data bfin_spi_dataflash_data = {
987 .name = "SPI Dataflash",
988 .parts = bfin_spi_dataflash_partitions,
989 .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
990};
991
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800992/* DataFlash chip */
993static struct bfin5xx_spi_chip data_flash_chip_info = {
994 .enable_dma = 0, /* use dma transfer with this chip*/
995 .bits_per_word = 8,
996};
997#endif
998
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000999#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1000static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
1001 .enable_dma = 0, /* use dma transfer with this chip*/
1002 .bits_per_word = 8,
1003};
1004#endif
1005
Michael Hennerich0891bae2010-03-08 11:58:53 +00001006#if defined(CONFIG_AD7476) || defined(CONFIG_AD7476_MODULE)
1007static struct bfin5xx_spi_chip spi_ad7476_chip_info = {
1008 .enable_dma = 0, /* use dma transfer with this chip*/
1009 .bits_per_word = 8,
1010};
1011#endif
1012
Bryan Wu1394f032007-05-06 14:50:22 -07001013static struct spi_board_info bfin_spi_board_info[] __initdata = {
1014#if defined(CONFIG_MTD_M25P80) \
1015 || defined(CONFIG_MTD_M25P80_MODULE)
1016 {
1017 /* the modalias must be the same as spi device driver name */
1018 .modalias = "m25p80", /* Name of spi_driver for this device */
1019 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001020 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -07001021 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
1022 .platform_data = &bfin_spi_flash_data,
1023 .controller_data = &spi_flash_chip_info,
1024 .mode = SPI_MODE_3,
1025 },
1026#endif
Michael Hennerich8e9d5c72008-04-24 08:46:19 +08001027#if defined(CONFIG_MTD_DATAFLASH) \
1028 || defined(CONFIG_MTD_DATAFLASH_MODULE)
1029 { /* DataFlash chip */
1030 .modalias = "mtd_dataflash",
Michael Hennerichceac2652008-08-25 17:39:11 +08001031 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
Michael Hennerich8e9d5c72008-04-24 08:46:19 +08001032 .bus_num = 0, /* Framework bus number */
1033 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
Michael Hennerichceac2652008-08-25 17:39:11 +08001034 .platform_data = &bfin_spi_dataflash_data,
Michael Hennerich8e9d5c72008-04-24 08:46:19 +08001035 .controller_data = &data_flash_chip_info,
1036 .mode = SPI_MODE_3,
1037 },
1038#endif
Mike Frysingera261eec2009-05-20 14:05:36 +00001039#if defined(CONFIG_BFIN_SPI_ADC) \
1040 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -07001041 {
1042 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
1043 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001044 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -07001045 .chip_select = 1, /* Framework chip select. */
1046 .platform_data = NULL, /* No spi_driver specific config */
1047 .controller_data = &spi_adc_chip_info,
1048 },
1049#endif
1050
Barry Songd40bd712010-02-22 10:31:06 +00001051#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
1052 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -07001053 {
Barry Songd40bd712010-02-22 10:31:06 +00001054 .modalias = "ad183x",
Bryan Wu1394f032007-05-06 14:50:22 -07001055 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001056 .bus_num = 0,
Barry Song7ba80062010-01-28 09:37:21 +00001057 .chip_select = 4,
Barry Songd40bd712010-02-22 10:31:06 +00001058 .platform_data = "ad1836", /* only includes chip name for the moment */
Bryan Wu1394f032007-05-06 14:50:22 -07001059 .controller_data = &ad1836_spi_chip_info,
Barry Song83124402009-08-06 21:03:02 +00001060 .mode = SPI_MODE_3,
Bryan Wu1394f032007-05-06 14:50:22 -07001061 },
1062#endif
Barry Songd4b834c2009-06-04 10:14:17 +00001063
Barry Song3b827902010-01-27 09:01:36 +00001064#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +00001065 {
Barry Song3b827902010-01-27 09:01:36 +00001066 .modalias = "ad193x",
Barry Songd4b834c2009-06-04 10:14:17 +00001067 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1068 .bus_num = 0,
Barry Song08a54bf2009-09-18 09:14:38 +00001069 .chip_select = 5,
Barry Songd4b834c2009-06-04 10:14:17 +00001070 .controller_data = &ad1938_spi_chip_info,
1071 .mode = SPI_MODE_3,
1072 },
1073#endif
1074
Yi Lia65912c2010-04-06 05:53:16 +00001075#if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
1076 {
1077 .modalias = "adav80x",
1078 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1079 .bus_num = 0,
1080 .chip_select = 1,
1081 .controller_data = &adav801_spi_chip_info,
1082 .mode = SPI_MODE_3,
1083 },
1084#endif
1085
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001086#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +00001087 {
1088 .modalias = "ad714x_captouch",
1089 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1090 .irq = IRQ_PF4,
1091 .bus_num = 0,
1092 .chip_select = 5,
1093 .mode = SPI_MODE_3,
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001094 .platform_data = &ad7147_spi_platform_data,
Barry Song427f2772009-07-17 07:04:55 +00001095 .controller_data = &ad7147_spi_chip_info,
1096 },
1097#endif
1098
Graf Yangf5f95312010-02-10 07:15:59 +00001099#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
1100 {
1101 .modalias = "ad2s90",
1102 .bus_num = 0,
1103 .chip_select = 3, /* change it for your board */
Barry Song6fbfa0c2010-04-12 05:04:15 +00001104 .mode = SPI_MODE_3,
Graf Yangf5f95312010-02-10 07:15:59 +00001105 .platform_data = NULL,
1106 .controller_data = &ad2s90_spi_chip_info,
1107 },
1108#endif
1109
Graf Yangdf6a9492010-02-21 10:23:07 +00001110#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
1111 {
1112 .modalias = "ad2s120x",
1113 .bus_num = 0,
1114 .chip_select = 4, /* CS, change it for your board */
1115 .platform_data = ad2s120x_platform_data,
1116 .controller_data = &ad2s120x_spi_chip_info,
1117 },
1118#endif
1119
Graf Yang848c51c2010-02-26 11:49:52 +00001120#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
1121 {
1122 .modalias = "ad2s1210",
1123 .max_speed_hz = 8192000,
1124 .bus_num = 0,
1125 .chip_select = 4, /* CS, change it for your board */
1126 .platform_data = ad2s1210_platform_data,
1127 .controller_data = &ad2s1210_spi_chip_info,
1128 },
1129#endif
1130
Michael Hennerich0891bae2010-03-08 11:58:53 +00001131#if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE)
1132 {
1133 .modalias = "ad7314",
1134 .max_speed_hz = 1000000,
1135 .bus_num = 0,
1136 .chip_select = 4, /* CS, change it for your board */
1137 .controller_data = &ad7314_spi_chip_info,
1138 .mode = SPI_MODE_1,
1139 },
1140#endif
1141
1142#if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE)
1143 {
1144 .modalias = "ad7818",
1145 .max_speed_hz = 1000000,
1146 .bus_num = 0,
1147 .chip_select = 4, /* CS, change it for your board */
1148 .platform_data = ad7816_platform_data,
1149 .controller_data = &ad7816_spi_chip_info,
1150 .mode = SPI_MODE_3,
1151 },
1152#endif
1153
1154#if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE)
1155 {
1156 .modalias = "adt7310",
1157 .max_speed_hz = 1000000,
1158 .irq = IRQ_PG5, /* CT alarm event. Line 0 */
1159 .bus_num = 0,
1160 .chip_select = 4, /* CS, change it for your board */
1161 .platform_data = adt7310_platform_data,
1162 .controller_data = &adt7310_spi_chip_info,
1163 .mode = SPI_MODE_3,
1164 },
1165#endif
1166
1167#if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE)
1168 {
1169 .modalias = "ad7298",
1170 .max_speed_hz = 1000000,
1171 .bus_num = 0,
1172 .chip_select = 4, /* CS, change it for your board */
1173 .platform_data = ad7298_platform_data,
1174 .controller_data = &ad7298_spi_chip_info,
1175 .mode = SPI_MODE_3,
1176 },
1177#endif
1178
1179#if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE)
1180 {
1181 .modalias = "adt7316",
1182 .max_speed_hz = 1000000,
1183 .irq = IRQ_PG5, /* interrupt line */
1184 .bus_num = 0,
1185 .chip_select = 4, /* CS, change it for your board */
1186 .platform_data = adt7316_spi_data,
1187 .controller_data = &adt7316_spi_chip_info,
1188 .mode = SPI_MODE_3,
1189 },
1190#endif
1191
Yi Lif79ea4c2009-01-07 23:14:38 +08001192#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
1193 {
1194 .modalias = "mmc_spi",
1195 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1196 .bus_num = 0,
1197 .chip_select = 4,
1198 .platform_data = &bfin_mmc_spi_pdata,
1199 .controller_data = &mmc_spi_chip_info,
1200 .mode = SPI_MODE_3,
1201 },
1202#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001203#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1204 {
1205 .modalias = "ad7877",
1206 .platform_data = &bfin_ad7877_ts_info,
1207 .irq = IRQ_PF6,
1208 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Michael Hennerichc7d48962007-11-15 21:33:31 +08001209 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -07001210 .chip_select = 1,
1211 .controller_data = &spi_ad7877_chip_info,
1212 },
1213#endif
Michael Hennerichf5150152008-10-16 23:23:18 +08001214#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +08001215 {
1216 .modalias = "ad7879",
1217 .platform_data = &bfin_ad7879_ts_info,
1218 .irq = IRQ_PF7,
1219 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1220 .bus_num = 0,
1221 .chip_select = 1,
1222 .controller_data = &spi_ad7879_chip_info,
1223 .mode = SPI_CPHA | SPI_CPOL,
1224 },
1225#endif
Michael Hennerich6e668932008-02-09 01:54:09 +08001226#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1227 {
1228 .modalias = "spidev",
1229 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1230 .bus_num = 0,
1231 .chip_select = 1,
1232 .controller_data = &spidev_chip_info,
1233 },
1234#endif
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001235#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1236 {
1237 .modalias = "bfin-lq035q1-spi",
1238 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1239 .bus_num = 0,
Michael Hennerich46aa04f2008-10-13 11:30:17 +08001240 .chip_select = 2,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001241 .controller_data = &lq035q1_spi_chip_info,
1242 .mode = SPI_CPHA | SPI_CPOL,
1243 },
1244#endif
Michael Hennerich85a192e2009-01-07 23:14:38 +08001245#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
1246 {
1247 .modalias = "enc28j60",
1248 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1249 .irq = IRQ_PF6,
1250 .bus_num = 0,
Barry Songf9f0e3b2009-11-17 09:45:59 +00001251 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
Michael Hennerich85a192e2009-01-07 23:14:38 +08001252 .controller_data = &enc28j60_spi_chip_info,
1253 .mode = SPI_MODE_0,
1254 },
1255#endif
Michael Hennerich57af8ed2009-10-16 12:35:20 +00001256#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1257 {
1258 .modalias = "adxl34x",
1259 .platform_data = &adxl34x_info,
1260 .irq = IRQ_PF6,
1261 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1262 .bus_num = 0,
1263 .chip_select = 2,
1264 .controller_data = &spi_adxl34x_chip_info,
1265 .mode = SPI_MODE_3,
1266 },
1267#endif
Michael Hennerichefaf7cd2009-11-12 16:54:08 +00001268#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
1269 {
1270 .modalias = "adf702x",
1271 .max_speed_hz = 16000000, /* max spi clock (SCK) speed in HZ */
1272 .bus_num = 0,
Barry Songf9f0e3b2009-11-17 09:45:59 +00001273 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
Michael Hennerichefaf7cd2009-11-12 16:54:08 +00001274 .controller_data = &adf7021_spi_chip_info,
1275 .platform_data = &adf7021_platform_data,
1276 .mode = SPI_MODE_0,
1277 },
1278#endif
Michael Hennerichfe5b25c2010-02-04 14:41:39 +00001279#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
1280 {
1281 .modalias = "ads7846",
1282 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1283 .bus_num = 0,
1284 .irq = IRQ_PF6,
1285 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1286 .controller_data = &ad7873_spi_chip_info,
1287 .platform_data = &ad7873_pdata,
1288 .mode = SPI_MODE_0,
1289 },
1290#endif
Michael Hennerich0891bae2010-03-08 11:58:53 +00001291#if defined(CONFIG_AD7476) \
1292 || defined(CONFIG_AD7476_MODULE)
1293 {
1294 .modalias = "ad7476", /* Name of spi_driver for this device */
1295 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
1296 .bus_num = 0, /* Framework bus number */
1297 .chip_select = 1, /* Framework chip select. */
1298 .platform_data = NULL, /* No spi_driver specific config */
1299 .controller_data = &spi_ad7476_chip_info,
1300 .mode = SPI_MODE_3,
1301 },
1302#endif
1303#if defined(CONFIG_ADE7753) \
1304 || defined(CONFIG_ADE7753_MODULE)
1305 {
1306 .modalias = "ade7753",
1307 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1308 .bus_num = 0,
1309 .chip_select = 1, /* CS, change it for your board */
1310 .platform_data = NULL, /* No spi_driver specific config */
1311 .mode = SPI_MODE_1,
1312 },
1313#endif
1314#if defined(CONFIG_ADE7754) \
1315 || defined(CONFIG_ADE7754_MODULE)
1316 {
1317 .modalias = "ade7754",
1318 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1319 .bus_num = 0,
1320 .chip_select = 1, /* CS, change it for your board */
1321 .platform_data = NULL, /* No spi_driver specific config */
1322 .mode = SPI_MODE_1,
1323 },
1324#endif
1325#if defined(CONFIG_ADE7758) \
1326 || defined(CONFIG_ADE7758_MODULE)
1327 {
1328 .modalias = "ade7758",
1329 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1330 .bus_num = 0,
1331 .chip_select = 1, /* CS, change it for your board */
1332 .platform_data = NULL, /* No spi_driver specific config */
1333 .mode = SPI_MODE_1,
1334 },
1335#endif
1336#if defined(CONFIG_ADE7759) \
1337 || defined(CONFIG_ADE7759_MODULE)
1338 {
1339 .modalias = "ade7759",
1340 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1341 .bus_num = 0,
1342 .chip_select = 1, /* CS, change it for your board */
1343 .platform_data = NULL, /* No spi_driver specific config */
1344 .mode = SPI_MODE_1,
1345 },
1346#endif
1347#if defined(CONFIG_ADE7854_SPI) \
1348 || defined(CONFIG_ADE7854_SPI_MODULE)
1349 {
1350 .modalias = "ade7854",
1351 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1352 .bus_num = 0,
1353 .chip_select = 1, /* CS, change it for your board */
1354 .platform_data = NULL, /* No spi_driver specific config */
1355 .mode = SPI_MODE_3,
1356 },
1357#endif
1358#if defined(CONFIG_ADIS16060) \
1359 || defined(CONFIG_ADIS16060_MODULE)
1360 {
1361 .modalias = "adis16060_r",
1362 .max_speed_hz = 2900000, /* max spi clock (SCK) speed in HZ */
1363 .bus_num = 0,
1364 .chip_select = MAX_CTRL_CS + 1, /* CS for read, change it for your board */
1365 .platform_data = NULL, /* No spi_driver specific config */
1366 .mode = SPI_MODE_0,
1367 },
1368 {
1369 .modalias = "adis16060_w",
1370 .max_speed_hz = 2900000, /* max spi clock (SCK) speed in HZ */
1371 .bus_num = 0,
1372 .chip_select = 2, /* CS for write, change it for your board */
1373 .platform_data = NULL, /* No spi_driver specific config */
1374 .mode = SPI_MODE_1,
1375 },
1376#endif
1377#if defined(CONFIG_ADIS16130) \
1378 || defined(CONFIG_ADIS16130_MODULE)
1379 {
1380 .modalias = "adis16130",
1381 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1382 .bus_num = 0,
1383 .chip_select = 1, /* CS for read, change it for your board */
1384 .platform_data = NULL, /* No spi_driver specific config */
1385 .mode = SPI_MODE_3,
1386 },
1387#endif
1388#if defined(CONFIG_ADIS16201) \
1389 || defined(CONFIG_ADIS16201_MODULE)
1390 {
1391 .modalias = "adis16201",
1392 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1393 .bus_num = 0,
1394 .chip_select = 5, /* CS, change it for your board */
1395 .platform_data = NULL, /* No spi_driver specific config */
1396 .mode = SPI_MODE_3,
1397 .irq = IRQ_PF4,
1398 },
1399#endif
1400#if defined(CONFIG_ADIS16203) \
1401 || defined(CONFIG_ADIS16203_MODULE)
1402 {
1403 .modalias = "adis16203",
1404 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1405 .bus_num = 0,
1406 .chip_select = 5, /* CS, change it for your board */
1407 .platform_data = NULL, /* No spi_driver specific config */
1408 .mode = SPI_MODE_3,
1409 .irq = IRQ_PF4,
1410 },
1411#endif
1412#if defined(CONFIG_ADIS16204) \
1413 || defined(CONFIG_ADIS16204_MODULE)
1414 {
1415 .modalias = "adis16204",
1416 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1417 .bus_num = 0,
1418 .chip_select = 5, /* CS, change it for your board */
1419 .platform_data = NULL, /* No spi_driver specific config */
1420 .mode = SPI_MODE_3,
1421 .irq = IRQ_PF4,
1422 },
1423#endif
1424#if defined(CONFIG_ADIS16209) \
1425 || defined(CONFIG_ADIS16209_MODULE)
1426 {
1427 .modalias = "adis16209",
1428 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1429 .bus_num = 0,
1430 .chip_select = 5, /* CS, change it for your board */
1431 .platform_data = NULL, /* No spi_driver specific config */
1432 .mode = SPI_MODE_3,
1433 .irq = IRQ_PF4,
1434 },
1435#endif
1436#if defined(CONFIG_ADIS16220) \
1437 || defined(CONFIG_ADIS16220_MODULE)
1438 {
1439 .modalias = "adis16220",
1440 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1441 .bus_num = 0,
1442 .chip_select = 5, /* CS, change it for your board */
1443 .platform_data = NULL, /* No spi_driver specific config */
1444 .mode = SPI_MODE_3,
1445 .irq = IRQ_PF4,
1446 },
1447#endif
1448#if defined(CONFIG_ADIS16240) \
1449 || defined(CONFIG_ADIS16240_MODULE)
1450 {
1451 .modalias = "adis16240",
1452 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */
1453 .bus_num = 0,
1454 .chip_select = 5, /* CS, change it for your board */
1455 .platform_data = NULL, /* No spi_driver specific config */
1456 .mode = SPI_MODE_3,
1457 .irq = IRQ_PF4,
1458 },
1459#endif
1460#if defined(CONFIG_ADIS16260) \
1461 || defined(CONFIG_ADIS16260_MODULE)
1462 {
1463 .modalias = "adis16260",
1464 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */
1465 .bus_num = 0,
1466 .chip_select = 5, /* CS, change it for your board */
1467 .platform_data = NULL, /* No spi_driver specific config */
1468 .mode = SPI_MODE_3,
1469 .irq = IRQ_PF4,
1470 },
1471#endif
1472#if defined(CONFIG_ADIS16261) \
1473 || defined(CONFIG_ADIS16261_MODULE)
1474 {
1475 .modalias = "adis16261",
1476 .max_speed_hz = 2500000, /* max spi clock (SCK) speed in HZ */
1477 .bus_num = 0,
1478 .chip_select = 1, /* CS, change it for your board */
1479 .platform_data = NULL, /* No spi_driver specific config */
1480 .mode = SPI_MODE_3,
1481 },
1482#endif
1483#if defined(CONFIG_ADIS16300) \
1484 || defined(CONFIG_ADIS16300_MODULE)
1485 {
1486 .modalias = "adis16300",
1487 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1488 .bus_num = 0,
1489 .chip_select = 5, /* CS, change it for your board */
1490 .platform_data = NULL, /* No spi_driver specific config */
1491 .mode = SPI_MODE_3,
1492 .irq = IRQ_PF4,
1493 },
1494#endif
1495#if defined(CONFIG_ADIS16350) \
1496 || defined(CONFIG_ADIS16350_MODULE)
1497 {
1498 .modalias = "adis16364",
1499 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1500 .bus_num = 0,
1501 .chip_select = 5, /* CS, change it for your board */
1502 .platform_data = NULL, /* No spi_driver specific config */
1503 .mode = SPI_MODE_3,
1504 .irq = IRQ_PF4,
1505 },
1506#endif
1507#if defined(CONFIG_ADIS16400) \
1508 || defined(CONFIG_ADIS16400_MODULE)
1509 {
1510 .modalias = "adis16400",
1511 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1512 .bus_num = 0,
1513 .chip_select = 1, /* CS, change it for your board */
1514 .platform_data = NULL, /* No spi_driver specific config */
1515 .mode = SPI_MODE_3,
1516 },
1517#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001518};
1519
Mike Frysinger5bda2722008-06-07 15:03:01 +08001520#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -07001521/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001522static struct bfin5xx_spi_master bfin_spi0_info = {
Barry Songf9f0e3b2009-11-17 09:45:59 +00001523 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
Bryan Wu1394f032007-05-06 14:50:22 -07001524 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +08001525 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -07001526};
1527
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001528/* SPI (0) */
1529static struct resource bfin_spi0_resource[] = {
1530 [0] = {
1531 .start = SPI0_REGBASE,
1532 .end = SPI0_REGBASE + 0xFF,
1533 .flags = IORESOURCE_MEM,
1534 },
1535 [1] = {
1536 .start = CH_SPI,
1537 .end = CH_SPI,
Yi Lie68d1eb2009-06-03 09:46:22 +00001538 .flags = IORESOURCE_DMA,
1539 },
1540 [2] = {
1541 .start = IRQ_SPI,
1542 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001543 .flags = IORESOURCE_IRQ,
1544 },
1545};
1546
1547static struct platform_device bfin_spi0_device = {
1548 .name = "bfin-spi",
1549 .id = 0, /* Bus number */
1550 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1551 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001552 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001553 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -07001554 },
1555};
1556#endif /* spi master and devices */
1557
Cliff Cai1e9aa952009-03-28 23:28:51 +08001558#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1559
1560/* SPORT SPI controller data */
1561static struct bfin5xx_spi_master bfin_sport_spi0_info = {
1562 .num_chipselect = 1, /* master only supports one device */
1563 .enable_dma = 0, /* master don't support DMA */
1564 .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
1565 P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
1566};
1567
1568static struct resource bfin_sport_spi0_resource[] = {
1569 [0] = {
1570 .start = SPORT0_TCR1,
1571 .end = SPORT0_TCR1 + 0xFF,
1572 .flags = IORESOURCE_MEM,
1573 },
1574 [1] = {
1575 .start = IRQ_SPORT0_ERROR,
1576 .end = IRQ_SPORT0_ERROR,
1577 .flags = IORESOURCE_IRQ,
1578 },
1579};
1580
1581static struct platform_device bfin_sport_spi0_device = {
1582 .name = "bfin-sport-spi",
1583 .id = 1, /* Bus number */
1584 .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
1585 .resource = bfin_sport_spi0_resource,
1586 .dev = {
1587 .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
1588 },
1589};
1590
1591static struct bfin5xx_spi_master bfin_sport_spi1_info = {
1592 .num_chipselect = 1, /* master only supports one device */
1593 .enable_dma = 0, /* master don't support DMA */
1594 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
1595 P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
1596};
1597
1598static struct resource bfin_sport_spi1_resource[] = {
1599 [0] = {
1600 .start = SPORT1_TCR1,
1601 .end = SPORT1_TCR1 + 0xFF,
1602 .flags = IORESOURCE_MEM,
1603 },
1604 [1] = {
1605 .start = IRQ_SPORT1_ERROR,
1606 .end = IRQ_SPORT1_ERROR,
1607 .flags = IORESOURCE_IRQ,
1608 },
1609};
1610
1611static struct platform_device bfin_sport_spi1_device = {
1612 .name = "bfin-sport-spi",
1613 .id = 2, /* Bus number */
1614 .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
1615 .resource = bfin_sport_spi1_resource,
1616 .dev = {
1617 .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
1618 },
1619};
1620
1621#endif /* sport spi master and devices */
1622
Bryan Wu1394f032007-05-06 14:50:22 -07001623#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1624static struct platform_device bfin_fb_device = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001625 .name = "bf537-lq035",
1626};
1627#endif
1628
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001629#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1630#include <asm/bfin-lq035q1.h>
1631
1632static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001633 .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
1634 .ppi_mode = USE_RGB565_16_BIT_PPI,
1635 .use_bl = 0, /* let something else control the LCD Blacklight */
1636 .gpio_bl = GPIO_PF7,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001637};
1638
1639static struct resource bfin_lq035q1_resources[] = {
1640 {
1641 .start = IRQ_PPI_ERROR,
1642 .end = IRQ_PPI_ERROR,
1643 .flags = IORESOURCE_IRQ,
1644 },
1645};
1646
1647static struct platform_device bfin_lq035q1_device = {
1648 .name = "bfin-lq035q1",
1649 .id = -1,
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001650 .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
1651 .resource = bfin_lq035q1_resources,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001652 .dev = {
1653 .platform_data = &bfin_lq035q1_data,
1654 },
1655};
1656#endif
1657
Bryan Wu1394f032007-05-06 14:50:22 -07001658#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang233b28a2007-11-21 17:04:41 +08001659#ifdef CONFIG_SERIAL_BFIN_UART0
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001660static struct resource bfin_uart0_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -07001661 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001662 .start = UART0_THR,
1663 .end = UART0_GCTL+2,
Bryan Wu1394f032007-05-06 14:50:22 -07001664 .flags = IORESOURCE_MEM,
Sonic Zhang233b28a2007-11-21 17:04:41 +08001665 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001666 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001667 .start = IRQ_UART0_RX,
1668 .end = IRQ_UART0_RX+1,
1669 .flags = IORESOURCE_IRQ,
1670 },
1671 {
1672 .start = IRQ_UART0_ERROR,
1673 .end = IRQ_UART0_ERROR,
1674 .flags = IORESOURCE_IRQ,
1675 },
1676 {
1677 .start = CH_UART0_TX,
1678 .end = CH_UART0_TX,
1679 .flags = IORESOURCE_DMA,
1680 },
1681 {
1682 .start = CH_UART0_RX,
1683 .end = CH_UART0_RX,
1684 .flags = IORESOURCE_DMA,
1685 },
1686#ifdef CONFIG_BFIN_UART0_CTSRTS
1687 { /* CTS pin */
1688 .start = GPIO_PG7,
1689 .end = GPIO_PG7,
1690 .flags = IORESOURCE_IO,
1691 },
1692 { /* RTS pin */
1693 .start = GPIO_PG6,
1694 .end = GPIO_PG6,
1695 .flags = IORESOURCE_IO,
Bryan Wu1394f032007-05-06 14:50:22 -07001696 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001697#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001698};
1699
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001700unsigned short bfin_uart0_peripherals[] = {
1701 P_UART0_TX, P_UART0_RX, 0
1702};
1703
1704static struct platform_device bfin_uart0_device = {
1705 .name = "bfin-uart",
1706 .id = 0,
1707 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
1708 .resource = bfin_uart0_resources,
1709 .dev = {
1710 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
1711 },
1712};
1713#endif
1714#ifdef CONFIG_SERIAL_BFIN_UART1
1715static struct resource bfin_uart1_resources[] = {
1716 {
1717 .start = UART1_THR,
1718 .end = UART1_GCTL+2,
1719 .flags = IORESOURCE_MEM,
1720 },
1721 {
1722 .start = IRQ_UART1_RX,
1723 .end = IRQ_UART1_RX+1,
1724 .flags = IORESOURCE_IRQ,
1725 },
1726 {
1727 .start = IRQ_UART1_ERROR,
1728 .end = IRQ_UART1_ERROR,
1729 .flags = IORESOURCE_IRQ,
1730 },
1731 {
1732 .start = CH_UART1_TX,
1733 .end = CH_UART1_TX,
1734 .flags = IORESOURCE_DMA,
1735 },
1736 {
1737 .start = CH_UART1_RX,
1738 .end = CH_UART1_RX,
1739 .flags = IORESOURCE_DMA,
1740 },
1741};
1742
1743unsigned short bfin_uart1_peripherals[] = {
1744 P_UART1_TX, P_UART1_RX, 0
1745};
1746
1747static struct platform_device bfin_uart1_device = {
Bryan Wu1394f032007-05-06 14:50:22 -07001748 .name = "bfin-uart",
1749 .id = 1,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001750 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
1751 .resource = bfin_uart1_resources,
1752 .dev = {
1753 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
1754 },
Bryan Wu1394f032007-05-06 14:50:22 -07001755};
1756#endif
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001757#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001758
Graf Yang5be36d22008-04-25 03:09:15 +08001759#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +08001760#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +08001761static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001762 {
1763 .start = 0xFFC00400,
1764 .end = 0xFFC004FF,
1765 .flags = IORESOURCE_MEM,
1766 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001767 {
1768 .start = IRQ_UART0_RX,
1769 .end = IRQ_UART0_RX+1,
1770 .flags = IORESOURCE_IRQ,
1771 },
1772 {
1773 .start = CH_UART0_RX,
1774 .end = CH_UART0_RX+1,
1775 .flags = IORESOURCE_DMA,
1776 },
1777};
1778
1779static struct platform_device bfin_sir0_device = {
1780 .name = "bfin_sir",
1781 .id = 0,
1782 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
1783 .resource = bfin_sir0_resources,
1784};
Graf Yang5be36d22008-04-25 03:09:15 +08001785#endif
1786#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +08001787static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001788 {
1789 .start = 0xFFC02000,
1790 .end = 0xFFC020FF,
1791 .flags = IORESOURCE_MEM,
1792 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001793 {
1794 .start = IRQ_UART1_RX,
1795 .end = IRQ_UART1_RX+1,
1796 .flags = IORESOURCE_IRQ,
1797 },
1798 {
1799 .start = CH_UART1_RX,
1800 .end = CH_UART1_RX+1,
1801 .flags = IORESOURCE_DMA,
1802 },
Graf Yang5be36d22008-04-25 03:09:15 +08001803};
1804
Graf Yang42bd8bc2009-01-07 23:14:39 +08001805static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +08001806 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +08001807 .id = 1,
1808 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
1809 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +08001810};
1811#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +08001812#endif
Graf Yang5be36d22008-04-25 03:09:15 +08001813
Bryan Wu1394f032007-05-06 14:50:22 -07001814#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001815static struct resource bfin_twi0_resource[] = {
1816 [0] = {
1817 .start = TWI0_REGBASE,
1818 .end = TWI0_REGBASE,
1819 .flags = IORESOURCE_MEM,
1820 },
1821 [1] = {
1822 .start = IRQ_TWI,
1823 .end = IRQ_TWI,
1824 .flags = IORESOURCE_IRQ,
1825 },
1826};
1827
Bryan Wu1394f032007-05-06 14:50:22 -07001828static struct platform_device i2c_bfin_twi_device = {
1829 .name = "i2c-bfin-twi",
1830 .id = 0,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001831 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1832 .resource = bfin_twi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001833};
1834#endif
1835
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001836#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001837static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1838 [0] = KEY_GRAVE,
1839 [1] = KEY_1,
1840 [2] = KEY_2,
1841 [3] = KEY_3,
1842 [4] = KEY_4,
1843 [5] = KEY_5,
1844 [6] = KEY_6,
1845 [7] = KEY_7,
1846 [8] = KEY_8,
1847 [9] = KEY_9,
1848 [10] = KEY_0,
1849 [11] = KEY_MINUS,
1850 [12] = KEY_EQUAL,
1851 [13] = KEY_BACKSLASH,
1852 [15] = KEY_KP0,
1853 [16] = KEY_Q,
1854 [17] = KEY_W,
1855 [18] = KEY_E,
1856 [19] = KEY_R,
1857 [20] = KEY_T,
1858 [21] = KEY_Y,
1859 [22] = KEY_U,
1860 [23] = KEY_I,
1861 [24] = KEY_O,
1862 [25] = KEY_P,
1863 [26] = KEY_LEFTBRACE,
1864 [27] = KEY_RIGHTBRACE,
1865 [29] = KEY_KP1,
1866 [30] = KEY_KP2,
1867 [31] = KEY_KP3,
1868 [32] = KEY_A,
1869 [33] = KEY_S,
1870 [34] = KEY_D,
1871 [35] = KEY_F,
1872 [36] = KEY_G,
1873 [37] = KEY_H,
1874 [38] = KEY_J,
1875 [39] = KEY_K,
1876 [40] = KEY_L,
1877 [41] = KEY_SEMICOLON,
1878 [42] = KEY_APOSTROPHE,
1879 [43] = KEY_BACKSLASH,
1880 [45] = KEY_KP4,
1881 [46] = KEY_KP5,
1882 [47] = KEY_KP6,
1883 [48] = KEY_102ND,
1884 [49] = KEY_Z,
1885 [50] = KEY_X,
1886 [51] = KEY_C,
1887 [52] = KEY_V,
1888 [53] = KEY_B,
1889 [54] = KEY_N,
1890 [55] = KEY_M,
1891 [56] = KEY_COMMA,
1892 [57] = KEY_DOT,
1893 [58] = KEY_SLASH,
1894 [60] = KEY_KPDOT,
1895 [61] = KEY_KP7,
1896 [62] = KEY_KP8,
1897 [63] = KEY_KP9,
1898 [64] = KEY_SPACE,
1899 [65] = KEY_BACKSPACE,
1900 [66] = KEY_TAB,
1901 [67] = KEY_KPENTER,
1902 [68] = KEY_ENTER,
1903 [69] = KEY_ESC,
1904 [70] = KEY_DELETE,
1905 [74] = KEY_KPMINUS,
1906 [76] = KEY_UP,
1907 [77] = KEY_DOWN,
1908 [78] = KEY_RIGHT,
1909 [79] = KEY_LEFT,
1910};
1911
1912static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1913 .rows = 8,
1914 .cols = 10,
1915 .keymap = adp5588_keymap,
1916 .keymapsize = ARRAY_SIZE(adp5588_keymap),
1917 .repeat = 0,
1918};
1919#endif
1920
Michael Hennerich3ea57212009-03-28 22:15:07 +08001921#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1922#include <linux/mfd/adp5520.h>
1923
1924 /*
1925 * ADP5520/5501 Backlight Data
1926 */
1927
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001928static struct adp5520_backlight_platform_data adp5520_backlight_data = {
1929 .fade_in = ADP5520_FADE_T_1200ms,
1930 .fade_out = ADP5520_FADE_T_1200ms,
1931 .fade_led_law = ADP5520_BL_LAW_LINEAR,
1932 .en_ambl_sens = 1,
1933 .abml_filt = ADP5520_BL_AMBL_FILT_640ms,
1934 .l1_daylight_max = ADP5520_BL_CUR_mA(15),
1935 .l1_daylight_dim = ADP5520_BL_CUR_mA(0),
1936 .l2_office_max = ADP5520_BL_CUR_mA(7),
1937 .l2_office_dim = ADP5520_BL_CUR_mA(0),
1938 .l3_dark_max = ADP5520_BL_CUR_mA(3),
1939 .l3_dark_dim = ADP5520_BL_CUR_mA(0),
1940 .l2_trip = ADP5520_L2_COMP_CURR_uA(700),
1941 .l2_hyst = ADP5520_L2_COMP_CURR_uA(50),
1942 .l3_trip = ADP5520_L3_COMP_CURR_uA(80),
1943 .l3_hyst = ADP5520_L3_COMP_CURR_uA(20),
Michael Hennerich3ea57212009-03-28 22:15:07 +08001944};
1945
1946 /*
1947 * ADP5520/5501 LEDs Data
1948 */
1949
Michael Hennerich3ea57212009-03-28 22:15:07 +08001950static struct led_info adp5520_leds[] = {
1951 {
1952 .name = "adp5520-led1",
1953 .default_trigger = "none",
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001954 .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001955 },
1956#ifdef ADP5520_EN_ALL_LEDS
1957 {
1958 .name = "adp5520-led2",
1959 .default_trigger = "none",
1960 .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
1961 },
1962 {
1963 .name = "adp5520-led3",
1964 .default_trigger = "none",
1965 .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
1966 },
1967#endif
1968};
1969
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001970static struct adp5520_leds_platform_data adp5520_leds_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001971 .num_leds = ARRAY_SIZE(adp5520_leds),
1972 .leds = adp5520_leds,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001973 .fade_in = ADP5520_FADE_T_600ms,
1974 .fade_out = ADP5520_FADE_T_600ms,
1975 .led_on_time = ADP5520_LED_ONT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001976};
1977
1978 /*
1979 * ADP5520 GPIO Data
1980 */
1981
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001982static struct adp5520_gpio_platform_data adp5520_gpio_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001983 .gpio_start = 50,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001984 .gpio_en_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
1985 .gpio_pullup_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001986};
1987
1988 /*
1989 * ADP5520 Keypad Data
1990 */
1991
Michael Hennerich3ea57212009-03-28 22:15:07 +08001992static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001993 [ADP5520_KEY(0, 0)] = KEY_GRAVE,
1994 [ADP5520_KEY(0, 1)] = KEY_1,
1995 [ADP5520_KEY(0, 2)] = KEY_2,
1996 [ADP5520_KEY(0, 3)] = KEY_3,
1997 [ADP5520_KEY(1, 0)] = KEY_4,
1998 [ADP5520_KEY(1, 1)] = KEY_5,
1999 [ADP5520_KEY(1, 2)] = KEY_6,
2000 [ADP5520_KEY(1, 3)] = KEY_7,
2001 [ADP5520_KEY(2, 0)] = KEY_8,
2002 [ADP5520_KEY(2, 1)] = KEY_9,
2003 [ADP5520_KEY(2, 2)] = KEY_0,
2004 [ADP5520_KEY(2, 3)] = KEY_MINUS,
2005 [ADP5520_KEY(3, 0)] = KEY_EQUAL,
2006 [ADP5520_KEY(3, 1)] = KEY_BACKSLASH,
2007 [ADP5520_KEY(3, 2)] = KEY_BACKSPACE,
2008 [ADP5520_KEY(3, 3)] = KEY_ENTER,
Michael Hennerich3ea57212009-03-28 22:15:07 +08002009};
2010
Michael Hennerich1d23dc82009-10-05 13:33:11 +00002011static struct adp5520_keys_platform_data adp5520_keys_data = {
2012 .rows_en_mask = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
2013 .cols_en_mask = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08002014 .keymap = adp5520_keymap,
2015 .keymapsize = ARRAY_SIZE(adp5520_keymap),
2016 .repeat = 0,
2017};
2018
2019 /*
2020 * ADP5520/5501 Multifuction Device Init Data
2021 */
2022
Michael Hennerich3ea57212009-03-28 22:15:07 +08002023static struct adp5520_platform_data adp5520_pdev_data = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00002024 .backlight = &adp5520_backlight_data,
2025 .leds = &adp5520_leds_data,
2026 .gpio = &adp5520_gpio_data,
2027 .keys = &adp5520_keys_data,
Michael Hennerich3ea57212009-03-28 22:15:07 +08002028};
2029
2030#endif
2031
Michael Hennerichba877d42009-08-27 04:09:32 +00002032#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
Michael Hennerich1d23dc82009-10-05 13:33:11 +00002033static struct adp5588_gpio_platform_data adp5588_gpio_data = {
Michael Hennerichba877d42009-08-27 04:09:32 +00002034 .gpio_start = 50,
2035 .pullup_dis_mask = 0,
2036};
2037#endif
2038
Michael Hennerich78756c62009-10-13 15:28:33 +00002039#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
2040#include <linux/i2c/adp8870.h>
2041static struct led_info adp8870_leds[] = {
2042 {
2043 .name = "adp8870-led7",
2044 .default_trigger = "none",
2045 .flags = ADP8870_LED_D7 | ADP8870_LED_OFFT_600ms,
2046 },
2047};
2048
2049
2050static struct adp8870_backlight_platform_data adp8870_pdata = {
2051 .bl_led_assign = ADP8870_BL_D1 | ADP8870_BL_D2 | ADP8870_BL_D3 |
2052 ADP8870_BL_D4 | ADP8870_BL_D5 | ADP8870_BL_D6, /* 1 = Backlight 0 = Individual LED */
2053 .pwm_assign = 0, /* 1 = Enables PWM mode */
2054
2055 .bl_fade_in = ADP8870_FADE_T_1200ms, /* Backlight Fade-In Timer */
2056 .bl_fade_out = ADP8870_FADE_T_1200ms, /* Backlight Fade-Out Timer */
2057 .bl_fade_law = ADP8870_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
2058
2059 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
2060 .abml_filt = ADP8870_BL_AMBL_FILT_320ms, /* Light sensor filter time */
2061
2062 .l1_daylight_max = ADP8870_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2063 .l1_daylight_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2064 .l2_bright_max = ADP8870_BL_CUR_mA(14), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2065 .l2_bright_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2066 .l3_office_max = ADP8870_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2067 .l3_office_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2068 .l4_indoor_max = ADP8870_BL_CUR_mA(3), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2069 .l4_indor_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2070 .l5_dark_max = ADP8870_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2071 .l5_dark_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2072
2073 .l2_trip = ADP8870_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2074 .l2_hyst = ADP8870_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2075 .l3_trip = ADP8870_L3_COMP_CURR_uA(389), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
2076 .l3_hyst = ADP8870_L3_COMP_CURR_uA(54), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
2077 .l4_trip = ADP8870_L4_COMP_CURR_uA(167), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
2078 .l4_hyst = ADP8870_L4_COMP_CURR_uA(16), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
2079 .l5_trip = ADP8870_L5_COMP_CURR_uA(43), /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2080 .l5_hyst = ADP8870_L5_COMP_CURR_uA(11), /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2081
2082 .leds = adp8870_leds,
2083 .num_leds = ARRAY_SIZE(adp8870_leds),
2084 .led_fade_law = ADP8870_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
2085 .led_fade_in = ADP8870_FADE_T_600ms,
2086 .led_fade_out = ADP8870_FADE_T_600ms,
2087 .led_on_time = ADP8870_LED_ONT_200ms,
2088};
2089#endif
2090
Michael Hennerich72fa2e92010-02-24 21:05:35 +00002091#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
2092#include <linux/i2c/adp8860.h>
2093static struct led_info adp8860_leds[] = {
2094 {
2095 .name = "adp8860-led7",
2096 .default_trigger = "none",
2097 .flags = ADP8860_LED_D7 | ADP8860_LED_OFFT_600ms,
2098 },
2099};
2100
2101static struct adp8860_backlight_platform_data adp8860_pdata = {
2102 .bl_led_assign = ADP8860_BL_D1 | ADP8860_BL_D2 | ADP8860_BL_D3 |
2103 ADP8860_BL_D4 | ADP8860_BL_D5 | ADP8860_BL_D6, /* 1 = Backlight 0 = Individual LED */
2104
2105 .bl_fade_in = ADP8860_FADE_T_1200ms, /* Backlight Fade-In Timer */
2106 .bl_fade_out = ADP8860_FADE_T_1200ms, /* Backlight Fade-Out Timer */
2107 .bl_fade_law = ADP8860_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
2108
2109 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
2110 .abml_filt = ADP8860_BL_AMBL_FILT_320ms, /* Light sensor filter time */
2111
2112 .l1_daylight_max = ADP8860_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2113 .l1_daylight_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2114 .l2_office_max = ADP8860_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2115 .l2_office_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2116 .l3_dark_max = ADP8860_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2117 .l3_dark_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2118
2119 .l2_trip = ADP8860_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2120 .l2_hyst = ADP8860_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2121 .l3_trip = ADP8860_L3_COMP_CURR_uA(43), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2122 .l3_hyst = ADP8860_L3_COMP_CURR_uA(11), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2123
2124 .leds = adp8860_leds,
2125 .num_leds = ARRAY_SIZE(adp8860_leds),
2126 .led_fade_law = ADP8860_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
2127 .led_fade_in = ADP8860_FADE_T_600ms,
2128 .led_fade_out = ADP8860_FADE_T_600ms,
2129 .led_on_time = ADP8860_LED_ONT_200ms,
2130};
2131#endif
2132
Sonic Zhangf32792d2010-02-09 02:47:09 +00002133#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2134static struct regulator_consumer_supply ad5398_consumer = {
2135 .supply = "current",
2136};
2137
2138static struct regulator_init_data ad5398_regulator_data = {
2139 .constraints = {
2140 .name = "current range",
2141 .max_uA = 120000,
2142 .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
2143 },
2144 .num_consumer_supplies = 1,
2145 .consumer_supplies = &ad5398_consumer,
2146};
2147
2148static struct ad5398_platform_data ad5398_i2c_platform_data = {
2149 .current_bits = 10,
2150 .current_offset = 4,
2151 .regulator_data = &ad5398_regulator_data,
2152};
2153
2154#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2155 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2156static struct platform_device ad5398_virt_consumer_device = {
2157 .name = "reg-virt-consumer",
2158 .id = 0,
2159 .dev = {
2160 .platform_data = "current", /* Passed to driver */
2161 },
2162};
2163#endif
2164#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2165 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2166static struct regulator_bulk_data ad5398_bulk_data = {
2167 .supply = "current",
2168};
2169
2170static struct regulator_userspace_consumer_data ad5398_userspace_comsumer_data = {
2171 .name = "ad5398",
2172 .num_supplies = 1,
2173 .supplies = &ad5398_bulk_data,
2174};
2175
2176static struct platform_device ad5398_userspace_consumer_device = {
2177 .name = "reg-userspace-consumer",
2178 .id = 0,
2179 .dev = {
2180 .platform_data = &ad5398_userspace_comsumer_data,
2181 },
2182};
2183#endif
2184#endif
2185
Michael Hennerich0891bae2010-03-08 11:58:53 +00002186#if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE)
2187/* INT bound temperature alarm event. line 1 */
2188static unsigned long adt7410_platform_data[2] = {
2189 IRQ_PG4, IRQF_TRIGGER_LOW,
2190};
2191#endif
2192
2193#if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE)
2194/* INT bound temperature alarm event. line 1 */
2195static unsigned long adt7316_i2c_data[2] = {
2196 IRQF_TRIGGER_LOW, /* interrupt flags */
2197 GPIO_PF4, /* ldac_pin, 0 means DAC/LDAC registers control DAC update */
2198};
2199#endif
2200
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002201static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
Barry Song92b20f72010-03-17 08:12:30 +00002202#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
2203 {
2204 I2C_BOARD_INFO("ad1937", 0x04),
2205 },
2206#endif
2207
Yi Lia65912c2010-04-06 05:53:16 +00002208#if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
2209 {
2210 I2C_BOARD_INFO("adav803", 0x10),
2211 },
2212#endif
2213
Mike Frysinger5b7c5772009-10-12 15:56:58 +00002214#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002215 {
Barry Song427f2772009-07-17 07:04:55 +00002216 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
Barry Song4c94c3e2009-07-07 07:41:50 +00002217 .irq = IRQ_PG5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +00002218 .platform_data = (void *)&ad7142_i2c_platform_data,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002219 },
2220#endif
Barry Songad6720c2010-02-03 09:15:31 +00002221
2222#if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
2223 {
2224 I2C_BOARD_INFO("ad7150", 0x48),
2225 .irq = IRQ_PG5, /* fixme: use real interrupt number */
2226 },
2227#endif
2228
2229#if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
2230 {
2231 I2C_BOARD_INFO("ad7152", 0x48),
2232 },
2233#endif
2234
2235#if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
2236 {
2237 I2C_BOARD_INFO("ad774x", 0x48),
2238 },
2239#endif
2240
Sonic Zhang5f022592010-02-24 07:32:50 +00002241#if defined(CONFIG_AD7414) || defined(CONFIG_AD7414_MODULE)
2242 {
2243 I2C_BOARD_INFO("ad7414", 0x9),
2244 .irq = IRQ_PG5,
Michael Hennerich0891bae2010-03-08 11:58:53 +00002245 .irq_flags = IRQF_TRIGGER_LOW,
Sonic Zhang5f022592010-02-24 07:32:50 +00002246 },
2247#endif
2248
Sonic Zhangef8873e2010-02-25 10:27:48 +00002249#if defined(CONFIG_AD7416) || defined(CONFIG_AD7416_MODULE)
2250 {
2251 I2C_BOARD_INFO("ad7417", 0xb),
2252 .irq = IRQ_PG5,
Michael Hennerich0891bae2010-03-08 11:58:53 +00002253 .irq_flags = IRQF_TRIGGER_LOW,
2254 .platform_data = (void *)GPIO_PF4,
2255 },
2256#endif
2257
2258#if defined(CONFIG_ADE7854_I2C) || defined(CONFIG_ADE7854_I2C_MODULE)
2259 {
2260 I2C_BOARD_INFO("ade7854", 0x38),
2261 },
2262#endif
2263
2264#if defined(CONFIG_ADT75) || defined(CONFIG_ADT75_MODULE)
2265 {
2266 I2C_BOARD_INFO("adt75", 0x9),
2267 .irq = IRQ_PG5,
2268 .irq_flags = IRQF_TRIGGER_LOW,
2269 },
2270#endif
2271
2272#if defined(CONFIG_ADT7408) || defined(CONFIG_ADT7408_MODULE)
2273 {
2274 I2C_BOARD_INFO("adt7408", 0x18),
2275 .irq = IRQ_PG5,
2276 .irq_flags = IRQF_TRIGGER_LOW,
2277 },
2278#endif
2279
2280#if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE)
2281 {
2282 I2C_BOARD_INFO("adt7410", 0x48),
2283 /* CT critical temperature event. line 0 */
2284 .irq = IRQ_PG5,
2285 .irq_flags = IRQF_TRIGGER_LOW,
2286 .platform_data = (void *)&adt7410_platform_data,
2287 },
2288#endif
2289
2290#if defined(CONFIG_AD7291) || defined(CONFIG_AD7291_MODULE)
2291 {
2292 I2C_BOARD_INFO("ad7291", 0x20),
2293 .irq = IRQ_PG5,
2294 .irq_flags = IRQF_TRIGGER_LOW,
2295 },
2296#endif
2297
2298#if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE)
2299 {
2300 I2C_BOARD_INFO("adt7316", 0x48),
2301 .irq = IRQ_PG6,
2302 .platform_data = (void *)&adt7316_i2c_data,
Sonic Zhangef8873e2010-02-25 10:27:48 +00002303 },
2304#endif
2305
Michael Hennerichebd58332009-07-02 11:00:38 +00002306#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002307 {
2308 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002309 },
2310#endif
Michael Hennerich204844e2009-06-30 14:57:22 +00002311#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002312 {
2313 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
Michael Hennerichf5150152008-10-16 23:23:18 +08002314 .irq = IRQ_PG6,
2315 },
2316#endif
2317#if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
2318 {
2319 I2C_BOARD_INFO("ad7879", 0x2F),
2320 .irq = IRQ_PG5,
2321 .platform_data = (void *)&bfin_ad7879_ts_info,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002322 },
2323#endif
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08002324#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
2325 {
2326 I2C_BOARD_INFO("adp5588-keys", 0x34),
2327 .irq = IRQ_PG0,
2328 .platform_data = (void *)&adp5588_kpad_data,
2329 },
2330#endif
Michael Hennerich3ea57212009-03-28 22:15:07 +08002331#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
2332 {
2333 I2C_BOARD_INFO("pmic-adp5520", 0x32),
Mike Frysinger4f84b6e2009-06-10 20:45:48 -04002334 .irq = IRQ_PG0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08002335 .platform_data = (void *)&adp5520_pdev_data,
2336 },
2337#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00002338#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
2339 {
2340 I2C_BOARD_INFO("adxl34x", 0x53),
2341 .irq = IRQ_PG3,
2342 .platform_data = (void *)&adxl34x_info,
2343 },
2344#endif
Michael Hennerichba877d42009-08-27 04:09:32 +00002345#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
2346 {
2347 I2C_BOARD_INFO("adp5588-gpio", 0x34),
2348 .platform_data = (void *)&adp5588_gpio_data,
2349 },
2350#endif
Michael Hennerich50c4c082009-09-22 13:10:09 +00002351#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
2352 {
2353 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
2354 },
2355#endif
Michael Hennerichddcd7cb2009-09-22 15:36:55 +00002356#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2357 {
2358 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2C),
2359 },
2360#endif
Michael Hennerich78756c62009-10-13 15:28:33 +00002361#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
2362 {
2363 I2C_BOARD_INFO("adp8870", 0x2B),
2364 .platform_data = (void *)&adp8870_pdata,
2365 },
2366#endif
Cliff Caid53127f2009-10-15 02:33:04 +00002367#if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
2368 {
2369 I2C_BOARD_INFO("adau1371", 0x1A),
2370 },
2371#endif
Cliff Cai04267632009-10-28 06:50:36 +00002372#if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
2373 {
2374 I2C_BOARD_INFO("adau1761", 0x38),
2375 },
2376#endif
Cliff Caic48d7672010-02-11 09:27:18 +00002377#if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE)
2378 {
2379 I2C_BOARD_INFO("adau1361", 0x38),
2380 },
2381#endif
Michael Hennerich1f13f2f2009-11-17 10:18:27 +00002382#if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
2383 {
2384 I2C_BOARD_INFO("ad5258", 0x18),
2385 },
2386#endif
Cliff Cai29bb3bc2010-01-14 08:28:38 +00002387#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
2388 {
2389 I2C_BOARD_INFO("ssm2602", 0x1b),
2390 },
2391#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +00002392#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2393 {
2394 I2C_BOARD_INFO("ad5398", 0xC),
2395 .platform_data = (void *)&ad5398_i2c_platform_data,
2396 },
2397#endif
Michael Hennerich72fa2e92010-02-24 21:05:35 +00002398#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
2399 {
2400 I2C_BOARD_INFO("adp8860", 0x2A),
2401 .platform_data = (void *)&adp8860_pdata,
2402 },
2403#endif
Cliff Cai3cbcb1612010-04-22 05:55:56 +00002404#if defined(CONFIG_SND_SOC_ADAU1373) || defined(CONFIG_SND_SOC_ADAU1373_MODULE)
2405 {
2406 I2C_BOARD_INFO("adau1373", 0x1A),
2407 },
2408#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002409};
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002410
Bryan Wu1394f032007-05-06 14:50:22 -07002411#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00002412#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2413static struct resource bfin_sport0_uart_resources[] = {
2414 {
2415 .start = SPORT0_TCR1,
2416 .end = SPORT0_MRCS3+4,
2417 .flags = IORESOURCE_MEM,
2418 },
2419 {
2420 .start = IRQ_SPORT0_RX,
2421 .end = IRQ_SPORT0_RX+1,
2422 .flags = IORESOURCE_IRQ,
2423 },
2424 {
2425 .start = IRQ_SPORT0_ERROR,
2426 .end = IRQ_SPORT0_ERROR,
2427 .flags = IORESOURCE_IRQ,
2428 },
2429};
2430
2431unsigned short bfin_sport0_peripherals[] = {
2432 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
2433 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
2434};
2435
Bryan Wu1394f032007-05-06 14:50:22 -07002436static struct platform_device bfin_sport0_uart_device = {
2437 .name = "bfin-sport-uart",
2438 .id = 0,
Sonic Zhangdf5de262009-09-23 05:01:56 +00002439 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
2440 .resource = bfin_sport0_uart_resources,
2441 .dev = {
2442 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
2443 },
2444};
2445#endif
2446#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2447static struct resource bfin_sport1_uart_resources[] = {
2448 {
2449 .start = SPORT1_TCR1,
2450 .end = SPORT1_MRCS3+4,
2451 .flags = IORESOURCE_MEM,
2452 },
2453 {
2454 .start = IRQ_SPORT1_RX,
2455 .end = IRQ_SPORT1_RX+1,
2456 .flags = IORESOURCE_IRQ,
2457 },
2458 {
2459 .start = IRQ_SPORT1_ERROR,
2460 .end = IRQ_SPORT1_ERROR,
2461 .flags = IORESOURCE_IRQ,
2462 },
2463};
2464
2465unsigned short bfin_sport1_peripherals[] = {
2466 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
2467 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
Bryan Wu1394f032007-05-06 14:50:22 -07002468};
2469
2470static struct platform_device bfin_sport1_uart_device = {
2471 .name = "bfin-sport-uart",
2472 .id = 1,
Sonic Zhangdf5de262009-09-23 05:01:56 +00002473 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
2474 .resource = bfin_sport1_uart_resources,
2475 .dev = {
2476 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
2477 },
Bryan Wu1394f032007-05-06 14:50:22 -07002478};
2479#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00002480#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002481
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002482#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002483#define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2484/* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002485
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002486#ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2487#define PATA_INT IRQ_PF5
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002488static struct pata_platform_info bfin_pata_platform_data = {
2489 .ioport_shift = 1,
Mike Frysinger64e5c512007-10-30 11:56:13 +08002490 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002491};
2492
2493static struct resource bfin_pata_resources[] = {
2494 {
2495 .start = 0x20314020,
2496 .end = 0x2031403F,
2497 .flags = IORESOURCE_MEM,
2498 },
2499 {
2500 .start = 0x2031401C,
2501 .end = 0x2031401F,
2502 .flags = IORESOURCE_MEM,
2503 },
2504 {
2505 .start = PATA_INT,
2506 .end = PATA_INT,
2507 .flags = IORESOURCE_IRQ,
2508 },
2509};
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002510#elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
2511static struct pata_platform_info bfin_pata_platform_data = {
2512 .ioport_shift = 0,
2513};
Michael Hennerich648882d2009-04-21 12:05:50 +00002514/* CompactFlash Storage Card Memory Mapped Adressing
2515 * /REG = A11 = 1
2516 */
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002517static struct resource bfin_pata_resources[] = {
2518 {
Michael Hennerich648882d2009-04-21 12:05:50 +00002519 .start = 0x20211800,
2520 .end = 0x20211807,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002521 .flags = IORESOURCE_MEM,
2522 },
2523 {
Michael Hennerich648882d2009-04-21 12:05:50 +00002524 .start = 0x2021180E, /* Device Ctl */
2525 .end = 0x2021180E,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002526 .flags = IORESOURCE_MEM,
2527 },
2528};
2529#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002530
2531static struct platform_device bfin_pata_device = {
2532 .name = "pata_platform",
2533 .id = -1,
2534 .num_resources = ARRAY_SIZE(bfin_pata_resources),
2535 .resource = bfin_pata_resources,
2536 .dev = {
2537 .platform_data = &bfin_pata_platform_data,
2538 }
2539};
2540#endif
2541
Michael Hennerich14b03202008-05-07 11:41:26 +08002542static const unsigned int cclk_vlev_datasheet[] =
2543{
2544 VRPAIR(VLEV_085, 250000000),
2545 VRPAIR(VLEV_090, 376000000),
2546 VRPAIR(VLEV_095, 426000000),
2547 VRPAIR(VLEV_100, 426000000),
2548 VRPAIR(VLEV_105, 476000000),
2549 VRPAIR(VLEV_110, 476000000),
2550 VRPAIR(VLEV_115, 476000000),
2551 VRPAIR(VLEV_120, 500000000),
2552 VRPAIR(VLEV_125, 533000000),
2553 VRPAIR(VLEV_130, 600000000),
2554};
2555
2556static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
2557 .tuple_tab = cclk_vlev_datasheet,
2558 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
2559 .vr_settling_time = 25 /* us */,
2560};
2561
2562static struct platform_device bfin_dpmc = {
2563 .name = "bfin dpmc",
2564 .dev = {
2565 .platform_data = &bfin_dmpc_vreg_data,
2566 },
2567};
2568
Barry Song336746e2009-10-13 09:19:18 +00002569#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2570static struct platform_device bfin_i2s = {
2571 .name = "bfin-i2s",
2572 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2573 /* TODO: add platform data here */
2574};
2575#endif
2576
Barry Song83124402009-08-06 21:03:02 +00002577#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2578static struct platform_device bfin_tdm = {
2579 .name = "bfin-tdm",
Barry Song336746e2009-10-13 09:19:18 +00002580 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2581 /* TODO: add platform data here */
2582};
2583#endif
2584
2585#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2586static struct platform_device bfin_ac97 = {
2587 .name = "bfin-ac97",
2588 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Barry Song83124402009-08-06 21:03:02 +00002589 /* TODO: add platform data here */
2590};
2591#endif
2592
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002593#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
2594#define REGULATOR_ADP122 "adp122"
2595#define REGULATOR_ADP150 "adp150"
2596
2597static struct regulator_consumer_supply adp122_consumers = {
2598 .supply = REGULATOR_ADP122,
2599};
2600
2601static struct regulator_consumer_supply adp150_consumers = {
2602 .supply = REGULATOR_ADP150,
2603};
2604
2605static struct regulator_init_data adp_switch_regulator_data[] = {
2606 {
2607 .constraints = {
2608 .name = REGULATOR_ADP122,
2609 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
Sonic Zhang5f022592010-02-24 07:32:50 +00002610 .min_uA = 0,
2611 .max_uA = 300000,
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002612 },
2613 .num_consumer_supplies = 1, /* only 1 */
2614 .consumer_supplies = &adp122_consumers,
2615 .driver_data = (void *)GPIO_PF2, /* gpio port only */
2616 },
2617 {
2618 .constraints = {
2619 .name = REGULATOR_ADP150,
2620 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
Sonic Zhang5f022592010-02-24 07:32:50 +00002621 .min_uA = 0,
2622 .max_uA = 150000,
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002623 },
2624 .num_consumer_supplies = 1, /* only 1 */
2625 .consumer_supplies = &adp150_consumers,
2626 .driver_data = (void *)GPIO_PF3, /* gpio port only */
2627 },
2628};
2629
2630static struct adp_switch_platform_data adp_switch_pdata = {
2631 .regulator_num = ARRAY_SIZE(adp_switch_regulator_data),
2632 .regulator_data = adp_switch_regulator_data,
2633};
2634
2635static struct platform_device adp_switch_device = {
2636 .name = "adp_switch",
2637 .id = 0,
2638 .dev = {
2639 .platform_data = &adp_switch_pdata,
2640 },
2641};
2642
2643#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2644 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2645static struct regulator_bulk_data adp122_bulk_data = {
2646 .supply = REGULATOR_ADP122,
2647};
2648
2649static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data = {
2650 .name = REGULATOR_ADP122,
2651 .num_supplies = 1,
2652 .supplies = &adp122_bulk_data,
2653};
2654
2655static struct platform_device adp122_userspace_consumer_device = {
2656 .name = "reg-userspace-consumer",
2657 .id = 0,
2658 .dev = {
2659 .platform_data = &adp122_userspace_comsumer_data,
2660 },
2661};
2662
2663static struct regulator_bulk_data adp150_bulk_data = {
2664 .supply = REGULATOR_ADP150,
2665};
2666
2667static struct regulator_userspace_consumer_data adp150_userspace_comsumer_data = {
2668 .name = REGULATOR_ADP150,
2669 .num_supplies = 1,
2670 .supplies = &adp150_bulk_data,
2671};
2672
2673static struct platform_device adp150_userspace_consumer_device = {
2674 .name = "reg-userspace-consumer",
2675 .id = 1,
2676 .dev = {
2677 .platform_data = &adp150_userspace_comsumer_data,
2678 },
2679};
2680#endif
2681#endif
2682
Michael Hennerich0891bae2010-03-08 11:58:53 +00002683#if defined(CONFIG_IIO_GPIO_TRIGGER) || \
2684 defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2685
2686static struct resource iio_gpio_trigger_resources[] = {
2687 [0] = {
2688 .start = IRQ_PF5,
2689 .end = IRQ_PF5,
2690 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
2691 },
2692};
2693
2694static struct platform_device iio_gpio_trigger = {
2695 .name = "iio_gpio_trigger",
2696 .num_resources = ARRAY_SIZE(iio_gpio_trigger_resources),
2697 .resource = iio_gpio_trigger_resources,
2698};
2699#endif
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002700
Bryan Wu1394f032007-05-06 14:50:22 -07002701static struct platform_device *stamp_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +08002702
2703 &bfin_dpmc,
2704
Bryan Wu1394f032007-05-06 14:50:22 -07002705#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
2706 &bfin_pcmcia_cf_device,
2707#endif
2708
2709#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
2710 &rtc_device,
2711#endif
2712
2713#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
2714 &sl811_hcd_device,
2715#endif
2716
2717#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
2718 &isp1362_hcd_device,
2719#endif
2720
Michael Hennerich3f375692008-11-18 17:48:22 +08002721#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
2722 &bfin_isp1760_device,
2723#endif
2724
Bryan Wu1394f032007-05-06 14:50:22 -07002725#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
2726 &smc91x_device,
2727#endif
2728
Alex Landauf40d24d2007-07-12 12:11:48 +08002729#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
2730 &dm9000_device,
2731#endif
2732
Barry Song706a01b2009-11-02 07:29:07 +00002733#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
2734 &bfin_can_device,
2735#endif
2736
Bryan Wu1394f032007-05-06 14:50:22 -07002737#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +08002738 &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -07002739 &bfin_mac_device,
2740#endif
2741
2742#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
2743 &net2272_bfin_device,
2744#endif
2745
2746#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002747 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -07002748#endif
2749
Cliff Cai1e9aa952009-03-28 23:28:51 +08002750#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
2751 &bfin_sport_spi0_device,
2752 &bfin_sport_spi1_device,
2753#endif
2754
Bryan Wu1394f032007-05-06 14:50:22 -07002755#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2756 &bfin_fb_device,
2757#endif
2758
Michael Hennerich2043f3f2008-10-13 14:46:30 +08002759#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
2760 &bfin_lq035q1_device,
2761#endif
2762
Bryan Wu1394f032007-05-06 14:50:22 -07002763#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00002764#ifdef CONFIG_SERIAL_BFIN_UART0
2765 &bfin_uart0_device,
2766#endif
2767#ifdef CONFIG_SERIAL_BFIN_UART1
2768 &bfin_uart1_device,
2769#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002770#endif
2771
Graf Yang5be36d22008-04-25 03:09:15 +08002772#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +08002773#ifdef CONFIG_BFIN_SIR0
2774 &bfin_sir0_device,
2775#endif
2776#ifdef CONFIG_BFIN_SIR1
2777 &bfin_sir1_device,
2778#endif
Graf Yang5be36d22008-04-25 03:09:15 +08002779#endif
2780
Bryan Wu1394f032007-05-06 14:50:22 -07002781#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
2782 &i2c_bfin_twi_device,
2783#endif
2784
2785#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00002786#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002787 &bfin_sport0_uart_device,
Sonic Zhangdf5de262009-09-23 05:01:56 +00002788#endif
2789#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002790 &bfin_sport1_uart_device,
2791#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00002792#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002793
2794#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2795 &bfin_pata_device,
2796#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +08002797
2798#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
2799 &bfin_device_gpiokeys,
2800#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +08002801
Mike Frysingerfc689112008-06-25 11:41:42 +08002802#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
2803 &bfin_async_nand_device,
2804#endif
2805
Mike Frysinger793dc272008-03-26 08:09:12 +08002806#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +08002807 &stamp_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +08002808#endif
Barry Song83124402009-08-06 21:03:02 +00002809
Barry Song336746e2009-10-13 09:19:18 +00002810#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2811 &bfin_i2s,
2812#endif
2813
Barry Song83124402009-08-06 21:03:02 +00002814#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2815 &bfin_tdm,
2816#endif
Barry Song336746e2009-10-13 09:19:18 +00002817
2818#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2819 &bfin_ac97,
2820#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +00002821#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2822#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2823 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2824 &ad5398_virt_consumer_device,
2825#endif
2826#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2827 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2828 &ad5398_userspace_consumer_device,
2829#endif
2830#endif
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002831
2832#if defined(CONFIG_REGULATOR_ADP_SWITCH) || defined(CONFIG_REGULATOR_ADP_SWITCH_MODULE)
2833 &adp_switch_device,
2834#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2835 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2836 &adp122_userspace_consumer_device,
2837 &adp150_userspace_consumer_device,
2838#endif
2839#endif
Michael Hennerich0891bae2010-03-08 11:58:53 +00002840
2841#if defined(CONFIG_IIO_GPIO_TRIGGER) || \
2842 defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2843 &iio_gpio_trigger,
2844#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002845};
2846
2847static int __init stamp_init(void)
2848{
Harvey Harrisonb85d8582008-04-23 09:39:01 +08002849 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Mike Frysingerfc689112008-06-25 11:41:42 +08002850 bfin_plat_nand_init();
Mike Frysinger0531c462010-01-19 07:04:29 +00002851 adf702x_mac_init();
Bryan Wu1394f032007-05-06 14:50:22 -07002852 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
Sonic Zhangdf5de262009-09-23 05:01:56 +00002853 i2c_register_board_info(0, bfin_i2c_board_info,
2854 ARRAY_SIZE(bfin_i2c_board_info));
Mike Frysinger5bda2722008-06-07 15:03:01 +08002855 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002856
Bryan Wu1394f032007-05-06 14:50:22 -07002857 return 0;
2858}
2859
2860arch_initcall(stamp_init);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002861
Sonic Zhangc13ce9f2009-09-23 09:37:46 +00002862
2863static struct platform_device *stamp_early_devices[] __initdata = {
2864#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
2865#ifdef CONFIG_SERIAL_BFIN_UART0
2866 &bfin_uart0_device,
2867#endif
2868#ifdef CONFIG_SERIAL_BFIN_UART1
2869 &bfin_uart1_device,
2870#endif
2871#endif
2872
2873#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2874#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2875 &bfin_sport0_uart_device,
2876#endif
2877#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2878 &bfin_sport1_uart_device,
2879#endif
2880#endif
2881};
2882
2883void __init native_machine_early_platform_add_devices(void)
2884{
2885 printk(KERN_INFO "register early platform devices\n");
2886 early_platform_add_devices(stamp_early_devices,
2887 ARRAY_SIZE(stamp_early_devices));
2888}
2889
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002890void native_machine_restart(char *cmd)
2891{
2892 /* workaround reboot hang when booting from SPI */
2893 if ((bfin_read_SYSCR() & 0x7) == 0x3)
Sonic Zhangb52dae32009-02-04 16:49:45 +08002894 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002895}
Mike Frysinger137b1522007-11-22 16:07:03 +08002896
2897/*
2898 * Currently the MAC address is saved in Flash by U-Boot
2899 */
2900#define FLASH_MAC 0x203f0000
Mike Frysinger9862cc52007-11-15 21:21:20 +08002901void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +08002902{
2903 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
2904 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
2905}
Mike Frysinger9862cc52007-11-15 21:21:20 +08002906EXPORT_SYMBOL(bfin_get_ether_addr);