All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Matthias Reichl <hias@horus.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, <patches@opensource.cirrus.com>,
	Richard Fitzgerald <rf@opensource.cirrus.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: Regression in 4.18-rc1 caused by regulator: arizona-ldo1: Look up a descriptor and pass to the core
Date: Tue, 19 Jun 2018 09:51:33 +0100	[thread overview]
Message-ID: <20180619085133.GF18740@imbe.wolfsonmicro.main> (raw)
In-Reply-To: <20180618171410.z3bshzmwu7x5yylj@camel2.lan>

On Mon, Jun 18, 2018 at 07:14:10PM +0200, Matthias Reichl wrote:
> Commit e1739e86f0cb9c48e8745a610e6981a4e24cadad breaks reading
> the wlf,ldoena property from device tree. This causes ldo1 to
> stay off and thus arizona device detection to fail:
> 
> [    4.495958] of_get_named_gpiod_flags: parsed 'wlf,reset' property of node '/s
> oc/spi@7e204000/wm5102@1[0]' - status (0)
> [    4.509756] arizona-ldo1 arizona-ldo1: GPIO lookup for consumer wlf,ldoena
> [    4.511339] arizona-ldo1 arizona-ldo1: using lookup tables for GPIO lookup
> [    4.511351] arizona-ldo1 arizona-ldo1: No GPIO consumer wlf,ldoena found
> [    4.511413] LDO1: supplied by RPi-Cirrus 1v8
> [    4.549164] arizona spi0.1: Unknown device ID: 0
> 
> With this commit reverted the ldoena GPIO is properly found and
> asserted high and the arizona device type is read successfully:
> 
> [    4.630445] of_get_named_gpiod_flags: parsed 'wlf,reset' property of node '/s
> oc/spi@7e204000/wm5102@1[0]' - status (0)
> [    4.647622] of_get_named_gpiod_flags: parsed 'wlf,ldoena' property of node '/soc/spi@7e204000/wm5102@1[0]' - status (0)
> [    4.666100] arizona spi0.1: WM5102 revision C
> 
> I've tested this on a Raspberry Pi 3 with upstream 4.18-rc1,
> the Cirrus Logic Audio Card from Element 14 (using a WM5102
> connected via SPI) and the downstream card driver added as
> a module.
> 
> Both wlf,reset and wlf,ldoena properties are defined in
> the wm5102 devicetree node:
> 
> wm5102@1{
> 	compatible = "wlf,wm5102";
> 	reg = <1>;
> 	...
> 	wlf,reset = <&gpio 17 0>;
> 	wlf,ldoena = <&gpio 22 0>;
> 	...
> };
> 
> If I understand the code correctly the cuplrit seems to be that
> with this patch the gpio is looked up from the arizona-ldo1 dev,
> which has a NULL of_node:
> 
> config.ena_gpiod = devm_gpiod_get_optional(&pdev->dev, "wlf,ldoena", ...
> 
> The old version did an of lookup in the parent (arizona) dev, which
> contains the of_node with wlf,ldoena:
> 
> arizona_ldo1_common_init:
> 	struct device *parent_dev = pdev->dev.parent;
> 	struct regulator_config config = { };
> 	...
> 	config.dev = parent_dev;
> 	...
> 	arizona_ldo1_of_get_pdata(pdata, config, ...
> 
> arizona_ldo1_of_get_pdata:
> 	struct device_node *np = config->dev->of_node;
> 	...
> 	pdata->ldoena = of_get_named_gpio(np, "wlf,ldoena", 0);
> 

Urgh.. sorry about that. I did test that patch but it seems I
messed it up. On our boards the LDOENA defaults to on so I missed
that it wasn't getting configured anymore.

I think we just need to not use the devm version of the
get_optional and pass the correct device. I will get a patch
ready this morning and ping it through for testing.

Thanks,
Charles

      reply	other threads:[~2018-06-19  8:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 17:14 Regression in 4.18-rc1 caused by regulator: arizona-ldo1: Look up a descriptor and pass to the core Matthias Reichl
2018-06-19  8:51 ` Charles Keepax [this message]

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=20180619085133.GF18740@imbe.wolfsonmicro.main \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=hias@horus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rf@opensource.cirrus.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.