devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
To: Sylwester Nawrocki <s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Sangbeom Kim <sbkim73-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/2] mfd: wm8994: Add some OF properties
Date: Thu, 11 Apr 2013 15:21:00 +0100	[thread overview]
Message-ID: <20130411142100.GA24971@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <5166BCCC.5020307-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

On Thu, Apr 11, 2013 at 03:38:20PM +0200, Sylwester Nawrocki wrote:
> On 04/10/2013 04:39 PM, Mark Brown wrote:

> > Untested at present.

> I've tested it with wm1811 codec and found a few issues/things that are 
> a bit confusing to me.

Wasn't kidding about the lack of testing!

> > +  - AVDD2-supply, DBVDD1-supply, DBVDD2-supply, DBVDD3-supply, CPVDD-supply,
> > +    SPKVDD1-supply, SPKVDD2-supply : power supplies for the device, as covered

> These capitalized regulator supply names look like standard ones. Sorry, 
> I'm quite new to all this ASoC stuff. I was wondering, what about LDO1, LDO2
> regulators that are present in the wm1811 chip for instance ? Are those
> regulators supposed to be associated with some of the supply names above ?

> AFAICS LDO1, LDO2 need to be enabled before we can actually perform any I2C 
> communication.

Since all designs I've ever seen for this chip use the internal
regulators in a consistent fashion I've added support for setting up the
standard hookup by default so users don't need to specify this by hand
since that wound up being repetitive and boring.  This is in -next or

  git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git topic/wm8994

and should show up in v3.10.  The above list includes the supplies for
LDO1 and LDO2.  If someone wants to support other configurations the
binding can always be extended with optional properties.

> Besides that, I needed to specify following regulator supplies in order to
> to get the wm8994 codec successfully initialized:

>   DCVDD-supply
>   AVDD1-supply

> That might be something specific to the sound machine driver though, I'm not
> certain. 

No, it's not - it's the above regulator driver changes, those are the
supplies normally supplied by the internal regulators.

> > +  - micbias-cfg : Three MICBIAS register values for WM1811 or

> Aren't there just 2 MICBIAS registers ? At least I've found the wm8994 driver
> handles only 2 values.

That'll be a cut'n'paste.

> > +  - ldo1ena : GPIO specifier for control of LDO1ENA input to device.
> > +  - ldo2ena : GPIO specifier for control of LDO2ENA input to device.

> Hmm, don't we need to specify the constraints for the regulators as well ?
> AFAICS for wm8994 you choose not to specify functions of this MFD as child
> DT nodes.

For the DT bindings it seemed simplest to assume the default setup so
the regulator driver ought to just do the right thing.  If someone has
done something different then you're right and we need to add code for
this.

> > +  - ldoena-always-driven : If present LDOENA is always driven

> I suppose the custom properties should be prefixed with "wlf,".

Meh, yeah.  Will fix.

> > +	if (of_property_read_u32_array(np, "gpio-cfg", pdata->gpio_defaults,
> > +				       ARRAY_SIZE(pdata->gpio_defaults)) >= 0) {
> > +		for (i = 0; i < ARRAY_SIZE(pdata->gpio_defaults); i++) {
> > +			if (wm8994->pdata.gpio_defaults[i] == 0) {
> > +				pdata->gpio_defaults[i]
> > +					= WM8994_CONFIGURE_GPIO;

> Hmm, that's not obvious from the binding, that 0 is replaced with 0x10000
> by the implementation.

This is an implementation detail due to conversion to platform data.
Since the idiom for platform data is that zero does nothing for platform
data we made the user set an out of range bit (the registers are 16 bit)
to set zero, otherwise we left the value untouched.  The result is that
we rewrite to 0x10000 in the platform data which is then rewritten to
zero.

> > +			} else if (pdata->gpio_defaults[i] == 0xffffffff) {
> > +				pdata->gpio_defaults[i] = 0;
> > +			} else if (pdata->gpio_defaults[i] > 0xffff) {

> And this is not specified as an error condition at the binding. I expected
> in such case the default value of a register would be used.

Yes, bitrot due to cut'n'paste from two different sources.  Will fix.

> I guess you preferred it that way, rather than

> 	pdata->lineout1_diff = !of_property_read_bool(np, "lineout1-se");
> 	pdata->lineout2_diff = !of_property_read_bool(np, "lineout2-se");

> ?

Yes, I tend to prefer to write things out a bit more explicitly.

  parent reply	other threads:[~2013-04-11 14:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 14:39 [PATCH 1/2] mfd: wm8994: Add device ID data to WM8994 OF device IDs Mark Brown
2013-04-10 14:39 ` [PATCH 2/2] mfd: wm8994: Add some OF properties Mark Brown
2013-04-11 13:38   ` Sylwester Nawrocki
     [not found]     ` <5166BCCC.5020307-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-04-11 14:21       ` Mark Brown [this message]
2013-04-11 16:17         ` Sylwester Nawrocki
2013-04-11 16:23           ` Mark Brown
2013-04-11 16:36             ` [PATCH] regulator: wm8994: Use GPIO parsed from DT when registering regulators Sylwester Nawrocki
     [not found]               ` <1365698217-17771-1-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-04-11 16:57                 ` Mark Brown
2013-04-11  9:53 ` [PATCH 1/2] mfd: wm8994: Add device ID data to WM8994 OF device IDs Sylwester Nawrocki
  -- strict thread matches above, loose matches on Subject: below --
2013-04-11 16:37 Mark Brown
     [not found] ` <1365698223-4684-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2013-04-11 16:37   ` [PATCH 2/2] mfd: wm8994: Add some OF properties Mark Brown
2013-04-11 17:06     ` Sylwester Nawrocki
2013-04-11 17:11       ` Mark Brown
2013-04-11 17:11 [PATCH 1/2] mfd: wm8994: Add device ID data to WM8994 OF device IDs Mark Brown
2013-04-11 17:11 ` [PATCH 2/2] mfd: wm8994: Add some OF properties 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=20130411142100.GA24971@opensource.wolfsonmicro.com \
    --to=broonie-yzvpicuk2aatku/dhu1wvuem+bqzidxxqq4iyu8u01e@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=sbkim73-Sze3O3UU22JBDgjK7y7TUQ@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).