All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kurtz <djkurtz@chromium.org>
To: unlisted-recipients:; (no To-header on input)
Cc: Dylan Reid <dgreid@chromium.org>,
	Jimmy Cheng-Yi Chiang <cychiang@google.com>,
	Akshu Agrawal <akshu.agrawal@amd.com>,
	Daniel Kurtz <djkurtz@chromium.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	"Mukunda, Vijendar" <Vijendar.Mukunda@amd.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	alsa-devel@alsa-project.org (moderated list:SOUND - SOC LAYER /
	DYNAMIC AUDIO POWER MANAGEM...),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 2/2] ASoC: AMD: Add an always on fixed 1.8V regulator for da7219 VDDIO
Date: Tue, 17 Jul 2018 18:49:09 -0600	[thread overview]
Message-ID: <20180718004909.213735-3-djkurtz@chromium.org> (raw)
In-Reply-To: <20180718004909.213735-1-djkurtz@chromium.org>

From: Akshu Agrawal <akshu.agrawal@amd.com>

DA7219's VDDIO for our platform need to be configured for 1.8V.
Hence we register a fixed 1.8V voltage regulator in the machine driver.

Change-Id: I65fd93e1dd37c3e0d38265b4b1492ea53b93afd4
Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
---
 sound/soc/amd/Kconfig                |  1 +
 sound/soc/amd/acp-da7219-max98357a.c | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig
index 6cbf9cf4d1a4c2..58c1dcb4d2550f 100644
--- a/sound/soc/amd/Kconfig
+++ b/sound/soc/amd/Kconfig
@@ -8,6 +8,7 @@ config SND_SOC_AMD_CZ_DA7219MX98357_MACH
 	select SND_SOC_DA7219
 	select SND_SOC_MAX98357A
 	select SND_SOC_ADAU7002
+	select REGULATOR
 	depends on SND_SOC_AMD_ACP && I2C
 	help
 	 This option enables machine driver for DA7219 and MAX9835.
diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c
index ccddc6650b9c79..6ea0f42f5b7692 100644
--- a/sound/soc/amd/acp-da7219-max98357a.c
+++ b/sound/soc/amd/acp-da7219-max98357a.c
@@ -32,6 +32,8 @@
 #include <linux/clk.h>
 #include <linux/gpio.h>
 #include <linux/module.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
 #include <linux/i2c.h>
 #include <linux/input.h>
 #include <linux/acpi.h>
@@ -278,11 +280,23 @@ static struct snd_soc_card cz_card = {
 	.num_controls = ARRAY_SIZE(cz_mc_controls),
 };
 
+static struct regulator_consumer_supply acp_da7219_supplies[] = {
+	REGULATOR_SUPPLY("VDDIO", "i2c-DLGS7219:00")
+};
+
 static int cz_probe(struct platform_device *pdev)
 {
 	int ret;
 	struct snd_soc_card *card;
 	struct acp_platform_info *machine;
+	struct platform_device *reg;
+
+	reg = regulator_register_always_on(0, "fixed-1.8V",
+					   acp_da7219_supplies,
+					   ARRAY_SIZE(acp_da7219_supplies),
+					   1800000);
+	if (!reg)
+		return -ENOMEM;
 
 	machine = devm_kzalloc(&pdev->dev, sizeof(struct acp_platform_info),
 			       GFP_KERNEL);
-- 
2.18.0.203.gfac676dfb9-goog


WARNING: multiple messages have this Message-ID (diff)
From: Daniel Kurtz <djkurtz@chromium.org>
Cc: Dylan Reid <dgreid@chromium.org>,
	Jimmy Cheng-Yi Chiang <cychiang@google.com>,
	Akshu Agrawal <akshu.agrawal@amd.com>,
	Daniel Kurtz <djkurtz@chromium.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	"Mukunda, Vijendar" <Vijendar.Mukunda@amd.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	"moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER
	MANAGEM..." <alsa-devel@alsa-project.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/2] ASoC: AMD: Add an always on fixed 1.8V regulator for da7219 VDDIO
Date: Tue, 17 Jul 2018 18:49:09 -0600	[thread overview]
Message-ID: <20180718004909.213735-3-djkurtz@chromium.org> (raw)
In-Reply-To: <20180718004909.213735-1-djkurtz@chromium.org>

From: Akshu Agrawal <akshu.agrawal@amd.com>

DA7219's VDDIO for our platform need to be configured for 1.8V.
Hence we register a fixed 1.8V voltage regulator in the machine driver.

Change-Id: I65fd93e1dd37c3e0d38265b4b1492ea53b93afd4
Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
---
 sound/soc/amd/Kconfig                |  1 +
 sound/soc/amd/acp-da7219-max98357a.c | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig
index 6cbf9cf4d1a4c2..58c1dcb4d2550f 100644
--- a/sound/soc/amd/Kconfig
+++ b/sound/soc/amd/Kconfig
@@ -8,6 +8,7 @@ config SND_SOC_AMD_CZ_DA7219MX98357_MACH
 	select SND_SOC_DA7219
 	select SND_SOC_MAX98357A
 	select SND_SOC_ADAU7002
+	select REGULATOR
 	depends on SND_SOC_AMD_ACP && I2C
 	help
 	 This option enables machine driver for DA7219 and MAX9835.
diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c
index ccddc6650b9c79..6ea0f42f5b7692 100644
--- a/sound/soc/amd/acp-da7219-max98357a.c
+++ b/sound/soc/amd/acp-da7219-max98357a.c
@@ -32,6 +32,8 @@
 #include <linux/clk.h>
 #include <linux/gpio.h>
 #include <linux/module.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
 #include <linux/i2c.h>
 #include <linux/input.h>
 #include <linux/acpi.h>
@@ -278,11 +280,23 @@ static struct snd_soc_card cz_card = {
 	.num_controls = ARRAY_SIZE(cz_mc_controls),
 };
 
+static struct regulator_consumer_supply acp_da7219_supplies[] = {
+	REGULATOR_SUPPLY("VDDIO", "i2c-DLGS7219:00")
+};
+
 static int cz_probe(struct platform_device *pdev)
 {
 	int ret;
 	struct snd_soc_card *card;
 	struct acp_platform_info *machine;
+	struct platform_device *reg;
+
+	reg = regulator_register_always_on(0, "fixed-1.8V",
+					   acp_da7219_supplies,
+					   ARRAY_SIZE(acp_da7219_supplies),
+					   1800000);
+	if (!reg)
+		return -ENOMEM;
 
 	machine = devm_kzalloc(&pdev->dev, sizeof(struct acp_platform_info),
 			       GFP_KERNEL);
-- 
2.18.0.203.gfac676dfb9-goog

  parent reply	other threads:[~2018-07-18  0:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180718004909.213735-1-djkurtz@chromium.org>
2018-07-18  0:49 ` [PATCH 1/2] regulator: allow drivers in modules to register fixed regulators Daniel Kurtz
2018-07-18 10:42   ` Mark Brown
2018-07-18  0:49 ` Daniel Kurtz [this message]
2018-07-18  0:49   ` [PATCH 2/2] ASoC: AMD: Add an always on fixed 1.8V regulator for da7219 VDDIO Daniel Kurtz
2018-07-18 10:46   ` Mark Brown
2018-07-18 10:46     ` 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=20180718004909.213735-3-djkurtz@chromium.org \
    --to=djkurtz@chromium.org \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=akshu.agrawal@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cychiang@google.com \
    --cc=dgreid@chromium.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=weiyongjun1@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.