From: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Koro Chen <koro.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
perex-/Fr2/VpizcU@public.gmane.org,
tiwai-l3A5Bk7waGM@public.gmane.org,
srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org
Subject: Re: [PATCH 2/3] ASoC: mediatek: Add machine driver for MAX98090 codec
Date: Fri, 12 Jun 2015 14:13:25 +0100 [thread overview]
Message-ID: <20150612131325.GA1921@sirena.org.uk> (raw)
In-Reply-To: <1433946276-25969-3-git-send-email-koro.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]
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.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-06-12 13:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-10 14:24 [PATCH 0/3] ASoC: Mediatek: Add support for MT8173 SoC Koro Chen
2015-06-10 14:24 ` [PATCH 2/3] ASoC: mediatek: Add machine driver for MAX98090 codec Koro Chen
[not found] ` <1433946276-25969-3-git-send-email-koro.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-06-12 13:13 ` Mark Brown [this message]
[not found] ` <20150612131325.GA1921-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-06-15 2:31 ` Koro Chen
[not found] ` <1433946276-25969-1-git-send-email-koro.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-06-10 14:24 ` [PATCH 1/3] ASoC: mediatek: Add AFE platform driver Koro Chen
2015-06-11 7:03 ` Paul Bolle
2015-06-11 7:13 ` Paul Bolle
2015-06-12 1:55 ` [alsa-devel] " Koro Chen
2015-06-12 7:37 ` Paul Bolle
2015-06-12 8:24 ` Koro Chen
[not found] ` <1433946276-25969-2-git-send-email-koro.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2015-06-12 13:06 ` Mark Brown
[not found] ` <20150612130638.GZ1921-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-06-15 2:06 ` Koro Chen
2015-06-10 14:24 ` [PATCH 3/3] ASoC: mediatek: Add machine driver for rt5650 rt5676 codec Koro Chen
2015-06-12 13:15 ` 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=20150612131325.GA1921@sirena.org.uk \
--to=broonie-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=koro.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=perex-/Fr2/VpizcU@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=tiwai-l3A5Bk7waGM@public.gmane.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;
as well as URLs for NNTP newsgroup(s).