diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2010-11-30 19:31:46 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-12-01 01:55:04 -0500 |
commit | 1a44d72a4058f870c305a23aa5cbc4cacb6758ea (patch) | |
tree | 23e821a2f9bc928078244ee6842056f117469006 /arch/arm/mach-shmobile | |
parent | d44deb35c26c74d0f1ebea95a5fc386f72d210f7 (diff) |
ARM: mach-shmobile: mackerel: Add FSI-AK4643 support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/board-mackerel.c | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index b9528b0211dc..cf3e660d8e70 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -29,15 +29,19 @@ | |||
29 | #include <linux/gpio.h> | 29 | #include <linux/gpio.h> |
30 | #include <linux/input.h> | 30 | #include <linux/input.h> |
31 | #include <linux/io.h> | 31 | #include <linux/io.h> |
32 | #include <linux/i2c.h> | ||
32 | #include <linux/leds.h> | 33 | #include <linux/leds.h> |
33 | #include <linux/mtd/mtd.h> | 34 | #include <linux/mtd/mtd.h> |
34 | #include <linux/mtd/partitions.h> | 35 | #include <linux/mtd/partitions.h> |
35 | #include <linux/mtd/physmap.h> | 36 | #include <linux/mtd/physmap.h> |
36 | #include <linux/smsc911x.h> | 37 | #include <linux/smsc911x.h> |
38 | #include <linux/sh_intc.h> | ||
37 | #include <linux/usb/r8a66597.h> | 39 | #include <linux/usb/r8a66597.h> |
38 | 40 | ||
39 | #include <video/sh_mobile_lcdc.h> | 41 | #include <video/sh_mobile_lcdc.h> |
40 | 42 | ||
43 | #include <sound/sh_fsi.h> | ||
44 | |||
41 | #include <mach/common.h> | 45 | #include <mach/common.h> |
42 | #include <mach/sh7372.h> | 46 | #include <mach/sh7372.h> |
43 | 47 | ||
@@ -133,6 +137,21 @@ | |||
133 | * CN31 is used as Host in Linux. | 137 | * CN31 is used as Host in Linux. |
134 | */ | 138 | */ |
135 | 139 | ||
140 | /* | ||
141 | * FIXME !! | ||
142 | * | ||
143 | * gpio_no_direction | ||
144 | * are quick_hack. | ||
145 | * | ||
146 | * current gpio frame work doesn't have | ||
147 | * the method to control only pull up/down/free. | ||
148 | * this function should be replaced by correct gpio function | ||
149 | */ | ||
150 | static void __init gpio_no_direction(u32 addr) | ||
151 | { | ||
152 | __raw_writeb(0x00, addr); | ||
153 | } | ||
154 | |||
136 | /* MTD */ | 155 | /* MTD */ |
137 | static struct mtd_partition nor_flash_partitions[] = { | 156 | static struct mtd_partition nor_flash_partitions[] = { |
138 | { | 157 | { |
@@ -347,6 +366,42 @@ static struct platform_device leds_device = { | |||
347 | }, | 366 | }, |
348 | }; | 367 | }; |
349 | 368 | ||
369 | /* FSI */ | ||
370 | #define IRQ_FSI evt2irq(0x1840) | ||
371 | static struct sh_fsi_platform_info fsi_info = { | ||
372 | .porta_flags = SH_FSI_BRS_INV | | ||
373 | SH_FSI_OUT_SLAVE_MODE | | ||
374 | SH_FSI_IN_SLAVE_MODE | | ||
375 | SH_FSI_OFMT(PCM) | | ||
376 | SH_FSI_IFMT(PCM), | ||
377 | }; | ||
378 | |||
379 | static struct resource fsi_resources[] = { | ||
380 | [0] = { | ||
381 | .name = "FSI", | ||
382 | .start = 0xFE3C0000, | ||
383 | .end = 0xFE3C0400 - 1, | ||
384 | .flags = IORESOURCE_MEM, | ||
385 | }, | ||
386 | [1] = { | ||
387 | .start = IRQ_FSI, | ||
388 | .flags = IORESOURCE_IRQ, | ||
389 | }, | ||
390 | }; | ||
391 | |||
392 | static struct platform_device fsi_device = { | ||
393 | .name = "sh_fsi2", | ||
394 | .id = -1, | ||
395 | .num_resources = ARRAY_SIZE(fsi_resources), | ||
396 | .resource = fsi_resources, | ||
397 | .dev = { | ||
398 | .platform_data = &fsi_info, | ||
399 | }, | ||
400 | }; | ||
401 | |||
402 | static struct platform_device fsi_ak4643_device = { | ||
403 | .name = "sh_fsi2_a_ak4643", | ||
404 | }; | ||
350 | 405 | ||
351 | static struct platform_device *mackerel_devices[] __initdata = { | 406 | static struct platform_device *mackerel_devices[] __initdata = { |
352 | &nor_flash_device, | 407 | &nor_flash_device, |
@@ -354,6 +409,15 @@ static struct platform_device *mackerel_devices[] __initdata = { | |||
354 | &lcdc_device, | 409 | &lcdc_device, |
355 | &usb1_host_device, | 410 | &usb1_host_device, |
356 | &leds_device, | 411 | &leds_device, |
412 | &fsi_device, | ||
413 | &fsi_ak4643_device, | ||
414 | }; | ||
415 | |||
416 | /* I2C */ | ||
417 | static struct i2c_board_info i2c0_devices[] = { | ||
418 | { | ||
419 | I2C_BOARD_INFO("ak4643", 0x13), | ||
420 | }, | ||
357 | }; | 421 | }; |
358 | 422 | ||
359 | static struct map_desc mackerel_io_desc[] __initdata = { | 423 | static struct map_desc mackerel_io_desc[] __initdata = { |
@@ -377,6 +441,8 @@ static void __init mackerel_map_io(void) | |||
377 | shmobile_setup_console(); | 441 | shmobile_setup_console(); |
378 | } | 442 | } |
379 | 443 | ||
444 | #define GPIO_PORT9CR 0xE6051009 | ||
445 | #define GPIO_PORT10CR 0xE605100A | ||
380 | static void __init mackerel_init(void) | 446 | static void __init mackerel_init(void) |
381 | { | 447 | { |
382 | sh7372_pinmux_init(); | 448 | sh7372_pinmux_init(); |
@@ -434,6 +500,24 @@ static void __init mackerel_init(void) | |||
434 | /* setup USB phy */ | 500 | /* setup USB phy */ |
435 | __raw_writew(0x8a0a, 0xE6058130); /* USBCR2 */ | 501 | __raw_writew(0x8a0a, 0xE6058130); /* USBCR2 */ |
436 | 502 | ||
503 | /* enable FSI2 port A (ak4643) */ | ||
504 | gpio_request(GPIO_FN_FSIAIBT, NULL); | ||
505 | gpio_request(GPIO_FN_FSIAILR, NULL); | ||
506 | gpio_request(GPIO_FN_FSIAISLD, NULL); | ||
507 | gpio_request(GPIO_FN_FSIAOSLD, NULL); | ||
508 | gpio_request(GPIO_PORT161, NULL); | ||
509 | gpio_direction_output(GPIO_PORT161, 0); /* slave */ | ||
510 | |||
511 | gpio_request(GPIO_PORT9, NULL); | ||
512 | gpio_request(GPIO_PORT10, NULL); | ||
513 | gpio_no_direction(GPIO_PORT9CR); /* FSIAOBT needs no direction */ | ||
514 | gpio_no_direction(GPIO_PORT10CR); /* FSIAOLR needs no direction */ | ||
515 | |||
516 | intc_set_priority(IRQ_FSI, 3); /* irq priority FSI(3) > SMSC911X(2) */ | ||
517 | |||
518 | |||
519 | i2c_register_board_info(0, i2c0_devices, | ||
520 | ARRAY_SIZE(i2c0_devices)); | ||
437 | 521 | ||
438 | sh7372_add_standard_devices(); | 522 | sh7372_add_standard_devices(); |
439 | 523 | ||