[PATCH v2 1/2] regulator: pca9450: Use LDO5 low-control enable mask

Fabio Estevam <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,dev.linux.lists.imx
Message-ID <[email protected]>
From: Fabio Estevam <[email protected]>

LDO5 has voltage-selection fields in both LDO5CTRL_L and LDO5CTRL_H,
selected by the SD_VSEL pin. Its ENMODE field, however, is only in
LDO5CTRL_L.

The regulator descriptors correctly use LDO5CTRL_L as enable_reg, but
use the misleading LDO5H_EN_MASK name for enable_mask. Both mask
definitions have the same value, so this causes no functional problem.

Use LDO5L_EN_MASK in all LDO5 descriptors and remove the unused
LDO5H_EN_MASK definition.

Signed-off-by: Fabio Estevam <[email protected]>
---
Changes since v1:
- New patch clarifying that the LDO5 ENMODE field is in LDO5CTRL_L.

 drivers/regulator/pca9450-regulator.c | 6 +++---
 include/linux/regulator/pca9450.h     | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/pca9450-regulator.c b/drivers/regulator/pca9450-regulator.c
index c41db70fa052..93d0af7f7eda 100644
--- a/drivers/regulator/pca9450-regulator.c
+++ b/drivers/regulator/pca9450-regulator.c
@@ -621,7 +621,7 @@ static struct pca9450_regulator_desc pca9450a_regulators[] = {
 			.vsel_reg = PCA9450_REG_LDO5CTRL_H,
 			.vsel_mask = LDO5HOUT_MASK,
 			.enable_reg = PCA9450_REG_LDO5CTRL_L,
-			.enable_mask = LDO5H_EN_MASK,
+			.enable_mask = LDO5L_EN_MASK,
 			.owner = THIS_MODULE,
 		},
 	},
@@ -866,7 +866,7 @@ static struct pca9450_regulator_desc pca9450bc_regulators[] = {
 			.vsel_reg = PCA9450_REG_LDO5CTRL_H,
 			.vsel_mask = LDO5HOUT_MASK,
 			.enable_reg = PCA9450_REG_LDO5CTRL_L,
-			.enable_mask = LDO5H_EN_MASK,
+			.enable_mask = LDO5L_EN_MASK,
 			.owner = THIS_MODULE,
 		},
 	},
@@ -1086,7 +1086,7 @@ static struct pca9450_regulator_desc pca9451a_regulators[] = {
 			.vsel_reg = PCA9450_REG_LDO5CTRL_H,
 			.vsel_mask = LDO5HOUT_MASK,
 			.enable_reg = PCA9450_REG_LDO5CTRL_L,
-			.enable_mask = LDO5H_EN_MASK,
+			.enable_mask = LDO5L_EN_MASK,
 			.owner = THIS_MODULE,
 		},
 	},
diff --git a/include/linux/regulator/pca9450.h b/include/linux/regulator/pca9450.h
index 0df8b3c48082..2aa73624d0b8 100644
--- a/include/linux/regulator/pca9450.h
+++ b/include/linux/regulator/pca9450.h
@@ -210,7 +210,6 @@ enum {
 #define LDO5L_EN_MASK			0xC0
 #define LDO5LOUT_MASK			0x0F
 
-#define LDO5H_EN_MASK			0xC0
 #define LDO5HOUT_MASK			0x0F
 
 /* PCA9450_REG_IRQ bits */
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.