mbox series

[v6,00/16] Support ROHM BD71815 PMIC

Message ID cover.1617616855.git.matti.vaittinen@fi.rohmeurope.com
Headers show
Series Support ROHM BD71815 PMIC | expand

Message

Vaittinen, Matti April 5, 2021, 11:40 a.m. UTC
Patch series introducing support for ROHM BD71815 PMIC

ROHM BD71815 is a power management IC used in some battery powered
systems. It contains regulators, GPO(s), charger + coulomb counter, RTC
and a clock gate.

All regulators can be controlled via I2C. LDO4 can additionally be set to
be enabled/disabled by a GPIO. LDO3 voltage could be selected from two
voltages written into separate VSEL reisters using GPIO but this mode is
not supported by driver. On top of that the PMIC has the typical HW
state machine which is present also on many other ROHM PMICs.

IC contains two GPOs - but one of the GPOs is marked as GND in
data-sheet. Thus the driver by default only exposes one GPO. The second
GPO can be enabled by special DT property.

RTC is almost similar to what is on BD71828. For currently used features
only the register address offset to RTC block differs.

The charger driver is not included in this series. ROHM has a charger
driver with some fuel-gauging logig written in but this is not included
here. I am working on separating the logic from HW specific driver and
supporting both BD71815 and BD71828 chargers in separate patch series.

Changelog v6:
  Rebased on v5.12-rc6
  Regulator:
   - Fixed few minor issues pointer by Mark
   - Dropped the helper patches which were applied to regulator tree.
     Please note, there is compile-time dependency to those helpers so
     regulator helpers should be pulled in from:
     https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
     tags/regulator-list-ramp-helpers
  GPIO:
   - Corrected change log spelling
   - Fixes some styling issues pointed by Andy.
