summaryrefslogtreecommitdiff
path: root/sound/soc/mediatek
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@google.com>2020-07-20 04:25:59 +0300
committerMark Brown <broonie@kernel.org>2020-07-22 16:02:02 +0300
commit08145535a8321eb330fceb9e6542b51091f7d3c6 (patch)
treea9b3361c6993b80721c4ec6260c8f41b2ea3833f /sound/soc/mediatek
parente3c3cdbd5ad65182e3803a2e1c33156c5ff48cd1 (diff)
downloadlinux-08145535a8321eb330fceb9e6542b51091f7d3c6.tar.xz
ASoC: mediatek: mt8183: support machine driver with max98357b
Supports machine driver with max98357b ("mt8183-mt6358-ts3a227-max98357b"). The key difference from max98357a: max98357b needs to use left justified format. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200720012559.906088-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/mediatek')
-rw-r--r--sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
index bd04c4bd309b..5ec2789855a7 100644
--- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
+++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
@@ -528,6 +528,13 @@ static struct snd_soc_card mt8183_mt6358_ts3a227_max98357_card = {
.num_links = ARRAY_SIZE(mt8183_mt6358_ts3a227_dai_links),
};
+static struct snd_soc_card mt8183_mt6358_ts3a227_max98357b_card = {
+ .name = "mt8183_mt6358_ts3a227_max98357b",
+ .owner = THIS_MODULE,
+ .dai_link = mt8183_mt6358_ts3a227_dai_links,
+ .num_links = ARRAY_SIZE(mt8183_mt6358_ts3a227_dai_links),
+};
+
static struct snd_soc_codec_conf mt8183_mt6358_ts3a227_rt1015_amp_conf[] = {
{
.dlc = COMP_CODEC_CONF(RT1015_DEV0_NAME),
@@ -617,7 +624,8 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev)
}
if (strcmp(dai_link->name, "I2S3") == 0) {
- if (card == &mt8183_mt6358_ts3a227_max98357_card) {
+ if (card == &mt8183_mt6358_ts3a227_max98357_card ||
+ card == &mt8183_mt6358_ts3a227_max98357b_card) {
dai_link->be_hw_params_fixup =
mt8183_i2s_hw_params_fixup;
dai_link->ops = &mt8183_mt6358_i2s_ops;
@@ -646,6 +654,14 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev)
}
}
+ if (card == &mt8183_mt6358_ts3a227_max98357b_card) {
+ if (strcmp(dai_link->name, "I2S2") == 0 ||
+ strcmp(dai_link->name, "I2S3") == 0)
+ dai_link->dai_fmt = SND_SOC_DAIFMT_LEFT_J |
+ SND_SOC_DAIFMT_NB_NF |
+ SND_SOC_DAIFMT_CBM_CFM;
+ }
+
if (hdmi_codec && strcmp(dai_link->name, "TDM") == 0)
dai_link->codecs->of_node = hdmi_codec;
@@ -712,6 +728,10 @@ static const struct of_device_id mt8183_mt6358_ts3a227_max98357_dt_match[] = {
.data = &mt8183_mt6358_ts3a227_max98357_card,
},
{
+ .compatible = "mediatek,mt8183_mt6358_ts3a227_max98357b",
+ .data = &mt8183_mt6358_ts3a227_max98357b_card,
+ },
+ {
.compatible = "mediatek,mt8183_mt6358_ts3a227_rt1015",
.data = &mt8183_mt6358_ts3a227_rt1015_card,
},