aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/mediatek/mt8183
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@google.com>2020-07-09 20:24:43 +0800
committerMark Brown <broonie@kernel.org>2020-07-09 20:34:34 +0100
commite5d4bdffc8c89ce253e5663fecd09c893ece7eec (patch)
tree725990a8b7336b504ec4867547164f96edbc25e6 /sound/soc/mediatek/mt8183
parentASoC: mediatek: mt8183-da7219: remove forward declaration of headset_init (diff)
downloadlinux-dev-e5d4bdffc8c89ce253e5663fecd09c893ece7eec.tar.xz
linux-dev-e5d4bdffc8c89ce253e5663fecd09c893ece7eec.zip
ASoC: mediatek: mt8183-da7219: extract codec and DAI names
Extracts codec and DAI names of DA7219. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200709122445.1584497-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/mediatek/mt8183')
-rw-r--r--sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
index 9636771ce9a2..17c8e4ac18a9 100644
--- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
+++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
@@ -17,6 +17,9 @@
#include "../../codecs/da7219.h"
#include "mt8183-afe-common.h"
+#define DA7219_CODEC_DAI "da7219-hifi"
+#define DA7219_DEV_NAME "da7219.5-001a"
+
struct mt8183_da7219_max98357_priv {
struct snd_soc_jack headset_jack;
};
@@ -54,8 +57,7 @@ static int mt8183_da7219_i2s_hw_params(struct snd_pcm_substream *substream,
dev_err(rtd->dev, "failed to set cpu dai sysclk\n");
for_each_rtd_codec_dais(rtd, j, codec_dai) {
-
- if (!strcmp(codec_dai->component->name, "da7219.5-001a")) {
+ if (!strcmp(codec_dai->component->name, DA7219_DEV_NAME)) {
ret = snd_soc_dai_set_sysclk(codec_dai,
DA7219_CLKSRC_MCLK,
mclk_fs,
@@ -87,8 +89,7 @@ static int mt8183_da7219_hw_free(struct snd_pcm_substream *substream)
int ret = 0, j;
for_each_rtd_codec_dais(rtd, j, codec_dai) {
-
- if (!strcmp(codec_dai->component->name, "da7219.5-001a")) {
+ if (!strcmp(codec_dai->component->name, DA7219_DEV_NAME)) {
ret = snd_soc_dai_set_pll(codec_dai,
0, DA7219_SYSCLK_MCLK, 0, 0);
if (ret < 0) {
@@ -268,13 +269,13 @@ SND_SOC_DAILINK_DEFS(i2s1,
SND_SOC_DAILINK_DEFS(i2s2,
DAILINK_COMP_ARRAY(COMP_CPU("I2S2")),
- DAILINK_COMP_ARRAY(COMP_CODEC("da7219.5-001a", "da7219-hifi")),
+ DAILINK_COMP_ARRAY(COMP_CODEC(DA7219_DEV_NAME, DA7219_CODEC_DAI)),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(i2s3,
DAILINK_COMP_ARRAY(COMP_CPU("I2S3")),
DAILINK_COMP_ARRAY(COMP_CODEC("max98357a", "HiFi"),
- COMP_CODEC("da7219.5-001a", "da7219-hifi")),
+ COMP_CODEC(DA7219_DEV_NAME, DA7219_CODEC_DAI)),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(i2s5,