Changelog v5:
  Regulator:
  - Added regmap helper for regulator ramp-delay and taken it in use
    (patches 13, 14, 16 - they can be just dropped if ramp-delay helper is not
    a good idea. Patch 15 implements old-fashioned ramp-delay)
  GPIO:
  - styling changes to GPIO (Mostly suggested by Andy)
  - implemented init_valid_mask (but can't count on it yet)
Changelog v4:
  - Sorted ROHM chip ID enum
  - Statcized DVS structures in regulator driver
  - Minor styling for regulator driver
  - rebased on v5.12-rc4
Changelog v3:
  - GPIO clean-up as suggested by Bartosz
  - MFD clean-up as suggested by Lee
  - clk-mode dt-binding handling in MFD driver corrected to reflect new
    property values.
  - Dropped already applied patches
  - Rebased on v5.12-rc2
Changelog v2:
  - Rebased on top of v5.11-rc3
  - Added another "preliminary patch" which fixes HW-dvs voltage
    handling (patch 1)
  - split regulator patch to two.
  - changed dt-binding patch ordering.
  regulators:
    - staticized probe
    - removed some unnecessary defines
    - updated comments
    - split rohm-regulator patch adding SNVS and supporting simple
      linear mapping into two - one adding support for mapping, other
      adding SNVS.
  GPIO:
    - removed unnecessary headers
    - clarified dev/parent->dev usage
    - removed forgotten #define DEBUG
  dt-bindings:
    - changed patch order to meet ref-dependencies
    - added missing regulator nodes
    - changed string property for clk mode to tristated
  MFD:
    - header cleanups.
  CLK:
    - fixed commit message

--

Matti Vaittinen (16):
  rtc: bd70528: Do not require parent data
  mfd: bd718x7: simplify by cleaning unnecessary device data
  dt_bindings: bd71828: Add clock output mode
  dt_bindings: regulator: Add ROHM BD71815 PMIC regulators
  dt_bindings: mfd: Add ROHM BD71815 PMIC
  mfd: Add ROHM BD71815 ID
  mfd: Sort ROHM chip ID list for better readability
  mfd: Support for ROHM BD71815 PMIC core
  gpio: support ROHM BD71815 GPOs
  regulator: rohm-regulator: linear voltage support
  regulator: rohm-regulator: Support SNVS HW state.
  regulator: bd718x7, bd71828: Use ramp-delay helper
  regulator: Support ROHM BD71815 regulators
  clk: bd718x7: Add support for clk gate on ROHM BD71815 PMIC
  rtc: bd70528: Support RTC on ROHM BD71815
  MAINTAINERS: Add ROHM BD71815AGW

 .../bindings/mfd/rohm,bd71815-pmic.yaml       | 201 ++++++
 .../bindings/mfd/rohm,bd71828-pmic.yaml       |   6 +
 .../regulator/rohm,bd71815-regulator.yaml     | 116 ++++
 MAINTAINERS                                   |   3 +
 drivers/clk/clk-bd718x7.c                     |   9 +-
 drivers/gpio/Kconfig                          |  10 +
 drivers/gpio/Makefile                         |   1 +
 drivers/gpio/gpio-bd71815.c                   | 185 +++++
 drivers/mfd/Kconfig                           |  15 +-
 drivers/mfd/rohm-bd71828.c                    | 486 +++++++++----
 drivers/mfd/rohm-bd718x7.c                    |  43 +-
 drivers/regulator/Kconfig                     |  11 +
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/bd71815-regulator.c         | 652 ++++++++++++++++++
 drivers/regulator/bd71828-regulator.c         |  51 +-
 drivers/regulator/bd718x7-regulator.c         |  60 +-
 drivers/regulator/rohm-regulator.c            |  23 +-
 drivers/rtc/Kconfig                           |   6 +-
 drivers/rtc/rtc-bd70528.c                     | 104 +--
 include/linux/mfd/rohm-bd71815.h              | 562 +++++++++++++++
 include/linux/mfd/rohm-bd71828.h              |   3 +
 include/linux/mfd/rohm-bd718x7.h              |  13 -
 include/linux/mfd/rohm-generic.h              |  15 +-
 23 files changed, 2286 insertions(+), 290 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml
 create mode 100644 Documentation/devicetree/bindings/regulator/rohm,bd71815-regulator.yaml
 create mode 100644 drivers/gpio/gpio-bd71815.c
 create mode 100644 drivers/regulator/bd71815-regulator.c
 create mode 100644 include/linux/mfd/rohm-bd71815.h


base-commit: e49d033bddf5b565044e2abe4241353959bc9120

Comments

Lee Jones April 14, 2021, 1:11 p.m. UTC | #1
Please note that this PR will break your build unless you have the
required Regulator API update.

 fb8fee9efdcf0 regulator: Add regmap helper for ramp-delay setting
 e3baacf542756 regulator: helpers: Export helper voltage listing

Pull at your peril! :)

