blob: c9e0e85629bfa9355563916ed8bf96e8a107dafd [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 Zhang1b04cbe2010-06-02 05:00:21 +000038#ifdef CONFIG_REGULATOR_FIXED_VOLTAGE
39#include <linux/regulator/fixed.h>
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +000040#endif
Sonic Zhang1b04cbe2010-06-02 05:00:21 +000041#include <linux/regulator/machine.h>
Sonic Zhangf32792d2010-02-09 02:47:09 +000042#include <linux/regulator/consumer.h>
43#include <linux/regulator/userspace-consumer.h>
Bryan Wu1394f032007-05-06 14:50:22 -070044
45/*
46 * Name the Board for the /proc/cpuinfo
47 */
Mike Frysingerfe85cad2008-11-18 17:48:22 +080048const char bfin_board_name[] = "ADI BF537-STAMP";
Bryan Wu1394f032007-05-06 14:50:22 -070049
50/*
51 * Driver needs to know address, irq and flag pin.
52 */
53
Bryan Wu1394f032007-05-06 14:50:22 -070054#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
Michael Hennerich3f375692008-11-18 17:48:22 +080055#include <linux/usb/isp1760.h>
56static struct resource bfin_isp1760_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -070057 [0] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080058 .start = 0x203C0000,
59 .end = 0x203C0000 + 0x000fffff,
Bryan Wu1394f032007-05-06 14:50:22 -070060 .flags = IORESOURCE_MEM,
61 },
62 [1] = {
Michael Hennerich3f375692008-11-18 17:48:22 +080063 .start = IRQ_PF7,
64 .end = IRQ_PF7,
Michael Hennerich6a6be3d2009-01-07 23:14:39 +080065 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Bryan Wu1394f032007-05-06 14:50:22 -070066 },
67};
68
Michael Hennerich3f375692008-11-18 17:48:22 +080069static struct isp1760_platform_data isp1760_priv = {
70 .is_isp1761 = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080071 .bus_width_16 = 1,
72 .port1_otg = 0,
73 .analog_oc = 0,
74 .dack_polarity_high = 0,
75 .dreq_polarity_high = 0,
76};
77
78static struct platform_device bfin_isp1760_device = {
Michael Hennerichc6feb7682009-10-15 10:37:33 +000079 .name = "isp1760",
Bryan Wu1394f032007-05-06 14:50:22 -070080 .id = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080081 .dev = {
82 .platform_data = &isp1760_priv,
83 },
84 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
85 .resource = bfin_isp1760_resources,
Bryan Wu1394f032007-05-06 14:50:22 -070086};
Bryan Wu1394f032007-05-06 14:50:22 -070087#endif
88
Michael Hennerich2463ef22008-01-27 16:49:48 +080089#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
Michael Hennerich2463ef22008-01-27 16:49:48 +080090#include <linux/gpio_keys.h>
91
92static struct gpio_keys_button bfin_gpio_keys_table[] = {
93 {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
94 {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
95 {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
96 {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
97};
98
99static struct gpio_keys_platform_data bfin_gpio_keys_data = {
100 .buttons = bfin_gpio_keys_table,
101 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
102};
103
104static struct platform_device bfin_device_gpiokeys = {
105 .name = "gpio-keys",
106 .dev = {
107 .platform_data = &bfin_gpio_keys_data,
108 },
109};
110#endif
111
Bryan Wu1394f032007-05-06 14:50:22 -0700112#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
113static struct resource bfin_pcmcia_cf_resources[] = {
114 {
115 .start = 0x20310000, /* IO PORT */
116 .end = 0x20312000,
117 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800118 }, {
Simon Arlottd2d50aa2007-06-11 15:31:30 +0800119 .start = 0x20311000, /* Attribute Memory */
Bryan Wu1394f032007-05-06 14:50:22 -0700120 .end = 0x20311FFF,
121 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800122 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700123 .start = IRQ_PF4,
124 .end = IRQ_PF4,
125 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800126 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700127 .start = 6, /* Card Detect PF6 */
128 .end = 6,
129 .flags = IORESOURCE_IRQ,
130 },
131};
132
133static struct platform_device bfin_pcmcia_cf_device = {
134 .name = "bfin_cf_pcmcia",
135 .id = -1,
136 .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
137 .resource = bfin_pcmcia_cf_resources,
138};
139#endif
140
141#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
142static struct platform_device rtc_device = {
143 .name = "rtc-bfin",
144 .id = -1,
145};
146#endif
147
148#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
Michael Hennerich61f09b52009-07-24 08:48:31 +0000149#include <linux/smc91x.h>
150
151static struct smc91x_platdata smc91x_info = {
152 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
153 .leda = RPC_LED_100_10,
154 .ledb = RPC_LED_TX_RX,
155};
156
Bryan Wu1394f032007-05-06 14:50:22 -0700157static struct resource smc91x_resources[] = {
158 {
159 .name = "smc91x-regs",
160 .start = 0x20300300,
161 .end = 0x20300300 + 16,
162 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800163 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700164
165 .start = IRQ_PF7,
166 .end = IRQ_PF7,
167 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
168 },
169};
170static struct platform_device smc91x_device = {
171 .name = "smc91x",
172 .id = 0,
173 .num_resources = ARRAY_SIZE(smc91x_resources),
174 .resource = smc91x_resources,
Michael Hennerich61f09b52009-07-24 08:48:31 +0000175 .dev = {
176 .platform_data = &smc91x_info,
177 },
Bryan Wu1394f032007-05-06 14:50:22 -0700178};
179#endif
180
Alex Landauf40d24d2007-07-12 12:11:48 +0800181#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
182static struct resource dm9000_resources[] = {
183 [0] = {
184 .start = 0x203FB800,
Barry Songb3dec4a2009-07-27 06:42:50 +0000185 .end = 0x203FB800 + 1,
Alex Landauf40d24d2007-07-12 12:11:48 +0800186 .flags = IORESOURCE_MEM,
187 },
188 [1] = {
Barry Songb3dec4a2009-07-27 06:42:50 +0000189 .start = 0x203FB804,
190 .end = 0x203FB804 + 1,
191 .flags = IORESOURCE_MEM,
192 },
193 [2] = {
Alex Landauf40d24d2007-07-12 12:11:48 +0800194 .start = IRQ_PF9,
195 .end = IRQ_PF9,
196 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
197 },
198};
199
200static struct platform_device dm9000_device = {
201 .name = "dm9000",
202 .id = -1,
203 .num_resources = ARRAY_SIZE(dm9000_resources),
204 .resource = dm9000_resources,
205};
206#endif
207
Bryan Wu1394f032007-05-06 14:50:22 -0700208#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
209static struct resource sl811_hcd_resources[] = {
210 {
211 .start = 0x20340000,
212 .end = 0x20340000,
213 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800214 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700215 .start = 0x20340004,
216 .end = 0x20340004,
217 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800218 }, {
Mike Frysinger01218652009-12-21 15:07:43 +0000219 .start = IRQ_PF4,
220 .end = IRQ_PF4,
Bryan Wu1394f032007-05-06 14:50:22 -0700221 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
222 },
223};
224
225#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
226void sl811_port_power(struct device *dev, int is_on)
227{
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800228 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
Michael Hennerichacbcd262008-01-22 18:36:20 +0800229 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
Bryan Wu1394f032007-05-06 14:50:22 -0700230}
231#endif
232
233static struct sl811_platform_data sl811_priv = {
234 .potpg = 10,
235 .power = 250, /* == 500mA */
236#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
237 .port_power = &sl811_port_power,
238#endif
239};
240
241static struct platform_device sl811_hcd_device = {
242 .name = "sl811-hcd",
243 .id = 0,
244 .dev = {
245 .platform_data = &sl811_priv,
246 },
247 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
248 .resource = sl811_hcd_resources,
249};
250#endif
251
252#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
253static struct resource isp1362_hcd_resources[] = {
254 {
255 .start = 0x20360000,
256 .end = 0x20360000,
257 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800258 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700259 .start = 0x20360004,
260 .end = 0x20360004,
261 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800262 }, {
Mike Frysinger21b03cf2009-09-24 05:44:36 +0000263 .start = IRQ_PF3,
264 .end = IRQ_PF3,
Michael Hennerich9e758942010-03-18 12:51:49 +0000265 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
Bryan Wu1394f032007-05-06 14:50:22 -0700266 },
267};
268
269static struct isp1362_platform_data isp1362_priv = {
270 .sel15Kres = 1,
271 .clknotstop = 0,
272 .oc_enable = 0,
273 .int_act_high = 0,
274 .int_edge_triggered = 0,
275 .remote_wakeup_connected = 0,
276 .no_power_switching = 1,
277 .power_switching_mode = 0,
278};
279
280static struct platform_device isp1362_hcd_device = {
281 .name = "isp1362-hcd",
282 .id = 0,
283 .dev = {
284 .platform_data = &isp1362_priv,
285 },
286 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
287 .resource = isp1362_hcd_resources,
288};
289#endif
290
Barry Song706a01b2009-11-02 07:29:07 +0000291#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
292unsigned short bfin_can_peripherals[] = {
293 P_CAN0_RX, P_CAN0_TX, 0
294};
295
296static struct resource bfin_can_resources[] = {
297 {
298 .start = 0xFFC02A00,
299 .end = 0xFFC02FFF,
300 .flags = IORESOURCE_MEM,
301 },
302 {
303 .start = IRQ_CAN_RX,
304 .end = IRQ_CAN_RX,
305 .flags = IORESOURCE_IRQ,
306 },
307 {
308 .start = IRQ_CAN_TX,
309 .end = IRQ_CAN_TX,
310 .flags = IORESOURCE_IRQ,
311 },
312 {
313 .start = IRQ_CAN_ERROR,
314 .end = IRQ_CAN_ERROR,
315 .flags = IORESOURCE_IRQ,
316 },
317};
318
319static struct platform_device bfin_can_device = {
320 .name = "bfin_can",
321 .num_resources = ARRAY_SIZE(bfin_can_resources),
322 .resource = bfin_can_resources,
323 .dev = {
324 .platform_data = &bfin_can_peripherals, /* Passed to driver */
325 },
326};
327#endif
328
Bryan Wu1394f032007-05-06 14:50:22 -0700329#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +0800330static struct platform_device bfin_mii_bus = {
331 .name = "bfin_mii_bus",
332};
333
Bryan Wu1394f032007-05-06 14:50:22 -0700334static struct platform_device bfin_mac_device = {
335 .name = "bfin_mac",
Graf Yang65319622009-02-04 16:49:45 +0800336 .dev.platform_data = &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -0700337};
338#endif
339
340#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
341static struct resource net2272_bfin_resources[] = {
342 {
343 .start = 0x20300000,
344 .end = 0x20300000 + 0x100,
345 .flags = IORESOURCE_MEM,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800346 }, {
Bryan Wu1394f032007-05-06 14:50:22 -0700347 .start = IRQ_PF7,
348 .end = IRQ_PF7,
349 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
350 },
351};
352
353static struct platform_device net2272_bfin_device = {
354 .name = "net2272",
355 .id = -1,
356 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
357 .resource = net2272_bfin_resources,
358};
359#endif
360
Mike Frysingerfc689112008-06-25 11:41:42 +0800361#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
362#ifdef CONFIG_MTD_PARTITIONS
363const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
364
365static struct mtd_partition bfin_plat_nand_partitions[] = {
366 {
Robin Getzaa582972008-08-05 17:47:29 +0800367 .name = "linux kernel(nand)",
Mike Frysingerfc689112008-06-25 11:41:42 +0800368 .size = 0x400000,
369 .offset = 0,
370 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800371 .name = "file system(nand)",
Mike Frysingerfc689112008-06-25 11:41:42 +0800372 .size = MTDPART_SIZ_FULL,
373 .offset = MTDPART_OFS_APPEND,
374 },
375};
376#endif
377
378#define BFIN_NAND_PLAT_CLE 2
379#define BFIN_NAND_PLAT_ALE 1
380static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
381{
382 struct nand_chip *this = mtd->priv;
383
384 if (cmd == NAND_CMD_NONE)
385 return;
386
387 if (ctrl & NAND_CLE)
388 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
389 else
390 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
391}
392
393#define BFIN_NAND_PLAT_READY GPIO_PF3
394static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
395{
396 return gpio_get_value(BFIN_NAND_PLAT_READY);
397}
398
399static struct platform_nand_data bfin_plat_nand_data = {
400 .chip = {
Marek Vasutef566092010-08-12 03:53:54 +0100401 .nr_chips = 1,
Mike Frysingerfc689112008-06-25 11:41:42 +0800402 .chip_delay = 30,
403#ifdef CONFIG_MTD_PARTITIONS
404 .part_probe_types = part_probes,
405 .partitions = bfin_plat_nand_partitions,
406 .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
407#endif
408 },
409 .ctrl = {
410 .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
411 .dev_ready = bfin_plat_nand_dev_ready,
412 },
413};
414
415#define MAX(x, y) (x > y ? x : y)
416static struct resource bfin_plat_nand_resources = {
417 .start = 0x20212000,
418 .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
Mike Frysinger67d99632010-03-16 14:28:44 +0000419 .flags = IORESOURCE_MEM,
Mike Frysingerfc689112008-06-25 11:41:42 +0800420};
421
422static struct platform_device bfin_async_nand_device = {
423 .name = "gen_nand",
424 .id = -1,
425 .num_resources = 1,
426 .resource = &bfin_plat_nand_resources,
427 .dev = {
428 .platform_data = &bfin_plat_nand_data,
429 },
430};
431
432static void bfin_plat_nand_init(void)
433{
434 gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
435}
436#else
437static void bfin_plat_nand_init(void) {}
438#endif
439
Mike Frysinger793dc272008-03-26 08:09:12 +0800440#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800441static struct mtd_partition stamp_partitions[] = {
442 {
Robin Getzaa582972008-08-05 17:47:29 +0800443 .name = "bootloader(nor)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800444 .size = 0x40000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800445 .offset = 0,
446 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800447 .name = "linux kernel(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800448 .size = 0x180000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800449 .offset = MTDPART_OFS_APPEND,
450 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800451 .name = "file system(nor)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800452 .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800453 .offset = MTDPART_OFS_APPEND,
454 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800455 .name = "MAC Address(nor)",
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800456 .size = MTDPART_SIZ_FULL,
457 .offset = 0x3F0000,
458 .mask_flags = MTD_WRITEABLE,
459 }
460};
461
462static struct physmap_flash_data stamp_flash_data = {
463 .width = 2,
464 .parts = stamp_partitions,
465 .nr_parts = ARRAY_SIZE(stamp_partitions),
Barry Song38e76732010-01-15 03:24:39 +0000466#ifdef CONFIG_ROMKERNEL
467 .probe_type = "map_rom",
468#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800469};
470
471static struct resource stamp_flash_resource = {
472 .start = 0x20000000,
473 .end = 0x203fffff,
474 .flags = IORESOURCE_MEM,
475};
476
477static struct platform_device stamp_flash_device = {
478 .name = "physmap-flash",
479 .id = 0,
480 .dev = {
481 .platform_data = &stamp_flash_data,
482 },
483 .num_resources = 1,
484 .resource = &stamp_flash_resource,
485};
Mike Frysinger793dc272008-03-26 08:09:12 +0800486#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800487
Bryan Wu1394f032007-05-06 14:50:22 -0700488#if defined(CONFIG_MTD_M25P80) \
489 || defined(CONFIG_MTD_M25P80_MODULE)
490static struct mtd_partition bfin_spi_flash_partitions[] = {
491 {
Robin Getzaa582972008-08-05 17:47:29 +0800492 .name = "bootloader(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800493 .size = 0x00040000,
Bryan Wu1394f032007-05-06 14:50:22 -0700494 .offset = 0,
495 .mask_flags = MTD_CAP_ROM
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800496 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800497 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800498 .size = 0x180000,
Mike Frysingeredf05642008-02-25 11:38:11 +0800499 .offset = MTDPART_OFS_APPEND,
Mike Frysinger1f83b8f2007-07-12 22:58:21 +0800500 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800501 .name = "file system(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800502 .size = MTDPART_SIZ_FULL,
503 .offset = MTDPART_OFS_APPEND,
Bryan Wu1394f032007-05-06 14:50:22 -0700504 }
505};
506
507static struct flash_platform_data bfin_spi_flash_data = {
508 .name = "m25p80",
509 .parts = bfin_spi_flash_partitions,
510 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
Michael Hennerich88a80782008-11-18 17:48:22 +0800511 /* .type = "m25p64", */
Bryan Wu1394f032007-05-06 14:50:22 -0700512};
513
514/* SPI flash chip (m25p64) */
515static struct bfin5xx_spi_chip spi_flash_chip_info = {
516 .enable_dma = 0, /* use dma transfer with this chip*/
517 .bits_per_word = 8,
518};
519#endif
520
Mike Frysingera261eec2009-05-20 14:05:36 +0000521#if defined(CONFIG_BFIN_SPI_ADC) \
522 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700523/* SPI ADC chip */
524static struct bfin5xx_spi_chip spi_adc_chip_info = {
525 .enable_dma = 1, /* use dma transfer with this chip*/
526 .bits_per_word = 16,
527};
528#endif
529
Barry Songd40bd712010-02-22 10:31:06 +0000530#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
531 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -0700532static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
533 .enable_dma = 0,
534 .bits_per_word = 16,
535};
536#endif
537
Barry Song3b827902010-01-27 09:01:36 +0000538#if defined(CONFIG_SND_BF5XX_SOC_AD193X) \
539 || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +0000540static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
541 .enable_dma = 0,
542 .bits_per_word = 8,
Barry Songd4b834c2009-06-04 10:14:17 +0000543};
544#endif
545
Yi Lia65912c2010-04-06 05:53:16 +0000546#if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) \
547 || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
548static struct bfin5xx_spi_chip adav801_spi_chip_info = {
549 .enable_dma = 0,
550 .bits_per_word = 8,
551};
552#endif
553
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000554#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000555#include <linux/input/ad714x.h>
556static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
557 .enable_dma = 0,
558 .bits_per_word = 16,
559};
560
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000561static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000562 {
563 .start_stage = 0,
564 .end_stage = 7,
565 .max_coord = 128,
566 },
567};
568
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000569static struct ad714x_button_plat ad7147_spi_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000570 {
571 .keycode = BTN_FORWARD,
572 .l_mask = 0,
573 .h_mask = 0x600,
574 },
575 {
576 .keycode = BTN_LEFT,
577 .l_mask = 0,
578 .h_mask = 0x500,
579 },
580 {
581 .keycode = BTN_MIDDLE,
582 .l_mask = 0,
583 .h_mask = 0x800,
584 },
585 {
586 .keycode = BTN_RIGHT,
587 .l_mask = 0x100,
588 .h_mask = 0x400,
589 },
590 {
591 .keycode = BTN_BACK,
592 .l_mask = 0x200,
593 .h_mask = 0x400,
594 },
595};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000596static struct ad714x_platform_data ad7147_spi_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000597 .slider_num = 1,
598 .button_num = 5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000599 .slider = ad7147_spi_slider_plat,
600 .button = ad7147_spi_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000601 .stage_cfg_reg = {
602 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
603 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
604 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
605 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
606 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
607 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
608 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
609 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
610 {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
611 {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
612 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
613 {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
614 },
615 .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
616};
617#endif
618
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000619#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Barry Song427f2772009-07-17 07:04:55 +0000620#include <linux/input/ad714x.h>
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000621static struct ad714x_button_plat ad7142_i2c_button_plat[] = {
Barry Song427f2772009-07-17 07:04:55 +0000622 {
623 .keycode = BTN_1,
624 .l_mask = 0,
625 .h_mask = 0x1,
626 },
627 {
628 .keycode = BTN_2,
629 .l_mask = 0,
630 .h_mask = 0x2,
631 },
632 {
633 .keycode = BTN_3,
634 .l_mask = 0,
635 .h_mask = 0x4,
636 },
637 {
638 .keycode = BTN_4,
639 .l_mask = 0x0,
640 .h_mask = 0x8,
641 },
642};
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000643static struct ad714x_platform_data ad7142_i2c_platform_data = {
Barry Song427f2772009-07-17 07:04:55 +0000644 .button_num = 4,
Mike Frysinger5b7c5772009-10-12 15:56:58 +0000645 .button = ad7142_i2c_button_plat,
Barry Song427f2772009-07-17 07:04:55 +0000646 .stage_cfg_reg = {
647 /* fixme: figure out right setting for all comoponent according
648 * to hardware feature of EVAL-AD7142EB board */
649 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
650 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
651 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
652 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
653 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
654 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
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 },
662 .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
663};
664#endif
665
Graf Yangf5f95312010-02-10 07:15:59 +0000666#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
667static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {
668 .enable_dma = 0,
669 .bits_per_word = 16,
670};
671#endif
672
Graf Yangdf6a9492010-02-21 10:23:07 +0000673#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
674unsigned short ad2s120x_platform_data[] = {
675 /* used as SAMPLE and RDVEL */
676 GPIO_PF5, GPIO_PF6, 0
677};
678
679static struct bfin5xx_spi_chip ad2s120x_spi_chip_info = {
680 .enable_dma = 0,
681 .bits_per_word = 16,
682};
683#endif
684
Graf Yang848c51c2010-02-26 11:49:52 +0000685#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
686unsigned short ad2s1210_platform_data[] = {
687 /* use as SAMPLE, A0, A1 */
688 GPIO_PF7, GPIO_PF8, GPIO_PF9,
689# if defined(CONFIG_AD2S1210_GPIO_INPUT) || defined(CONFIG_AD2S1210_GPIO_OUTPUT)
690 /* the RES0 and RES1 pins */
691 GPIO_PF4, GPIO_PF5,
692# endif
693 0,
694};
695
696static struct bfin5xx_spi_chip ad2s1210_spi_chip_info = {
697 .enable_dma = 0,
698 .bits_per_word = 8,
699};
700#endif
701
Michael Hennerich0891bae2010-03-08 11:58:53 +0000702#if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE)
703static struct bfin5xx_spi_chip ad7314_spi_chip_info = {
704 .enable_dma = 0,
705 .bits_per_word = 16,
706};
707#endif
708
709#if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE)
710static unsigned short ad7816_platform_data[] = {
711 GPIO_PF4, /* rdwr_pin */
712 GPIO_PF5, /* convert_pin */
713 GPIO_PF7, /* busy_pin */
714 0,
715};
716
717static struct bfin5xx_spi_chip ad7816_spi_chip_info = {
718 .enable_dma = 0,
719 .bits_per_word = 8,
720};
721#endif
722
723#if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE)
724static unsigned long adt7310_platform_data[3] = {
725/* INT bound temperature alarm event. line 1 */
726 IRQ_PG4, IRQF_TRIGGER_LOW,
727/* CT bound temperature alarm event irq_flags. line 0 */
728 IRQF_TRIGGER_LOW,
729};
730
731static struct bfin5xx_spi_chip adt7310_spi_chip_info = {
732 .enable_dma = 0,
733 .bits_per_word = 8,
734};
735#endif
736
737#if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE)
738static unsigned short ad7298_platform_data[] = {
739 GPIO_PF7, /* busy_pin */
740 0,
741};
742
743static struct bfin5xx_spi_chip ad7298_spi_chip_info = {
744 .enable_dma = 0,
745 .bits_per_word = 16,
746};
747#endif
748
749#if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE)
750static unsigned long adt7316_spi_data[2] = {
751 IRQF_TRIGGER_LOW, /* interrupt flags */
752 GPIO_PF7, /* ldac_pin, 0 means DAC/LDAC registers control DAC update */
753};
754
755static struct bfin5xx_spi_chip adt7316_spi_chip_info = {
756 .enable_dma = 0,
757 .bits_per_word = 8,
758};
759#endif
760
Yi Lif79ea4c2009-01-07 23:14:38 +0800761#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
762#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
763
764static int bfin_mmc_spi_init(struct device *dev,
765 irqreturn_t (*detect_int)(int, void *), void *data)
766{
767 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
768 IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
769}
770
771static void bfin_mmc_spi_exit(struct device *dev, void *data)
772{
773 free_irq(MMC_SPI_CARD_DETECT_INT, data);
774}
775
776static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
777 .init = bfin_mmc_spi_init,
778 .exit = bfin_mmc_spi_exit,
779 .detect_delay = 100, /* msecs */
780};
781
782static struct bfin5xx_spi_chip mmc_spi_chip_info = {
783 .enable_dma = 0,
784 .bits_per_word = 8,
Yi Lie68d1eb2009-06-03 09:46:22 +0000785 .pio_interrupt = 0,
Yi Lif79ea4c2009-01-07 23:14:38 +0800786};
787#endif
788
Bryan Wu1394f032007-05-06 14:50:22 -0700789#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800790#include <linux/spi/ad7877.h>
Bryan Wu1394f032007-05-06 14:50:22 -0700791static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
Bryan Wu1394f032007-05-06 14:50:22 -0700792 .enable_dma = 0,
793 .bits_per_word = 16,
794};
795
796static const struct ad7877_platform_data bfin_ad7877_ts_info = {
797 .model = 7877,
798 .vref_delay_usecs = 50, /* internal, no capacitor */
799 .x_plate_ohms = 419,
800 .y_plate_ohms = 486,
801 .pressure_max = 1000,
802 .pressure_min = 0,
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000803 .stopacq_polarity = 1,
804 .first_conversion_delay = 3,
805 .acquisition_time = 1,
806 .averaging = 1,
807 .pen_down_acc_interval = 1,
Bryan Wu1394f032007-05-06 14:50:22 -0700808};
809#endif
810
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800811#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
812#include <linux/spi/ad7879.h>
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800813static const struct ad7879_platform_data bfin_ad7879_ts_info = {
814 .model = 7879, /* Model = AD7879 */
815 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
816 .pressure_max = 10000,
817 .pressure_min = 0,
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000818 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
819 .acquisition_time = 1, /* 4us acquisition time per sample */
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800820 .median = 2, /* do 8 measurements */
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000821 .averaging = 1, /* take the average of 4 middle samples */
822 .pen_down_acc_interval = 255, /* 9.4 ms */
Michael Hennerich244d3422009-12-18 09:29:39 +0000823 .gpio_export = 1, /* Export GPIO to gpiolib */
824 .gpio_base = -1, /* Dynamic allocation */
Michael Hennerich46aa04f2008-10-13 11:30:17 +0800825};
826#endif
827
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000828#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000829#include <linux/input/adxl34x.h>
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000830static const struct adxl34x_platform_data adxl34x_info = {
831 .x_axis_offset = 0,
832 .y_axis_offset = 0,
833 .z_axis_offset = 0,
834 .tap_threshold = 0x31,
835 .tap_duration = 0x10,
836 .tap_latency = 0x60,
837 .tap_window = 0xF0,
838 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
839 .act_axis_control = 0xFF,
840 .activity_threshold = 5,
841 .inactivity_threshold = 3,
842 .inactivity_time = 4,
843 .free_fall_threshold = 0x7,
844 .free_fall_time = 0x20,
845 .data_rate = 0x8,
846 .data_range = ADXL_FULL_RES,
847
848 .ev_type = EV_ABS,
849 .ev_code_x = ABS_X, /* EV_REL */
850 .ev_code_y = ABS_Y, /* EV_REL */
851 .ev_code_z = ABS_Z, /* EV_REL */
852
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000853 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000854
855/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
856/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
857 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
858 .fifo_mode = ADXL_FIFO_STREAM,
Michael Hennerich6ba255f2009-12-08 11:34:07 +0000859 .orientation_enable = ADXL_EN_ORIENTATION_3D,
860 .deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,
861 .divisor_length = ADXL_LP_FILTER_DIVISOR_16,
862 /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
863 .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000864};
865#endif
866
Michael Hennerichf5150152008-10-16 23:23:18 +0800867#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
868static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
869 .enable_dma = 0,
870 .bits_per_word = 16,
871};
872#endif
873
Michael Hennerich6e668932008-02-09 01:54:09 +0800874#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
875static struct bfin5xx_spi_chip spidev_chip_info = {
876 .enable_dma = 0,
877 .bits_per_word = 8,
878};
879#endif
880
Michael Hennerich2043f3f2008-10-13 14:46:30 +0800881#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
882static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
883 .enable_dma = 0,
884 .bits_per_word = 8,
885};
886#endif
887
Michael Hennerich85a192e2009-01-07 23:14:38 +0800888#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
889static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
890 .enable_dma = 1,
891 .bits_per_word = 8,
Michael Hennerich85a192e2009-01-07 23:14:38 +0800892};
893#endif
894
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000895#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
896static struct bfin5xx_spi_chip adf7021_spi_chip_info = {
897 .bits_per_word = 16,
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000898};
899
900#include <linux/spi/adf702x.h>
901#define TXREG 0x0160A470
902static const u32 adf7021_regs[] = {
903 0x09608FA0,
904 0x00575011,
905 0x00A7F092,
906 0x2B141563,
907 0x81F29E94,
908 0x00003155,
909 0x050A4F66,
910 0x00000007,
911 0x00000008,
912 0x000231E9,
913 0x3296354A,
914 0x891A2B3B,
915 0x00000D9C,
916 0x0000000D,
917 0x0000000E,
918 0x0000000F,
919};
920
921static struct adf702x_platform_data adf7021_platform_data = {
922 .regs_base = (void *)SPORT1_TCR1,
923 .dma_ch_rx = CH_SPORT1_RX,
924 .dma_ch_tx = CH_SPORT1_TX,
925 .irq_sport_err = IRQ_SPORT1_ERROR,
926 .gpio_int_rfs = GPIO_PF8,
927 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_RFS, P_SPORT1_DRPRI,
928 P_SPORT1_RSCLK, P_SPORT1_TSCLK, 0},
929 .adf702x_model = MODEL_ADF7021,
930 .adf702x_regs = adf7021_regs,
931 .tx_reg = TXREG,
932};
Mike Frysinger0531c462010-01-19 07:04:29 +0000933static inline void adf702x_mac_init(void)
934{
935 random_ether_addr(adf7021_platform_data.mac_addr);
936}
937#else
938static inline void adf702x_mac_init(void) {}
Michael Hennerichefaf7cd2009-11-12 16:54:08 +0000939#endif
940
Michael Hennerichfe5b25c2010-02-04 14:41:39 +0000941#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
942#include <linux/spi/ads7846.h>
943static struct bfin5xx_spi_chip ad7873_spi_chip_info = {
944 .bits_per_word = 8,
945};
946
947static int ads7873_get_pendown_state(void)
948{
949 return gpio_get_value(GPIO_PF6);
950}
951
952static struct ads7846_platform_data __initdata ad7873_pdata = {
953 .model = 7873, /* AD7873 */
954 .x_max = 0xfff,
955 .y_max = 0xfff,
956 .x_plate_ohms = 620,
957 .debounce_max = 1,
958 .debounce_rep = 0,
959 .debounce_tol = (~0),
960 .get_pendown_state = ads7873_get_pendown_state,
961};
962#endif
963
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800964#if defined(CONFIG_MTD_DATAFLASH) \
965 || defined(CONFIG_MTD_DATAFLASH_MODULE)
Michael Hennerichceac2652008-08-25 17:39:11 +0800966
967static struct mtd_partition bfin_spi_dataflash_partitions[] = {
968 {
969 .name = "bootloader(spi)",
970 .size = 0x00040000,
971 .offset = 0,
972 .mask_flags = MTD_CAP_ROM
973 }, {
974 .name = "linux kernel(spi)",
Grace Pan6ecb5b62009-01-07 23:14:38 +0800975 .size = 0x180000,
Michael Hennerichceac2652008-08-25 17:39:11 +0800976 .offset = MTDPART_OFS_APPEND,
977 }, {
978 .name = "file system(spi)",
979 .size = MTDPART_SIZ_FULL,
980 .offset = MTDPART_OFS_APPEND,
981 }
982};
983
984static struct flash_platform_data bfin_spi_dataflash_data = {
985 .name = "SPI Dataflash",
986 .parts = bfin_spi_dataflash_partitions,
987 .nr_parts = ARRAY_SIZE(bfin_spi_dataflash_partitions),
988};
989
Michael Hennerich8e9d5c72008-04-24 08:46:19 +0800990/* DataFlash chip */
991static struct bfin5xx_spi_chip data_flash_chip_info = {
992 .enable_dma = 0, /* use dma transfer with this chip*/
993 .bits_per_word = 8,
994};
995#endif
996
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000997#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
998static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
999 .enable_dma = 0, /* use dma transfer with this chip*/
1000 .bits_per_word = 8,
1001};
1002#endif
1003
Michael Hennerich0891bae2010-03-08 11:58:53 +00001004#if defined(CONFIG_AD7476) || defined(CONFIG_AD7476_MODULE)
1005static struct bfin5xx_spi_chip spi_ad7476_chip_info = {
1006 .enable_dma = 0, /* use dma transfer with this chip*/
1007 .bits_per_word = 8,
1008};
1009#endif
1010
Bryan Wu1394f032007-05-06 14:50:22 -07001011static struct spi_board_info bfin_spi_board_info[] __initdata = {
1012#if defined(CONFIG_MTD_M25P80) \
1013 || defined(CONFIG_MTD_M25P80_MODULE)
1014 {
1015 /* the modalias must be the same as spi device driver name */
1016 .modalias = "m25p80", /* Name of spi_driver for this device */
1017 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001018 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -07001019 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
1020 .platform_data = &bfin_spi_flash_data,
1021 .controller_data = &spi_flash_chip_info,
1022 .mode = SPI_MODE_3,
1023 },
1024#endif
Michael Hennerich8e9d5c72008-04-24 08:46:19 +08001025#if defined(CONFIG_MTD_DATAFLASH) \
1026 || defined(CONFIG_MTD_DATAFLASH_MODULE)
1027 { /* DataFlash chip */
1028 .modalias = "mtd_dataflash",
Michael Hennerichceac2652008-08-25 17:39:11 +08001029 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
Michael Hennerich8e9d5c72008-04-24 08:46:19 +08001030 .bus_num = 0, /* Framework bus number */
1031 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
Michael Hennerichceac2652008-08-25 17:39:11 +08001032 .platform_data = &bfin_spi_dataflash_data,
Michael Hennerich8e9d5c72008-04-24 08:46:19 +08001033 .controller_data = &data_flash_chip_info,
1034 .mode = SPI_MODE_3,
1035 },
1036#endif
Mike Frysingera261eec2009-05-20 14:05:36 +00001037#if defined(CONFIG_BFIN_SPI_ADC) \
1038 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -07001039 {
1040 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
1041 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001042 .bus_num = 0, /* Framework bus number */
Bryan Wu1394f032007-05-06 14:50:22 -07001043 .chip_select = 1, /* Framework chip select. */
1044 .platform_data = NULL, /* No spi_driver specific config */
1045 .controller_data = &spi_adc_chip_info,
1046 },
1047#endif
1048
Barry Songd40bd712010-02-22 10:31:06 +00001049#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
1050 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -07001051 {
Barry Songd40bd712010-02-22 10:31:06 +00001052 .modalias = "ad183x",
Bryan Wu1394f032007-05-06 14:50:22 -07001053 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001054 .bus_num = 0,
Barry Song7ba80062010-01-28 09:37:21 +00001055 .chip_select = 4,
Barry Songd40bd712010-02-22 10:31:06 +00001056 .platform_data = "ad1836", /* only includes chip name for the moment */
Bryan Wu1394f032007-05-06 14:50:22 -07001057 .controller_data = &ad1836_spi_chip_info,
Barry Song83124402009-08-06 21:03:02 +00001058 .mode = SPI_MODE_3,
Bryan Wu1394f032007-05-06 14:50:22 -07001059 },
1060#endif
Barry Songd4b834c2009-06-04 10:14:17 +00001061
Barry Song3b827902010-01-27 09:01:36 +00001062#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
Barry Songd4b834c2009-06-04 10:14:17 +00001063 {
Barry Song3b827902010-01-27 09:01:36 +00001064 .modalias = "ad193x",
Barry Songd4b834c2009-06-04 10:14:17 +00001065 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1066 .bus_num = 0,
Barry Song08a54bf2009-09-18 09:14:38 +00001067 .chip_select = 5,
Barry Songd4b834c2009-06-04 10:14:17 +00001068 .controller_data = &ad1938_spi_chip_info,
1069 .mode = SPI_MODE_3,
1070 },
1071#endif
1072
Yi Lia65912c2010-04-06 05:53:16 +00001073#if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
1074 {
1075 .modalias = "adav80x",
1076 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1077 .bus_num = 0,
1078 .chip_select = 1,
1079 .controller_data = &adav801_spi_chip_info,
1080 .mode = SPI_MODE_3,
1081 },
1082#endif
1083
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001084#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
Barry Song427f2772009-07-17 07:04:55 +00001085 {
1086 .modalias = "ad714x_captouch",
1087 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1088 .irq = IRQ_PF4,
1089 .bus_num = 0,
1090 .chip_select = 5,
1091 .mode = SPI_MODE_3,
Mike Frysinger5b7c5772009-10-12 15:56:58 +00001092 .platform_data = &ad7147_spi_platform_data,
Barry Song427f2772009-07-17 07:04:55 +00001093 .controller_data = &ad7147_spi_chip_info,
1094 },
1095#endif
1096
Graf Yangf5f95312010-02-10 07:15:59 +00001097#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE)
1098 {
1099 .modalias = "ad2s90",
1100 .bus_num = 0,
1101 .chip_select = 3, /* change it for your board */
Barry Song6fbfa0c2010-04-12 05:04:15 +00001102 .mode = SPI_MODE_3,
Graf Yangf5f95312010-02-10 07:15:59 +00001103 .platform_data = NULL,
1104 .controller_data = &ad2s90_spi_chip_info,
1105 },
1106#endif
1107
Graf Yangdf6a9492010-02-21 10:23:07 +00001108#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE)
1109 {
1110 .modalias = "ad2s120x",
1111 .bus_num = 0,
1112 .chip_select = 4, /* CS, change it for your board */
1113 .platform_data = ad2s120x_platform_data,
1114 .controller_data = &ad2s120x_spi_chip_info,
1115 },
1116#endif
1117
Graf Yang848c51c2010-02-26 11:49:52 +00001118#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE)
1119 {
1120 .modalias = "ad2s1210",
1121 .max_speed_hz = 8192000,
1122 .bus_num = 0,
1123 .chip_select = 4, /* CS, change it for your board */
1124 .platform_data = ad2s1210_platform_data,
1125 .controller_data = &ad2s1210_spi_chip_info,
1126 },
1127#endif
1128
Michael Hennerich0891bae2010-03-08 11:58:53 +00001129#if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE)
1130 {
1131 .modalias = "ad7314",
1132 .max_speed_hz = 1000000,
1133 .bus_num = 0,
1134 .chip_select = 4, /* CS, change it for your board */
1135 .controller_data = &ad7314_spi_chip_info,
1136 .mode = SPI_MODE_1,
1137 },
1138#endif
1139
1140#if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE)
1141 {
1142 .modalias = "ad7818",
1143 .max_speed_hz = 1000000,
1144 .bus_num = 0,
1145 .chip_select = 4, /* CS, change it for your board */
1146 .platform_data = ad7816_platform_data,
1147 .controller_data = &ad7816_spi_chip_info,
1148 .mode = SPI_MODE_3,
1149 },
1150#endif
1151
1152#if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE)
1153 {
1154 .modalias = "adt7310",
1155 .max_speed_hz = 1000000,
1156 .irq = IRQ_PG5, /* CT alarm event. Line 0 */
1157 .bus_num = 0,
1158 .chip_select = 4, /* CS, change it for your board */
1159 .platform_data = adt7310_platform_data,
1160 .controller_data = &adt7310_spi_chip_info,
1161 .mode = SPI_MODE_3,
1162 },
1163#endif
1164
1165#if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE)
1166 {
1167 .modalias = "ad7298",
1168 .max_speed_hz = 1000000,
1169 .bus_num = 0,
1170 .chip_select = 4, /* CS, change it for your board */
1171 .platform_data = ad7298_platform_data,
1172 .controller_data = &ad7298_spi_chip_info,
1173 .mode = SPI_MODE_3,
1174 },
1175#endif
1176
1177#if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE)
1178 {
1179 .modalias = "adt7316",
1180 .max_speed_hz = 1000000,
1181 .irq = IRQ_PG5, /* interrupt line */
1182 .bus_num = 0,
1183 .chip_select = 4, /* CS, change it for your board */
1184 .platform_data = adt7316_spi_data,
1185 .controller_data = &adt7316_spi_chip_info,
1186 .mode = SPI_MODE_3,
1187 },
1188#endif
1189
Yi Lif79ea4c2009-01-07 23:14:38 +08001190#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
1191 {
1192 .modalias = "mmc_spi",
1193 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1194 .bus_num = 0,
1195 .chip_select = 4,
1196 .platform_data = &bfin_mmc_spi_pdata,
1197 .controller_data = &mmc_spi_chip_info,
1198 .mode = SPI_MODE_3,
1199 },
1200#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001201#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1202 {
1203 .modalias = "ad7877",
1204 .platform_data = &bfin_ad7877_ts_info,
1205 .irq = IRQ_PF6,
1206 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
Michael Hennerichc7d48962007-11-15 21:33:31 +08001207 .bus_num = 0,
Bryan Wu1394f032007-05-06 14:50:22 -07001208 .chip_select = 1,
1209 .controller_data = &spi_ad7877_chip_info,
1210 },
1211#endif
Michael Hennerichf5150152008-10-16 23:23:18 +08001212#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
Michael Hennerich46aa04f2008-10-13 11:30:17 +08001213 {
1214 .modalias = "ad7879",
1215 .platform_data = &bfin_ad7879_ts_info,
1216 .irq = IRQ_PF7,
1217 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1218 .bus_num = 0,
1219 .chip_select = 1,
1220 .controller_data = &spi_ad7879_chip_info,
1221 .mode = SPI_CPHA | SPI_CPOL,
1222 },
1223#endif
Michael Hennerich6e668932008-02-09 01:54:09 +08001224#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1225 {
1226 .modalias = "spidev",
1227 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1228 .bus_num = 0,
1229 .chip_select = 1,
1230 .controller_data = &spidev_chip_info,
1231 },
1232#endif
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001233#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1234 {
1235 .modalias = "bfin-lq035q1-spi",
1236 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1237 .bus_num = 0,
Michael Hennerich46aa04f2008-10-13 11:30:17 +08001238 .chip_select = 2,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001239 .controller_data = &lq035q1_spi_chip_info,
1240 .mode = SPI_CPHA | SPI_CPOL,
1241 },
1242#endif
Michael Hennerich85a192e2009-01-07 23:14:38 +08001243#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
1244 {
1245 .modalias = "enc28j60",
1246 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
1247 .irq = IRQ_PF6,
1248 .bus_num = 0,
Barry Songf9f0e3b2009-11-17 09:45:59 +00001249 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
Michael Hennerich85a192e2009-01-07 23:14:38 +08001250 .controller_data = &enc28j60_spi_chip_info,
1251 .mode = SPI_MODE_0,
1252 },
1253#endif
Michael Hennerich57af8ed2009-10-16 12:35:20 +00001254#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1255 {
1256 .modalias = "adxl34x",
1257 .platform_data = &adxl34x_info,
1258 .irq = IRQ_PF6,
1259 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1260 .bus_num = 0,
1261 .chip_select = 2,
1262 .controller_data = &spi_adxl34x_chip_info,
1263 .mode = SPI_MODE_3,
1264 },
1265#endif
Michael Hennerichefaf7cd2009-11-12 16:54:08 +00001266#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
1267 {
1268 .modalias = "adf702x",
1269 .max_speed_hz = 16000000, /* max spi clock (SCK) speed in HZ */
1270 .bus_num = 0,
Barry Songf9f0e3b2009-11-17 09:45:59 +00001271 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
Michael Hennerichefaf7cd2009-11-12 16:54:08 +00001272 .controller_data = &adf7021_spi_chip_info,
1273 .platform_data = &adf7021_platform_data,
1274 .mode = SPI_MODE_0,
1275 },
1276#endif
Michael Hennerichfe5b25c2010-02-04 14:41:39 +00001277#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
1278 {
1279 .modalias = "ads7846",
1280 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1281 .bus_num = 0,
1282 .irq = IRQ_PF6,
1283 .chip_select = GPIO_PF10 + MAX_CTRL_CS, /* GPIO controlled SSEL */
1284 .controller_data = &ad7873_spi_chip_info,
1285 .platform_data = &ad7873_pdata,
1286 .mode = SPI_MODE_0,
1287 },
1288#endif
Michael Hennerich0891bae2010-03-08 11:58:53 +00001289#if defined(CONFIG_AD7476) \
1290 || defined(CONFIG_AD7476_MODULE)
1291 {
1292 .modalias = "ad7476", /* Name of spi_driver for this device */
1293 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
1294 .bus_num = 0, /* Framework bus number */
1295 .chip_select = 1, /* Framework chip select. */
1296 .platform_data = NULL, /* No spi_driver specific config */
1297 .controller_data = &spi_ad7476_chip_info,
1298 .mode = SPI_MODE_3,
1299 },
1300#endif
1301#if defined(CONFIG_ADE7753) \
1302 || defined(CONFIG_ADE7753_MODULE)
1303 {
1304 .modalias = "ade7753",
1305 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1306 .bus_num = 0,
1307 .chip_select = 1, /* CS, change it for your board */
1308 .platform_data = NULL, /* No spi_driver specific config */
1309 .mode = SPI_MODE_1,
1310 },
1311#endif
1312#if defined(CONFIG_ADE7754) \
1313 || defined(CONFIG_ADE7754_MODULE)
1314 {
1315 .modalias = "ade7754",
1316 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1317 .bus_num = 0,
1318 .chip_select = 1, /* CS, change it for your board */
1319 .platform_data = NULL, /* No spi_driver specific config */
1320 .mode = SPI_MODE_1,
1321 },
1322#endif
1323#if defined(CONFIG_ADE7758) \
1324 || defined(CONFIG_ADE7758_MODULE)
1325 {
1326 .modalias = "ade7758",
1327 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1328 .bus_num = 0,
1329 .chip_select = 1, /* CS, change it for your board */
1330 .platform_data = NULL, /* No spi_driver specific config */
1331 .mode = SPI_MODE_1,
1332 },
1333#endif
1334#if defined(CONFIG_ADE7759) \
1335 || defined(CONFIG_ADE7759_MODULE)
1336 {
1337 .modalias = "ade7759",
1338 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1339 .bus_num = 0,
1340 .chip_select = 1, /* CS, change it for your board */
1341 .platform_data = NULL, /* No spi_driver specific config */
1342 .mode = SPI_MODE_1,
1343 },
1344#endif
1345#if defined(CONFIG_ADE7854_SPI) \
1346 || defined(CONFIG_ADE7854_SPI_MODULE)
1347 {
1348 .modalias = "ade7854",
1349 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1350 .bus_num = 0,
1351 .chip_select = 1, /* CS, change it for your board */
1352 .platform_data = NULL, /* No spi_driver specific config */
1353 .mode = SPI_MODE_3,
1354 },
1355#endif
1356#if defined(CONFIG_ADIS16060) \
1357 || defined(CONFIG_ADIS16060_MODULE)
1358 {
1359 .modalias = "adis16060_r",
1360 .max_speed_hz = 2900000, /* max spi clock (SCK) speed in HZ */
1361 .bus_num = 0,
1362 .chip_select = MAX_CTRL_CS + 1, /* CS for read, change it for your board */
1363 .platform_data = NULL, /* No spi_driver specific config */
1364 .mode = SPI_MODE_0,
1365 },
1366 {
1367 .modalias = "adis16060_w",
1368 .max_speed_hz = 2900000, /* max spi clock (SCK) speed in HZ */
1369 .bus_num = 0,
1370 .chip_select = 2, /* CS for write, change it for your board */
1371 .platform_data = NULL, /* No spi_driver specific config */
1372 .mode = SPI_MODE_1,
1373 },
1374#endif
1375#if defined(CONFIG_ADIS16130) \
1376 || defined(CONFIG_ADIS16130_MODULE)
1377 {
1378 .modalias = "adis16130",
1379 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1380 .bus_num = 0,
1381 .chip_select = 1, /* CS for read, change it for your board */
1382 .platform_data = NULL, /* No spi_driver specific config */
1383 .mode = SPI_MODE_3,
1384 },
1385#endif
1386#if defined(CONFIG_ADIS16201) \
1387 || defined(CONFIG_ADIS16201_MODULE)
1388 {
1389 .modalias = "adis16201",
1390 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1391 .bus_num = 0,
1392 .chip_select = 5, /* CS, change it for your board */
1393 .platform_data = NULL, /* No spi_driver specific config */
1394 .mode = SPI_MODE_3,
1395 .irq = IRQ_PF4,
1396 },
1397#endif
1398#if defined(CONFIG_ADIS16203) \
1399 || defined(CONFIG_ADIS16203_MODULE)
1400 {
1401 .modalias = "adis16203",
1402 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1403 .bus_num = 0,
1404 .chip_select = 5, /* CS, change it for your board */
1405 .platform_data = NULL, /* No spi_driver specific config */
1406 .mode = SPI_MODE_3,
1407 .irq = IRQ_PF4,
1408 },
1409#endif
1410#if defined(CONFIG_ADIS16204) \
1411 || defined(CONFIG_ADIS16204_MODULE)
1412 {
1413 .modalias = "adis16204",
1414 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1415 .bus_num = 0,
1416 .chip_select = 5, /* CS, change it for your board */
1417 .platform_data = NULL, /* No spi_driver specific config */
1418 .mode = SPI_MODE_3,
1419 .irq = IRQ_PF4,
1420 },
1421#endif
1422#if defined(CONFIG_ADIS16209) \
1423 || defined(CONFIG_ADIS16209_MODULE)
1424 {
1425 .modalias = "adis16209",
1426 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1427 .bus_num = 0,
1428 .chip_select = 5, /* CS, change it for your board */
1429 .platform_data = NULL, /* No spi_driver specific config */
1430 .mode = SPI_MODE_3,
1431 .irq = IRQ_PF4,
1432 },
1433#endif
1434#if defined(CONFIG_ADIS16220) \
1435 || defined(CONFIG_ADIS16220_MODULE)
1436 {
1437 .modalias = "adis16220",
1438 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
1439 .bus_num = 0,
1440 .chip_select = 5, /* CS, change it for your board */
1441 .platform_data = NULL, /* No spi_driver specific config */
1442 .mode = SPI_MODE_3,
1443 .irq = IRQ_PF4,
1444 },
1445#endif
1446#if defined(CONFIG_ADIS16240) \
1447 || defined(CONFIG_ADIS16240_MODULE)
1448 {
1449 .modalias = "adis16240",
1450 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */
1451 .bus_num = 0,
1452 .chip_select = 5, /* CS, change it for your board */
1453 .platform_data = NULL, /* No spi_driver specific config */
1454 .mode = SPI_MODE_3,
1455 .irq = IRQ_PF4,
1456 },
1457#endif
1458#if defined(CONFIG_ADIS16260) \
1459 || defined(CONFIG_ADIS16260_MODULE)
1460 {
1461 .modalias = "adis16260",
1462 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */
1463 .bus_num = 0,
1464 .chip_select = 5, /* CS, change it for your board */
1465 .platform_data = NULL, /* No spi_driver specific config */
1466 .mode = SPI_MODE_3,
1467 .irq = IRQ_PF4,
1468 },
1469#endif
1470#if defined(CONFIG_ADIS16261) \
1471 || defined(CONFIG_ADIS16261_MODULE)
1472 {
1473 .modalias = "adis16261",
1474 .max_speed_hz = 2500000, /* max spi clock (SCK) speed in HZ */
1475 .bus_num = 0,
1476 .chip_select = 1, /* CS, change it for your board */
1477 .platform_data = NULL, /* No spi_driver specific config */
1478 .mode = SPI_MODE_3,
1479 },
1480#endif
1481#if defined(CONFIG_ADIS16300) \
1482 || defined(CONFIG_ADIS16300_MODULE)
1483 {
1484 .modalias = "adis16300",
1485 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1486 .bus_num = 0,
1487 .chip_select = 5, /* CS, change it for your board */
1488 .platform_data = NULL, /* No spi_driver specific config */
1489 .mode = SPI_MODE_3,
1490 .irq = IRQ_PF4,
1491 },
1492#endif
1493#if defined(CONFIG_ADIS16350) \
1494 || defined(CONFIG_ADIS16350_MODULE)
1495 {
1496 .modalias = "adis16364",
1497 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1498 .bus_num = 0,
1499 .chip_select = 5, /* CS, change it for your board */
1500 .platform_data = NULL, /* No spi_driver specific config */
1501 .mode = SPI_MODE_3,
1502 .irq = IRQ_PF4,
1503 },
1504#endif
1505#if defined(CONFIG_ADIS16400) \
1506 || defined(CONFIG_ADIS16400_MODULE)
1507 {
1508 .modalias = "adis16400",
1509 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
1510 .bus_num = 0,
1511 .chip_select = 1, /* CS, change it for your board */
1512 .platform_data = NULL, /* No spi_driver specific config */
1513 .mode = SPI_MODE_3,
1514 },
1515#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001516};
1517
Mike Frysinger5bda2722008-06-07 15:03:01 +08001518#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wu1394f032007-05-06 14:50:22 -07001519/* SPI controller data */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001520static struct bfin5xx_spi_master bfin_spi0_info = {
Barry Songf9f0e3b2009-11-17 09:45:59 +00001521 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
Bryan Wu1394f032007-05-06 14:50:22 -07001522 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +08001523 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wu1394f032007-05-06 14:50:22 -07001524};
1525
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001526/* SPI (0) */
1527static struct resource bfin_spi0_resource[] = {
1528 [0] = {
1529 .start = SPI0_REGBASE,
1530 .end = SPI0_REGBASE + 0xFF,
1531 .flags = IORESOURCE_MEM,
1532 },
1533 [1] = {
1534 .start = CH_SPI,
1535 .end = CH_SPI,
Yi Lie68d1eb2009-06-03 09:46:22 +00001536 .flags = IORESOURCE_DMA,
1537 },
1538 [2] = {
1539 .start = IRQ_SPI,
1540 .end = IRQ_SPI,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001541 .flags = IORESOURCE_IRQ,
1542 },
1543};
1544
1545static struct platform_device bfin_spi0_device = {
1546 .name = "bfin-spi",
1547 .id = 0, /* Bus number */
1548 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1549 .resource = bfin_spi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001550 .dev = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001551 .platform_data = &bfin_spi0_info, /* Passed to driver */
Bryan Wu1394f032007-05-06 14:50:22 -07001552 },
1553};
1554#endif /* spi master and devices */
1555
Cliff Cai1e9aa952009-03-28 23:28:51 +08001556#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1557
1558/* SPORT SPI controller data */
1559static struct bfin5xx_spi_master bfin_sport_spi0_info = {
1560 .num_chipselect = 1, /* master only supports one device */
1561 .enable_dma = 0, /* master don't support DMA */
1562 .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
1563 P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
1564};
1565
1566static struct resource bfin_sport_spi0_resource[] = {
1567 [0] = {
1568 .start = SPORT0_TCR1,
1569 .end = SPORT0_TCR1 + 0xFF,
1570 .flags = IORESOURCE_MEM,
1571 },
1572 [1] = {
1573 .start = IRQ_SPORT0_ERROR,
1574 .end = IRQ_SPORT0_ERROR,
1575 .flags = IORESOURCE_IRQ,
1576 },
1577};
1578
1579static struct platform_device bfin_sport_spi0_device = {
1580 .name = "bfin-sport-spi",
1581 .id = 1, /* Bus number */
1582 .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
1583 .resource = bfin_sport_spi0_resource,
1584 .dev = {
1585 .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
1586 },
1587};
1588
1589static struct bfin5xx_spi_master bfin_sport_spi1_info = {
1590 .num_chipselect = 1, /* master only supports one device */
1591 .enable_dma = 0, /* master don't support DMA */
1592 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
1593 P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
1594};
1595
1596static struct resource bfin_sport_spi1_resource[] = {
1597 [0] = {
1598 .start = SPORT1_TCR1,
1599 .end = SPORT1_TCR1 + 0xFF,
1600 .flags = IORESOURCE_MEM,
1601 },
1602 [1] = {
1603 .start = IRQ_SPORT1_ERROR,
1604 .end = IRQ_SPORT1_ERROR,
1605 .flags = IORESOURCE_IRQ,
1606 },
1607};
1608
1609static struct platform_device bfin_sport_spi1_device = {
1610 .name = "bfin-sport-spi",
1611 .id = 2, /* Bus number */
1612 .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
1613 .resource = bfin_sport_spi1_resource,
1614 .dev = {
1615 .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
1616 },
1617};
1618
1619#endif /* sport spi master and devices */
1620
Bryan Wu1394f032007-05-06 14:50:22 -07001621#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1622static struct platform_device bfin_fb_device = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001623 .name = "bf537-lq035",
1624};
1625#endif
1626
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001627#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1628#include <asm/bfin-lq035q1.h>
1629
1630static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001631 .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
1632 .ppi_mode = USE_RGB565_16_BIT_PPI,
1633 .use_bl = 0, /* let something else control the LCD Blacklight */
1634 .gpio_bl = GPIO_PF7,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001635};
1636
1637static struct resource bfin_lq035q1_resources[] = {
1638 {
1639 .start = IRQ_PPI_ERROR,
1640 .end = IRQ_PPI_ERROR,
1641 .flags = IORESOURCE_IRQ,
1642 },
1643};
1644
1645static struct platform_device bfin_lq035q1_device = {
1646 .name = "bfin-lq035q1",
1647 .id = -1,
Michael Hennerichd94a1aa2009-12-08 11:45:55 +00001648 .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
1649 .resource = bfin_lq035q1_resources,
Michael Hennerich2043f3f2008-10-13 14:46:30 +08001650 .dev = {
1651 .platform_data = &bfin_lq035q1_data,
1652 },
1653};
1654#endif
1655
Bryan Wu1394f032007-05-06 14:50:22 -07001656#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang233b28a2007-11-21 17:04:41 +08001657#ifdef CONFIG_SERIAL_BFIN_UART0
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001658static struct resource bfin_uart0_resources[] = {
Bryan Wu1394f032007-05-06 14:50:22 -07001659 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001660 .start = UART0_THR,
1661 .end = UART0_GCTL+2,
Bryan Wu1394f032007-05-06 14:50:22 -07001662 .flags = IORESOURCE_MEM,
Sonic Zhang233b28a2007-11-21 17:04:41 +08001663 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001664 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001665 .start = IRQ_UART0_RX,
1666 .end = IRQ_UART0_RX+1,
1667 .flags = IORESOURCE_IRQ,
1668 },
1669 {
1670 .start = IRQ_UART0_ERROR,
1671 .end = IRQ_UART0_ERROR,
1672 .flags = IORESOURCE_IRQ,
1673 },
1674 {
1675 .start = CH_UART0_TX,
1676 .end = CH_UART0_TX,
1677 .flags = IORESOURCE_DMA,
1678 },
1679 {
1680 .start = CH_UART0_RX,
1681 .end = CH_UART0_RX,
1682 .flags = IORESOURCE_DMA,
1683 },
1684#ifdef CONFIG_BFIN_UART0_CTSRTS
1685 { /* CTS pin */
1686 .start = GPIO_PG7,
1687 .end = GPIO_PG7,
1688 .flags = IORESOURCE_IO,
1689 },
1690 { /* RTS pin */
1691 .start = GPIO_PG6,
1692 .end = GPIO_PG6,
1693 .flags = IORESOURCE_IO,
Bryan Wu1394f032007-05-06 14:50:22 -07001694 },
Sonic Zhang233b28a2007-11-21 17:04:41 +08001695#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001696};
1697
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001698unsigned short bfin_uart0_peripherals[] = {
1699 P_UART0_TX, P_UART0_RX, 0
1700};
1701
1702static struct platform_device bfin_uart0_device = {
1703 .name = "bfin-uart",
1704 .id = 0,
1705 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
1706 .resource = bfin_uart0_resources,
1707 .dev = {
1708 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
1709 },
1710};
1711#endif
1712#ifdef CONFIG_SERIAL_BFIN_UART1
1713static struct resource bfin_uart1_resources[] = {
1714 {
1715 .start = UART1_THR,
1716 .end = UART1_GCTL+2,
1717 .flags = IORESOURCE_MEM,
1718 },
1719 {
1720 .start = IRQ_UART1_RX,
1721 .end = IRQ_UART1_RX+1,
1722 .flags = IORESOURCE_IRQ,
1723 },
1724 {
1725 .start = IRQ_UART1_ERROR,
1726 .end = IRQ_UART1_ERROR,
1727 .flags = IORESOURCE_IRQ,
1728 },
1729 {
1730 .start = CH_UART1_TX,
1731 .end = CH_UART1_TX,
1732 .flags = IORESOURCE_DMA,
1733 },
1734 {
1735 .start = CH_UART1_RX,
1736 .end = CH_UART1_RX,
1737 .flags = IORESOURCE_DMA,
1738 },
1739};
1740
1741unsigned short bfin_uart1_peripherals[] = {
1742 P_UART1_TX, P_UART1_RX, 0
1743};
1744
1745static struct platform_device bfin_uart1_device = {
Bryan Wu1394f032007-05-06 14:50:22 -07001746 .name = "bfin-uart",
1747 .id = 1,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001748 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
1749 .resource = bfin_uart1_resources,
1750 .dev = {
1751 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
1752 },
Bryan Wu1394f032007-05-06 14:50:22 -07001753};
1754#endif
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001755#endif
Bryan Wu1394f032007-05-06 14:50:22 -07001756
Graf Yang5be36d22008-04-25 03:09:15 +08001757#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +08001758#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +08001759static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001760 {
1761 .start = 0xFFC00400,
1762 .end = 0xFFC004FF,
1763 .flags = IORESOURCE_MEM,
1764 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001765 {
1766 .start = IRQ_UART0_RX,
1767 .end = IRQ_UART0_RX+1,
1768 .flags = IORESOURCE_IRQ,
1769 },
1770 {
1771 .start = CH_UART0_RX,
1772 .end = CH_UART0_RX+1,
1773 .flags = IORESOURCE_DMA,
1774 },
1775};
1776
1777static struct platform_device bfin_sir0_device = {
1778 .name = "bfin_sir",
1779 .id = 0,
1780 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
1781 .resource = bfin_sir0_resources,
1782};
Graf Yang5be36d22008-04-25 03:09:15 +08001783#endif
1784#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +08001785static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +08001786 {
1787 .start = 0xFFC02000,
1788 .end = 0xFFC020FF,
1789 .flags = IORESOURCE_MEM,
1790 },
Graf Yang42bd8bc2009-01-07 23:14:39 +08001791 {
1792 .start = IRQ_UART1_RX,
1793 .end = IRQ_UART1_RX+1,
1794 .flags = IORESOURCE_IRQ,
1795 },
1796 {
1797 .start = CH_UART1_RX,
1798 .end = CH_UART1_RX+1,
1799 .flags = IORESOURCE_DMA,
1800 },
Graf Yang5be36d22008-04-25 03:09:15 +08001801};
1802
Graf Yang42bd8bc2009-01-07 23:14:39 +08001803static struct platform_device bfin_sir1_device = {
Graf Yang5be36d22008-04-25 03:09:15 +08001804 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +08001805 .id = 1,
1806 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
1807 .resource = bfin_sir1_resources,
Graf Yang5be36d22008-04-25 03:09:15 +08001808};
1809#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +08001810#endif
Graf Yang5be36d22008-04-25 03:09:15 +08001811
Bryan Wu1394f032007-05-06 14:50:22 -07001812#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001813static struct resource bfin_twi0_resource[] = {
1814 [0] = {
1815 .start = TWI0_REGBASE,
1816 .end = TWI0_REGBASE,
1817 .flags = IORESOURCE_MEM,
1818 },
1819 [1] = {
1820 .start = IRQ_TWI,
1821 .end = IRQ_TWI,
1822 .flags = IORESOURCE_IRQ,
1823 },
1824};
1825
Bryan Wu1394f032007-05-06 14:50:22 -07001826static struct platform_device i2c_bfin_twi_device = {
1827 .name = "i2c-bfin-twi",
1828 .id = 0,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001829 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1830 .resource = bfin_twi0_resource,
Bryan Wu1394f032007-05-06 14:50:22 -07001831};
1832#endif
1833
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001834#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08001835static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1836 [0] = KEY_GRAVE,
1837 [1] = KEY_1,
1838 [2] = KEY_2,
1839 [3] = KEY_3,
1840 [4] = KEY_4,
1841 [5] = KEY_5,
1842 [6] = KEY_6,
1843 [7] = KEY_7,
1844 [8] = KEY_8,
1845 [9] = KEY_9,
1846 [10] = KEY_0,
1847 [11] = KEY_MINUS,
1848 [12] = KEY_EQUAL,
1849 [13] = KEY_BACKSLASH,
1850 [15] = KEY_KP0,
1851 [16] = KEY_Q,
1852 [17] = KEY_W,
1853 [18] = KEY_E,
1854 [19] = KEY_R,
1855 [20] = KEY_T,
1856 [21] = KEY_Y,
1857 [22] = KEY_U,
1858 [23] = KEY_I,
1859 [24] = KEY_O,
1860 [25] = KEY_P,
1861 [26] = KEY_LEFTBRACE,
1862 [27] = KEY_RIGHTBRACE,
1863 [29] = KEY_KP1,
1864 [30] = KEY_KP2,
1865 [31] = KEY_KP3,
1866 [32] = KEY_A,
1867 [33] = KEY_S,
1868 [34] = KEY_D,
1869 [35] = KEY_F,
1870 [36] = KEY_G,
1871 [37] = KEY_H,
1872 [38] = KEY_J,
1873 [39] = KEY_K,
1874 [40] = KEY_L,
1875 [41] = KEY_SEMICOLON,
1876 [42] = KEY_APOSTROPHE,
1877 [43] = KEY_BACKSLASH,
1878 [45] = KEY_KP4,
1879 [46] = KEY_KP5,
1880 [47] = KEY_KP6,
1881 [48] = KEY_102ND,
1882 [49] = KEY_Z,
1883 [50] = KEY_X,
1884 [51] = KEY_C,
1885 [52] = KEY_V,
1886 [53] = KEY_B,
1887 [54] = KEY_N,
1888 [55] = KEY_M,
1889 [56] = KEY_COMMA,
1890 [57] = KEY_DOT,
1891 [58] = KEY_SLASH,
1892 [60] = KEY_KPDOT,
1893 [61] = KEY_KP7,
1894 [62] = KEY_KP8,
1895 [63] = KEY_KP9,
1896 [64] = KEY_SPACE,
1897 [65] = KEY_BACKSPACE,
1898 [66] = KEY_TAB,
1899 [67] = KEY_KPENTER,
1900 [68] = KEY_ENTER,
1901 [69] = KEY_ESC,
1902 [70] = KEY_DELETE,
1903 [74] = KEY_KPMINUS,
1904 [76] = KEY_UP,
1905 [77] = KEY_DOWN,
1906 [78] = KEY_RIGHT,
1907 [79] = KEY_LEFT,
1908};
1909
1910static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1911 .rows = 8,
1912 .cols = 10,
1913 .keymap = adp5588_keymap,
1914 .keymapsize = ARRAY_SIZE(adp5588_keymap),
1915 .repeat = 0,
1916};
1917#endif
1918
Michael Hennerich3ea57212009-03-28 22:15:07 +08001919#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1920#include <linux/mfd/adp5520.h>
1921
1922 /*
1923 * ADP5520/5501 Backlight Data
1924 */
1925
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001926static struct adp5520_backlight_platform_data adp5520_backlight_data = {
1927 .fade_in = ADP5520_FADE_T_1200ms,
1928 .fade_out = ADP5520_FADE_T_1200ms,
1929 .fade_led_law = ADP5520_BL_LAW_LINEAR,
1930 .en_ambl_sens = 1,
1931 .abml_filt = ADP5520_BL_AMBL_FILT_640ms,
1932 .l1_daylight_max = ADP5520_BL_CUR_mA(15),
1933 .l1_daylight_dim = ADP5520_BL_CUR_mA(0),
1934 .l2_office_max = ADP5520_BL_CUR_mA(7),
1935 .l2_office_dim = ADP5520_BL_CUR_mA(0),
1936 .l3_dark_max = ADP5520_BL_CUR_mA(3),
1937 .l3_dark_dim = ADP5520_BL_CUR_mA(0),
1938 .l2_trip = ADP5520_L2_COMP_CURR_uA(700),
1939 .l2_hyst = ADP5520_L2_COMP_CURR_uA(50),
1940 .l3_trip = ADP5520_L3_COMP_CURR_uA(80),
1941 .l3_hyst = ADP5520_L3_COMP_CURR_uA(20),
Michael Hennerich3ea57212009-03-28 22:15:07 +08001942};
1943
1944 /*
1945 * ADP5520/5501 LEDs Data
1946 */
1947
Michael Hennerich3ea57212009-03-28 22:15:07 +08001948static struct led_info adp5520_leds[] = {
1949 {
1950 .name = "adp5520-led1",
1951 .default_trigger = "none",
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001952 .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | ADP5520_LED_OFFT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001953 },
1954#ifdef ADP5520_EN_ALL_LEDS
1955 {
1956 .name = "adp5520-led2",
1957 .default_trigger = "none",
1958 .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
1959 },
1960 {
1961 .name = "adp5520-led3",
1962 .default_trigger = "none",
1963 .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
1964 },
1965#endif
1966};
1967
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001968static struct adp5520_leds_platform_data adp5520_leds_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001969 .num_leds = ARRAY_SIZE(adp5520_leds),
1970 .leds = adp5520_leds,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001971 .fade_in = ADP5520_FADE_T_600ms,
1972 .fade_out = ADP5520_FADE_T_600ms,
1973 .led_on_time = ADP5520_LED_ONT_600ms,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001974};
1975
1976 /*
1977 * ADP5520 GPIO Data
1978 */
1979
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001980static struct adp5520_gpio_platform_data adp5520_gpio_data = {
Michael Hennerich3ea57212009-03-28 22:15:07 +08001981 .gpio_start = 50,
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001982 .gpio_en_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
1983 .gpio_pullup_mask = ADP5520_GPIO_C1 | ADP5520_GPIO_C2 | ADP5520_GPIO_R2,
Michael Hennerich3ea57212009-03-28 22:15:07 +08001984};
1985
1986 /*
1987 * ADP5520 Keypad Data
1988 */
1989
Michael Hennerich3ea57212009-03-28 22:15:07 +08001990static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00001991 [ADP5520_KEY(0, 0)] = KEY_GRAVE,
1992 [ADP5520_KEY(0, 1)] = KEY_1,
1993 [ADP5520_KEY(0, 2)] = KEY_2,
1994 [ADP5520_KEY(0, 3)] = KEY_3,
1995 [ADP5520_KEY(1, 0)] = KEY_4,
1996 [ADP5520_KEY(1, 1)] = KEY_5,
1997 [ADP5520_KEY(1, 2)] = KEY_6,
1998 [ADP5520_KEY(1, 3)] = KEY_7,
1999 [ADP5520_KEY(2, 0)] = KEY_8,
2000 [ADP5520_KEY(2, 1)] = KEY_9,
2001 [ADP5520_KEY(2, 2)] = KEY_0,
2002 [ADP5520_KEY(2, 3)] = KEY_MINUS,
2003 [ADP5520_KEY(3, 0)] = KEY_EQUAL,
2004 [ADP5520_KEY(3, 1)] = KEY_BACKSLASH,
2005 [ADP5520_KEY(3, 2)] = KEY_BACKSPACE,
2006 [ADP5520_KEY(3, 3)] = KEY_ENTER,
Michael Hennerich3ea57212009-03-28 22:15:07 +08002007};
2008
Michael Hennerich1d23dc82009-10-05 13:33:11 +00002009static struct adp5520_keys_platform_data adp5520_keys_data = {
2010 .rows_en_mask = ADP5520_ROW_R3 | ADP5520_ROW_R2 | ADP5520_ROW_R1 | ADP5520_ROW_R0,
2011 .cols_en_mask = ADP5520_COL_C3 | ADP5520_COL_C2 | ADP5520_COL_C1 | ADP5520_COL_C0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08002012 .keymap = adp5520_keymap,
2013 .keymapsize = ARRAY_SIZE(adp5520_keymap),
2014 .repeat = 0,
2015};
2016
2017 /*
2018 * ADP5520/5501 Multifuction Device Init Data
2019 */
2020
Michael Hennerich3ea57212009-03-28 22:15:07 +08002021static struct adp5520_platform_data adp5520_pdev_data = {
Michael Hennerich1d23dc82009-10-05 13:33:11 +00002022 .backlight = &adp5520_backlight_data,
2023 .leds = &adp5520_leds_data,
2024 .gpio = &adp5520_gpio_data,
2025 .keys = &adp5520_keys_data,
Michael Hennerich3ea57212009-03-28 22:15:07 +08002026};
2027
2028#endif
2029
Michael Hennerichba877d42009-08-27 04:09:32 +00002030#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
Michael Hennerich1d23dc82009-10-05 13:33:11 +00002031static struct adp5588_gpio_platform_data adp5588_gpio_data = {
Michael Hennerichba877d42009-08-27 04:09:32 +00002032 .gpio_start = 50,
2033 .pullup_dis_mask = 0,
2034};
2035#endif
2036
Michael Hennerich78756c62009-10-13 15:28:33 +00002037#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
2038#include <linux/i2c/adp8870.h>
2039static struct led_info adp8870_leds[] = {
2040 {
2041 .name = "adp8870-led7",
2042 .default_trigger = "none",
2043 .flags = ADP8870_LED_D7 | ADP8870_LED_OFFT_600ms,
2044 },
2045};
2046
2047
2048static struct adp8870_backlight_platform_data adp8870_pdata = {
2049 .bl_led_assign = ADP8870_BL_D1 | ADP8870_BL_D2 | ADP8870_BL_D3 |
2050 ADP8870_BL_D4 | ADP8870_BL_D5 | ADP8870_BL_D6, /* 1 = Backlight 0 = Individual LED */
2051 .pwm_assign = 0, /* 1 = Enables PWM mode */
2052
2053 .bl_fade_in = ADP8870_FADE_T_1200ms, /* Backlight Fade-In Timer */
2054 .bl_fade_out = ADP8870_FADE_T_1200ms, /* Backlight Fade-Out Timer */
2055 .bl_fade_law = ADP8870_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
2056
2057 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
2058 .abml_filt = ADP8870_BL_AMBL_FILT_320ms, /* Light sensor filter time */
2059
2060 .l1_daylight_max = ADP8870_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2061 .l1_daylight_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2062 .l2_bright_max = ADP8870_BL_CUR_mA(14), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2063 .l2_bright_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2064 .l3_office_max = ADP8870_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2065 .l3_office_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2066 .l4_indoor_max = ADP8870_BL_CUR_mA(3), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2067 .l4_indor_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2068 .l5_dark_max = ADP8870_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2069 .l5_dark_dim = ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2070
2071 .l2_trip = ADP8870_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2072 .l2_hyst = ADP8870_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2073 .l3_trip = ADP8870_L3_COMP_CURR_uA(389), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
2074 .l3_hyst = ADP8870_L3_COMP_CURR_uA(54), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
2075 .l4_trip = ADP8870_L4_COMP_CURR_uA(167), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
2076 .l4_hyst = ADP8870_L4_COMP_CURR_uA(16), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
2077 .l5_trip = ADP8870_L5_COMP_CURR_uA(43), /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2078 .l5_hyst = ADP8870_L5_COMP_CURR_uA(11), /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2079
2080 .leds = adp8870_leds,
2081 .num_leds = ARRAY_SIZE(adp8870_leds),
2082 .led_fade_law = ADP8870_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
2083 .led_fade_in = ADP8870_FADE_T_600ms,
2084 .led_fade_out = ADP8870_FADE_T_600ms,
2085 .led_on_time = ADP8870_LED_ONT_200ms,
2086};
2087#endif
2088
Michael Hennerich72fa2e92010-02-24 21:05:35 +00002089#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
2090#include <linux/i2c/adp8860.h>
2091static struct led_info adp8860_leds[] = {
2092 {
2093 .name = "adp8860-led7",
2094 .default_trigger = "none",
2095 .flags = ADP8860_LED_D7 | ADP8860_LED_OFFT_600ms,
2096 },
2097};
2098
2099static struct adp8860_backlight_platform_data adp8860_pdata = {
2100 .bl_led_assign = ADP8860_BL_D1 | ADP8860_BL_D2 | ADP8860_BL_D3 |
2101 ADP8860_BL_D4 | ADP8860_BL_D5 | ADP8860_BL_D6, /* 1 = Backlight 0 = Individual LED */
2102
2103 .bl_fade_in = ADP8860_FADE_T_1200ms, /* Backlight Fade-In Timer */
2104 .bl_fade_out = ADP8860_FADE_T_1200ms, /* Backlight Fade-Out Timer */
2105 .bl_fade_law = ADP8860_FADE_LAW_CUBIC1, /* fade-on/fade-off transfer characteristic */
2106
2107 .en_ambl_sens = 1, /* 1 = enable ambient light sensor */
2108 .abml_filt = ADP8860_BL_AMBL_FILT_320ms, /* Light sensor filter time */
2109
2110 .l1_daylight_max = ADP8860_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2111 .l1_daylight_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2112 .l2_office_max = ADP8860_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2113 .l2_office_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2114 .l3_dark_max = ADP8860_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
2115 .l3_dark_dim = ADP8860_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
2116
2117 .l2_trip = ADP8860_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2118 .l2_hyst = ADP8860_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
2119 .l3_trip = ADP8860_L3_COMP_CURR_uA(43), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2120 .l3_hyst = ADP8860_L3_COMP_CURR_uA(11), /* use L3_COMP_CURR_uA(I) 0 <= I <= 138 uA */
2121
2122 .leds = adp8860_leds,
2123 .num_leds = ARRAY_SIZE(adp8860_leds),
2124 .led_fade_law = ADP8860_FADE_LAW_SQUARE, /* fade-on/fade-off transfer characteristic */
2125 .led_fade_in = ADP8860_FADE_T_600ms,
2126 .led_fade_out = ADP8860_FADE_T_600ms,
2127 .led_on_time = ADP8860_LED_ONT_200ms,
2128};
2129#endif
2130
Sonic Zhangf32792d2010-02-09 02:47:09 +00002131#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2132static struct regulator_consumer_supply ad5398_consumer = {
2133 .supply = "current",
2134};
2135
2136static struct regulator_init_data ad5398_regulator_data = {
2137 .constraints = {
2138 .name = "current range",
2139 .max_uA = 120000,
2140 .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
2141 },
2142 .num_consumer_supplies = 1,
2143 .consumer_supplies = &ad5398_consumer,
2144};
2145
Sonic Zhangf32792d2010-02-09 02:47:09 +00002146#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2147 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2148static struct platform_device ad5398_virt_consumer_device = {
2149 .name = "reg-virt-consumer",
2150 .id = 0,
2151 .dev = {
2152 .platform_data = "current", /* Passed to driver */
2153 },
2154};
2155#endif
2156#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2157 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2158static struct regulator_bulk_data ad5398_bulk_data = {
2159 .supply = "current",
2160};
2161
2162static struct regulator_userspace_consumer_data ad5398_userspace_comsumer_data = {
2163 .name = "ad5398",
2164 .num_supplies = 1,
2165 .supplies = &ad5398_bulk_data,
2166};
2167
2168static struct platform_device ad5398_userspace_consumer_device = {
2169 .name = "reg-userspace-consumer",
2170 .id = 0,
2171 .dev = {
2172 .platform_data = &ad5398_userspace_comsumer_data,
2173 },
2174};
2175#endif
2176#endif
2177
Michael Hennerich0891bae2010-03-08 11:58:53 +00002178#if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE)
2179/* INT bound temperature alarm event. line 1 */
2180static unsigned long adt7410_platform_data[2] = {
2181 IRQ_PG4, IRQF_TRIGGER_LOW,
2182};
2183#endif
2184
2185#if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE)
2186/* INT bound temperature alarm event. line 1 */
2187static unsigned long adt7316_i2c_data[2] = {
2188 IRQF_TRIGGER_LOW, /* interrupt flags */
2189 GPIO_PF4, /* ldac_pin, 0 means DAC/LDAC registers control DAC update */
2190};
2191#endif
2192
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002193static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
Barry Song92b20f72010-03-17 08:12:30 +00002194#if defined(CONFIG_SND_BF5XX_SOC_AD193X) || defined(CONFIG_SND_BF5XX_SOC_AD193X_MODULE)
2195 {
2196 I2C_BOARD_INFO("ad1937", 0x04),
2197 },
2198#endif
2199
Yi Lia65912c2010-04-06 05:53:16 +00002200#if defined(CONFIG_SND_BF5XX_SOC_ADAV80X) || defined(CONFIG_SND_BF5XX_SOC_ADAV80X_MODULE)
2201 {
2202 I2C_BOARD_INFO("adav803", 0x10),
2203 },
2204#endif
2205
Mike Frysinger5b7c5772009-10-12 15:56:58 +00002206#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002207 {
Barry Song427f2772009-07-17 07:04:55 +00002208 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
Barry Song4c94c3e2009-07-07 07:41:50 +00002209 .irq = IRQ_PG5,
Mike Frysinger5b7c5772009-10-12 15:56:58 +00002210 .platform_data = (void *)&ad7142_i2c_platform_data,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002211 },
2212#endif
Barry Songad6720c2010-02-03 09:15:31 +00002213
2214#if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE)
2215 {
2216 I2C_BOARD_INFO("ad7150", 0x48),
2217 .irq = IRQ_PG5, /* fixme: use real interrupt number */
2218 },
2219#endif
2220
2221#if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE)
2222 {
2223 I2C_BOARD_INFO("ad7152", 0x48),
2224 },
2225#endif
2226
2227#if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE)
2228 {
2229 I2C_BOARD_INFO("ad774x", 0x48),
2230 },
2231#endif
2232
Sonic Zhang5f022592010-02-24 07:32:50 +00002233#if defined(CONFIG_AD7414) || defined(CONFIG_AD7414_MODULE)
2234 {
2235 I2C_BOARD_INFO("ad7414", 0x9),
2236 .irq = IRQ_PG5,
Michael Hennerich0891bae2010-03-08 11:58:53 +00002237 .irq_flags = IRQF_TRIGGER_LOW,
Sonic Zhang5f022592010-02-24 07:32:50 +00002238 },
2239#endif
2240
Sonic Zhangef8873e2010-02-25 10:27:48 +00002241#if defined(CONFIG_AD7416) || defined(CONFIG_AD7416_MODULE)
2242 {
2243 I2C_BOARD_INFO("ad7417", 0xb),
2244 .irq = IRQ_PG5,
Michael Hennerich0891bae2010-03-08 11:58:53 +00002245 .irq_flags = IRQF_TRIGGER_LOW,
2246 .platform_data = (void *)GPIO_PF4,
2247 },
2248#endif
2249
2250#if defined(CONFIG_ADE7854_I2C) || defined(CONFIG_ADE7854_I2C_MODULE)
2251 {
2252 I2C_BOARD_INFO("ade7854", 0x38),
2253 },
2254#endif
2255
2256#if defined(CONFIG_ADT75) || defined(CONFIG_ADT75_MODULE)
2257 {
2258 I2C_BOARD_INFO("adt75", 0x9),
2259 .irq = IRQ_PG5,
2260 .irq_flags = IRQF_TRIGGER_LOW,
2261 },
2262#endif
2263
2264#if defined(CONFIG_ADT7408) || defined(CONFIG_ADT7408_MODULE)
2265 {
2266 I2C_BOARD_INFO("adt7408", 0x18),
2267 .irq = IRQ_PG5,
2268 .irq_flags = IRQF_TRIGGER_LOW,
2269 },
2270#endif
2271
2272#if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE)
2273 {
2274 I2C_BOARD_INFO("adt7410", 0x48),
2275 /* CT critical temperature event. line 0 */
2276 .irq = IRQ_PG5,
2277 .irq_flags = IRQF_TRIGGER_LOW,
2278 .platform_data = (void *)&adt7410_platform_data,
2279 },
2280#endif
2281
2282#if defined(CONFIG_AD7291) || defined(CONFIG_AD7291_MODULE)
2283 {
2284 I2C_BOARD_INFO("ad7291", 0x20),
2285 .irq = IRQ_PG5,
2286 .irq_flags = IRQF_TRIGGER_LOW,
2287 },
2288#endif
2289
2290#if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE)
2291 {
2292 I2C_BOARD_INFO("adt7316", 0x48),
2293 .irq = IRQ_PG6,
2294 .platform_data = (void *)&adt7316_i2c_data,
Sonic Zhangef8873e2010-02-25 10:27:48 +00002295 },
2296#endif
2297
Michael Hennerichebd58332009-07-02 11:00:38 +00002298#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002299 {
2300 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002301 },
2302#endif
Michael Hennerich204844e2009-06-30 14:57:22 +00002303#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002304 {
2305 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
Michael Hennerichf5150152008-10-16 23:23:18 +08002306 .irq = IRQ_PG6,
2307 },
2308#endif
2309#if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
2310 {
2311 I2C_BOARD_INFO("ad7879", 0x2F),
2312 .irq = IRQ_PG5,
2313 .platform_data = (void *)&bfin_ad7879_ts_info,
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002314 },
2315#endif
Michael Hennerich51ed9ad2009-01-07 23:14:38 +08002316#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
2317 {
2318 I2C_BOARD_INFO("adp5588-keys", 0x34),
2319 .irq = IRQ_PG0,
2320 .platform_data = (void *)&adp5588_kpad_data,
2321 },
2322#endif
Michael Hennerich3ea57212009-03-28 22:15:07 +08002323#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
2324 {
2325 I2C_BOARD_INFO("pmic-adp5520", 0x32),
Mike Frysinger4f84b6e2009-06-10 20:45:48 -04002326 .irq = IRQ_PG0,
Michael Hennerich3ea57212009-03-28 22:15:07 +08002327 .platform_data = (void *)&adp5520_pdev_data,
2328 },
2329#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00002330#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
2331 {
2332 I2C_BOARD_INFO("adxl34x", 0x53),
2333 .irq = IRQ_PG3,
2334 .platform_data = (void *)&adxl34x_info,
2335 },
2336#endif
Michael Hennerichba877d42009-08-27 04:09:32 +00002337#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
2338 {
2339 I2C_BOARD_INFO("adp5588-gpio", 0x34),
2340 .platform_data = (void *)&adp5588_gpio_data,
2341 },
2342#endif
Michael Hennerich50c4c082009-09-22 13:10:09 +00002343#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
2344 {
2345 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
2346 },
2347#endif
Michael Hennerichddcd7cb2009-09-22 15:36:55 +00002348#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2349 {
Sonic Zhang948ca1a2010-08-18 09:17:25 +00002350 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2F),
Michael Hennerichddcd7cb2009-09-22 15:36:55 +00002351 },
2352#endif
Michael Hennerich78756c62009-10-13 15:28:33 +00002353#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
2354 {
2355 I2C_BOARD_INFO("adp8870", 0x2B),
2356 .platform_data = (void *)&adp8870_pdata,
2357 },
2358#endif
Cliff Caid53127f2009-10-15 02:33:04 +00002359#if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
2360 {
2361 I2C_BOARD_INFO("adau1371", 0x1A),
2362 },
2363#endif
Cliff Cai04267632009-10-28 06:50:36 +00002364#if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
2365 {
2366 I2C_BOARD_INFO("adau1761", 0x38),
2367 },
2368#endif
Cliff Caic48d7672010-02-11 09:27:18 +00002369#if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE)
2370 {
2371 I2C_BOARD_INFO("adau1361", 0x38),
2372 },
2373#endif
Michael Hennerich1f13f2f2009-11-17 10:18:27 +00002374#if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
2375 {
2376 I2C_BOARD_INFO("ad5258", 0x18),
2377 },
2378#endif
Cliff Cai29bb3bc2010-01-14 08:28:38 +00002379#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
2380 {
2381 I2C_BOARD_INFO("ssm2602", 0x1b),
2382 },
2383#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +00002384#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2385 {
2386 I2C_BOARD_INFO("ad5398", 0xC),
Sonic Zhang27e9f0b2010-06-02 08:24:18 +00002387 .platform_data = (void *)&ad5398_regulator_data,
Sonic Zhangf32792d2010-02-09 02:47:09 +00002388 },
2389#endif
Michael Hennerich72fa2e92010-02-24 21:05:35 +00002390#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE)
2391 {
2392 I2C_BOARD_INFO("adp8860", 0x2A),
2393 .platform_data = (void *)&adp8860_pdata,
2394 },
2395#endif
Cliff Cai3cbcb162010-04-22 05:55:56 +00002396#if defined(CONFIG_SND_SOC_ADAU1373) || defined(CONFIG_SND_SOC_ADAU1373_MODULE)
2397 {
2398 I2C_BOARD_INFO("adau1373", 0x1A),
2399 },
2400#endif
steven miao39d3c1c2010-08-26 08:25:13 +00002401#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
2402 {
2403 I2C_BOARD_INFO("ad5252", 0x2e),
2404 },
2405#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002406};
Bryan Wu81d9c7f2008-03-26 10:02:13 +08002407
Bryan Wu1394f032007-05-06 14:50:22 -07002408#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00002409#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2410static struct resource bfin_sport0_uart_resources[] = {
2411 {
2412 .start = SPORT0_TCR1,
2413 .end = SPORT0_MRCS3+4,
2414 .flags = IORESOURCE_MEM,
2415 },
2416 {
2417 .start = IRQ_SPORT0_RX,
2418 .end = IRQ_SPORT0_RX+1,
2419 .flags = IORESOURCE_IRQ,
2420 },
2421 {
2422 .start = IRQ_SPORT0_ERROR,
2423 .end = IRQ_SPORT0_ERROR,
2424 .flags = IORESOURCE_IRQ,
2425 },
2426};
2427
2428unsigned short bfin_sport0_peripherals[] = {
2429 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
2430 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
2431};
2432
Bryan Wu1394f032007-05-06 14:50:22 -07002433static struct platform_device bfin_sport0_uart_device = {
2434 .name = "bfin-sport-uart",
2435 .id = 0,
Sonic Zhangdf5de262009-09-23 05:01:56 +00002436 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
2437 .resource = bfin_sport0_uart_resources,
2438 .dev = {
2439 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
2440 },
2441};
2442#endif
2443#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2444static struct resource bfin_sport1_uart_resources[] = {
2445 {
2446 .start = SPORT1_TCR1,
2447 .end = SPORT1_MRCS3+4,
2448 .flags = IORESOURCE_MEM,
2449 },
2450 {
2451 .start = IRQ_SPORT1_RX,
2452 .end = IRQ_SPORT1_RX+1,
2453 .flags = IORESOURCE_IRQ,
2454 },
2455 {
2456 .start = IRQ_SPORT1_ERROR,
2457 .end = IRQ_SPORT1_ERROR,
2458 .flags = IORESOURCE_IRQ,
2459 },
2460};
2461
2462unsigned short bfin_sport1_peripherals[] = {
2463 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
2464 P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0
Bryan Wu1394f032007-05-06 14:50:22 -07002465};
2466
2467static struct platform_device bfin_sport1_uart_device = {
2468 .name = "bfin-sport-uart",
2469 .id = 1,
Sonic Zhangdf5de262009-09-23 05:01:56 +00002470 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
2471 .resource = bfin_sport1_uart_resources,
2472 .dev = {
2473 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
2474 },
Bryan Wu1394f032007-05-06 14:50:22 -07002475};
2476#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00002477#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002478
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002479#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002480#define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2481/* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002482
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002483#ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2484#define PATA_INT IRQ_PF5
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002485static struct pata_platform_info bfin_pata_platform_data = {
2486 .ioport_shift = 1,
Mike Frysinger64e5c512007-10-30 11:56:13 +08002487 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002488};
2489
2490static struct resource bfin_pata_resources[] = {
2491 {
2492 .start = 0x20314020,
2493 .end = 0x2031403F,
2494 .flags = IORESOURCE_MEM,
2495 },
2496 {
2497 .start = 0x2031401C,
2498 .end = 0x2031401F,
2499 .flags = IORESOURCE_MEM,
2500 },
2501 {
2502 .start = PATA_INT,
2503 .end = PATA_INT,
2504 .flags = IORESOURCE_IRQ,
2505 },
2506};
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002507#elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
2508static struct pata_platform_info bfin_pata_platform_data = {
2509 .ioport_shift = 0,
2510};
Michael Hennerich648882d2009-04-21 12:05:50 +00002511/* CompactFlash Storage Card Memory Mapped Adressing
2512 * /REG = A11 = 1
2513 */
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002514static struct resource bfin_pata_resources[] = {
2515 {
Michael Hennerich648882d2009-04-21 12:05:50 +00002516 .start = 0x20211800,
2517 .end = 0x20211807,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002518 .flags = IORESOURCE_MEM,
2519 },
2520 {
Michael Hennerich648882d2009-04-21 12:05:50 +00002521 .start = 0x2021180E, /* Device Ctl */
2522 .end = 0x2021180E,
Michael Hennerich2c8beb22009-03-28 22:13:43 +08002523 .flags = IORESOURCE_MEM,
2524 },
2525};
2526#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002527
2528static struct platform_device bfin_pata_device = {
2529 .name = "pata_platform",
2530 .id = -1,
2531 .num_resources = ARRAY_SIZE(bfin_pata_resources),
2532 .resource = bfin_pata_resources,
2533 .dev = {
2534 .platform_data = &bfin_pata_platform_data,
2535 }
2536};
2537#endif
2538
Michael Hennerich14b03202008-05-07 11:41:26 +08002539static const unsigned int cclk_vlev_datasheet[] =
2540{
2541 VRPAIR(VLEV_085, 250000000),
2542 VRPAIR(VLEV_090, 376000000),
2543 VRPAIR(VLEV_095, 426000000),
2544 VRPAIR(VLEV_100, 426000000),
2545 VRPAIR(VLEV_105, 476000000),
2546 VRPAIR(VLEV_110, 476000000),
2547 VRPAIR(VLEV_115, 476000000),
2548 VRPAIR(VLEV_120, 500000000),
2549 VRPAIR(VLEV_125, 533000000),
2550 VRPAIR(VLEV_130, 600000000),
2551};
2552
2553static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
2554 .tuple_tab = cclk_vlev_datasheet,
2555 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
2556 .vr_settling_time = 25 /* us */,
2557};
2558
2559static struct platform_device bfin_dpmc = {
2560 .name = "bfin dpmc",
2561 .dev = {
2562 .platform_data = &bfin_dmpc_vreg_data,
2563 },
2564};
2565
Barry Song336746e2009-10-13 09:19:18 +00002566#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2567static struct platform_device bfin_i2s = {
2568 .name = "bfin-i2s",
2569 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2570 /* TODO: add platform data here */
2571};
2572#endif
2573
Barry Song83124402009-08-06 21:03:02 +00002574#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2575static struct platform_device bfin_tdm = {
2576 .name = "bfin-tdm",
Barry Song336746e2009-10-13 09:19:18 +00002577 .id = CONFIG_SND_BF5XX_SPORT_NUM,
2578 /* TODO: add platform data here */
2579};
2580#endif
2581
2582#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2583static struct platform_device bfin_ac97 = {
2584 .name = "bfin-ac97",
2585 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Barry Song83124402009-08-06 21:03:02 +00002586 /* TODO: add platform data here */
2587};
2588#endif
2589
Sonic Zhang1b04cbe2010-06-02 05:00:21 +00002590#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
2591#define REGULATOR_ADP122 "adp122"
2592#define REGULATOR_ADP122_UV 2500000
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002593
2594static struct regulator_consumer_supply adp122_consumers = {
2595 .supply = REGULATOR_ADP122,
2596};
2597
Sonic Zhang1b04cbe2010-06-02 05:00:21 +00002598static struct regulator_init_data adp_switch_regulator_data = {
2599 .constraints = {
2600 .name = REGULATOR_ADP122,
2601 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
2602 .min_uV = REGULATOR_ADP122_UV,
2603 .max_uV = REGULATOR_ADP122_UV,
2604 .min_uA = 0,
2605 .max_uA = 300000,
2606 },
2607 .num_consumer_supplies = 1, /* only 1 */
2608 .consumer_supplies = &adp122_consumers,
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002609};
2610
Sonic Zhang1b04cbe2010-06-02 05:00:21 +00002611static struct fixed_voltage_config adp_switch_pdata = {
2612 .supply_name = REGULATOR_ADP122,
2613 .microvolts = REGULATOR_ADP122_UV,
2614 .gpio = GPIO_PF2,
2615 .enable_high = 1,
2616 .enabled_at_boot = 0,
2617 .init_data = &adp_switch_regulator_data,
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002618};
2619
2620static struct platform_device adp_switch_device = {
Sonic Zhang1b04cbe2010-06-02 05:00:21 +00002621 .name = "reg-fixed-voltage",
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002622 .id = 0,
2623 .dev = {
2624 .platform_data = &adp_switch_pdata,
2625 },
2626};
2627
2628#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2629 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2630static struct regulator_bulk_data adp122_bulk_data = {
2631 .supply = REGULATOR_ADP122,
2632};
2633
2634static struct regulator_userspace_consumer_data adp122_userspace_comsumer_data = {
2635 .name = REGULATOR_ADP122,
2636 .num_supplies = 1,
2637 .supplies = &adp122_bulk_data,
2638};
2639
2640static struct platform_device adp122_userspace_consumer_device = {
2641 .name = "reg-userspace-consumer",
2642 .id = 0,
2643 .dev = {
2644 .platform_data = &adp122_userspace_comsumer_data,
2645 },
2646};
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002647#endif
2648#endif
2649
Michael Hennerich0891bae2010-03-08 11:58:53 +00002650#if defined(CONFIG_IIO_GPIO_TRIGGER) || \
2651 defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2652
2653static struct resource iio_gpio_trigger_resources[] = {
2654 [0] = {
2655 .start = IRQ_PF5,
2656 .end = IRQ_PF5,
2657 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
2658 },
2659};
2660
2661static struct platform_device iio_gpio_trigger = {
2662 .name = "iio_gpio_trigger",
2663 .num_resources = ARRAY_SIZE(iio_gpio_trigger_resources),
2664 .resource = iio_gpio_trigger_resources,
2665};
2666#endif
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002667
Bryan Wu1394f032007-05-06 14:50:22 -07002668static struct platform_device *stamp_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +08002669
2670 &bfin_dpmc,
2671
Bryan Wu1394f032007-05-06 14:50:22 -07002672#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
2673 &bfin_pcmcia_cf_device,
2674#endif
2675
2676#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
2677 &rtc_device,
2678#endif
2679
2680#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
2681 &sl811_hcd_device,
2682#endif
2683
2684#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
2685 &isp1362_hcd_device,
2686#endif
2687
Michael Hennerich3f375692008-11-18 17:48:22 +08002688#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
2689 &bfin_isp1760_device,
2690#endif
2691
Bryan Wu1394f032007-05-06 14:50:22 -07002692#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
2693 &smc91x_device,
2694#endif
2695
Alex Landauf40d24d2007-07-12 12:11:48 +08002696#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
2697 &dm9000_device,
2698#endif
2699
Barry Song706a01b2009-11-02 07:29:07 +00002700#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
2701 &bfin_can_device,
2702#endif
2703
Bryan Wu1394f032007-05-06 14:50:22 -07002704#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
Graf Yang65319622009-02-04 16:49:45 +08002705 &bfin_mii_bus,
Bryan Wu1394f032007-05-06 14:50:22 -07002706 &bfin_mac_device,
2707#endif
2708
2709#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
2710 &net2272_bfin_device,
2711#endif
2712
2713#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002714 &bfin_spi0_device,
Bryan Wu1394f032007-05-06 14:50:22 -07002715#endif
2716
Cliff Cai1e9aa952009-03-28 23:28:51 +08002717#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
2718 &bfin_sport_spi0_device,
2719 &bfin_sport_spi1_device,
2720#endif
2721
Bryan Wu1394f032007-05-06 14:50:22 -07002722#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
2723 &bfin_fb_device,
2724#endif
2725
Michael Hennerich2043f3f2008-10-13 14:46:30 +08002726#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
2727 &bfin_lq035q1_device,
2728#endif
2729
Bryan Wu1394f032007-05-06 14:50:22 -07002730#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00002731#ifdef CONFIG_SERIAL_BFIN_UART0
2732 &bfin_uart0_device,
2733#endif
2734#ifdef CONFIG_SERIAL_BFIN_UART1
2735 &bfin_uart1_device,
2736#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002737#endif
2738
Graf Yang5be36d22008-04-25 03:09:15 +08002739#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +08002740#ifdef CONFIG_BFIN_SIR0
2741 &bfin_sir0_device,
2742#endif
2743#ifdef CONFIG_BFIN_SIR1
2744 &bfin_sir1_device,
2745#endif
Graf Yang5be36d22008-04-25 03:09:15 +08002746#endif
2747
Bryan Wu1394f032007-05-06 14:50:22 -07002748#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
2749 &i2c_bfin_twi_device,
2750#endif
2751
2752#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
Sonic Zhangdf5de262009-09-23 05:01:56 +00002753#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002754 &bfin_sport0_uart_device,
Sonic Zhangdf5de262009-09-23 05:01:56 +00002755#endif
2756#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
Bryan Wu1394f032007-05-06 14:50:22 -07002757 &bfin_sport1_uart_device,
2758#endif
Sonic Zhangdf5de262009-09-23 05:01:56 +00002759#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002760
2761#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
2762 &bfin_pata_device,
2763#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +08002764
2765#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
2766 &bfin_device_gpiokeys,
2767#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +08002768
Mike Frysingerfc689112008-06-25 11:41:42 +08002769#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
2770 &bfin_async_nand_device,
2771#endif
2772
Mike Frysinger793dc272008-03-26 08:09:12 +08002773#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +08002774 &stamp_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +08002775#endif
Barry Song83124402009-08-06 21:03:02 +00002776
Barry Song336746e2009-10-13 09:19:18 +00002777#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
2778 &bfin_i2s,
2779#endif
2780
Barry Song83124402009-08-06 21:03:02 +00002781#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
2782 &bfin_tdm,
2783#endif
Barry Song336746e2009-10-13 09:19:18 +00002784
2785#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
2786 &bfin_ac97,
2787#endif
Sonic Zhangf32792d2010-02-09 02:47:09 +00002788#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE)
2789#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \
2790 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2791 &ad5398_virt_consumer_device,
2792#endif
2793#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2794 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2795 &ad5398_userspace_consumer_device,
2796#endif
2797#endif
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002798
Sonic Zhang1b04cbe2010-06-02 05:00:21 +00002799#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002800 &adp_switch_device,
2801#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \
2802 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2803 &adp122_userspace_consumer_device,
Sonic Zhangf8e6dbf2010-02-10 09:09:05 +00002804#endif
2805#endif
Michael Hennerich0891bae2010-03-08 11:58:53 +00002806
2807#if defined(CONFIG_IIO_GPIO_TRIGGER) || \
2808 defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2809 &iio_gpio_trigger,
2810#endif
Bryan Wu1394f032007-05-06 14:50:22 -07002811};
2812
2813static int __init stamp_init(void)
2814{
Harvey Harrisonb85d8582008-04-23 09:39:01 +08002815 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Mike Frysingerfc689112008-06-25 11:41:42 +08002816 bfin_plat_nand_init();
Mike Frysinger0531c462010-01-19 07:04:29 +00002817 adf702x_mac_init();
Bryan Wu1394f032007-05-06 14:50:22 -07002818 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
Sonic Zhangdf5de262009-09-23 05:01:56 +00002819 i2c_register_board_info(0, bfin_i2c_board_info,
2820 ARRAY_SIZE(bfin_i2c_board_info));
Mike Frysinger5bda2722008-06-07 15:03:01 +08002821 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002822
Bryan Wu1394f032007-05-06 14:50:22 -07002823 return 0;
2824}
2825
2826arch_initcall(stamp_init);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002827
Sonic Zhangc13ce9f2009-09-23 09:37:46 +00002828
2829static struct platform_device *stamp_early_devices[] __initdata = {
2830#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
2831#ifdef CONFIG_SERIAL_BFIN_UART0
2832 &bfin_uart0_device,
2833#endif
2834#ifdef CONFIG_SERIAL_BFIN_UART1
2835 &bfin_uart1_device,
2836#endif
2837#endif
2838
2839#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2840#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2841 &bfin_sport0_uart_device,
2842#endif
2843#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2844 &bfin_sport1_uart_device,
2845#endif
2846#endif
2847};
2848
2849void __init native_machine_early_platform_add_devices(void)
2850{
2851 printk(KERN_INFO "register early platform devices\n");
2852 early_platform_add_devices(stamp_early_devices,
2853 ARRAY_SIZE(stamp_early_devices));
2854}
2855
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002856void native_machine_restart(char *cmd)
2857{
2858 /* workaround reboot hang when booting from SPI */
2859 if ((bfin_read_SYSCR() & 0x7) == 0x3)
Sonic Zhangb52dae32009-02-04 16:49:45 +08002860 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08002861}
Mike Frysinger137b1522007-11-22 16:07:03 +08002862
2863/*
2864 * Currently the MAC address is saved in Flash by U-Boot
2865 */
2866#define FLASH_MAC 0x203f0000
Mike Frysinger9862cc52007-11-15 21:21:20 +08002867void bfin_get_ether_addr(char *addr)
Mike Frysinger137b1522007-11-22 16:07:03 +08002868{
2869 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
2870 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
2871}
Mike Frysinger9862cc52007-11-15 21:21:20 +08002872EXPORT_SYMBOL(bfin_get_ether_addr);