All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] power: pmic: Let PFUZE3000 see all 256 registers
@ 2018-04-25 17:06 Trent Piepho
  2018-04-26  6:22 ` Fabio Estevam
  2018-06-27  1:37 ` Fabio Estevam
  0 siblings, 2 replies; 6+ messages in thread
From: Trent Piepho @ 2018-04-25 17:06 UTC (permalink / raw)
  To: u-boot

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 <Peng.Fan@freescale.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Trent Piepho <tpiepho@impinj.com>
---
 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(-)

diff --git a/drivers/power/pmic/pfuze100.c b/drivers/power/pmic/pfuze100.c
index a06cbc07d4..f85ad25981 100644
--- a/drivers/power/pmic/pfuze100.c
+++ b/drivers/power/pmic/pfuze100.c
@@ -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,
diff --git a/drivers/power/pmic/pmic_pfuze3000.c b/drivers/power/pmic/pmic_pfuze3000.c
index ac807a801f..d0f358f808 100644
--- a/drivers/power/pmic/pmic_pfuze3000.c
+++ b/drivers/power/pmic/pmic_pfuze3000.c
@@ -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;
diff --git a/include/power/pfuze3000_pmic.h b/include/power/pfuze3000_pmic.h
index 7d66ba48d4..94946e9594 100644
--- a/include/power/pfuze3000_pmic.h
+++ b/include/power/pfuze3000_pmic.h
@@ -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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] power: pmic: Let PFUZE3000 see all 256 registers
  2018-04-25 17:06 [U-Boot] [PATCH] power: pmic: Let PFUZE3000 see all 256 registers Trent Piepho
@ 2018-04-26  6:22 ` Fabio Estevam
  2018-05-31 18:01   ` Trent Piepho
  2018-06-27  1:37 ` Fabio Estevam
  1 sibling, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2018-04-26  6:22 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 25, 2018 at 2:06 PM, Trent Piepho <tpiepho@impinj.com> wrote:
> 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 <Peng.Fan@freescale.com>
> Cc: Jaehoon Chung <jh80.chung@samsung.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Signed-off-by: Trent Piepho <tpiepho@impinj.com>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] power: pmic: Let PFUZE3000 see all 256 registers
  2018-04-26  6:22 ` Fabio Estevam
@ 2018-05-31 18:01   ` Trent Piepho
  2018-06-01  0:44     ` Fabio Estevam
  0 siblings, 1 reply; 6+ messages in thread
From: Trent Piepho @ 2018-05-31 18:01 UTC (permalink / raw)
  To: u-boot

Ping.  Been a while.  2018.05 is out.

On Thu, 2018-04-26 at 03:22 -0300, Fabio Estevam wrote:
> On Wed, Apr 25, 2018 at 2:06 PM, Trent Piepho <tpiepho@impinj.com>
> wrote:
> > 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 <Peng.Fan@freescale.com>
> > Cc: Jaehoon Chung <jh80.chung@samsung.com>
> > Cc: Stefano Babic <sbabic@denx.de>
> > Cc: Fabio Estevam <fabio.estevam@nxp.com>
> > Signed-off-by: Trent Piepho <tpiepho@impinj.com>
> 
> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] power: pmic: Let PFUZE3000 see all 256 registers
  2018-05-31 18:01   ` Trent Piepho
@ 2018-06-01  0:44     ` Fabio Estevam
  0 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2018-06-01  0:44 UTC (permalink / raw)
  To: u-boot

[Adding Stefano]