The following changes since commit a38fd8748464831584a19438cbb3082b5a2dab15:

  Linux 5.12-rc2 (2021-03-05 17:33:41 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-clk-gpio-regulator-rtc-v5.13

for you to fetch changes up to 5a8a64d9a38b9d3794f9f5e153fc0358b858cc24:

  MAINTAINERS: Add ROHM BD71815AGW (2021-04-14 10:21:43 +0100)

----------------------------------------------------------------
Immutable branch between MFD, Clock, GPIO, Regulator and RTC due for the v5.13 merge window

----------------------------------------------------------------
Matti Vaittinen (16):
      rtc: bd70528: Do not require parent data
      mfd: bd718x7: simplify by cleaning unnecessary device data
      dt_bindings: bd71828: Add clock output mode
      dt_bindings: regulator: Add ROHM BD71815 PMIC regulators
      dt_bindings: mfd: Add ROHM BD71815 PMIC
      mfd: Add ROHM BD71815 ID
      mfd: Sort ROHM chip ID list for better readability
      mfd: Support for ROHM BD71815 PMIC core
      gpio: Support ROHM BD71815 GPOs
      regulator: rohm-regulator: linear voltage support
      regulator: rohm-regulator: Support SNVS HW state.
      regulator: bd718x7, bd71828: Use ramp-delay helper
      regulator: Support ROHM BD71815 regulators
      clk: bd718x7: Add support for clk gate on ROHM BD71815 PMIC
      rtc: bd70528: Support RTC on ROHM BD71815
      MAINTAINERS: Add ROHM BD71815AGW

 .../devicetree/bindings/mfd/rohm,bd71815-pmic.yaml | 201 +++++++
 .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml |   6 +
 .../bindings/regulator/rohm,bd71815-regulator.yaml | 116 ++++
 MAINTAINERS                                        |   3 +
 drivers/clk/clk-bd718x7.c                          |   9 +-
 drivers/gpio/Kconfig                               |  10 +
 drivers/gpio/Makefile                              |   1 +
 drivers/gpio/gpio-bd71815.c                        | 185 ++++++
 drivers/mfd/Kconfig                                |  15 +-
 drivers/mfd/rohm-bd71828.c                         | 486 +++++++++++----
 drivers/mfd/rohm-bd718x7.c                         |  43 +-
 drivers/regulator/Kconfig                          |  11 +
 drivers/regulator/Makefile                         |   1 +
 drivers/regulator/bd71815-regulator.c              | 652 +++++++++++++++++++++
 drivers/regulator/bd71828-regulator.c              |  51 +-
 drivers/regulator/bd718x7-regulator.c              |  60 +-
 drivers/regulator/rohm-regulator.c                 |  23 +-
 drivers/rtc/Kconfig                                |   6 +-
 drivers/rtc/rtc-bd70528.c                          | 104 ++--
 include/linux/mfd/rohm-bd71815.h                   | 562 ++++++++++++++++++
 include/linux/mfd/rohm-bd71828.h                   |   3 +
 include/linux/mfd/rohm-bd718x7.h                   |  13 -
 include/linux/mfd/rohm-generic.h                   |  15 +-
 23 files changed, 2286 insertions(+), 290 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml
 create mode 100644 Documentation/devicetree/bindings/regulator/rohm,bd71815-regulator.yaml
 create mode 100644 drivers/gpio/gpio-bd71815.c
 create mode 100644 drivers/regulator/bd71815-regulator.c
 create mode 100644 include/linux/mfd/rohm-bd71815.h

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Lee Jones April 14, 2021, 2:53 p.m. UTC | #2
On Wed, 14 Apr 2021, Lee Jones wrote:

> Please note that this PR will break your build unless you have the

> required Regulator API update.

> 

>  fb8fee9efdcf0 regulator: Add regmap helper for ramp-delay setting

>  e3baacf542756 regulator: helpers: Export helper voltage listing


Looks like Mark has these:

 git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator regulator-list-ramp-helpers
 
> Pull at your peril! :)

> 

> The following changes since commit a38fd8748464831584a19438cbb3082b5a2dab15:

> 

>   Linux 5.12-rc2 (2021-03-05 17:33:41 -0800)

> 

> are available in the Git repository at:

> 

>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-clk-gpio-regulator-rtc-v5.13

> 

> for you to fetch changes up to 5a8a64d9a38b9d3794f9f5e153fc0358b858cc24:

> 

>   MAINTAINERS: Add ROHM BD71815AGW (2021-04-14 10:21:43 +0100)

> 

> ----------------------------------------------------------------

> Immutable branch between MFD, Clock, GPIO, Regulator and RTC due for the v5.13 merge window

> 

> ----------------------------------------------------------------

> Matti Vaittinen (16):

>       rtc: bd70528: Do not require parent data

>       mfd: bd718x7: simplify by cleaning unnecessary device data

>       dt_bindings: bd71828: Add clock output mode

>       dt_bindings: regulator: Add ROHM BD71815 PMIC regulators

>       dt_bindings: mfd: Add ROHM BD71815 PMIC

>       mfd: Add ROHM BD71815 ID

>       mfd: Sort ROHM chip ID list for better readability

>       mfd: Support for ROHM BD71815 PMIC core

>       gpio: Support ROHM BD71815 GPOs

>       regulator: rohm-regulator: linear voltage support

>       regulator: rohm-regulator: Support SNVS HW state.

>       regulator: bd718x7, bd71828: Use ramp-delay helper

>       regulator: Support ROHM BD71815 regulators

>       clk: bd718x7: Add support for clk gate on ROHM BD71815 PMIC

>       rtc: bd70528: Support RTC on ROHM BD71815

>       MAINTAINERS: Add ROHM BD71815AGW

> 

>  .../devicetree/bindings/mfd/rohm,bd71815-pmic.yaml | 201 +++++++

>  .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml |   6 +

>  .../bindings/regulator/rohm,bd71815-regulator.yaml | 116 ++++

>  MAINTAINERS                                        |   3 +

>  drivers/clk/clk-bd718x7.c                          |   9 +-

>  drivers/gpio/Kconfig                               |  10 +

>  drivers/gpio/Makefile                              |   1 +

>  drivers/gpio/gpio-bd71815.c                        | 185 ++++++

>  drivers/mfd/Kconfig                                |  15 +-

>  drivers/mfd/rohm-bd71828.c                         | 486 +++++++++++----

>  drivers/mfd/rohm-bd718x7.c                         |  43 +-

>  drivers/regulator/Kconfig                          |  11 +

>  drivers/regulator/Makefile                         |   1 +

>  drivers/regulator/bd71815-regulator.c              | 652 +++++++++++++++++++++

>  drivers/regulator/bd71828-regulator.c              |  51 +-

>  drivers/regulator/bd718x7-regulator.c              |  60 +-

>  drivers/regulator/rohm-regulator.c                 |  23 +-

>  drivers/rtc/Kconfig                                |   6 +-

>  drivers/rtc/rtc-bd70528.c                          | 104 ++--

>  include/linux/mfd/rohm-bd71815.h                   | 562 ++++++++++++++++++

>  include/linux/mfd/rohm-bd71828.h                   |   3 +

>  include/linux/mfd/rohm-bd718x7.h                   |  13 -

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

>  23 files changed, 2286 insertions(+), 290 deletions(-)

>  create mode 100644 Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml

>  create mode 100644 Documentation/devicetree/bindings/regulator/rohm,bd71815-regulator.yaml

>  create mode 100644 drivers/gpio/gpio-bd71815.c

>  create mode 100644 drivers/regulator/bd71815-regulator.c

>  create mode 100644 include/linux/mfd/rohm-bd71815.h

> 


-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Vaittinen, Matti April 14, 2021, 5:09 p.m. UTC | #3
Hello Lee, Mark, Stephen, Linus, Alexandre,

On Wed, 2021-04-14 at 15:53 +0100, Lee Jones wrote:
> On Wed, 14 Apr 2021, Lee Jones wrote:

> 

> > Please note that this PR will break your build unless you have the

> > required Regulator API update.

> > 

> >  fb8fee9efdcf0 regulator: Add regmap helper for ramp-delay setting

> >  e3baacf542756 regulator: helpers: Export helper voltage listing

> 

> Looks like Mark has these:

> 

>  git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

> regulator-list-ramp-helpers

>  

> > Pull at your peril! :)

> > 

> > The following changes since commit

> > a38fd8748464831584a19438cbb3082b5a2dab15:

> > 

> >   Linux 5.12-rc2 (2021-03-05 17:33:41 -0800)

> > 

> > are available in the Git repository at:

> > 

> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git

> > tags/ib-mfd-clk-gpio-regulator-rtc-v5.13

> > 

> > for you to fetch changes up to

> > 5a8a64d9a38b9d3794f9f5e153fc0358b858cc24:

> > 

> >   MAINTAINERS: Add ROHM BD71815AGW (2021-04-14 10:21:43 +0100)

> > 

> > ----------------------------------------------------------------

> > Immutable branch between MFD, Clock, GPIO, Regulator and RTC due

> > for the v5.13 merge window

> > 

> > ----------------------------------------------------------------

> > Matti Vaittinen (16):

> >       rtc: bd70528: Do not require parent data

> >       mfd: bd718x7: simplify by cleaning unnecessary device data

> >       dt_bindings: bd71828: Add clock output mode

> >       dt_bindings: regulator: Add ROHM BD71815 PMIC regulators

> >       dt_bindings: mfd: Add ROHM BD71815 PMIC

