Message ID | 20180718004909.213735-3-djkurtz@chromium.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Jul 17, 2018 at 06:49:09PM -0600, Daniel Kurtz wrote: > 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 Again, please don't include noise like this in upstream submissions. > +++ 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 This seems inappropriate, I'd expect a dependency and if it were to stay a select it's also not selecting all the bits required to make this do something useful.
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);