From: <cy_huang@richtek.com>
To: Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>
Cc: ChiYuan Huang <cy_huang@richtek.com>,
Allen Lin <allen_lin@richtek.com>, <alsa-devel@alsa-project.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] ASoC: codecs: rtq9128: Add TDM data source selection
Date: Wed, 27 Sep 2023 10:06:16 +0800 [thread overview]
Message-ID: <1695780376-32301-1-git-send-email-cy_huang@richtek.com> (raw)
From: ChiYuan Huang <cy_huang@richtek.com>
Since rtq9128 can support 4 channel I2S mode audio data, there are two
dedicated data input pins for CH12 and CH34. But in TDM mode, input
source was already drived on one data pin for multiple data slots. In
this case, only one input source is needed for TDM mode.
This patch is to add the data source pin selection for CH12 and CH34.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
sound/soc/codecs/rtq9128.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sound/soc/codecs/rtq9128.c b/sound/soc/codecs/rtq9128.c
index 926b79ed8078..3cf613c6900e 100644
--- a/sound/soc/codecs/rtq9128.c
+++ b/sound/soc/codecs/rtq9128.c
@@ -225,6 +225,7 @@ static const char * const phase_select_text[] = {
"180 degree", "225 degree", "270 degree", "315 degree",
};
static const char * const dvdduv_select_text[] = { "1P4V", "1P5V", "2P1V", "2P3V" };
+static const char * const tdm_data_select_text[] = { "DATA1", "DATA2" };
static const struct soc_enum rtq9128_ch1_si_enum =
SOC_ENUM_SINGLE(RTQ9128_REG_SDI_SEL, 6, ARRAY_SIZE(source_select_text), source_select_text);
@@ -246,6 +247,12 @@ static const struct soc_enum rtq9128_out3_phase_enum =
static const struct soc_enum rtq9128_out4_phase_enum =
SOC_ENUM_SINGLE(RTQ9128_REG_PLLTRI_GEN2, 0, ARRAY_SIZE(phase_select_text),
phase_select_text);
+static const struct soc_enum rtq9128_ch12_tdm_data_select_enum =
+ SOC_ENUM_SINGLE(RTQ9128_REG_SDO_SEL, 5, ARRAY_SIZE(tdm_data_select_text),
+ tdm_data_select_text);
+static const struct soc_enum rtq9128_ch34_tdm_data_select_enum =
+ SOC_ENUM_SINGLE(RTQ9128_REG_SDO_SEL, 4, ARRAY_SIZE(tdm_data_select_text),
+ tdm_data_select_text);
/*
* In general usage, DVDD could be 1P8V, 3P0V or 3P3V.
@@ -277,6 +284,8 @@ static const struct snd_kcontrol_new rtq9128_snd_ctrls[] = {
SOC_ENUM("OUT3 Phase Select", rtq9128_out3_phase_enum),
SOC_ENUM("OUT4 Phase Select", rtq9128_out4_phase_enum),
SOC_ENUM("DVDD UV Threshold Select", rtq9128_dvdduv_select_enum),
+ SOC_ENUM("CH12 TDM Data Select", rtq9128_ch12_tdm_data_select_enum),
+ SOC_ENUM("CH34 TDM Data Select", rtq9128_ch34_tdm_data_select_enum),
};
static int rtq9128_dac_power_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol,
base-commit: c351835058419c1eb8791941a057c3f3e6068cb6
--
2.34.1
next reply other threads:[~2023-09-27 5:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-27 2:06 cy_huang [this message]
2023-09-27 9:13 ` Mark Brown
2023-09-27 9:46 ` ChiYuan Huang
2023-09-27 9:59 ` Mark Brown
2023-09-27 10:19 ` ChiYuan Huang
2023-09-27 10:28 ` Mark Brown
2023-09-28 2:03 ` ChiYuan Huang
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=1695780376-32301-1-git-send-email-cy_huang@richtek.com \
--to=cy_huang@richtek.com \
--cc=allen_lin@richtek.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®