Skip to contentSkip to conversation

power: pmic: Let PFUZE3000 see all 256 registers

PATCH New Trent Piepho 3 participants 6 messages Apr 25, 2018 – Jun 27, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: pmic: Let PFUZE3000 see all 256 registers

The PFUZE3000 uses registers addresses up to 0xff.

The DM pfuze100 driver supports both pfuze100 and pfuze3000. Allow it to use the device type to return the correct number of registers.

Also rename the too generic PMIC_NUM_OF_REGS enumeration value for pfuze3000 to match the other "PFUZE3000_" prefixed enumerations and the pfuze100 enumeration value PFUZE100_NUM_OF_REGS.

Cc Peng Fan <[email protected]>
Cc Jaehoon Chung <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 drivers/power/pmic/pfuze100.c       | 3 ++-
 drivers/power/pmic/pmic_pfuze3000.c | 2 +-
 include/power/pfuze3000_pmic.h      | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/power/pmic/pfuze100.c +2 -1
index a06cbc07d4..f85ad25981 100644
@@ -13,6 +13,7 @@
 #include <power/pmic.h>
 #include <power/regulator.h>
 #include <power/pfuze100_pmic.h>
+#include <power/pfuze3000_pmic.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -26,7 +27,7 @@ static const struct pmic_child_info pmic_children_info[] = {
 
 static int pfuze100_reg_count(struct udevice *dev)
 {
-	return PFUZE100_NUM_OF_REGS;
+	return dev->driver_data == PFUZE3000 ? PFUZE3000_NUM_OF_REGS : PFUZE100_NUM_OF_REGS;
 }
 
 static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff,
drivers/power/pmic/pmic_pfuze3000.c +1 -1
index ac807a801f..d0f358f808 100644
@@ -23,7 +23,7 @@ int power_pfuze3000_init(unsigned char bus)
 
 	p->name = name;
 	p->interface = PMIC_I2C;
-	p->number_of_regs = PMIC_NUM_OF_REGS;
+	p->number_of_regs = PFUZE3000_NUM_OF_REGS;
 	p->hw.i2c.addr = CONFIG_POWER_PFUZE3000_I2C_ADDR;
 	p->hw.i2c.tx_num = 1;
 	p->bus = bus;
include/power/pfuze3000_pmic.h +1 -1
index 7d66ba48d4..94946e9594 100644
@@ -70,7 +70,7 @@ enum {
 	PFUZE3000_VLDO3CTL	= 0x70,
 	PFUZE3000_VLD4CTL	= 0x71,
 
-	PMIC_NUM_OF_REGS	= 0x7F,
+	PFUZE3000_NUM_OF_REGS	= 0x100,
 };
 
 int power_pfuze3000_init(unsigned char bus);
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/1 power: pmic: Let PFUZE3000 see all 256 registers

Quoted 9 lines · Trent Piepho

The PFUZE3000 uses registers addresses up to 0xff.

The DM pfuze100 driver supports both pfuze100 and pfuze3000. Allow it to use the device type to return the correct number of registers.

Also rename the too generic PMIC_NUM_OF_REGS enumeration value for pfuze3000 to match the other "PFUZE3000_" prefixed enumerations and the pfuze100 enumeration value PFUZE100_NUM_OF_REGS.

Quoted 5 lines
Cc Peng Fan <[email protected]>
Cc Jaehoon Chung <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
#2 lore raw

PATCH 1/1 power: pmic: Let PFUZE3000 see all 256 registers

Ping. Been a while. 2018.05 is out.

Quoted 20 lines · Fabio Estevam
Quoted 11 lines · Trent Piepho

The PFUZE3000 uses registers addresses up to 0xff.

The DM pfuze100 driver supports both pfuze100 and pfuze3000. Allow it
to use the device type to return the correct number of registers.

Also rename the too generic PMIC_NUM_OF_REGS enumeration value for pfuze3000 to match the other "PFUZE3000_" prefixed enumerations and the
pfuze100 enumeration value PFUZE100_NUM_OF_REGS.

Quoted 5 lines
Cc Peng Fan <[email protected]>
Cc Jaehoon Chung <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
#3 lore raw

PATCH 1/1 power: pmic: Let PFUZE3000 see all 256 registers

[Adding Stefano]

Quoted 23 lines · Trent Piepho

Ping. Been a while. 2018.05 is out.

Quoted 20 lines · Fabio Estevam
Quoted 11 lines · Trent Piepho

The PFUZE3000 uses registers addresses up to 0xff.

The DM pfuze100 driver supports both pfuze100 and pfuze3000. Allow it
to use the device type to return the correct number of registers.

Also rename the too generic PMIC_NUM_OF_REGS enumeration value for pfuze3000 to match the other "PFUZE3000_" prefixed enumerations and the
pfuze100 enumeration value PFUZE100_NUM_OF_REGS.

Quoted 5 lines
Cc Peng Fan <[email protected]>
Cc Jaehoon Chung <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
#4 lore raw

PATCH 1/1 power: pmic: Let PFUZE3000 see all 256 registers

In reply to Trent Piepho

Hi Stefano,

Could you please consider this one for 2018.07?

Thanks

Quoted 74 lines · Trent Piepho

The PFUZE3000 uses registers addresses up to 0xff.

