mbox series

[v2,00/10] treewide: bd9571mwv: Add support for BD9574MWF

Message ID 1607686060-17448-1-git-send-email-yoshihiro.shimoda.uh@renesas.com
Headers show
Series treewide: bd9571mwv: Add support for BD9574MWF | expand

Message

Yoshihiro Shimoda Dec. 11, 2020, 11:27 a.m. UTC
Add BD9574MWF support into bd9571mwv gpio, mfd and regulator drivers.
Latest Ebisu-4D boards has this chip instead of BD9571MWV so that
we need this patch series.

Changes from v1:
 - Document BD9574MWF on the dt-binding.
 - Add ROHM_CHIP_TYPE_BD957[14] into rohm-generic.h.
 - To simplify gpio and regulator drivers, using regmap instead of
   using struct bd9571mwv.
 - Remove BD9574MWF definitions to make gpio and regulator driver
   simple to support for BD9574MWF.
 - Add BD9574MWF support for gpio and regulator drivers.
 - Add missing regmap ranges for BD9574MWF.
 - Rename "part_number" with "part_name".
 https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=398059

Khiem Nguyen (2):
  mfd: bd9571mwv: Make the driver more generic
  mfd: bd9571mwv: Add support for BD9574MWF

Yoshihiro Shimoda (8):
  dt-bindings: mfd: bd9571mwv: Document BD9574MWF
  mfd: rohm-generic: Add BD9571 and BD9574
  regulator: bd9571mwv: rid of using struct bd9571mwv
  regulator: bd9571mwv: Add BD9574MWF support
  gpio: bd9571mwv: Use the SPDX license identifier
  gpio: bd9571mwv: rid of using struct bd9571mwv
  gpio: bd9571mwv: Add BD9574MWF support
  mfd: bd9571mwv: Use the SPDX license identifier

 .../devicetree/bindings/mfd/bd9571mwv.txt          |   4 +-
 drivers/gpio/gpio-bd9571mwv.c                      |  35 ++---
 drivers/mfd/bd9571mwv.c                            | 167 ++++++++++++++++++---
 drivers/regulator/bd9571mwv-regulator.c            |  59 +++++---
 include/linux/mfd/bd9571mwv.h                      |  46 +++---
 include/linux/mfd/rohm-generic.h                   |   2 +
 6 files changed, 215 insertions(+), 98 deletions(-)

Comments

Vaittinen, Matti Dec. 11, 2020, 11:36 a.m. UTC | #1
On Fri, 2020-12-11 at 20:27 +0900, Yoshihiro Shimoda wrote:
> Add chip IDs for BD9571MWV and BD9574MWF.

> 

> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

> ---

>  include/linux/mfd/rohm-generic.h | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/include/linux/mfd/rohm-generic.h

> b/include/linux/mfd/rohm-generic.h

> index 4283b5b..affacf8 100644

> --- a/include/linux/mfd/rohm-generic.h

> +++ b/include/linux/mfd/rohm-generic.h

> @@ -12,6 +12,8 @@ enum rohm_chip_type {

>  	ROHM_CHIP_TYPE_BD71847,

>  	ROHM_CHIP_TYPE_BD70528,

>  	ROHM_CHIP_TYPE_BD71828,

> +	ROHM_CHIP_TYPE_BD9571,

> +	ROHM_CHIP_TYPE_BD9574,

>  	ROHM_CHIP_TYPE_AMOUNT

>  };

>  



Just a note to Lee & Others:
This will probably conflict with the BD9573/BD9576 patch series (which
introduces those chip IDs here). Conflict should be trivial though.

With that note:
Reviewed-By: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>



--Matti
Vaittinen, Matti Dec. 11, 2020, 12:55 p.m. UTC | #2
On Fri, 2020-12-11 at 20:27 +0900, Yoshihiro Shimoda wrote:
> Add support for BD9574MWF which is silimar chip with BD9571MWV.

> Note that BD9574MWF has an additional feature, but doesn't

> support it for now.


nit:
Perhaps mention which feature? And I think you mean the driver does not
support it yet?

> 

> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>


FWIW:
Reviewed-By: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>


> ---

>  drivers/gpio/gpio-bd9571mwv.c | 6 ++++--

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

> 

> diff --git a/drivers/gpio/gpio-bd9571mwv.c b/drivers/gpio/gpio-

> bd9571mwv.c

> index 0e5395f..df6102b 100644

> --- a/drivers/gpio/gpio-bd9571mwv.c

> +++ b/drivers/gpio/gpio-bd9571mwv.c

> @@ -1,6 +1,6 @@

>  // SPDX-License-Identifier: GPL-2.0-only

>  /*

> - * ROHM BD9571MWV-M GPIO driver

> + * ROHM BD9571MWV-M and BD9574MWF-M GPIO driver

>   *

>   * Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@gmail.com>

>   *

> @@ -10,6 +10,7 @@

>   */

