diff options
author | Kuninori Morimoto <morimoto.kuninori@renesas.com> | 2009-12-15 00:37:39 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-12-15 08:03:08 -0500 |
commit | 1980fdc4df4778741f15f50f715cd790ccbe0a79 (patch) | |
tree | e5d0b4d9963fec759502e112937ced5f1b04e32e /arch/sh | |
parent | 9aa25d64499161048ff024cde704f912a41fad6f (diff) |
sh: mach-ecovec24: Add FSI sound support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/boards/mach-ecovec24/setup.c | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 89c5a715d0b6..194aaca22d47 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/input/sh_keysc.h> | 27 | #include <linux/input/sh_keysc.h> |
28 | #include <linux/mfd/sh_mobile_sdhi.h> | 28 | #include <linux/mfd/sh_mobile_sdhi.h> |
29 | #include <video/sh_mobile_lcdc.h> | 29 | #include <video/sh_mobile_lcdc.h> |
30 | #include <sound/sh_fsi.h> | ||
30 | #include <media/sh_mobile_ceu.h> | 31 | #include <media/sh_mobile_ceu.h> |
31 | #include <media/tw9910.h> | 32 | #include <media/tw9910.h> |
32 | #include <media/mt9t112.h> | 33 | #include <media/mt9t112.h> |
@@ -344,6 +345,12 @@ static struct platform_device ceu1_device = { | |||
344 | }; | 345 | }; |
345 | 346 | ||
346 | /* I2C device */ | 347 | /* I2C device */ |
348 | static struct i2c_board_info i2c0_devices[] = { | ||
349 | { | ||
350 | I2C_BOARD_INFO("da7210", 0x1a), | ||
351 | }, | ||
352 | }; | ||
353 | |||
347 | static struct i2c_board_info i2c1_devices[] = { | 354 | static struct i2c_board_info i2c1_devices[] = { |
348 | { | 355 | { |
349 | I2C_BOARD_INFO("r2025sd", 0x32), | 356 | I2C_BOARD_INFO("r2025sd", 0x32), |
@@ -679,6 +686,69 @@ static struct platform_device camera_devices[] = { | |||
679 | }, | 686 | }, |
680 | }; | 687 | }; |
681 | 688 | ||
689 | /* FSI */ | ||
690 | /* | ||
691 | * FSI-B use external clock which came from da7210. | ||
692 | * So, we should change parent of fsi | ||
693 | */ | ||
694 | #define FCLKBCR 0xa415000c | ||
695 | static void fsimck_init(struct clk *clk) | ||
696 | { | ||
697 | u32 status = ctrl_inl(clk->enable_reg); | ||
698 | |||
699 | /* use external clock */ | ||
700 | status &= ~0x000000ff; | ||
701 | status |= 0x00000080; | ||
702 | |||
703 | ctrl_outl(status, clk->enable_reg); | ||
704 | } | ||
705 | |||
706 | static struct clk_ops fsimck_clk_ops = { | ||
707 | .init = fsimck_init, | ||
708 | }; | ||
709 | |||
710 | static struct clk fsimckb_clk = { | ||
711 | .name = "fsimckb_clk", | ||
712 | .id = -1, | ||
713 | .ops = &fsimck_clk_ops, | ||
714 | .enable_reg = (void __iomem *)FCLKBCR, | ||
715 | .rate = 0, /* unknown */ | ||
716 | }; | ||
717 | |||
718 | struct sh_fsi_platform_info fsi_info = { | ||
719 | .portb_flags = SH_FSI_BRS_INV | | ||
720 | SH_FSI_OUT_SLAVE_MODE | | ||
721 | SH_FSI_IN_SLAVE_MODE | | ||
722 | SH_FSI_OFMT(I2S) | | ||
723 | SH_FSI_IFMT(I2S), | ||
724 | }; | ||
725 | |||
726 | static struct resource fsi_resources[] = { | ||
727 | [0] = { | ||
728 | .name = "FSI", | ||
729 | .start = 0xFE3C0000, | ||
730 | .end = 0xFE3C021d, | ||
731 | .flags = IORESOURCE_MEM, | ||
732 | }, | ||
733 | [1] = { | ||
734 | .start = 108, | ||
735 | .flags = IORESOURCE_IRQ, | ||
736 | }, | ||
737 | }; | ||
738 | |||
739 | static struct platform_device fsi_device = { | ||
740 | .name = "sh_fsi", | ||
741 | .id = 0, | ||
742 | .num_resources = ARRAY_SIZE(fsi_resources), | ||
743 | .resource = fsi_resources, | ||
744 | .dev = { | ||
745 | .platform_data = &fsi_info, | ||
746 | }, | ||
747 | .archdata = { | ||
748 | .hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */ | ||
749 | }, | ||
750 | }; | ||
751 | |||
682 | static struct platform_device *ecovec_devices[] __initdata = { | 752 | static struct platform_device *ecovec_devices[] __initdata = { |
683 | &heartbeat_device, | 753 | &heartbeat_device, |
684 | &nor_flash_device, | 754 | &nor_flash_device, |
@@ -698,6 +768,7 @@ static struct platform_device *ecovec_devices[] __initdata = { | |||
698 | &camera_devices[0], | 768 | &camera_devices[0], |
699 | &camera_devices[1], | 769 | &camera_devices[1], |
700 | &camera_devices[2], | 770 | &camera_devices[2], |
771 | &fsi_device, | ||
701 | }; | 772 | }; |
702 | 773 | ||
703 | #define EEPROM_ADDR 0x50 | 774 | #define EEPROM_ADDR 0x50 |
@@ -753,6 +824,8 @@ extern char ecovec24_sdram_leave_end; | |||
753 | 824 | ||
754 | static int __init arch_setup(void) | 825 | static int __init arch_setup(void) |
755 | { | 826 | { |
827 | struct clk *clk; | ||
828 | |||
756 | /* register board specific self-refresh code */ | 829 | /* register board specific self-refresh code */ |
757 | sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, | 830 | sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, |
758 | &ecovec24_sdram_enter_start, | 831 | &ecovec24_sdram_enter_start, |
@@ -1020,7 +1093,32 @@ static int __init arch_setup(void) | |||
1020 | gpio_direction_output(GPIO_PTA3, 0); | 1093 | gpio_direction_output(GPIO_PTA3, 0); |
1021 | gpio_direction_output(GPIO_PTA4, 0); | 1094 | gpio_direction_output(GPIO_PTA4, 0); |
1022 | 1095 | ||
1096 | /* enable FSI */ | ||
1097 | gpio_request(GPIO_FN_FSIMCKB, NULL); | ||
1098 | gpio_request(GPIO_FN_FSIIBSD, NULL); | ||
1099 | gpio_request(GPIO_FN_FSIOBSD, NULL); | ||
1100 | gpio_request(GPIO_FN_FSIIBBCK, NULL); | ||
1101 | gpio_request(GPIO_FN_FSIIBLRCK, NULL); | ||
1102 | gpio_request(GPIO_FN_FSIOBBCK, NULL); | ||
1103 | gpio_request(GPIO_FN_FSIOBLRCK, NULL); | ||
1104 | gpio_request(GPIO_FN_CLKAUDIOBO, NULL); | ||
1105 | |||
1106 | /* change parent of FSI B */ | ||
1107 | clk = clk_get(NULL, "fsib_clk"); | ||
1108 | clk_register(&fsimckb_clk); | ||
1109 | clk_set_parent(clk, &fsimckb_clk); | ||
1110 | clk_set_rate(clk, 11000); | ||
1111 | clk_set_rate(&fsimckb_clk, 11000); | ||
1112 | clk_put(clk); | ||
1113 | |||
1114 | gpio_request(GPIO_PTU0, NULL); | ||
1115 | gpio_direction_output(GPIO_PTU0, 0); | ||
1116 | mdelay(20); | ||
1117 | |||
1023 | /* enable I2C device */ | 1118 | /* enable I2C device */ |
1119 | i2c_register_board_info(0, i2c0_devices, | ||
1120 | ARRAY_SIZE(i2c0_devices)); | ||
1121 | |||
1024 | i2c_register_board_info(1, i2c1_devices, | 1122 | i2c_register_board_info(1, i2c1_devices, |
1025 | ARRAY_SIZE(i2c1_devices)); | 1123 | ARRAY_SIZE(i2c1_devices)); |
1026 | 1124 | ||