public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Mark Brown <broonie@kernel.org>, Bjorn Andersson <andersson@kernel.org>
Cc: kernel@collabora.com,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Chen-Yu Tsai" <wenst@chromium.org>,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Oder Chiou" <oder_chiou@realtek.com>,
	"Takashi Iwai" <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 5/8] ASoC: rt5682s: Support DBVDD and LDO1-IN supplies
Date: Wed,  2 Nov 2022 14:19:59 -0400	[thread overview]
Message-ID: <20221102182002.255282-6-nfraprado@collabora.com> (raw)
In-Reply-To: <20221102182002.255282-1-nfraprado@collabora.com>

Add support for the DBVDD and LDO1-IN supplies.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

---

Changes in v2:
- Made names uppercase

 sound/soc/codecs/rt5682s.c | 22 ++++++++++++++++++++++
 sound/soc/codecs/rt5682s.h |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c
index 80c673aa14db..f5e5dbc3b0f0 100644
--- a/sound/soc/codecs/rt5682s.c
+++ b/sound/soc/codecs/rt5682s.c
@@ -44,6 +44,8 @@ static const struct rt5682s_platform_data i2s_default_platform_data = {
 static const char *rt5682s_supply_names[RT5682S_NUM_SUPPLIES] = {
 	[RT5682S_SUPPLY_AVDD] = "AVDD",
 	[RT5682S_SUPPLY_MICVDD] = "MICVDD",
+	[RT5682S_SUPPLY_DBVDD] = "DBVDD",
+	[RT5682S_SUPPLY_LDO1_IN] = "LDO1-IN",
 };
 
 static const struct reg_sequence patch_list[] = {
@@ -3089,6 +3091,14 @@ static void rt5682s_i2c_disable_regulators(void *data)
 	if (ret)
 		dev_err(dev, "Failed to disable supply AVDD: %d\n", ret);
 
+	ret = regulator_disable(rt5682s->supplies[RT5682S_SUPPLY_DBVDD].consumer);
+	if (ret)
+		dev_err(dev, "Failed to disable supply DBVDD: %d\n", ret);
+
+	ret = regulator_disable(rt5682s->supplies[RT5682S_SUPPLY_LDO1_IN].consumer);
+	if (ret)
+		dev_err(dev, "Failed to disable supply LDO1-IN: %d\n", ret);
+
 	usleep_range(1000, 1500);
 
 	ret = regulator_disable(rt5682s->supplies[RT5682S_SUPPLY_MICVDD].consumer);
@@ -3150,6 +3160,18 @@ static int rt5682s_i2c_probe(struct i2c_client *i2c)
 		return ret;
 	}
 
+	ret = regulator_enable(rt5682s->supplies[RT5682S_SUPPLY_DBVDD].consumer);
+	if (ret) {
+		dev_err(&i2c->dev, "Failed to enable supply DBVDD: %d\n", ret);
+		return ret;
+	}
+
+	ret = regulator_enable(rt5682s->supplies[RT5682S_SUPPLY_LDO1_IN].consumer);
+	if (ret) {
+		dev_err(&i2c->dev, "Failed to enable supply LDO1-IN: %d\n", ret);
+		return ret;
+	}
+
 	if (gpio_is_valid(rt5682s->pdata.ldo1_en)) {
 		if (devm_gpio_request_one(&i2c->dev, rt5682s->pdata.ldo1_en,
 					  GPIOF_OUT_INIT_HIGH, "rt5682s"))
diff --git a/sound/soc/codecs/rt5682s.h b/sound/soc/codecs/rt5682s.h
index 45464a041765..67f86a38a1cc 100644
--- a/sound/soc/codecs/rt5682s.h
+++ b/sound/soc/codecs/rt5682s.h
@@ -1438,6 +1438,8 @@ struct pll_calc_map {
 enum {
 	RT5682S_SUPPLY_AVDD,
 	RT5682S_SUPPLY_MICVDD,
+	RT5682S_SUPPLY_DBVDD,
+	RT5682S_SUPPLY_LDO1_IN,
 	RT5682S_NUM_SUPPLIES,
 };
 
-- 
2.38.1


  parent reply	other threads:[~2022-11-02 18:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 18:19 [PATCH v2 0/8] Adjust usage of rt5682(s) power supply properties Nícolas F. R. A. Prado
2022-11-02 18:19 ` [PATCH v2 1/8] ASoC: dt-bindings: realtek,rt5682s: Add AVDD and MICVDD supplies Nícolas F. R. A. Prado
2022-11-02 18:19 ` [PATCH v2 2/8] ASoC: dt-bindings: realtek,rt5682s: Add DBVDD and LDO1-IN supplies Nícolas F. R. A. Prado
2022-11-04 21:52   ` Rob Herring
2022-11-02 18:19 ` [PATCH v2 3/8] ASoC: dt-bindings: rt5682: Add AVDD, MICVDD and VBAT supplies Nícolas F. R. A. Prado
2022-11-02 18:19 ` [PATCH v2 4/8] ASoC: dt-bindings: rt5682: Add DBVDD and LDO1-IN supplies Nícolas F. R. A. Prado
2022-11-04 21:52   ` Rob Herring
2022-11-02 18:19 ` Nícolas F. R. A. Prado [this message]
2022-11-02 18:20 ` [PATCH v2 6/8] ASoC: rt5682: Support " Nícolas F. R. A. Prado
2022-11-02 18:20 ` [PATCH v2 7/8] arm64: dts: qcom: sc7180-trogdor: Add missing supplies for rt5682 Nícolas F. R. A. Prado
2022-11-02 18:20 ` [PATCH v2 8/8] arm64: dts: qcom: sc7180-trogdor: Remove VBAT supply from rt5682s Nícolas F. R. A. Prado
2022-12-06 18:19 ` (subset) [PATCH v2 0/8] Adjust usage of rt5682(s) power supply properties Bjorn Andersson

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=20221102182002.255282-6-nfraprado@collabora.com \
    --to=nfraprado@collabora.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andersson@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=kernel@collabora.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=wenst@chromium.org \
    /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