public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jarrah Gosbell <kernel@undef.tools>
To: Oder Chiou <oder_chiou@realtek.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Cc: phone-devel@vger.kernel.org, Ondrej Jirman <megi@xff.cz>,
	Jarrah Gosbell <kernel@undef.tools>
Subject: [PATCH 1/2] ASoC: rt5640: Allow configuration of LOUT to mono differential mode
Date: Fri,  9 Dec 2022 10:56:20 +0000	[thread overview]
Message-ID: <20221209105621.39237-1-kernel@undef.tools> (raw)

From: Ondrej Jirman <megi@xff.cz>

LOUT output can produce either single-ended stereo signals, or mono
differential signal. Some applications are wired to use LOUT in mono
differential mode. Allow to configure it via device property.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Jarrah Gosbell <kernel@undef.tools>
---
 sound/soc/codecs/rt5640.c | 4 ++++
 sound/soc/codecs/rt5640.h | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index 0f8e6dd214b0..18e01949f20e 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -2717,6 +2717,10 @@ static int rt5640_probe(struct snd_soc_component *component)
 		snd_soc_component_update_bits(component, RT5640_IN1_IN2,
 					      RT5640_IN_DF2, RT5640_IN_DF2);
 
+	if (device_property_read_bool(component->dev, "realtek,lout-differential"))
+		snd_soc_component_update_bits(component, RT5640_DUMMY1,
+					      RT5640_EN_LOUT_DF, RT5640_EN_LOUT_DF);
+
 	if (device_property_read_u32(component->dev, "realtek,dmic1-data-pin",
 				     &val) == 0 && val) {
 		dmic1_data_pin = val - 1;
diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h
index f58b88e3325b..9847a1ae01f4 100644
--- a/sound/soc/codecs/rt5640.h
+++ b/sound/soc/codecs/rt5640.h
@@ -1978,6 +1978,8 @@
 #define RT5640_ZCD_HP_EN			(0x1 << 15)
 
 /* General Control 1 (0xfa) */
+#define RT5640_EN_LOUT_DF			(0x1 << 14)
+#define RT5640_EN_LOUT_DF_SFT			14
 #define RT5640_M_MONO_ADC_L			(0x1 << 13)
 #define RT5640_M_MONO_ADC_L_SFT			13
 #define RT5640_M_MONO_ADC_R			(0x1 << 12)
-- 
2.35.1


             reply	other threads:[~2022-12-09 10:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09 10:56 Jarrah Gosbell [this message]
2022-12-09 10:56 ` [PATCH 2/2] dt-bindings: sound: rt5640: Allow to describe how LOUT is wired Jarrah Gosbell
2022-12-09 11:25   ` Krzysztof Kozlowski
2022-12-27 11:56 ` [PATCH 1/2] ASoC: rt5640: Allow configuration of LOUT to mono differential mode 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=20221209105621.39237-1-kernel@undef.tools \
    --to=kernel@undef.tools \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=megi@xff.cz \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --cc=phone-devel@vger.kernel.org \
    --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