>  

>  #include <linux/gpio/driver.h>

> +#include <linux/mfd/rohm-generic.h>

>  #include <linux/module.h>

>  #include <linux/platform_device.h>

>  

> @@ -118,7 +119,8 @@ static int bd9571mwv_gpio_probe(struct

> platform_device *pdev)

>  }

>  

>  static const struct platform_device_id bd9571mwv_gpio_id_table[] = {

> -	{ "bd9571mwv-gpio", },

> +	{ "bd9571mwv-gpio", ROHM_CHIP_TYPE_BD9571 },

> +	{ "bd9574mwf-gpio", ROHM_CHIP_TYPE_BD9574 },


I guess these CHIP_TYPES are used by subsequent patches?

I guess this means the existing functionality in both chips is same,
right? (GPIO register addresses etc? - I don't have BD9571 data-sheet
so I can't check)

>  	{ /* sentinel */ }

>  };

>  MODULE_DEVICE_TABLE(platform, bd9571mwv_gpio_id_table);
Yoshihiro Shimoda Dec. 14, 2020, 5:11 a.m. UTC | #3
Hi Matti-san,

Thank you for your review!

> From: Vaittinen, Matti, Sent: Friday, December 11, 2020 9:55 PM

> 

> On Fri, 2020-12-11 at 20:27 +0900, Yoshihiro Shimoda wrote:

> > Add support for BD9574MWF which is silimar chip with BD9571MWV.

> > Note that BD9574MWF has an additional feature, but doesn't

> > support it for now.

> 

> nit:

> Perhaps mention which feature?


BD9574MWF GPIO[01] have 4 functions like below.
 1) GPIO, 2) "RECOV_GPOUT", 3) "FREQSEL", 4) "RTC_IN"

It seems "pinctrl" features though and I don't know
these features in detail for now.

> And I think you mean the driver does not support it yet?


You're correct. Now this driver only support the 1) GPIO.

> >

> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

> 

> FWIW:

> Reviewed-By: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>


Thank you for your review!

> > ---

> >  drivers/gpio/gpio-bd9571mwv.c | 6 ++++--

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

> >

> > diff --git a/drivers/gpio/gpio-bd9571mwv.c b/drivers/gpio/gpio-

> > bd9571mwv.c

> > index 0e5395f..df6102b 100644

> > --- a/drivers/gpio/gpio-bd9571mwv.c

> > +++ b/drivers/gpio/gpio-bd9571mwv.c

> > @@ -1,6 +1,6 @@

> >  // SPDX-License-Identifier: GPL-2.0-only

> >  /*

> > - * ROHM BD9571MWV-M GPIO driver

> > + * ROHM BD9571MWV-M and BD9574MWF-M GPIO driver

> >   *

> >   * Copyright (C) 2017 Marek Vasut <marek.vasut+renesas@gmail.com>

> >   *

> > @@ -10,6 +10,7 @@

> >   */

> >

> >  #include <linux/gpio/driver.h>

> > +#include <linux/mfd/rohm-generic.h>

> >  #include <linux/module.h>

> >  #include <linux/platform_device.h>

> >

> > @@ -118,7 +119,8 @@ static int bd9571mwv_gpio_probe(struct

> > platform_device *pdev)

> >  }

> >

> >  static const struct platform_device_id bd9571mwv_gpio_id_table[] = {

> > -	{ "bd9571mwv-gpio", },

> > +	{ "bd9571mwv-gpio", ROHM_CHIP_TYPE_BD9571 },

> > +	{ "bd9574mwf-gpio", ROHM_CHIP_TYPE_BD9574 },

> 

> I guess these CHIP_TYPES are used by subsequent patches?

> 

> I guess this means the existing functionality in both chips is same,

> right? (GPIO register addresses etc? - I don't have BD9571 data-sheet

> so I can't check)


Yes, the existing functionality in both chips is same.
GPIO register addresses and bits are the same.
Note that BD9574MWF has one more register, but the driver
doesn't use it for now.

Best regards,
Yoshihiro Shimoda
Yoshihiro Shimoda Dec. 14, 2020, 12:12 p.m. UTC | #4
> From: Yoshihiro Shimoda, Sent: Friday, December 11, 2020 8:28 PM

> 

> Use the SPDX license identifier instead of a local description.

> 

> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>


I forgot to add Geert-san's Reviewed-by here. So, I'll submit v3 patch series later.

https://patchwork.kernel.org/project/linux-renesas-soc/patch/1607414643-25498-2-git-send-email-yoshihiro.shimoda.uh@renesas.com/#23832735

Best regards,
Yoshihiro Shimoda
Geert Uytterhoeven Dec. 15, 2020, 4:08 p.m. UTC | #5
On Fri, Dec 11, 2020 at 2:47 PM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> Use the SPDX license identifier instead of a local description.

>

> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>


Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>


Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds