i2c: Convert most new-style drivers to use module aliasing
[linux-2.6-block.git] / arch / blackfin / mach-bf548 / boards / ezkit.c
CommitLineData
24a07a12
RH
1/*
2 * File: arch/blackfin/mach-bf548/boards/ezkit.c
3 * Based on: arch/blackfin/mach-bf537/boards/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2007 Analog Devices Inc.
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31#include <linux/device.h>
32#include <linux/platform_device.h>
33#include <linux/mtd/mtd.h>
34#include <linux/mtd/partitions.h>
de8c43f2 35#include <linux/mtd/physmap.h>
24a07a12
RH
36#include <linux/spi/spi.h>
37#include <linux/spi/flash.h>
1f83b8f1 38#include <linux/irq.h>
81d9c7f2 39#include <linux/i2c.h>
24a07a12 40#include <linux/interrupt.h>
67f2d33e 41#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
c6c4d7bb 42#include <linux/usb/musb.h>
67f2d33e 43#endif
24a07a12 44#include <asm/bfin5xx_spi.h>
c6c4d7bb
BW
45#include <asm/cplb.h>
46#include <asm/dma.h>
47#include <asm/gpio.h>
48#include <asm/nand.h>
5d448dd5 49#include <asm/portmux.h>
c6c4d7bb
BW
50#include <asm/mach/bf54x_keys.h>
51#include <linux/input.h>
52#include <linux/spi/ad7877.h>
24a07a12
RH
53
54/*
55 * Name the Board for the /proc/cpuinfo
56 */
066954a3 57const char bfin_board_name[] = "ADSP-BF548-EZKIT";
24a07a12
RH
58
59/*
60 * Driver needs to know address, irq and flag pin.
61 */
62
c6c4d7bb
BW
63#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
64
65#include <asm/mach/bf54x-lq043.h>
66
67static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {
68 .width = 480,
69 .height = 272,
70 .xres = {480, 480, 480},
71 .yres = {272, 272, 272},
72 .bpp = {24, 24, 24},
73 .disp = GPIO_PE3,
74};
75
76static struct resource bf54x_lq043_resources[] = {
77 {
78 .start = IRQ_EPPI0_ERR,
79 .end = IRQ_EPPI0_ERR,
80 .flags = IORESOURCE_IRQ,
81 },
82};
83
84static struct platform_device bf54x_lq043_device = {
85 .name = "bf54x-lq043",
86 .id = -1,
87 .num_resources = ARRAY_SIZE(bf54x_lq043_resources),
88 .resource = bf54x_lq043_resources,
89 .dev = {
90 .platform_data = &bf54x_lq043_data,
91 },
92};
93#endif
94
95#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
8f740ef3 96static const unsigned int bf548_keymap[] = {
c6c4d7bb
BW
97 KEYVAL(0, 0, KEY_ENTER),
98 KEYVAL(0, 1, KEY_HELP),
99 KEYVAL(0, 2, KEY_0),
100 KEYVAL(0, 3, KEY_BACKSPACE),
101 KEYVAL(1, 0, KEY_TAB),
102 KEYVAL(1, 1, KEY_9),
103 KEYVAL(1, 2, KEY_8),
104 KEYVAL(1, 3, KEY_7),
105 KEYVAL(2, 0, KEY_DOWN),
106 KEYVAL(2, 1, KEY_6),
107 KEYVAL(2, 2, KEY_5),
108 KEYVAL(2, 3, KEY_4),
109 KEYVAL(3, 0, KEY_UP),
110 KEYVAL(3, 1, KEY_3),
111 KEYVAL(3, 2, KEY_2),
112 KEYVAL(3, 3, KEY_1),
113};
114
115static struct bfin_kpad_platform_data bf54x_kpad_data = {
116 .rows = 4,
117 .cols = 4,
8f740ef3
MH
118 .keymap = bf548_keymap,
119 .keymapsize = ARRAY_SIZE(bf548_keymap),
c6c4d7bb
BW
120 .repeat = 0,
121 .debounce_time = 5000, /* ns (5ms) */
122 .coldrive_time = 1000, /* ns (1ms) */
123 .keyup_test_interval = 50, /* ms (50ms) */
124};
125
126static struct resource bf54x_kpad_resources[] = {
127 {
128 .start = IRQ_KEY,
129 .end = IRQ_KEY,
130 .flags = IORESOURCE_IRQ,
131 },
132};
133
134static struct platform_device bf54x_kpad_device = {
135 .name = "bf54x-keys",
136 .id = -1,
137 .num_resources = ARRAY_SIZE(bf54x_kpad_resources),
138 .resource = bf54x_kpad_resources,
139 .dev = {
140 .platform_data = &bf54x_kpad_data,
141 },
142};
143#endif
144
24a07a12
RH
145#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
146static struct platform_device rtc_device = {
147 .name = "rtc-bfin",
148 .id = -1,
149};
150#endif
151
152#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
153static struct resource bfin_uart_resources[] = {
154#ifdef CONFIG_SERIAL_BFIN_UART0
155 {
156 .start = 0xFFC00400,
157 .end = 0xFFC004FF,
158 .flags = IORESOURCE_MEM,
159 },
160#endif
161#ifdef CONFIG_SERIAL_BFIN_UART1
162 {
163 .start = 0xFFC02000,
164 .end = 0xFFC020FF,
165 .flags = IORESOURCE_MEM,
166 },
167#endif
168#ifdef CONFIG_SERIAL_BFIN_UART2
169 {
170 .start = 0xFFC02100,
171 .end = 0xFFC021FF,
172 .flags = IORESOURCE_MEM,
173 },
174#endif
175#ifdef CONFIG_SERIAL_BFIN_UART3
176 {
177 .start = 0xFFC03100,
178 .end = 0xFFC031FF,
179 },
180#endif
181};
182
183static struct platform_device bfin_uart_device = {
184 .name = "bfin-uart",
185 .id = 1,
186 .num_resources = ARRAY_SIZE(bfin_uart_resources),
187 .resource = bfin_uart_resources,
188};
189#endif
190
5be36d22
GY
191#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
192static struct resource bfin_sir_resources[] = {
193#ifdef CONFIG_BFIN_SIR0
194 {
195 .start = 0xFFC00400,
196 .end = 0xFFC004FF,
197 .flags = IORESOURCE_MEM,
198 },
199#endif
200#ifdef CONFIG_BFIN_SIR1
201 {
202 .start = 0xFFC02000,
203 .end = 0xFFC020FF,
204 .flags = IORESOURCE_MEM,
205 },
206#endif
207#ifdef CONFIG_BFIN_SIR2
208 {
209 .start = 0xFFC02100,
210 .end = 0xFFC021FF,
211 .flags = IORESOURCE_MEM,
212 },
213#endif
214#ifdef CONFIG_BFIN_SIR3
215 {
216 .start = 0xFFC03100,
217 .end = 0xFFC031FF,
218 .flags = IORESOURCE_MEM,
219 },
220#endif
221};
222
223static struct platform_device bfin_sir_device = {
224 .name = "bfin_sir",
225 .id = 0,
226 .num_resources = ARRAY_SIZE(bfin_sir_resources),
227 .resource = bfin_sir_resources,
228};
229#endif
230
c6c4d7bb
BW
231#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
232static struct resource smsc911x_resources[] = {
233 {
234 .name = "smsc911x-memory",
235 .start = 0x24000000,
236 .end = 0x24000000 + 0xFF,
237 .flags = IORESOURCE_MEM,
238 },
239 {
240 .start = IRQ_PE8,
241 .end = IRQ_PE8,
242 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
243 },
244};
245static struct platform_device smsc911x_device = {
246 .name = "smsc911x",
247 .id = 0,
248 .num_resources = ARRAY_SIZE(smsc911x_resources),
249 .resource = smsc911x_resources,
250};
251#endif
252
c6c4d7bb
BW
253#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
254static struct resource musb_resources[] = {
255 [0] = {
256 .start = 0xFFC03C00,
257 .end = 0xFFC040FF,
258 .flags = IORESOURCE_MEM,
259 },
260 [1] = { /* general IRQ */
261 .start = IRQ_USB_INT0,
262 .end = IRQ_USB_INT0,
263 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
264 },
265 [2] = { /* DMA IRQ */
266 .start = IRQ_USB_DMA,
267 .end = IRQ_USB_DMA,
268 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
269 },
270};
271
272static struct musb_hdrc_platform_data musb_plat = {
2935077e 273#if defined(CONFIG_USB_MUSB_OTG)
c6c4d7bb 274 .mode = MUSB_OTG,
2935077e 275#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
c6c4d7bb 276 .mode = MUSB_HOST,
2935077e 277#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
c6c4d7bb
BW
278 .mode = MUSB_PERIPHERAL,
279#endif
2935077e 280 .multipoint = 0,
c6c4d7bb
BW
281};
282
283static u64 musb_dmamask = ~(u32)0;
284
285static struct platform_device musb_device = {
286 .name = "musb_hdrc",
287 .id = 0,
288 .dev = {
289 .dma_mask = &musb_dmamask,
290 .coherent_dma_mask = 0xffffffff,
291 .platform_data = &musb_plat,
292 },
293 .num_resources = ARRAY_SIZE(musb_resources),
294 .resource = musb_resources,
295};
296#endif
297
298#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
299static struct resource bfin_atapi_resources[] = {
300 {
301 .start = 0xFFC03800,
302 .end = 0xFFC0386F,
303 .flags = IORESOURCE_MEM,
304 },
305 {
306 .start = IRQ_ATAPI_ERR,
307 .end = IRQ_ATAPI_ERR,
308 .flags = IORESOURCE_IRQ,
309 },
310};
311
312static struct platform_device bfin_atapi_device = {
313 .name = "pata-bf54x",
314 .id = -1,
315 .num_resources = ARRAY_SIZE(bfin_atapi_resources),
316 .resource = bfin_atapi_resources,
317};
318#endif
319
320#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
321static struct mtd_partition partition_info[] = {
322 {
323 .name = "Linux Kernel",
324 .offset = 0,
325 .size = 4 * SIZE_1M,
326 },
327 {
328 .name = "File System",
edf05641
MF
329 .offset = MTDPART_OFS_APPEND,
330 .size = MTDPART_SIZ_FULL,
c6c4d7bb
BW
331 },
332};
333
334static struct bf5xx_nand_platform bf5xx_nand_platform = {
335 .page_size = NFC_PG_SIZE_256,
336 .data_width = NFC_NWIDTH_8,
337 .partitions = partition_info,
338 .nr_partitions = ARRAY_SIZE(partition_info),
339 .rd_dly = 3,
340 .wr_dly = 3,
341};
342
343static struct resource bf5xx_nand_resources[] = {
344 {
345 .start = 0xFFC03B00,
346 .end = 0xFFC03B4F,
347 .flags = IORESOURCE_MEM,
348 },
349 {
350 .start = CH_NFC,
351 .end = CH_NFC,
352 .flags = IORESOURCE_IRQ,
353 },
354};
355
356static struct platform_device bf5xx_nand_device = {
357 .name = "bf5xx-nand",
358 .id = 0,
359 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
360 .resource = bf5xx_nand_resources,
361 .dev = {
362 .platform_data = &bf5xx_nand_platform,
363 },
364};
365#endif
366
3d7e6cf8 367#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
c6c4d7bb
BW
368static struct platform_device bf54x_sdh_device = {
369 .name = "bfin-sdh",
370 .id = 0,
371};
372#endif
373
793dc27b 374#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
de8c43f2
MF
375static struct mtd_partition ezkit_partitions[] = {
376 {
377 .name = "Bootloader",
edf05641 378 .size = 0x40000,
de8c43f2
MF
379 .offset = 0,
380 }, {
381 .name = "Kernel",
ac76d889 382 .size = 0x1C0000,
de8c43f2
MF
383 .offset = MTDPART_OFS_APPEND,
384 }, {
385 .name = "RootFS",
386 .size = MTDPART_SIZ_FULL,
387 .offset = MTDPART_OFS_APPEND,
388 }
389};
390
391static struct physmap_flash_data ezkit_flash_data = {
392 .width = 2,
393 .parts = ezkit_partitions,
394 .nr_parts = ARRAY_SIZE(ezkit_partitions),
395};
396
397static struct resource ezkit_flash_resource = {
398 .start = 0x20000000,
399 .end = 0x20ffffff,
400 .flags = IORESOURCE_MEM,
401};
402
403static struct platform_device ezkit_flash_device = {
404 .name = "physmap-flash",
405 .id = 0,
406 .dev = {
407 .platform_data = &ezkit_flash_data,
408 },
409 .num_resources = 1,
410 .resource = &ezkit_flash_resource,
411};
793dc27b 412#endif
de8c43f2 413
c6c4d7bb
BW
414#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
415/* all SPI peripherals info goes here */
416#if defined(CONFIG_MTD_M25P80) \
417 || defined(CONFIG_MTD_M25P80_MODULE)
418/* SPI flash chip (m25p16) */
419static struct mtd_partition bfin_spi_flash_partitions[] = {
420 {
421 .name = "bootloader",
422 .size = 0x00040000,
423 .offset = 0,
424 .mask_flags = MTD_CAP_ROM
425 }, {
426 .name = "linux kernel",
edf05641
MF
427 .size = MTDPART_SIZ_FULL,
428 .offset = MTDPART_OFS_APPEND,
c6c4d7bb
BW
429 }
430};
431
432static struct flash_platform_data bfin_spi_flash_data = {
433 .name = "m25p80",
434 .parts = bfin_spi_flash_partitions,
435 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
436 .type = "m25p16",
437};
438
439static struct bfin5xx_spi_chip spi_flash_chip_info = {
440 .enable_dma = 0, /* use dma transfer with this chip*/
441 .bits_per_word = 8,
442 .cs_change_per_word = 0,
443};
444#endif
445
37fa2421
BS
446#if defined(CONFIG_SND_BLACKFIN_AD1836) \
447 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
448static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
449 .enable_dma = 0,
450 .bits_per_word = 16,
451};
452#endif
453
c6c4d7bb
BW
454#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
455static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
c7d48966 456 .cs_change_per_word = 0,
c6c4d7bb
BW
457 .enable_dma = 0,
458 .bits_per_word = 16,
459};
460
461static const struct ad7877_platform_data bfin_ad7877_ts_info = {
462 .model = 7877,
463 .vref_delay_usecs = 50, /* internal, no capacitor */
464 .x_plate_ohms = 419,
465 .y_plate_ohms = 486,
466 .pressure_max = 1000,
467 .pressure_min = 0,
468 .stopacq_polarity = 1,
469 .first_conversion_delay = 3,
470 .acquisition_time = 1,
471 .averaging = 1,
472 .pen_down_acc_interval = 1,
473};
474#endif
475
6e668936
MH
476#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
477static struct bfin5xx_spi_chip spidev_chip_info = {
478 .enable_dma = 0,
479 .bits_per_word = 8,
480};
481#endif
482
c6c4d7bb
BW
483static struct spi_board_info bf54x_spi_board_info[] __initdata = {
484#if defined(CONFIG_MTD_M25P80) \
485 || defined(CONFIG_MTD_M25P80_MODULE)
486 {
487 /* the modalias must be the same as spi device driver name */
488 .modalias = "m25p80", /* Name of spi_driver for this device */
489 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
490 .bus_num = 0, /* Framework bus number */
491 .chip_select = 1, /* SPI_SSEL1*/
492 .platform_data = &bfin_spi_flash_data,
493 .controller_data = &spi_flash_chip_info,
494 .mode = SPI_MODE_3,
495 },
496#endif
37fa2421
BS
497#if defined(CONFIG_SND_BLACKFIN_AD1836) \
498 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
499 {
500 .modalias = "ad1836-spi",
501 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
502 .bus_num = 1,
503 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
504 .controller_data = &ad1836_spi_chip_info,
505 },
506#endif
c6c4d7bb
BW
507#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
508{
509 .modalias = "ad7877",
510 .platform_data = &bfin_ad7877_ts_info,
511 .irq = IRQ_PJ11,
512 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
513 .bus_num = 0,
514 .chip_select = 2,
515 .controller_data = &spi_ad7877_chip_info,
516},
517#endif
6e668936
MH
518#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
519 {
520 .modalias = "spidev",
521 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
522 .bus_num = 0,
523 .chip_select = 1,
524 .controller_data = &spidev_chip_info,
525 },
526#endif
c6c4d7bb
BW
527};
528
529/* SPI (0) */
530static struct resource bfin_spi0_resource[] = {
531 [0] = {
532 .start = SPI0_REGBASE,
533 .end = SPI0_REGBASE + 0xFF,
534 .flags = IORESOURCE_MEM,
535 },
536 [1] = {
537 .start = CH_SPI0,
538 .end = CH_SPI0,
539 .flags = IORESOURCE_IRQ,
540 }
541};
542
543/* SPI (1) */
544static struct resource bfin_spi1_resource[] = {
545 [0] = {
546 .start = SPI1_REGBASE,
547 .end = SPI1_REGBASE + 0xFF,
548 .flags = IORESOURCE_MEM,
549 },
550 [1] = {
551 .start = CH_SPI1,
552 .end = CH_SPI1,
553 .flags = IORESOURCE_IRQ,
554 }
555};
556
557/* SPI controller data */
5d448dd5 558static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
c6c4d7bb
BW
559 .num_chipselect = 8,
560 .enable_dma = 1, /* master has the ability to do dma transfer */
5d448dd5 561 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
c6c4d7bb
BW
562};
563
564static struct platform_device bf54x_spi_master0 = {
565 .name = "bfin-spi",
566 .id = 0, /* Bus number */
567 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
568 .resource = bfin_spi0_resource,
569 .dev = {
5d448dd5 570 .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
c6c4d7bb
BW
571 },
572};
573
5d448dd5
BW
574static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
575 .num_chipselect = 8,
576 .enable_dma = 1, /* master has the ability to do dma transfer */
577 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
578};
579
c6c4d7bb
BW
580static struct platform_device bf54x_spi_master1 = {
581 .name = "bfin-spi",
582 .id = 1, /* Bus number */
583 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
584 .resource = bfin_spi1_resource,
585 .dev = {
5d448dd5 586 .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
c6c4d7bb
BW
587 },
588};
589#endif /* spi master and devices */
590
591#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
592static struct resource bfin_twi0_resource[] = {
593 [0] = {
594 .start = TWI0_REGBASE,
595 .end = TWI0_REGBASE + 0xFF,
596 .flags = IORESOURCE_MEM,
597 },
598 [1] = {
599 .start = IRQ_TWI0,
600 .end = IRQ_TWI0,
601 .flags = IORESOURCE_IRQ,
602 },
603};
604
605static struct platform_device i2c_bfin_twi0_device = {
606 .name = "i2c-bfin-twi",
607 .id = 0,
608 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
609 .resource = bfin_twi0_resource,
610};
611
7160e950 612#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
c6c4d7bb
BW
613static struct resource bfin_twi1_resource[] = {
614 [0] = {
615 .start = TWI1_REGBASE,
616 .end = TWI1_REGBASE + 0xFF,
617 .flags = IORESOURCE_MEM,
618 },
619 [1] = {
620 .start = IRQ_TWI1,
621 .end = IRQ_TWI1,
622 .flags = IORESOURCE_IRQ,
623 },
624};
625
626static struct platform_device i2c_bfin_twi1_device = {
627 .name = "i2c-bfin-twi",
628 .id = 1,
629 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
630 .resource = bfin_twi1_resource,
631};
632#endif
7160e950 633#endif
c6c4d7bb 634
81d9c7f2
BW
635#ifdef CONFIG_I2C_BOARDINFO
636static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
637};
638
639#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
640static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
641#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
642 {
643 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
81d9c7f2
BW
644 },
645#endif
646#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
647 {
648 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
81d9c7f2
BW
649 .irq = 212,
650 },
651#endif
652};
653#endif
654#endif
655
2463ef22
MH
656#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
657#include <linux/gpio_keys.h>
658
659static struct gpio_keys_button bfin_gpio_keys_table[] = {
660 {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"},
661 {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"},
662 {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"},
663 {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"},
664};
665
666static struct gpio_keys_platform_data bfin_gpio_keys_data = {
667 .buttons = bfin_gpio_keys_table,
668 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
669};
670
671static struct platform_device bfin_device_gpiokeys = {
672 .name = "gpio-keys",
673 .dev = {
674 .platform_data = &bfin_gpio_keys_data,
675 },
676};
677#endif
678
cad2ab65
MF
679static struct resource bfin_gpios_resources = {
680 .start = 0,
681 .end = MAX_BLACKFIN_GPIOS - 1,
682 .flags = IORESOURCE_IRQ,
683};
684
685static struct platform_device bfin_gpios_device = {
686 .name = "simple-gpio",
687 .id = -1,
688 .num_resources = 1,
689 .resource = &bfin_gpios_resources,
690};
691
24a07a12
RH
692static struct platform_device *ezkit_devices[] __initdata = {
693#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
694 &rtc_device,
695#endif
696
697#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
698 &bfin_uart_device,
699#endif
c6c4d7bb 700
5be36d22
GY
701#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
702 &bfin_sir_device,
703#endif
704
c6c4d7bb
BW
705#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
706 &bf54x_lq043_device,
707#endif
708
709#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
710 &smsc911x_device,
711#endif
712
c6c4d7bb
BW
713#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
714 &musb_device,
715#endif
716
717#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
718 &bfin_atapi_device,
719#endif
720
721#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
722 &bf5xx_nand_device,
723#endif
724
3d7e6cf8 725#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
c6c4d7bb
BW
726 &bf54x_sdh_device,
727#endif
728
729#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
730 &bf54x_spi_master0,
d4b1d273 731 &bf54x_spi_master1,
c6c4d7bb
BW
732#endif
733
734#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
735 &bf54x_kpad_device,
736#endif
737
738#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
739 &i2c_bfin_twi0_device,
7160e950 740#if !defined(CONFIG_BF542)
c6c4d7bb
BW
741 &i2c_bfin_twi1_device,
742#endif
7160e950 743#endif
2463ef22
MH
744
745#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
746 &bfin_device_gpiokeys,
747#endif
cad2ab65
MF
748
749 &bfin_gpios_device,
793dc27b
MF
750
751#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
de8c43f2 752 &ezkit_flash_device,
793dc27b 753#endif
24a07a12
RH
754};
755
a01d7a76 756static int __init ezkit_init(void)
24a07a12 757{
b85d858b 758 printk(KERN_INFO "%s(): registering device resources\n", __func__);
81d9c7f2
BW
759
760#ifdef CONFIG_I2C_BOARDINFO
761 i2c_register_board_info(0, bfin_i2c_board_info0,
762 ARRAY_SIZE(bfin_i2c_board_info0));
763#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
764 i2c_register_board_info(1, bfin_i2c_board_info1,
765 ARRAY_SIZE(bfin_i2c_board_info1));
766#endif
767#endif
768
24a07a12 769 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
c6c4d7bb
BW
770
771#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
772 spi_register_board_info(bf54x_spi_board_info,
773 ARRAY_SIZE(bf54x_spi_board_info));
774#endif
775
24a07a12
RH
776 return 0;
777}
778
a01d7a76 779arch_initcall(ezkit_init);