aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaechul Lee <jcsing.lee@samsung.com>2017-09-05 21:04:13 -0400
committerMark Brown <broonie@kernel.org>2017-09-19 10:58:59 -0400
commit22289ddcd87285b3d61cd8b129438ca6abb1aa37 (patch)
treeed9fbbb1f64e512e375b1f72a523ff205674297f
parent6431a7e36652517df82855ee79c8240001812a55 (diff)
ASoC: samsung: i2s: Use specific name for i2s dais
Add specific dais name when components are registered. Component and dai name will follow their parent dev name, if the name isn't described. In case of this driver, each dais will have same name like '11440000.i2s0' by fmt_single_name function. The problem having same name is that TM2 machine driver can't detect capture devices correctly. Machine driver doesn't know which one is proper to use for cpu dai. The driver just selects to use 'samsung-i2c-sec' that doesn't have capture functionality because the component of samsung-i2s-sec is located in the first of the component_list. I add dai name like 'samsung-i2s', 'samsung-i2s-sec' for each dais. The reason why adding dai id to 1 is that it doesn't allow to use particular dai name in case of when I use 0 for dai id. Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/samsung/i2s.c4
-rw-r--r--sound/soc/samsung/i2s.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index d7e7f4244d38..8d5e1861abb1 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1099,6 +1099,7 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev,
1099 i2s->pdev = pdev; 1099 i2s->pdev = pdev;
1100 i2s->pri_dai = NULL; 1100 i2s->pri_dai = NULL;
1101 i2s->sec_dai = NULL; 1101 i2s->sec_dai = NULL;
1102 i2s->i2s_dai_drv.id = 1;
1102 i2s->i2s_dai_drv.symmetric_rates = 1; 1103 i2s->i2s_dai_drv.symmetric_rates = 1;
1103 i2s->i2s_dai_drv.probe = samsung_i2s_dai_probe; 1104 i2s->i2s_dai_drv.probe = samsung_i2s_dai_probe;
1104 i2s->i2s_dai_drv.remove = samsung_i2s_dai_remove; 1105 i2s->i2s_dai_drv.remove = samsung_i2s_dai_remove;
@@ -1111,10 +1112,13 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev,
1111 i2s->i2s_dai_drv.playback.formats = SAMSUNG_I2S_FMTS; 1112 i2s->i2s_dai_drv.playback.formats = SAMSUNG_I2S_FMTS;
1112 1113
1113 if (!sec) { 1114 if (!sec) {
1115 i2s->i2s_dai_drv.name = SAMSUNG_I2S_DAI;
1114 i2s->i2s_dai_drv.capture.channels_min = 1; 1116 i2s->i2s_dai_drv.capture.channels_min = 1;
1115 i2s->i2s_dai_drv.capture.channels_max = 2; 1117 i2s->i2s_dai_drv.capture.channels_max = 2;
1116 i2s->i2s_dai_drv.capture.rates = i2s_dai_data->pcm_rates; 1118 i2s->i2s_dai_drv.capture.rates = i2s_dai_data->pcm_rates;
1117 i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS; 1119 i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS;
1120 } else {
1121 i2s->i2s_dai_drv.name = SAMSUNG_I2S_DAI_SEC;
1118 } 1122 }
1119 return i2s; 1123 return i2s;
1120} 1124}
diff --git a/sound/soc/samsung/i2s.h b/sound/soc/samsung/i2s.h
index 21ff24e930db..79781de2f247 100644
--- a/sound/soc/samsung/i2s.h
+++ b/sound/soc/samsung/i2s.h
@@ -13,6 +13,9 @@
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#define SAMSUNG_I2S_DAI "samsung-i2s"
17#define SAMSUNG_I2S_DAI_SEC "samsung-i2s-sec"
18
16#define SAMSUNG_I2S_DIV_BCLK 1 19#define SAMSUNG_I2S_DIV_BCLK 1
17 20
18#define SAMSUNG_I2S_RCLKSRC_0 0 21#define SAMSUNG_I2S_RCLKSRC_0 0