[v2 0/2] ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: add rt5650 support
To use RT5650 as the codec and the amp, add a new sound card named mt8186_rt5650.
Changes in v2: - PATCH 2/2: Modify the code format in line 1058 - Link to v1: https://lore.kernel.org/all/54ec6435-e69b-444a-a31a-c878a4b3564a@collabora.c... https://lore.kernel.org/all/8de0772b-3145-44e3-8174-702c7dc729bb@collabora.c...
xiazhengqiao (2): ASoC: dt-bindings: mt8186-mt6366-rt1019-rt5682s: add RT5650 support ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: add rt5650 support
.../sound/mt8186-mt6366-rt1019-rt5682s.yaml | 1 + sound/soc/mediatek/Kconfig | 1 + .../mt8186/mt8186-mt6366-rt1019-rt5682s.c | 44 ++++++++++++++++++- 3 files changed, 45 insertions(+), 1 deletion(-)
Add new sound card "mt8186_rt5650". RT5650 comes with amp and earphone codec.
Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: xiazhengqiao xiazhengqiao@huaqin.corp-partner.google.com --- .../devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml | 1 + 1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml b/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml index d80083df03eb..bdf7b0960533 100644 --- a/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml +++ b/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml @@ -17,6 +17,7 @@ properties: enum: - mediatek,mt8186-mt6366-rt1019-rt5682s-sound - mediatek,mt8186-mt6366-rt5682s-max98360-sound + - mediatek,mt8186-mt6366-rt5650-sound
mediatek,platform: $ref: /schemas/types.yaml#/definitions/phandle
To use RT5650 as the codec and the amp, add a new sound card named mt8186_rt5650.
Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: xiazhengqiao xiazhengqiao@huaqin.corp-partner.google.com --- sound/soc/mediatek/Kconfig | 1 + .../mt8186/mt8186-mt6366-rt1019-rt5682s.c | 44 ++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index 43c8fea00439..b93d455744ab 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -210,6 +210,7 @@ config SND_SOC_MT8186_MT6366_RT1019_RT5682S select SND_SOC_MAX98357A select SND_SOC_RT1015P select SND_SOC_RT5682S + select SND_SOC_RT5645 select SND_SOC_BT_SCO select SND_SOC_DMIC select SND_SOC_HDMI_CODEC diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c b/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c index 4684bfd89ecd..6dfcfcf47cab 100644 --- a/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c +++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c @@ -170,6 +170,7 @@ static int mt8186_rt5682s_init(struct snd_soc_pcm_runtime *rtd) struct snd_soc_component *cmpnt_codec = snd_soc_rtd_to_codec(rtd, 0)->component; int ret; + int type;
ret = mt8186_dai_i2s_set_share(afe, "I2S1", "I2S0"); if (ret) { @@ -193,7 +194,8 @@ static int mt8186_rt5682s_init(struct snd_soc_pcm_runtime *rtd) snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
- return snd_soc_component_set_jack(cmpnt_codec, jack, NULL); + type = SND_JACK_HEADSET | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 | SND_JACK_BTN_3; + return snd_soc_component_set_jack(cmpnt_codec, jack, (void *)&type); }
static int mt8186_rt5682s_i2s_hw_params(struct snd_pcm_substream *substream, @@ -1058,6 +1060,27 @@ mt8186_mt6366_rt1019_rt5682s_routes[] = { {"DSP_DL2_VIRT", NULL, SOF_DMA_DL2}, };
+static const struct snd_soc_dapm_route mt8186_mt6366_rt5650_routes[] = { + /* SPK */ + {"Speakers", NULL, "SPOL"}, + {"Speakers", NULL, "SPOR"}, + /* Headset */ + { "Headphone", NULL, "HPOL" }, + { "Headphone", NULL, "HPOR" }, + { "IN1P", NULL, "Headset Mic" }, + { "IN1N", NULL, "Headset Mic"}, + /* HDMI */ + { "HDMI1", NULL, "TX" }, + /* SOF Uplink */ + {SOF_DMA_UL1, NULL, "UL1_CH1"}, + {SOF_DMA_UL1, NULL, "UL1_CH2"}, + {SOF_DMA_UL2, NULL, "UL2_CH1"}, + {SOF_DMA_UL2, NULL, "UL2_CH2"}, + /* SOF Downlink */ + {"DSP_DL1_VIRT", NULL, SOF_DMA_DL1}, + {"DSP_DL2_VIRT", NULL, SOF_DMA_DL2}, +}; + static const struct snd_kcontrol_new mt8186_mt6366_rt1019_rt5682s_controls[] = { SOC_DAPM_PIN_SWITCH("Speakers"), @@ -1096,6 +1119,21 @@ static struct snd_soc_card mt8186_mt6366_rt5682s_max98360_soc_card = { .num_configs = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_codec_conf), };
+static struct snd_soc_card mt8186_mt6366_rt5650_soc_card = { + .name = "mt8186_rt5650", + .owner = THIS_MODULE, + .dai_link = mt8186_mt6366_rt1019_rt5682s_dai_links, + .num_links = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_dai_links), + .controls = mt8186_mt6366_rt1019_rt5682s_controls, + .num_controls = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_controls), + .dapm_widgets = mt8186_mt6366_rt1019_rt5682s_widgets, + .num_dapm_widgets = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_widgets), + .dapm_routes = mt8186_mt6366_rt5650_routes, + .num_dapm_routes = ARRAY_SIZE(mt8186_mt6366_rt5650_routes), + .codec_conf = mt8186_mt6366_rt1019_rt5682s_codec_conf, + .num_configs = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_codec_conf), +}; + static int mt8186_mt6366_rt1019_rt5682s_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card; @@ -1253,6 +1291,10 @@ static const struct of_device_id mt8186_mt6366_rt1019_rt5682s_dt_match[] = { .compatible = "mediatek,mt8186-mt6366-rt5682s-max98360-sound", .data = &mt8186_mt6366_rt5682s_max98360_soc_card, }, + { + .compatible = "mediatek,mt8186-mt6366-rt5650-sound", + .data = &mt8186_mt6366_rt5650_soc_card, + }, {} }; MODULE_DEVICE_TABLE(of, mt8186_mt6366_rt1019_rt5682s_dt_match);
On Thu, 19 Oct 2023 18:03:20 +0800, xiazhengqiao wrote:
To use RT5650 as the codec and the amp, add a new sound card named mt8186_rt5650.
Changes in v2:
- PATCH 2/2: Modify the code format in line 1058
- Link to v1: https://lore.kernel.org/all/54ec6435-e69b-444a-a31a-c878a4b3564a@collabora.c... https://lore.kernel.org/all/8de0772b-3145-44e3-8174-702c7dc729bb@collabora.c...
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: dt-bindings: mt8186-mt6366-rt1019-rt5682s: add RT5650 support commit: 8a79ff9e46beee03dfc2ce9cc80f7090f57d64cb [2/2] ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: add rt5650 support commit: d88c433831015a4ad4597885cef8f048808cd94d
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (2)
-
Mark Brown
-
xiazhengqiao