diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2012-06-25 06:32:50 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-06-30 09:24:51 -0400 |
commit | 5389bf719f87101339f292256392bff5ae926917 (patch) | |
tree | b139ba1d3a77f9b4368e91b407f84ae1dab1f3c6 /arch/arm/mach-shmobile | |
parent | e01fa821b8929e886665937e4b7525743bc357ac (diff) |
ARM: shmobile: armadillo800eva: enable FSI-WM8978 sound
This patch enable sound support on CON11
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-armadillo800eva.c | 99 |
2 files changed, 100 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index df33909205e2..1542e913f73e 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -106,6 +106,7 @@ config MACH_ARMADILLO800EVA | |||
106 | depends on ARCH_R8A7740 | 106 | depends on ARCH_R8A7740 |
107 | select ARCH_REQUIRE_GPIOLIB | 107 | select ARCH_REQUIRE_GPIOLIB |
108 | select USE_OF | 108 | select USE_OF |
109 | select SND_SOC_WM8978 if SND_SIMPLE_CARD | ||
109 | 110 | ||
110 | config MACH_MARZEN | 111 | config MACH_MARZEN |
111 | bool "MARZEN board" | 112 | bool "MARZEN board" |
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index 2cce28b2e40a..08f0e7b5deef 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c | |||
@@ -49,6 +49,8 @@ | |||
49 | #include <asm/hardware/cache-l2x0.h> | 49 | #include <asm/hardware/cache-l2x0.h> |
50 | #include <video/sh_mobile_lcdc.h> | 50 | #include <video/sh_mobile_lcdc.h> |
51 | #include <video/sh_mobile_hdmi.h> | 51 | #include <video/sh_mobile_hdmi.h> |
52 | #include <sound/sh_fsi.h> | ||
53 | #include <sound/simple_card.h> | ||
52 | 54 | ||
53 | /* | 55 | /* |
54 | * CON1 Camera Module | 56 | * CON1 Camera Module |
@@ -112,6 +114,28 @@ | |||
112 | */ | 114 | */ |
113 | 115 | ||
114 | /* | 116 | /* |
117 | * FSI-WM8978 | ||
118 | * | ||
119 | * this command is required when playback. | ||
120 | * | ||
121 | * # amixer set "Headphone" 50 | ||
122 | */ | ||
123 | |||
124 | /* | ||
125 | * FIXME !! | ||
126 | * | ||
127 | * gpio_no_direction | ||
128 | * | ||
129 | * current gpio frame work doesn't have | ||
130 | * the method to control only pull up/down/free. | ||
131 | * this function should be replaced by correct gpio function | ||
132 | */ | ||
133 | static void __init gpio_no_direction(u32 addr) | ||
134 | { | ||
135 | __raw_writeb(0x00, addr); | ||
136 | } | ||
137 | |||
138 | /* | ||
115 | * USB function | 139 | * USB function |
116 | * | 140 | * |
117 | * When you use USB Function, | 141 | * When you use USB Function, |
@@ -714,12 +738,71 @@ static struct platform_device ceu0_device = { | |||
714 | }, | 738 | }, |
715 | }; | 739 | }; |
716 | 740 | ||
741 | /* FSI */ | ||
742 | static struct sh_fsi_platform_info fsi_info = { | ||
743 | /* FSI-WM8978 */ | ||
744 | .port_a = { | ||
745 | }, | ||
746 | }; | ||
747 | |||
748 | static struct resource fsi_resources[] = { | ||
749 | [0] = { | ||
750 | .name = "FSI", | ||
751 | .start = 0xfe1f0000, | ||
752 | .end = 0xfe1f8400 - 1, | ||
753 | .flags = IORESOURCE_MEM, | ||
754 | }, | ||
755 | [1] = { | ||
756 | .start = evt2irq(0x1840), | ||
757 | .flags = IORESOURCE_IRQ, | ||
758 | }, | ||
759 | }; | ||
760 | |||
761 | static struct platform_device fsi_device = { | ||
762 | .name = "sh_fsi2", | ||
763 | .id = -1, | ||
764 | .num_resources = ARRAY_SIZE(fsi_resources), | ||
765 | .resource = fsi_resources, | ||
766 | .dev = { | ||
767 | .platform_data = &fsi_info, | ||
768 | }, | ||
769 | }; | ||
770 | |||
771 | /* FSI-WM8978 */ | ||
772 | static struct asoc_simple_dai_init_info fsi_wm8978_init_info = { | ||
773 | .fmt = SND_SOC_DAIFMT_I2S, | ||
774 | .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_NB_NF, | ||
775 | .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS, | ||
776 | .sysclk = 12288000, | ||
777 | }; | ||
778 | |||
779 | static struct asoc_simple_card_info fsi_wm8978_info = { | ||
780 | .name = "wm8978", | ||
781 | .card = "FSI2A-WM8978", | ||
782 | .cpu_dai = "fsia-dai", | ||
783 | .codec = "wm8978.0-001a", | ||
784 | .platform = "sh_fsi2", | ||
785 | .codec_dai = "wm8978-hifi", | ||
786 | .init = &fsi_wm8978_init_info, | ||
787 | }; | ||
788 | |||
789 | static struct platform_device fsi_wm8978_device = { | ||
790 | .name = "asoc-simple-card", | ||
791 | .id = 0, | ||
792 | .dev = { | ||
793 | .platform_data = &fsi_wm8978_info, | ||
794 | }, | ||
795 | }; | ||
796 | |||
717 | /* I2C */ | 797 | /* I2C */ |
718 | static struct i2c_board_info i2c0_devices[] = { | 798 | static struct i2c_board_info i2c0_devices[] = { |
719 | { | 799 | { |
720 | I2C_BOARD_INFO("st1232-ts", 0x55), | 800 | I2C_BOARD_INFO("st1232-ts", 0x55), |
721 | .irq = evt2irq(0x0340), | 801 | .irq = evt2irq(0x0340), |
722 | }, | 802 | }, |
803 | { | ||
804 | I2C_BOARD_INFO("wm8978", 0x1a), | ||
805 | }, | ||
723 | }; | 806 | }; |
724 | 807 | ||
725 | /* | 808 | /* |
@@ -735,6 +818,8 @@ static struct platform_device *eva_devices[] __initdata = { | |||
735 | &hdmi_lcdc_device, | 818 | &hdmi_lcdc_device, |
736 | &camera_device, | 819 | &camera_device, |
737 | &ceu0_device, | 820 | &ceu0_device, |
821 | &fsi_device, | ||
822 | &fsi_wm8978_device, | ||
738 | }; | 823 | }; |
739 | 824 | ||
740 | static void __init eva_clock_init(void) | 825 | static void __init eva_clock_init(void) |
@@ -768,6 +853,8 @@ clock_error: | |||
768 | /* | 853 | /* |
769 | * board init | 854 | * board init |
770 | */ | 855 | */ |
856 | #define GPIO_PORT7CR 0xe6050007 | ||
857 | #define GPIO_PORT8CR 0xe6050008 | ||
771 | static void __init eva_init(void) | 858 | static void __init eva_init(void) |
772 | { | 859 | { |
773 | eva_clock_init(); | 860 | eva_clock_init(); |
@@ -916,6 +1003,18 @@ static void __init eva_init(void) | |||
916 | gpio_direction_output(GPIO_PORT172, 1); | 1003 | gpio_direction_output(GPIO_PORT172, 1); |
917 | gpio_direction_output(GPIO_PORT158, 0); /* see mt9t111_power() */ | 1004 | gpio_direction_output(GPIO_PORT158, 0); /* see mt9t111_power() */ |
918 | 1005 | ||
1006 | /* FSI-WM8978 */ | ||
1007 | gpio_request(GPIO_FN_FSIAIBT, NULL); | ||
1008 | gpio_request(GPIO_FN_FSIAILR, NULL); | ||
1009 | gpio_request(GPIO_FN_FSIAOMC, NULL); | ||
1010 | gpio_request(GPIO_FN_FSIAOSLD, NULL); | ||
1011 | gpio_request(GPIO_FN_FSIAISLD_PORT5, NULL); | ||
1012 | |||
1013 | gpio_request(GPIO_PORT7, NULL); | ||
1014 | gpio_request(GPIO_PORT8, NULL); | ||
1015 | gpio_no_direction(GPIO_PORT7CR); /* FSIAOBT needs no direction */ | ||
1016 | gpio_no_direction(GPIO_PORT8CR); /* FSIAOLR needs no direction */ | ||
1017 | |||
919 | /* | 1018 | /* |
920 | * CAUTION | 1019 | * CAUTION |
921 | * | 1020 | * |