Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Mark Brown <broonie@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>
Cc: kernel@collabora.com,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	"Akihiko Odaki" <akihiko.odaki@gmail.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Jiaxin Yu" <jiaxin.yu@mediatek.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Miaoqian Lin" <linmq006@gmail.com>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Tzung-Bi Shih" <tzungbi@google.com>,
	alsa-devel@alsa-project.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: [PATCH 02/10] ASoC: mediatek: mt8192-mt6359: Make i2s9 share the clock from i2s8
Date: Thu,  8 Sep 2022 12:11:46 -0400	[thread overview]
Message-ID: <20220908161154.648557-3-nfraprado@collabora.com> (raw)
In-Reply-To: <20220908161154.648557-1-nfraprado@collabora.com>

Both i2s8 and i2s9 are connected to the rt5682 codec and should share
the same clock to work in a full-duplex manner. Set the clock sharing
during the initialization for rt5682.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---

 sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
index d0f9d66627b1..044d6ab71f0a 100644
--- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
+++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
@@ -311,12 +311,21 @@ static int mt8192_mt6359_init(struct snd_soc_pcm_runtime *rtd)
 
 static int mt8192_rt5682_init(struct snd_soc_pcm_runtime *rtd)
 {
+	struct snd_soc_component *cmpnt_afe =
+		snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME);
+	struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe);
 	struct snd_soc_component *cmpnt_codec =
 		asoc_rtd_to_codec(rtd, 0)->component;
 	struct mt8192_mt6359_priv *priv = snd_soc_card_get_drvdata(rtd->card);
 	struct snd_soc_jack *jack = &priv->headset_jack;
 	int ret;
 
+	ret = mt8192_dai_i2s_set_share(afe, "I2S8", "I2S9");
+	if (ret) {
+		dev_err(rtd->dev, "Failed to set up shared clocks\n");
+		return ret;
+	}
+
 	ret = snd_soc_card_jack_new(rtd->card, "Headset Jack",
 				    SND_JACK_HEADSET | SND_JACK_BTN_0 |
 				    SND_JACK_BTN_1 | SND_JACK_BTN_2 |
-- 
2.37.3



  parent reply	other threads:[~2022-09-08 16:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 16:11 [PATCH 00/10] ASoC: mediatek: Set i2s clock sharing from machine drivers Nícolas F. R. A. Prado
2022-09-08 16:11 ` [PATCH 01/10] ASoC: mediatek: mt8192: Allow setting shared clocks from machine driver Nícolas F. R. A. Prado
2022-09-09  7:34   ` AngeloGioacchino Del Regno
2022-09-08 16:11 ` Nícolas F. R. A. Prado [this message]
2022-09-09  7:34   ` [PATCH 02/10] ASoC: mediatek: mt8192-mt6359: Make i2s9 share the clock from i2s8 AngeloGioacchino Del Regno
2022-09-08 16:11 ` [PATCH 03/10] ASoC: mediatek: mt8192: Remove clock share parsing from DT Nícolas F. R. A. Prado
2022-09-09  7:34   ` AngeloGioacchino Del Regno
2022-09-08 16:11 ` [PATCH 04/10] ASoC: mediatek: mt8183: Allow setting shared clocks from machine driver Nícolas F. R. A. Prado
2022-09-09  7:34   ` AngeloGioacchino Del Regno
2022-09-08 16:11 ` [PATCH 05/10] ASoC: mediatek: mt8183: Configure shared clocks Nícolas F. R. A. Prado
2022-09-09  7:34   ` AngeloGioacchino Del Regno
2022-09-08 16:11 ` [PATCH 06/10] ASoC: mediatek: mt8183: Remove clock share parsing from DT Nícolas F. R. A. Prado
2022-09-09  7:34   ` AngeloGioacchino Del Regno
2022-09-08 16:11 ` [PATCH 07/10] arm64: dts: mediatek: kukui: Remove i2s-share properties Nícolas F. R. A. Prado
2022-09-09  7:34   ` AngeloGioacchino Del Regno
2022-11-08 12:43   ` Matthias Brugger
2022-09-08 16:11 ` [PATCH 08/10] ASoC: mediatek: mt8186: Allow setting shared clocks from machine driver Nícolas F. R. A. Prado
2022-09-09  7:34   ` AngeloGioacchino Del Regno
2022-09-08 16:11 ` [PATCH 09/10] ASoC: mediatek: mt8186: Configure shared clocks Nícolas F. R. A. Prado
2022-09-09  7:34   ` AngeloGioacchino Del Regno
2022-09-08 16:11 ` [PATCH 10/10] ASoC: mediatek: mt8186: Remove clock share parsing from DT Nícolas F. R. A. Prado
2022-09-09  7:34   ` AngeloGioacchino Del Regno
2022-09-09 22:45 ` [PATCH 00/10] ASoC: mediatek: Set i2s clock sharing from machine drivers Mark Brown
2022-09-13 15:56   ` Matthias Brugger
2022-09-13 16:07     ` Mark Brown
2022-09-13 16:12 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220908161154.648557-3-nfraprado@collabora.com \
    --to=nfraprado@collabora.com \
    --cc=akihiko.odaki@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=jiaxin.yu@mediatek.com \
    --cc=kernel@collabora.com \
    --cc=lgirdwood@gmail.com \
    --cc=linmq006@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=tzungbi@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox