lkml.org 
[lkml]   [2019]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@st.com>");
> +MODULE_LICENSE("GPL v2");

No signoff from Gabriel?
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-04-10 12:40    [W:0.038 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site