The DM pfuze100 driver supports both pfuze100 and pfuze3000. Allow it to use the device type to return the correct number of registers.

Also rename the too generic PMIC_NUM_OF_REGS enumeration value for pfuze3000 to match the other "PFUZE3000_" prefixed enumerations and the pfuze100 enumeration value PFUZE100_NUM_OF_REGS.

Cc Peng Fan <[email protected]>
Cc Jaehoon Chung <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 drivers/power/pmic/pfuze100.c       | 3 ++-
 drivers/power/pmic/pmic_pfuze3000.c | 2 +-
 include/power/pfuze3000_pmic.h      | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/power/pmic/pfuze100.c +2 -1
index a06cbc07d4..f85ad25981 100644
@@ -13,6 +13,7 @@
 #include <power/pmic.h>
 #include <power/regulator.h>
 #include <power/pfuze100_pmic.h>
+#include <power/pfuze3000_pmic.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -26,7 +27,7 @@ static const struct pmic_child_info pmic_children_info[] = {
 
 static int pfuze100_reg_count(struct udevice *dev)
 {
-       return PFUZE100_NUM_OF_REGS;
+       return dev->driver_data == PFUZE3000 ? PFUZE3000_NUM_OF_REGS : PFUZE100_NUM_OF_REGS;
 }
 
 static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff,
drivers/power/pmic/pmic_pfuze3000.c +1 -1
index ac807a801f..d0f358f808 100644
@@ -23,7 +23,7 @@ int power_pfuze3000_init(unsigned char bus)
 
        p->name = name;
        p->interface = PMIC_I2C;
-       p->number_of_regs = PMIC_NUM_OF_REGS;
+       p->number_of_regs = PFUZE3000_NUM_OF_REGS;
        p->hw.i2c.addr = CONFIG_POWER_PFUZE3000_I2C_ADDR;
        p->hw.i2c.tx_num = 1;
        p->bus = bus;
include/power/pfuze3000_pmic.h +1 -2
index 7d66ba48d4..94946e9594 100644
@@ -70,7 +70,7 @@ enum {
        PFUZE3000_VLDO3CTL      = 0x70,
        PFUZE3000_VLD4CTL       = 0x71,
 
-       PMIC_NUM_OF_REGS        = 0x7F,
+       PFUZE3000_NUM_OF_REGS   = 0x100,
 };
 
 int power_pfuze3000_init(unsigned char bus);
--

2.14.3

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#5 lore raw

PATCH 1/1 power: pmic: Let PFUZE3000 see all 256 registers

Quoted 4 lines · Fabio Estevam

Hi Stefano,

Could you please consider this one for 2018.07?

Hi Fabio,

sure, is u-boot-imx the right tree for it ?

Anyway, applied to u-boot-imx, thanks !

Best regards,
Stefano

Quoted 77 lines

Thanks

Quoted 74 lines · Trent Piepho

The PFUZE3000 uses registers addresses up to 0xff.

The DM pfuze100 driver supports both pfuze100 and pfuze3000. Allow it to use the device type to return the correct number of registers.

Also rename the too generic PMIC_NUM_OF_REGS enumeration value for pfuze3000 to match the other "PFUZE3000_" prefixed enumerations and the pfuze100 enumeration value PFUZE100_NUM_OF_REGS.

Cc Peng Fan <[email protected]>
Cc Jaehoon Chung <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 drivers/power/pmic/pfuze100.c       | 3 ++-
 drivers/power/pmic/pmic_pfuze3000.c | 2 +-
 include/power/pfuze3000_pmic.h      | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/power/pmic/pfuze100.c +2 -1
index a06cbc07d4..f85ad25981 100644
@@ -13,6 +13,7 @@
 #include <power/pmic.h>
 #include <power/regulator.h>
 #include <power/pfuze100_pmic.h>
+#include <power/pfuze3000_pmic.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -26,7 +27,7 @@ static const struct pmic_child_info pmic_children_info[] = {
 
 static int pfuze100_reg_count(struct udevice *dev)
 {
-       return PFUZE100_NUM_OF_REGS;
+       return dev->driver_data == PFUZE3000 ? PFUZE3000_NUM_OF_REGS : PFUZE100_NUM_OF_REGS;
 }
 
 static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff,
drivers/power/pmic/pmic_pfuze3000.c +1 -1
index ac807a801f..d0f358f808 100644
@@ -23,7 +23,7 @@ int power_pfuze3000_init(unsigned char bus)
 
        p->name = name;
        p->interface = PMIC_I2C;
-       p->number_of_regs = PMIC_NUM_OF_REGS;
+       p->number_of_regs = PFUZE3000_NUM_OF_REGS;
        p->hw.i2c.addr = CONFIG_POWER_PFUZE3000_I2C_ADDR;
        p->hw.i2c.tx_num = 1;
        p->bus = bus;
include/power/pfuze3000_pmic.h +1 -2
index 7d66ba48d4..94946e9594 100644
@@ -70,7 +70,7 @@ enum {
        PFUZE3000_VLDO3CTL      = 0x70,
        PFUZE3000_VLD4CTL       = 0x71,
 
-       PMIC_NUM_OF_REGS        = 0x7F,
+       PFUZE3000_NUM_OF_REGS   = 0x100,
 };
 
 int power_pfuze3000_init(unsigned char bus);
--

2.14.3

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================