Skip to contentSkip to conversation

regulator: lp8755: Fix mask for pchip->mphase

PATCH Superseded Axel Lin 2 participants 2 messages Dec 26, 2012 Voltage and current regulator framework

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: lp8755: Fix mask for pchip->mphase

According to lp8755.h:
enum lp8755_mphase_config {
MPHASE_CONF0,
MPHASE_CONF1,
MPHASE_CONF2,
MPHASE_CONF3,
MPHASE_CONF4,
MPHASE_CONF5,
MPHASE_CONF6,
MPHASE_CONF7,
MPHASE_CONF8,
MPHASE_CONF_MAX
};

MPHASE_CONF_MAX is 9, the mask for pchip->mphase should be 0x17. Otherwise, we cannot differentiate MPHASE_CONF0 and MPHASE_CONF8.

---
Hi Daniel,
I don't have the datasheet, can you check if this patch is correct?

BTW, I'm Axel, not Alex.

Regards,
Axel

 drivers/regulator/lp8755.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/lp8755.c +1 -1
index 06a82e2..6d5a11d 100644
@@ -301,7 +301,7 @@ static int lp8755_init_data(struct lp8755_chip *pchip)
 	ret = lp8755_read(pchip, 0x3D, &regval);
 	if (ret < 0)
 		goto out_i2c_error;
-	pchip->mphase = regval & 0x07;
+	pchip->mphase = regval & 0x17;
 
 	/* set default data based on multi-phase config */
 	for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++) {
Signature · 1 line
1.7.9.5
#1 lore raw

2012년 12월 26일 11:12, Axel Lin 쓴 글:

Quoted 34 lines

According to lp8755.h:
enum lp8755_mphase_config {
MPHASE_CONF0,
MPHASE_CONF1,
MPHASE_CONF2,
MPHASE_CONF3,
MPHASE_CONF4,
MPHASE_CONF5,
MPHASE_CONF6,
MPHASE_CONF7,
MPHASE_CONF8,
MPHASE_CONF_MAX
};

MPHASE_CONF_MAX is 9, the mask for pchip->mphase should be 0x17. Otherwise, we cannot differentiate MPHASE_CONF0 and MPHASE_CONF8.

---
Hi Daniel,
I don't have the datasheet, can you check if this patch is correct?

BTW, I'm Axel, not Alex.

Regards,
Axel

  drivers/regulator/lp8755.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/lp8755.c +0 -0
index 06a82e2..6d5a11d 100644

drivers/regulator/lp8755.c static int lp8755_init_data(struct lp8755_chip *pchip) · line 307

Quoted 8 lines
drivers/regulator/lp8755.c +1 -1
@@ -301,7 +301,7 @@ static int lp8755_init_data(struct lp8755_chip *pchip)
  	ret = lp8755_read(pchip, 0x3D, &regval);
  	if (ret < 0)
  		goto out_i2c_error;
-	pchip->mphase = regval & 0x07;
+	pchip->mphase = regval & 0x17;
 
  	/* set default data based on multi-phase config */
  	for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++) {

Hi Axel.

According to the new datasheet, it has 9 multi-phase mode from 0 to 8 and it takes 4bits in the register.

the mask for pchip->mphase should be 0x0F.

Thank you for your comments Axel.