On Thu, May 31, 2018 at 3:01 PM, Trent Piepho <tpiepho@impinj.com> wrote:
> Ping.  Been a while.  2018.05 is out.
>
> On Thu, 2018-04-26 at 03:22 -0300, Fabio Estevam wrote:
>> On Wed, Apr 25, 2018 at 2:06 PM, Trent Piepho <tpiepho@impinj.com>
>> wrote:
>> > 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 <Peng.Fan@freescale.com>
>> > Cc: Jaehoon Chung <jh80.chung@samsung.com>
>> > Cc: Stefano Babic <sbabic@denx.de>
>> > Cc: Fabio Estevam <fabio.estevam@nxp.com>
>> > Signed-off-by: Trent Piepho <tpiepho@impinj.com>
>>
>> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] power: pmic: Let PFUZE3000 see all 256 registers
  2018-04-25 17:06 [U-Boot] [PATCH] power: pmic: Let PFUZE3000 see all 256 registers Trent Piepho
  2018-04-26  6:22 ` Fabio Estevam
@ 2018-06-27  1:37 ` Fabio Estevam
  2018-06-27  7:49   ` Stefano Babic
  1 sibling, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2018-06-27  1:37 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

Could you please consider this one for 2018.07?

Thanks

On Wed, Apr 25, 2018 at 2:06 PM, Trent Piepho <tpiepho@impinj.com> wrote:
> 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 <Peng.Fan@freescale.com>
> Cc: Jaehoon Chung <jh80.chung@samsung.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Signed-off-by: Trent Piepho <tpiepho@impinj.com>
> ---
>  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(-)
>
> diff --git a/drivers/power/pmic/pfuze100.c b/drivers/power/pmic/pfuze100.c
> index a06cbc07d4..f85ad25981 100644
> --- a/drivers/power/pmic/pfuze100.c
> +++ b/drivers/power/pmic/pfuze100.c
> @@ -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,
> diff --git a/drivers/power/pmic/pmic_pfuze3000.c b/drivers/power/pmic/pmic_pfuze3000.c
> index ac807a801f..d0f358f808 100644
> --- a/drivers/power/pmic/pmic_pfuze3000.c
> +++ b/drivers/power/pmic/pmic_pfuze3000.c
> @@ -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;
> diff --git a/include/power/pfuze3000_pmic.h b/include/power/pfuze3000_pmic.h
> index 7d66ba48d4..94946e9594 100644
> --- a/include/power/pfuze3000_pmic.h
> +++ b/include/power/pfuze3000_pmic.h
> @@ -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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] power: pmic: Let PFUZE3000 see all 256 registers
  2018-06-27  1:37 ` Fabio Estevam
@ 2018-06-27  7:49   ` Stefano Babic
  0 siblings, 0 replies; 6+ messages in thread
From: Stefano Babic @ 2018-06-27  7:49 UTC (permalink / raw)
  To: u-boot

On 27/06/2018 03:37, Fabio Estevam wrote:
> 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

> Thanks
> 
> On Wed, Apr 25, 2018 at 2:06 PM, Trent Piepho <tpiepho@impinj.com> wrote:
>> 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 <Peng.Fan@freescale.com>
>> Cc: Jaehoon Chung <jh80.chung@samsung.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> Cc: Fabio Estevam <fabio.estevam@nxp.com>
>> Signed-off-by: Trent Piepho <tpiepho@impinj.com>
>> ---
>>  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(-)
>>
>> diff --git a/drivers/power/pmic/pfuze100.c b/drivers/power/pmic/pfuze100.c
>> index a06cbc07d4..f85ad25981 100644
>> --- a/drivers/power/pmic/pfuze100.c
>> +++ b/drivers/power/pmic/pfuze100.c
>> @@ -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,
>> diff --git a/drivers/power/pmic/pmic_pfuze3000.c b/drivers/power/pmic/pmic_pfuze3000.c
>> index ac807a801f..d0f358f808 100644
>> --- a/drivers/power/pmic/pmic_pfuze3000.c
>> +++ b/drivers/power/pmic/pmic_pfuze3000.c
>> @@ -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;
>> diff --git a/include/power/pfuze3000_pmic.h b/include/power/pfuze3000_pmic.h
>> index 7d66ba48d4..94946e9594 100644
>> --- a/include/power/pfuze3000_pmic.h
>> +++ b/include/power/pfuze3000_pmic.h
>> @@ -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


-- 
=====================================================================
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
=====================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-27  7:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 17:06 [U-Boot] [PATCH] power: pmic: Let PFUZE3000 see all 256 registers Trent Piepho
2018-04-26  6:22 ` Fabio Estevam
2018-05-31 18:01   ` Trent Piepho
2018-06-01  0:44     ` Fabio Estevam
2018-06-27  1:37 ` Fabio Estevam
2018-06-27  7:49   ` Stefano Babic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.