diff options
author | Kuninori Morimoto <morimoto.kuninori@renesas.com> | 2009-08-20 21:24:54 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-09-24 22:04:36 -0400 |
commit | 3e9ad52b95e259e68c7dcb69a25d58047ed51094 (patch) | |
tree | d6f0f043859a92f85e5a33a5e5c534d6b930f4dd /arch | |
parent | 40258ee97d0d5e5c30a3d4b7acaf294fe82cd23f (diff) |
sh: add FSI driver support for ms7724se
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/boards/mach-se/7724/setup.c | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index 00973e0f8c63..e78c3be8ad2f 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/usb/r8a66597.h> | 22 | #include <linux/usb/r8a66597.h> |
23 | #include <video/sh_mobile_lcdc.h> | 23 | #include <video/sh_mobile_lcdc.h> |
24 | #include <media/sh_mobile_ceu.h> | 24 | #include <media/sh_mobile_ceu.h> |
25 | #include <sound/sh_fsi.h> | ||
25 | #include <asm/io.h> | 26 | #include <asm/io.h> |
26 | #include <asm/heartbeat.h> | 27 | #include <asm/heartbeat.h> |
27 | #include <asm/sh_eth.h> | 28 | #include <asm/sh_eth.h> |
@@ -255,6 +256,65 @@ static struct platform_device ceu1_device = { | |||
255 | }, | 256 | }, |
256 | }; | 257 | }; |
257 | 258 | ||
259 | /* FSI */ | ||
260 | /* | ||
261 | * FSI-A use external clock which came from ak464x. | ||
262 | * So, we should change parent of fsi | ||
263 | */ | ||
264 | #define FCLKACR 0xa4150008 | ||
265 | static void fsimck_init(struct clk *clk) | ||
266 | { | ||
267 | u32 status = ctrl_inl(clk->enable_reg); | ||
268 | |||
269 | /* use external clock */ | ||
270 | status &= ~0x000000ff; | ||
271 | status |= 0x00000080; | ||
272 | ctrl_outl(status, clk->enable_reg); | ||
273 | } | ||
274 | |||
275 | static struct clk_ops fsimck_clk_ops = { | ||
276 | .init = fsimck_init, | ||
277 | }; | ||
278 | |||
279 | static struct clk fsimcka_clk = { | ||
280 | .name = "fsimcka_clk", | ||
281 | .id = -1, | ||
282 | .ops = &fsimck_clk_ops, | ||
283 | .enable_reg = (void __iomem *)FCLKACR, | ||
284 | .rate = 0, /* unknown */ | ||
285 | }; | ||
286 | |||
287 | struct sh_fsi_platform_info fsi_info = { | ||
288 | .porta_flags = SH_FSI_BRS_INV | | ||
289 | SH_FSI_OUT_SLAVE_MODE | | ||
290 | SH_FSI_IN_SLAVE_MODE | | ||
291 | SH_FSI_OFMT(PCM) | | ||
292 | SH_FSI_IFMT(PCM), | ||
293 | }; | ||
294 | |||
295 | static struct resource fsi_resources[] = { | ||
296 | [0] = { | ||
297 | .name = "FSI", | ||
298 | .start = 0xFE3C0000, | ||
299 | .end = 0xFE3C021d, | ||
300 | .flags = IORESOURCE_MEM, | ||
301 | }, | ||
302 | [1] = { | ||
303 | .start = 108, | ||
304 | .flags = IORESOURCE_IRQ, | ||
305 | }, | ||
306 | }; | ||
307 | |||
308 | static struct platform_device fsi_device = { | ||
309 | .name = "sh_fsi", | ||
310 | .id = 0, | ||
311 | .num_resources = ARRAY_SIZE(fsi_resources), | ||
312 | .resource = fsi_resources, | ||
313 | .dev = { | ||
314 | .platform_data = &fsi_info, | ||
315 | }, | ||
316 | }; | ||
317 | |||
258 | /* KEYSC in SoC (Needs SW33-2 set to ON) */ | 318 | /* KEYSC in SoC (Needs SW33-2 set to ON) */ |
259 | static struct sh_keysc_info keysc_info = { | 319 | static struct sh_keysc_info keysc_info = { |
260 | .mode = SH_KEYSC_MODE_1, | 320 | .mode = SH_KEYSC_MODE_1, |
@@ -399,6 +459,7 @@ static struct platform_device *ms7724se_devices[] __initdata = { | |||
399 | &sh_eth_device, | 459 | &sh_eth_device, |
400 | &sh7724_usb0_host_device, | 460 | &sh7724_usb0_host_device, |
401 | &sh7724_usb1_gadget_device, | 461 | &sh7724_usb1_gadget_device, |
462 | &fsi_device, | ||
402 | }; | 463 | }; |
403 | 464 | ||
404 | #define EEPROM_OP 0xBA206000 | 465 | #define EEPROM_OP 0xBA206000 |
@@ -466,11 +527,13 @@ static void __init sh_eth_init(void) | |||
466 | static int __init devices_setup(void) | 527 | static int __init devices_setup(void) |
467 | { | 528 | { |
468 | u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ | 529 | u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ |
530 | struct clk *fsia_clk; | ||
469 | 531 | ||
470 | /* Reset Release */ | 532 | /* Reset Release */ |
471 | ctrl_outw(ctrl_inw(FPGA_OUT) & | 533 | ctrl_outw(ctrl_inw(FPGA_OUT) & |
472 | ~((1 << 1) | /* LAN */ | 534 | ~((1 << 1) | /* LAN */ |
473 | (1 << 6) | /* VIDEO DAC */ | 535 | (1 << 6) | /* VIDEO DAC */ |
536 | (1 << 7) | /* AK4643 */ | ||
474 | (1 << 12) | /* USB0 */ | 537 | (1 << 12) | /* USB0 */ |
475 | (1 << 14)), /* RMII */ | 538 | (1 << 14)), /* RMII */ |
476 | FPGA_OUT); | 539 | FPGA_OUT); |
@@ -609,6 +672,32 @@ static int __init devices_setup(void) | |||
609 | gpio_request(GPIO_FN_KEYOUT1, NULL); | 672 | gpio_request(GPIO_FN_KEYOUT1, NULL); |
610 | gpio_request(GPIO_FN_KEYOUT0, NULL); | 673 | gpio_request(GPIO_FN_KEYOUT0, NULL); |
611 | 674 | ||
675 | /* enable FSI */ | ||
676 | gpio_request(GPIO_FN_FSIMCKB, NULL); | ||
677 | gpio_request(GPIO_FN_FSIMCKA, NULL); | ||
678 | gpio_request(GPIO_FN_FSIOASD, NULL); | ||
679 | gpio_request(GPIO_FN_FSIIABCK, NULL); | ||
680 | gpio_request(GPIO_FN_FSIIALRCK, NULL); | ||
681 | gpio_request(GPIO_FN_FSIOABCK, NULL); | ||
682 | gpio_request(GPIO_FN_FSIOALRCK, NULL); | ||
683 | gpio_request(GPIO_FN_CLKAUDIOAO, NULL); | ||
684 | gpio_request(GPIO_FN_FSIIBSD, NULL); | ||
685 | gpio_request(GPIO_FN_FSIOBSD, NULL); | ||
686 | gpio_request(GPIO_FN_FSIIBBCK, NULL); | ||
687 | gpio_request(GPIO_FN_FSIIBLRCK, NULL); | ||
688 | gpio_request(GPIO_FN_FSIOBBCK, NULL); | ||
689 | gpio_request(GPIO_FN_FSIOBLRCK, NULL); | ||
690 | gpio_request(GPIO_FN_CLKAUDIOBO, NULL); | ||
691 | gpio_request(GPIO_FN_FSIIASD, NULL); | ||
692 | |||
693 | /* change parent of FSI A */ | ||
694 | fsia_clk = clk_get(NULL, "fsia_clk"); | ||
695 | clk_register(&fsimcka_clk); | ||
696 | clk_set_parent(fsia_clk, &fsimcka_clk); | ||
697 | clk_set_rate(fsia_clk, 11000); | ||
698 | clk_set_rate(&fsimcka_clk, 11000); | ||
699 | clk_put(fsia_clk); | ||
700 | |||
612 | /* | 701 | /* |
613 | * enable SH-Eth | 702 | * enable SH-Eth |
614 | * | 703 | * |