[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190410103852.GG6106@sirena.org.uk>
Date: Wed, 10 Apr 2019 11:38:52 +0100
From: Mark Brown <broonie@...nel.org>
To: Pascal PAILLET-LME <p.paillet@...com>
Cc: "lgirdwood@...il.com" <lgirdwood@...il.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"mark.rutland@....com" <mark.rutland@....com>,
"mcoquelin.stm32@...il.com" <mcoquelin.stm32@...il.com>,
Alexandre TORGUE <alexandre.torgue@...com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-stm32@...md-mailman.stormreply.com"
<linux-stm32@...md-mailman.stormreply.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 2/2] regulator: Add support for stm32 power regulators
On Mon, Apr 08, 2019 at 03:24:08PM +0000, Pascal PAILLET-LME wrote:
> +config REGULATOR_STM32_PWR
> + bool "STMicroelectronics STM32 PWR"
> + depends on ARCH_STM32
There's no build time dependency here, please also add an || COMPILE_TEST to
help with build coverage.
> +int stm32_pwr_reg_is_enabled(struct regulator_dev *rdev)
> +{
> + struct stm32_pwr_reg *priv = rdev_get_drvdata(rdev);
> + u32 val;
> +
> + val = readl_relaxed(priv->base + REG_PWR_CR3);
> +
> + return (val & priv->ready_mask);
> +}
This looks like it's reading back a status bit from the hardware not the
state requested by software - I'd expect an _is_enabled() to reference
the same bit that's updated by the enable/disable functions. This looks
like a better fit for _get_status().
> + of_regulator_match(&pdev->dev, np, stm32_pwr_reg_matches,
> + STM32PWR_REG_NUM_REGS);
You don't need to open code the matching any more, just set of_match and
regulators_node in the regulator_desc and the core will do it for you.
> +MODULE_DESCRIPTION("STM32MP1 PWR voltage regulator driver");
> +MODULE_AUTHOR("Gabriel Fernandez <gabriel.fernandez@...com>");
> +MODULE_LICENSE("GPL v2");
No signoff from Gabriel?
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists