[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150612131325.GA1921@sirena.org.uk>
Date: Fri, 12 Jun 2015 14:13:25 +0100
From: Mark Brown <broonie@...nel.org>
To: Koro Chen <koro.chen@...iatek.com>
Cc: robh+dt@...nel.org, matthias.bgg@...il.com, perex@...ex.cz,
tiwai@...e.de, srv_heupstream@...iatek.com,
linux-mediatek@...ts.infradead.org, s.hauer@...gutronix.de,
galak@...eaurora.org, lgirdwood@...il.com,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, alsa-devel@...a-project.org
Subject: Re: [PATCH 2/3] ASoC: mediatek: Add machine driver for MAX98090 codec
On Wed, Jun 10, 2015 at 10:24:35PM +0800, Koro Chen wrote:
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/mt8173-max98090.txt
> @@ -0,0 +1,17 @@
> +MT8173 with MAX98090 CODEC
> +
> +Required properties:
> +- compatible : "mediatek,mt8173-max98090"
> +- mediatek,audio-codec: the phandle of the MAX98090 audio codec
> +- dvdd-supply : the phandle of regulator to supply 1.2V
> +- avdd-supply : the phandle of regulator to supply 1.8V
Why are these supplies part of the machine driver?
> +config SND_SOC_MT8173_MAX98090
> + bool "ASoC Audio driver for MT8173 with MAX98090 codec"
Why bool?
> + codec_node = of_parse_phandle(pdev->dev.of_node,
> + "mediatek,audio-codec", 0);
> + if (!codec_node) {
> + dev_err(&pdev->dev,
> + "Property 'audio-codec' missing or invalid\n");
> + } else {
Isn't this a fatal error?
> + /* set codec DVDD voltage */
> + reg_dvdd = devm_regulator_get(&pdev->dev, "dvdd");
> + if (IS_ERR(reg_dvdd)) {
> + dev_err(&pdev->dev, "failed to get dvdd\n");
> + return PTR_ERR(reg_dvdd);
> + }
> + ret = regulator_set_voltage(reg_dvdd, 1220000, 1220000);
> + if (ret != 0) {
> + dev_err(&pdev->dev, "Failed to set dvdd: %d\n", ret);
> + return ret;
> + }
No, this is not appropriate for a machine driver - this is something the
regulator constraints set for the board should do.
> + dev_info(&pdev->dev, "dvdd = %d uv\n",
> + regulator_get_voltage(reg_dvdd));
Don't include debugging stuff like this please.
> + ret = regulator_enable(reg_dvdd);
> + if (ret != 0) {
> + dev_err(&pdev->dev, "Failed to enable dvdd: %d\n", ret);
> + return ret;
> + }
IF this is for the CODEC then you should add regulator support to the
CODEC driver.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists