diff options
Diffstat (limited to 'sound/soc/sh/fsi-ak4642.c')
-rw-r--r-- | sound/soc/sh/fsi-ak4642.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/sound/soc/sh/fsi-ak4642.c b/sound/soc/sh/fsi-ak4642.c index a14820ac9665..d6f4703b3c07 100644 --- a/sound/soc/sh/fsi-ak4642.c +++ b/sound/soc/sh/fsi-ak4642.c | |||
@@ -18,18 +18,26 @@ struct fsi_ak4642_data { | |||
18 | const char *cpu_dai; | 18 | const char *cpu_dai; |
19 | const char *codec; | 19 | const char *codec; |
20 | const char *platform; | 20 | const char *platform; |
21 | int id; | ||
21 | }; | 22 | }; |
22 | 23 | ||
23 | static int fsi_ak4642_dai_init(struct snd_soc_pcm_runtime *rtd) | 24 | static int fsi_ak4642_dai_init(struct snd_soc_pcm_runtime *rtd) |
24 | { | 25 | { |
25 | struct snd_soc_dai *dai = rtd->codec_dai; | 26 | struct snd_soc_dai *codec = rtd->codec_dai; |
27 | struct snd_soc_dai *cpu = rtd->cpu_dai; | ||
26 | int ret; | 28 | int ret; |
27 | 29 | ||
28 | ret = snd_soc_dai_set_fmt(dai, SND_SOC_DAIFMT_CBM_CFM); | 30 | ret = snd_soc_dai_set_fmt(codec, SND_SOC_DAIFMT_LEFT_J | |
31 | SND_SOC_DAIFMT_CBM_CFM); | ||
29 | if (ret < 0) | 32 | if (ret < 0) |
30 | return ret; | 33 | return ret; |
31 | 34 | ||
32 | ret = snd_soc_dai_set_sysclk(dai, 0, 11289600, 0); | 35 | ret = snd_soc_dai_set_sysclk(codec, 0, 11289600, 0); |
36 | if (ret < 0) | ||
37 | return ret; | ||
38 | |||
39 | ret = snd_soc_dai_set_fmt(cpu, SND_SOC_DAIFMT_LEFT_J | | ||
40 | SND_SOC_DAIFMT_CBS_CFS); | ||
33 | 41 | ||
34 | return ret; | 42 | return ret; |
35 | } | 43 | } |
@@ -60,7 +68,7 @@ static int fsi_ak4642_probe(struct platform_device *pdev) | |||
60 | 68 | ||
61 | pdata = (struct fsi_ak4642_data *)id_entry->driver_data; | 69 | pdata = (struct fsi_ak4642_data *)id_entry->driver_data; |
62 | 70 | ||
63 | fsi_snd_device = platform_device_alloc("soc-audio", FSI_PORT_A); | 71 | fsi_snd_device = platform_device_alloc("soc-audio", pdata->id); |
64 | if (!fsi_snd_device) | 72 | if (!fsi_snd_device) |
65 | goto out; | 73 | goto out; |
66 | 74 | ||
@@ -93,6 +101,7 @@ static struct fsi_ak4642_data fsi_a_ak4642 = { | |||
93 | .cpu_dai = "fsia-dai", | 101 | .cpu_dai = "fsia-dai", |
94 | .codec = "ak4642-codec.0-0012", | 102 | .codec = "ak4642-codec.0-0012", |
95 | .platform = "sh_fsi.0", | 103 | .platform = "sh_fsi.0", |
104 | .id = FSI_PORT_A, | ||
96 | }; | 105 | }; |
97 | 106 | ||
98 | static struct fsi_ak4642_data fsi_b_ak4642 = { | 107 | static struct fsi_ak4642_data fsi_b_ak4642 = { |
@@ -101,6 +110,7 @@ static struct fsi_ak4642_data fsi_b_ak4642 = { | |||
101 | .cpu_dai = "fsib-dai", | 110 | .cpu_dai = "fsib-dai", |
102 | .codec = "ak4642-codec.0-0012", | 111 | .codec = "ak4642-codec.0-0012", |
103 | .platform = "sh_fsi.0", | 112 | .platform = "sh_fsi.0", |
113 | .id = FSI_PORT_B, | ||
104 | }; | 114 | }; |
105 | 115 | ||
106 | static struct fsi_ak4642_data fsi_a_ak4643 = { | 116 | static struct fsi_ak4642_data fsi_a_ak4643 = { |
@@ -109,6 +119,7 @@ static struct fsi_ak4642_data fsi_a_ak4643 = { | |||
109 | .cpu_dai = "fsia-dai", | 119 | .cpu_dai = "fsia-dai", |
110 | .codec = "ak4642-codec.0-0013", | 120 | .codec = "ak4642-codec.0-0013", |
111 | .platform = "sh_fsi.0", | 121 | .platform = "sh_fsi.0", |
122 | .id = FSI_PORT_A, | ||
112 | }; | 123 | }; |
113 | 124 | ||
114 | static struct fsi_ak4642_data fsi_b_ak4643 = { | 125 | static struct fsi_ak4642_data fsi_b_ak4643 = { |
@@ -117,6 +128,7 @@ static struct fsi_ak4642_data fsi_b_ak4643 = { | |||
117 | .cpu_dai = "fsib-dai", | 128 | .cpu_dai = "fsib-dai", |
118 | .codec = "ak4642-codec.0-0013", | 129 | .codec = "ak4642-codec.0-0013", |
119 | .platform = "sh_fsi.0", | 130 | .platform = "sh_fsi.0", |
131 | .id = FSI_PORT_B, | ||
120 | }; | 132 | }; |
121 | 133 | ||
122 | static struct fsi_ak4642_data fsi2_a_ak4642 = { | 134 | static struct fsi_ak4642_data fsi2_a_ak4642 = { |
@@ -125,6 +137,7 @@ static struct fsi_ak4642_data fsi2_a_ak4642 = { | |||
125 | .cpu_dai = "fsia-dai", | 137 | .cpu_dai = "fsia-dai", |
126 | .codec = "ak4642-codec.0-0012", | 138 | .codec = "ak4642-codec.0-0012", |
127 | .platform = "sh_fsi2", | 139 | .platform = "sh_fsi2", |
140 | .id = FSI_PORT_A, | ||
128 | }; | 141 | }; |
129 | 142 | ||
130 | static struct fsi_ak4642_data fsi2_b_ak4642 = { | 143 | static struct fsi_ak4642_data fsi2_b_ak4642 = { |
@@ -133,6 +146,7 @@ static struct fsi_ak4642_data fsi2_b_ak4642 = { | |||
133 | .cpu_dai = "fsib-dai", | 146 | .cpu_dai = "fsib-dai", |
134 | .codec = "ak4642-codec.0-0012", | 147 | .codec = "ak4642-codec.0-0012", |
135 | .platform = "sh_fsi2", | 148 | .platform = "sh_fsi2", |
149 | .id = FSI_PORT_B, | ||
136 | }; | 150 | }; |
137 | 151 | ||
138 | static struct fsi_ak4642_data fsi2_a_ak4643 = { | 152 | static struct fsi_ak4642_data fsi2_a_ak4643 = { |
@@ -141,6 +155,7 @@ static struct fsi_ak4642_data fsi2_a_ak4643 = { | |||
141 | .cpu_dai = "fsia-dai", | 155 | .cpu_dai = "fsia-dai", |
142 | .codec = "ak4642-codec.0-0013", | 156 | .codec = "ak4642-codec.0-0013", |
143 | .platform = "sh_fsi2", | 157 | .platform = "sh_fsi2", |
158 | .id = FSI_PORT_A, | ||
144 | }; | 159 | }; |
145 | 160 | ||
146 | static struct fsi_ak4642_data fsi2_b_ak4643 = { | 161 | static struct fsi_ak4642_data fsi2_b_ak4643 = { |
@@ -149,6 +164,7 @@ static struct fsi_ak4642_data fsi2_b_ak4643 = { | |||
149 | .cpu_dai = "fsib-dai", | 164 | .cpu_dai = "fsib-dai", |
150 | .codec = "ak4642-codec.0-0013", | 165 | .codec = "ak4642-codec.0-0013", |
151 | .platform = "sh_fsi2", | 166 | .platform = "sh_fsi2", |
167 | .id = FSI_PORT_B, | ||
152 | }; | 168 | }; |
153 | 169 | ||
154 | static struct platform_device_id fsi_id_table[] = { | 170 | static struct platform_device_id fsi_id_table[] = { |