> >       mfd: Add ROHM BD71815 ID

> >       mfd: Sort ROHM chip ID list for better readability

> >       mfd: Support for ROHM BD71815 PMIC core

> >       gpio: Support ROHM BD71815 GPOs

> >       regulator: rohm-regulator: linear voltage support

> >       regulator: rohm-regulator: Support SNVS HW state.

> >       regulator: bd718x7, bd71828: Use ramp-delay helper

> >       regulator: Support ROHM BD71815 regulators

> >       clk: bd718x7: Add support for clk gate on ROHM BD71815 PMIC

> >       rtc: bd70528: Support RTC on ROHM BD71815

> >       MAINTAINERS: Add ROHM BD71815AGW


I think the original idea was that Lee could get the Tag from Mark and
then get all the changes in via MFD tree. I can't say what would be the
best way to get these in. I'm open to all suggestions :)

Best Regards
	Matti Vaittinen
Lee Jones April 14, 2021, 5:15 p.m. UTC | #4
On Wed, 14 Apr 2021, Vaittinen, Matti wrote:

> Hello Lee, Mark, Stephen, Linus, Alexandre,

> 

> On Wed, 2021-04-14 at 15:53 +0100, Lee Jones wrote:

> > On Wed, 14 Apr 2021, Lee Jones wrote:

> > 

> > > Please note that this PR will break your build unless you have the

> > > required Regulator API update.

> > > 

> > >  fb8fee9efdcf0 regulator: Add regmap helper for ramp-delay setting

> > >  e3baacf542756 regulator: helpers: Export helper voltage listing

> > 

> > Looks like Mark has these:

> > 

> >  git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

> > regulator-list-ramp-helpers

> >  

> > > Pull at your peril! :)

> > > 

> > > The following changes since commit

> > > a38fd8748464831584a19438cbb3082b5a2dab15:

> > > 

> > >   Linux 5.12-rc2 (2021-03-05 17:33:41 -0800)

> > > 

> > > are available in the Git repository at:

> > > 

> > >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git

> > > tags/ib-mfd-clk-gpio-regulator-rtc-v5.13

> > > 

> > > for you to fetch changes up to

> > > 5a8a64d9a38b9d3794f9f5e153fc0358b858cc24:

> > > 

> > >   MAINTAINERS: Add ROHM BD71815AGW (2021-04-14 10:21:43 +0100)

> > > 

> > > ----------------------------------------------------------------

> > > Immutable branch between MFD, Clock, GPIO, Regulator and RTC due

> > > for the v5.13 merge window

> > > 

> > > ----------------------------------------------------------------

> > > Matti Vaittinen (16):

> > >       rtc: bd70528: Do not require parent data

> > >       mfd: bd718x7: simplify by cleaning unnecessary device data

> > >       dt_bindings: bd71828: Add clock output mode

> > >       dt_bindings: regulator: Add ROHM BD71815 PMIC regulators

> > >       dt_bindings: mfd: Add ROHM BD71815 PMIC

> > >       mfd: Add ROHM BD71815 ID

> > >       mfd: Sort ROHM chip ID list for better readability

> > >       mfd: Support for ROHM BD71815 PMIC core

> > >       gpio: Support ROHM BD71815 GPOs

> > >       regulator: rohm-regulator: linear voltage support

> > >       regulator: rohm-regulator: Support SNVS HW state.

> > >       regulator: bd718x7, bd71828: Use ramp-delay helper

> > >       regulator: Support ROHM BD71815 regulators

> > >       clk: bd718x7: Add support for clk gate on ROHM BD71815 PMIC

> > >       rtc: bd70528: Support RTC on ROHM BD71815

> > >       MAINTAINERS: Add ROHM BD71815AGW

> 

> I think the original idea was that Lee could get the Tag from Mark and

> then get all the changes in via MFD tree. I can't say what would be the

> best way to get these in. I'm open to all suggestions :)


It's done now.  Anyone who wishes to pull (and test) this branch
should also pull in the regulator-list-ramp-helpers tag from Mark's
Regulator tree.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog