diff mbox series

[1/6] regulator: lm363x: Make the gpio register enable flexible

Message ID 20190405145540.27703-2-dmurphy@ti.com
State Superseded
Headers show
Series [1/6] regulator: lm363x: Make the gpio register enable flexible | expand

Commit Message

Dan Murphy April 5, 2019, 2:55 p.m. UTC
The use of and enablement of the GPIO can be used across devices.
Use the enable_reg in the regulator descriptor for the register to
write.

Signed-off-by: Dan Murphy <dmurphy@ti.com>

---
 drivers/regulator/lm363x-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.19.0

Comments

Jacek Anaszewski April 9, 2019, 6:44 p.m. UTC | #1
Hi Dan,

Regulator maintainers should be added too.

On 4/5/19 4:55 PM, Dan Murphy wrote:
> The use of and enablement of the GPIO can be used across devices.

> Use the enable_reg in the regulator descriptor for the register to

> write.

> 

> Signed-off-by: Dan Murphy <dmurphy@ti.com>

> ---

>   drivers/regulator/lm363x-regulator.c | 4 ++--

>   1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/regulator/lm363x-regulator.c b/drivers/regulator/lm363x-regulator.c

> index c876e161052a..382b1cecdd93 100644

> --- a/drivers/regulator/lm363x-regulator.c

> +++ b/drivers/regulator/lm363x-regulator.c

> @@ -263,8 +263,8 @@ static int lm363x_regulator_probe(struct platform_device *pdev)

>   

>   	if (gpiod) {

>   		cfg.ena_gpiod = gpiod;

> -

> -		ret = regmap_update_bits(regmap, LM3632_REG_BIAS_CONFIG,

> +		ret = regmap_update_bits(regmap,

> +					 lm363x_regulator_desc[id].enable_reg,

>   					 LM3632_EXT_EN_MASK,

>   					 LM3632_EXT_EN_MASK);

>   		if (ret) {

> 


-- 
Best regards,
Jacek Anaszewski
diff mbox series

Patch

diff --git a/drivers/regulator/lm363x-regulator.c b/drivers/regulator/lm363x-regulator.c
index c876e161052a..382b1cecdd93 100644
--- a/drivers/regulator/lm363x-regulator.c
+++ b/drivers/regulator/lm363x-regulator.c
@@ -263,8 +263,8 @@  static int lm363x_regulator_probe(struct platform_device *pdev)
 
 	if (gpiod) {
 		cfg.ena_gpiod = gpiod;
-
-		ret = regmap_update_bits(regmap, LM3632_REG_BIAS_CONFIG,
+		ret = regmap_update_bits(regmap,
+					 lm363x_regulator_desc[id].enable_reg,
 					 LM3632_EXT_EN_MASK,
 					 LM3632_EXT_EN_MASK);
 		if (ret) {