aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/samsung
diff options
context:
space:
mode:
authorPadmavathi Venna <padma.v@samsung.com>2013-01-18 06:47:00 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-24 01:40:13 -0500
commit7c62eebbf7d1cdaec68ab9d2d4017007f9312391 (patch)
tree7e8e661b6ffa1e77474ed63f38920db8040dfcf2 /sound/soc/samsung
parent7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619 (diff)
ASoC: samsung: Rename samsung i2s secondary device name
All Samsung SoCs has max 3 i2s controllers. So the i2s secondary fifo interface device id was named as samsung-i2s.4. Renaming this to "samsung-i2s-sec" to support device tree in i2s driver. Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r--sound/soc/samsung/i2s.c31
-rw-r--r--sound/soc/samsung/i2s.h7
-rw-r--r--sound/soc/samsung/smdk_wm8580.c7
-rw-r--r--sound/soc/samsung/smdk_wm8994.c4
4 files changed, 32 insertions, 17 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index d2d124f1dd1b..ed5eeae6a48f 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -29,6 +29,11 @@
29 29
30#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t) 30#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
31 31
32enum samsung_dai_type {
33 TYPE_PRI,
34 TYPE_SEC,
35};
36
32struct i2s_dai { 37struct i2s_dai {
33 /* Platform device for this DAI */ 38 /* Platform device for this DAI */
34 struct platform_device *pdev; 39 struct platform_device *pdev;
@@ -981,8 +986,7 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
981 i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS; 986 i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS;
982 } else { /* Create a new platform_device for Secondary */ 987 } else { /* Create a new platform_device for Secondary */
983 i2s->pdev = platform_device_register_resndata(NULL, 988 i2s->pdev = platform_device_register_resndata(NULL,
984 pdev->name, pdev->id + SAMSUNG_I2S_SECOFF, 989 "samsung-i2s-sec", -1, NULL, 0, NULL, 0);
985 NULL, 0, NULL, 0);
986 if (IS_ERR(i2s->pdev)) 990 if (IS_ERR(i2s->pdev))
987 return NULL; 991 return NULL;
988 } 992 }
@@ -993,6 +997,11 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
993 return i2s; 997 return i2s;
994} 998}
995 999
1000static inline int samsung_i2s_get_driver_data(struct platform_device *pdev)
1001{
1002 return platform_get_device_id(pdev)->driver_data;
1003}
1004
996static int samsung_i2s_probe(struct platform_device *pdev) 1005static int samsung_i2s_probe(struct platform_device *pdev)
997{ 1006{
998 u32 dma_pl_chan, dma_cp_chan, dma_pl_sec_chan; 1007 u32 dma_pl_chan, dma_cp_chan, dma_pl_sec_chan;
@@ -1001,10 +1010,13 @@ static int samsung_i2s_probe(struct platform_device *pdev)
1001 struct samsung_i2s *i2s_cfg; 1010 struct samsung_i2s *i2s_cfg;
1002 struct resource *res; 1011 struct resource *res;
1003 u32 regs_base, quirks; 1012 u32 regs_base, quirks;
1013 enum samsung_dai_type samsung_dai_type;
1004 int ret = 0; 1014 int ret = 0;
1005 1015
1006 /* Call during Seconday interface registration */ 1016 /* Call during Seconday interface registration */
1007 if (pdev->id >= SAMSUNG_I2S_SECOFF) { 1017 samsung_dai_type = samsung_i2s_get_driver_data(pdev);
1018
1019 if (samsung_dai_type == TYPE_SEC) {
1008 sec_dai = dev_get_drvdata(&pdev->dev); 1020 sec_dai = dev_get_drvdata(&pdev->dev);
1009 snd_soc_register_dai(&sec_dai->pdev->dev, 1021 snd_soc_register_dai(&sec_dai->pdev->dev,
1010 &sec_dai->i2s_dai_drv); 1022 &sec_dai->i2s_dai_drv);
@@ -1143,9 +1155,22 @@ static int samsung_i2s_remove(struct platform_device *pdev)
1143 return 0; 1155 return 0;
1144} 1156}
1145 1157
1158static struct platform_device_id samsung_i2s_driver_ids[] = {
1159 {
1160 .name = "samsung-i2s",
1161 .driver_data = TYPE_PRI,
1162 }, {
1163 .name = "samsung-i2s-sec",
1164 .driver_data = TYPE_SEC,
1165 },
1166 {},
1167};
1168MODULE_DEVICE_TABLE(platform, samsung-i2s-driver-ids);
1169
1146static struct platform_driver samsung_i2s_driver = { 1170static struct platform_driver samsung_i2s_driver = {
1147 .probe = samsung_i2s_probe, 1171 .probe = samsung_i2s_probe,
1148 .remove = samsung_i2s_remove, 1172 .remove = samsung_i2s_remove,
1173 .id_table = samsung_i2s_driver_ids,
1149 .driver = { 1174 .driver = {
1150 .name = "samsung-i2s", 1175 .name = "samsung-i2s",
1151 .owner = THIS_MODULE, 1176 .owner = THIS_MODULE,
diff --git a/sound/soc/samsung/i2s.h b/sound/soc/samsung/i2s.h
index d420a7ca56ca..7966afc934db 100644
--- a/sound/soc/samsung/i2s.h
+++ b/sound/soc/samsung/i2s.h
@@ -13,13 +13,6 @@
13#ifndef __SND_SOC_SAMSUNG_I2S_H 13#ifndef __SND_SOC_SAMSUNG_I2S_H
14#define __SND_SOC_SAMSUNG_I2S_H 14#define __SND_SOC_SAMSUNG_I2S_H
15 15
16/*
17 * Maximum number of I2S blocks that any SoC can have.
18 * The secondary interface of a CPU dai(if there exists any),
19 * is indexed at [cpu-dai's ID + SAMSUNG_I2S_SECOFF]
20 */
21#define SAMSUNG_I2S_SECOFF 4
22
23#define SAMSUNG_I2S_DIV_BCLK 1 16#define SAMSUNG_I2S_DIV_BCLK 1
24 17
25#define SAMSUNG_I2S_RCLKSRC_0 0 18#define SAMSUNG_I2S_RCLKSRC_0 0
diff --git a/sound/soc/samsung/smdk_wm8580.c b/sound/soc/samsung/smdk_wm8580.c
index 7e2b710763be..7a16b32ed673 100644
--- a/sound/soc/samsung/smdk_wm8580.c
+++ b/sound/soc/samsung/smdk_wm8580.c
@@ -193,9 +193,9 @@ static struct snd_soc_dai_link smdk_dai[] = {
193 [SEC_PLAYBACK] = { /* Sec_Fifo Playback i/f */ 193 [SEC_PLAYBACK] = { /* Sec_Fifo Playback i/f */
194 .name = "Sec_FIFO TX", 194 .name = "Sec_FIFO TX",
195 .stream_name = "Playback", 195 .stream_name = "Playback",
196 .cpu_dai_name = "samsung-i2s.x", 196 .cpu_dai_name = "samsung-i2s-sec",
197 .codec_dai_name = "wm8580-hifi-playback", 197 .codec_dai_name = "wm8580-hifi-playback",
198 .platform_name = "samsung-i2s.x", 198 .platform_name = "samsung-i2s-sec",
199 .codec_name = "wm8580.0-001b", 199 .codec_name = "wm8580.0-001b",
200 .ops = &smdk_ops, 200 .ops = &smdk_ops,
201 }, 201 },
@@ -223,9 +223,6 @@ static int __init smdk_audio_init(void)
223 if (machine_is_smdkc100() 223 if (machine_is_smdkc100()
224 || machine_is_smdkv210() || machine_is_smdkc110()) { 224 || machine_is_smdkv210() || machine_is_smdkc110()) {
225 smdk.num_links = 3; 225 smdk.num_links = 3;
226 /* Secondary is at offset SAMSUNG_I2S_SECOFF from Primary */
227 str = (char *)smdk_dai[SEC_PLAYBACK].cpu_dai_name;
228 str[strlen(str) - 1] = '0' + SAMSUNG_I2S_SECOFF;
229 } else if (machine_is_smdk6410()) { 226 } else if (machine_is_smdk6410()) {
230 str = (char *)smdk_dai[PRI_PLAYBACK].cpu_dai_name; 227 str = (char *)smdk_dai[PRI_PLAYBACK].cpu_dai_name;
231 str[strlen(str) - 1] = '2'; 228 str[strlen(str) - 1] = '2';
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c
index b0d0ab8bff5a..cc2f407e9f1b 100644
--- a/sound/soc/samsung/smdk_wm8994.c
+++ b/sound/soc/samsung/smdk_wm8994.c
@@ -134,9 +134,9 @@ static struct snd_soc_dai_link smdk_dai[] = {
134 }, { /* Sec_Fifo Playback i/f */ 134 }, { /* Sec_Fifo Playback i/f */
135 .name = "Sec_FIFO TX", 135 .name = "Sec_FIFO TX",
136 .stream_name = "Sec_Dai", 136 .stream_name = "Sec_Dai",
137 .cpu_dai_name = "samsung-i2s.4", 137 .cpu_dai_name = "samsung-i2s-sec",
138 .codec_dai_name = "wm8994-aif1", 138 .codec_dai_name = "wm8994-aif1",
139 .platform_name = "samsung-i2s.4", 139 .platform_name = "samsung-i2s-sec",
140 .codec_name = "wm8994-codec", 140 .codec_name = "wm8994-codec",
141 .ops = &smdk_ops, 141 .ops = &smdk_ops,
142 }, 142 },