From: Maciej Strozek <mstrozek@opensource.cirrus.com>
To: Mark Brown <broonie@kernel.org>
Cc: James Schulman <james.schulman@cirrus.com>,
David Rhodes <david.rhodes@cirrus.com>,
Liam Girdwood <lgirdwood@gmail.com>,
<alsa-devel@alsa-project.org>, <patches@opensource.cirrus.com>,
<linux-sound@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Maciej Strozek <mstrozek@opensource.cirrus.com>
Subject: [PATCH 7/7] ASoC:cs43130: Add switch to control normal and alt hp inputs
Date: Fri, 17 Nov 2023 14:13:44 +0000 [thread overview]
Message-ID: <20231117141344.64320-8-mstrozek@opensource.cirrus.com> (raw)
In-Reply-To: <20231117141344.64320-1-mstrozek@opensource.cirrus.com>
Make sure these inputs are mutually exclusive as recommended by the
datasheet
Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
---
sound/soc/codecs/cs43130.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index 1e7c32eedc7b..8b77bd7fa907 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -1419,7 +1419,15 @@ static int cs43130_hpin_event(struct snd_soc_dapm_widget *w,
return 0;
}
+static const char * const bypass_mux_text[] = {
+ "Internal",
+ "Alternative",
+};
+static SOC_ENUM_SINGLE_DECL(bypass_enum, SND_SOC_NOPM, 0, bypass_mux_text);
+static const struct snd_kcontrol_new bypass_ctrl = SOC_DAPM_ENUM("Switch", bypass_enum);
+
static const struct snd_soc_dapm_widget digital_hp_widgets[] = {
+ SND_SOC_DAPM_MUX("Bypass Switch", SND_SOC_NOPM, 0, 0, &bypass_ctrl),
SND_SOC_DAPM_OUTPUT("HPOUTA"),
SND_SOC_DAPM_OUTPUT("HPOUTB"),
@@ -1472,13 +1480,13 @@ static const struct snd_soc_dapm_route digital_hp_routes[] = {
{"DSD", NULL, "XSPIN DSD"},
{"HiFi DAC", NULL, "ASPIN PCM"},
{"HiFi DAC", NULL, "DSD"},
- {"HPOUTA", NULL, "HiFi DAC"},
- {"HPOUTB", NULL, "HiFi DAC"},
+ {"Bypass Switch", "Internal", "HiFi DAC"},
+ {"HPOUTA", NULL, "Bypass Switch"},
+ {"HPOUTB", NULL, "Bypass Switch"},
};
static const struct snd_soc_dapm_route analog_hp_routes[] = {
- {"HPOUTA", NULL, "Analog Playback"},
- {"HPOUTB", NULL, "Analog Playback"},
+ {"Bypass Switch", "Alternative", "Analog Playback"},
};
static struct snd_soc_dapm_route all_hp_routes[
--
2.34.1
next prev parent reply other threads:[~2023-11-17 14:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-17 14:13 [PATCH 0/7] ASoC: cs43130: Fixes and improvements Maciej Strozek
2023-11-17 14:13 ` [PATCH 1/7] ASoC: cs43130: Fix the position of const qualifier Maciej Strozek
2023-11-17 14:13 ` [PATCH 2/7] ASoC: cs43130: Fix incorrect frame delay configuration Maciej Strozek
2023-11-17 14:13 ` [PATCH 3/7] ASoC: cs43130: Allow configuration of bit clock and frame inversion Maciej Strozek
2023-11-17 20:21 ` Mark Brown
2023-11-17 14:13 ` [PATCH 4/7] ASoC: cs43130: Store device in private struct and use it more consistently Maciej Strozek
2023-11-17 14:13 ` [PATCH 5/7] ASoC: cs43130: Add handling of ACPI Maciej Strozek
2023-11-17 14:13 ` [PATCH 6/7] ASoC: cs43130: Allow driver to work without IRQ thread Maciej Strozek
2023-11-17 16:36 ` Mark Brown
2023-11-20 9:43 ` Maciej Strozek
2023-11-17 14:13 ` Maciej Strozek [this message]
2023-11-17 15:53 ` [PATCH 0/7] ASoC: cs43130: Fixes and improvements Charles Keepax
2023-11-18 0:32 ` (subset) " 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=20231117141344.64320-8-mstrozek@opensource.cirrus.com \
--to=mstrozek@opensource.cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=david.rhodes@cirrus.com \
--cc=james.schulman@cirrus.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.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