[PATCH v6 00/10 RESEND] Add RT5033 charger device driver

Jakob Hauser posted 10 patches 2 years, 7 months ago
.../bindings/mfd/richtek,rt5033.yaml          | 138 ++++
.../power/supply/richtek,rt5033-battery.yaml  |   2 +-
.../power/supply/richtek,rt5033-charger.yaml  |  65 ++
drivers/mfd/rt5033.c                          |   8 +-
drivers/power/supply/Kconfig                  |   8 +
drivers/power/supply/Makefile                 |   1 +
drivers/power/supply/rt5033_battery.c         |  38 +-
drivers/power/supply/rt5033_charger.c         | 744 ++++++++++++++++++
include/linux/mfd/rt5033-private.h            |  64 +-
include/linux/mfd/rt5033.h                    |  24 -
10 files changed, 1034 insertions(+), 58 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt5033.yaml
create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt5033-charger.yaml
create mode 100644 drivers/power/supply/rt5033_charger.c
[PATCH v6 00/10 RESEND] Add RT5033 charger device driver
Posted by Jakob Hauser 2 years, 7 months ago
This patchset adds the charger driver "rt5033-charger". It is part of the
multifunction device rt5033. The patchset is based on an older version by
Beomho Seo of March 2015. For more information on the history and setup of
the patchset see the cover sheet of version v1, there is a link further down
below the changelog.

RESEND: Sorry for spamming. The first try of sending v6 got interrupted and
was split into two threads on the lore list. Therefore sending it again.

Changes in v6:
 - Patch 5: In function rt5033_charger_probe() after
   calling rt5033_charger_dt_init() replaced the return value from "-ENODEV"
   to "PTR_ERR(charger->chg)", as suggested by Christophe.
 - Patch 9: Changed the patch from adding "power-supplies: true" to replacing
   "additionalProperties: false" by "unevaluatedProperties: false", as
   suggested by Krzysztof.

v1: https://lore.kernel.org/linux-pm/cover.1677620677.git.jahau@rocketmail.com/T/#t
v2: https://lore.kernel.org/linux-pm/cover.1681646904.git.jahau@rocketmail.com/T/#t
v3: https://lore.kernel.org/linux-pm/cover.1682636929.git.jahau@rocketmail.com/T/#t
v4: https://lore.kernel.org/linux-pm/20230506155435.3005-1-jahau@rocketmail.com/T/#t
v5: https://lore.kernel.org/linux-pm/20230514123130.41172-1-jahau@rocketmail.com/T/#t

The result of the patchset v6 can be seen at:
https://github.com/Jakko3/linux/blob/rt5033-charger_v6/drivers/power/supply/rt5033_charger.c

Jakob Hauser (9):
  mfd: rt5033: Fix chip revision readout
  mfd: rt5033: Fix STAT_MASK, HZ_MASK and AICR defines
  mfd: rt5033: Apply preparatory changes before adding rt5033-charger
    driver
  power: supply: rt5033_charger: Add RT5033 charger device driver
  power: supply: rt5033_charger: Add cable detection and USB OTG supply
  power: supply: rt5033_battery: Move struct rt5033_battery to battery
    driver
  power: supply: rt5033_battery: Adopt status property from charger
  dt-bindings: power: supply: rt5033-battery: Apply
    unevaluatedProperties
  dt-bindings: Add rt5033 mfd, regulator and charger

Stephan Gerhold (1):
  mfd: rt5033: Drop rt5033-battery sub-device

 .../bindings/mfd/richtek,rt5033.yaml          | 138 ++++
 .../power/supply/richtek,rt5033-battery.yaml  |   2 +-
 .../power/supply/richtek,rt5033-charger.yaml  |  65 ++
 drivers/mfd/rt5033.c                          |   8 +-
 drivers/power/supply/Kconfig                  |   8 +
 drivers/power/supply/Makefile                 |   1 +
 drivers/power/supply/rt5033_battery.c         |  38 +-
 drivers/power/supply/rt5033_charger.c         | 744 ++++++++++++++++++
 include/linux/mfd/rt5033-private.h            |  64 +-
 include/linux/mfd/rt5033.h                    |  24 -
 10 files changed, 1034 insertions(+), 58 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt5033.yaml
 create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt5033-charger.yaml
 create mode 100644 drivers/power/supply/rt5033_charger.c

-- 
2.39.2
Re: [PATCH v6 00/10 RESEND] Add RT5033 charger device driver
Posted by Lee Jones 2 years, 6 months ago
On Mon, 15 May 2023, Jakob Hauser wrote:

> This patchset adds the charger driver "rt5033-charger". It is part of the
> multifunction device rt5033. The patchset is based on an older version by
> Beomho Seo of March 2015. For more information on the history and setup of
> the patchset see the cover sheet of version v1, there is a link further down
> below the changelog.
> 
> RESEND: Sorry for spamming. The first try of sending v6 got interrupted and
> was split into two threads on the lore list. Therefore sending it again.
> 
> Changes in v6:
>  - Patch 5: In function rt5033_charger_probe() after
>    calling rt5033_charger_dt_init() replaced the return value from "-ENODEV"
>    to "PTR_ERR(charger->chg)", as suggested by Christophe.
>  - Patch 9: Changed the patch from adding "power-supplies: true" to replacing
>    "additionalProperties: false" by "unevaluatedProperties: false", as
>    suggested by Krzysztof.
> 
> v1: https://lore.kernel.org/linux-pm/cover.1677620677.git.jahau@rocketmail.com/T/#t
> v2: https://lore.kernel.org/linux-pm/cover.1681646904.git.jahau@rocketmail.com/T/#t
> v3: https://lore.kernel.org/linux-pm/cover.1682636929.git.jahau@rocketmail.com/T/#t
> v4: https://lore.kernel.org/linux-pm/20230506155435.3005-1-jahau@rocketmail.com/T/#t
> v5: https://lore.kernel.org/linux-pm/20230514123130.41172-1-jahau@rocketmail.com/T/#t
> 
> The result of the patchset v6 can be seen at:
> https://github.com/Jakko3/linux/blob/rt5033-charger_v6/drivers/power/supply/rt5033_charger.c
> 
> Jakob Hauser (9):
>   mfd: rt5033: Fix chip revision readout
>   mfd: rt5033: Fix STAT_MASK, HZ_MASK and AICR defines
>   mfd: rt5033: Apply preparatory changes before adding rt5033-charger
>     driver
>   power: supply: rt5033_charger: Add RT5033 charger device driver
>   power: supply: rt5033_charger: Add cable detection and USB OTG supply
>   power: supply: rt5033_battery: Move struct rt5033_battery to battery
>     driver
>   power: supply: rt5033_battery: Adopt status property from charger
>   dt-bindings: power: supply: rt5033-battery: Apply
>     unevaluatedProperties
>   dt-bindings: Add rt5033 mfd, regulator and charger
> 
> Stephan Gerhold (1):
>   mfd: rt5033: Drop rt5033-battery sub-device
> 
>  .../bindings/mfd/richtek,rt5033.yaml          | 138 ++++
>  .../power/supply/richtek,rt5033-battery.yaml  |   2 +-
>  .../power/supply/richtek,rt5033-charger.yaml  |  65 ++
>  drivers/mfd/rt5033.c                          |   8 +-
>  drivers/power/supply/Kconfig                  |   8 +
>  drivers/power/supply/Makefile                 |   1 +
>  drivers/power/supply/rt5033_battery.c         |  38 +-
>  drivers/power/supply/rt5033_charger.c         | 744 ++++++++++++++++++
>  include/linux/mfd/rt5033-private.h            |  64 +-
>  include/linux/mfd/rt5033.h                    |  24 -
>  10 files changed, 1034 insertions(+), 58 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt5033.yaml
>  create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt5033-charger.yaml
>  create mode 100644 drivers/power/supply/rt5033_charger.c

All applied.  Sent for build testing.

I'll follow-up with a PR soon.

-- 
Lee Jones [李琼斯]
[GIT PULL] Immutable branch between MFD and Power due for the v6.5 merge window
Posted by Lee Jones 2 years, 6 months ago
Enjoy!

The following changes since commit ac9a78681b921877518763ba0e89202254349d1b:

  Linux 6.4-rc1 (2023-05-07 13:34:35 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-power-v6.5

for you to fetch changes up to b54185c1e3b02c91e4a190ac5c346ea7bfb0de93:

  dt-bindings: Add rt5033 MFD, Regulator and Charger (2023-06-08 18:18:13 +0100)

----------------------------------------------------------------
Immutable branch between MFD and Power due for the v6.5 merge window

----------------------------------------------------------------
Jakob Hauser (8):
      mfd: rt5033: Fix chip revision readout
      mfd: rt5033: Fix STAT_MASK, HZ_MASK and AICR defines
      mfd: rt5033: Apply preparatory changes before adding rt5033-charger driver
      power: supply: rt5033_charger: Add RT5033 charger device driver
      power: supply: rt5033_battery: Move struct rt5033_battery to battery driver
      power: supply: rt5033_battery: Adopt status property from charger
      dt-bindings: power: supply: rt5033-battery: Apply unevaluatedProperties
      dt-bindings: Add rt5033 MFD, Regulator and Charger

Stephan Gerhold (1):
      mfd: rt5033: Drop rt5033-battery sub-device

 .../devicetree/bindings/mfd/richtek,rt5033.yaml    | 138 ++++++
 .../power/supply/richtek,rt5033-battery.yaml       |   2 +-
 .../power/supply/richtek,rt5033-charger.yaml       |  65 +++
 drivers/mfd/rt5033.c                               |   8 +-
 drivers/power/supply/Kconfig                       |   8 +
 drivers/power/supply/Makefile                      |   1 +
 drivers/power/supply/rt5033_battery.c              |  38 +-
 drivers/power/supply/rt5033_charger.c              | 472 +++++++++++++++++++++
 include/linux/mfd/rt5033-private.h                 |  64 ++-
 include/linux/mfd/rt5033.h                         |  24 --
 10 files changed, 762 insertions(+), 58 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt5033.yaml
 create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt5033-charger.yaml
 create mode 100644 drivers/power/supply/rt5033_charger.c

-- 
Lee Jones [李琼斯]
Re: [GIT PULL] Immutable branch between MFD and Power due for the v6.5 merge window
Posted by Jakob Hauser 2 years, 6 months ago
Hi Lee,

On 09.06.23 08:47, Lee Jones wrote:
> Enjoy!
> 
> The following changes since commit ac9a78681b921877518763ba0e89202254349d1b:
> 
>    Linux 6.4-rc1 (2023-05-07 13:34:35 -0700)
> 
> are available in the Git repository at:
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-power-v6.5
> 
> for you to fetch changes up to b54185c1e3b02c91e4a190ac5c346ea7bfb0de93:
> 
>    dt-bindings: Add rt5033 MFD, Regulator and Charger (2023-06-08 18:18:13 +0100)
> 
> ----------------------------------------------------------------
> Immutable branch between MFD and Power due for the v6.5 merge window
> 
> ----------------------------------------------------------------
> Jakob Hauser (8):
>        mfd: rt5033: Fix chip revision readout
>        mfd: rt5033: Fix STAT_MASK, HZ_MASK and AICR defines
>        mfd: rt5033: Apply preparatory changes before adding rt5033-charger driver
>        power: supply: rt5033_charger: Add RT5033 charger device driver
>        power: supply: rt5033_battery: Move struct rt5033_battery to battery driver
>        power: supply: rt5033_battery: Adopt status property from charger
>        dt-bindings: power: supply: rt5033-battery: Apply unevaluatedProperties
>        dt-bindings: Add rt5033 MFD, Regulator and Charger
> 
> Stephan Gerhold (1):
>        mfd: rt5033: Drop rt5033-battery sub-device
> 
>   .../devicetree/bindings/mfd/richtek,rt5033.yaml    | 138 ++++++
>   .../power/supply/richtek,rt5033-battery.yaml       |   2 +-
>   .../power/supply/richtek,rt5033-charger.yaml       |  65 +++
>   drivers/mfd/rt5033.c                               |   8 +-
>   drivers/power/supply/Kconfig                       |   8 +
>   drivers/power/supply/Makefile                      |   1 +
>   drivers/power/supply/rt5033_battery.c              |  38 +-
>   drivers/power/supply/rt5033_charger.c              | 472 +++++++++++++++++++++
>   include/linux/mfd/rt5033-private.h                 |  64 ++-
>   include/linux/mfd/rt5033.h                         |  24 --
>   10 files changed, 762 insertions(+), 58 deletions(-)
>   create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt5033.yaml
>   create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt5033-charger.yaml
>   create mode 100644 drivers/power/supply/rt5033_charger.c
> 

I just realized that there is one patch missing in the immutable branch 
"ib-mfd-power-v6.5" [1]. Unfortunately I haven't noticed earlier. The 
immutable branch holds 9 patches, the patchset has 10 patches [2]. The 
missing patch is No. 6 "power: supply: rt5033_charger: Add cable 
detection and USB OTG supply".

As this patch No. 6 affects only the file 
drivers/power/supply/rt5033_charger.c and is the last patch on that 
file, it's no problem to add this patch on top of the other patches.

Could you submit another pull request for the v6.5 merge window to add 
this patch?

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git/log/?h=ib-mfd-power-6.5
[2] 
https://lore.kernel.org/linux-pm/cover.1684182964.git.jahau@rocketmail.com/T/#t

Kind regards,
Jakob
Re: [GIT PULL] Immutable branch between MFD and Power due for the v6.5 merge window
Posted by Lee Jones 2 years, 6 months ago
Sebastian,

On Fri, 16 Jun 2023, Jakob Hauser wrote:
> On 09.06.23 08:47, Lee Jones wrote:
> > Enjoy!
> > 
> > The following changes since commit ac9a78681b921877518763ba0e89202254349d1b:
> > 
> >    Linux 6.4-rc1 (2023-05-07 13:34:35 -0700)
> > 
> > are available in the Git repository at:
> > 
> >    git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-power-v6.5
> > 
> > for you to fetch changes up to b54185c1e3b02c91e4a190ac5c346ea7bfb0de93:
> > 
> >    dt-bindings: Add rt5033 MFD, Regulator and Charger (2023-06-08 18:18:13 +0100)
> > 
> > ----------------------------------------------------------------
> > Immutable branch between MFD and Power due for the v6.5 merge window
> > 
> > ----------------------------------------------------------------
> > Jakob Hauser (8):
> >        mfd: rt5033: Fix chip revision readout
> >        mfd: rt5033: Fix STAT_MASK, HZ_MASK and AICR defines
> >        mfd: rt5033: Apply preparatory changes before adding rt5033-charger driver
> >        power: supply: rt5033_charger: Add RT5033 charger device driver
> >        power: supply: rt5033_battery: Move struct rt5033_battery to battery driver
> >        power: supply: rt5033_battery: Adopt status property from charger
> >        dt-bindings: power: supply: rt5033-battery: Apply unevaluatedProperties
> >        dt-bindings: Add rt5033 MFD, Regulator and Charger
> > 
> > Stephan Gerhold (1):
> >        mfd: rt5033: Drop rt5033-battery sub-device
> > 
> >   .../devicetree/bindings/mfd/richtek,rt5033.yaml    | 138 ++++++
> >   .../power/supply/richtek,rt5033-battery.yaml       |   2 +-
> >   .../power/supply/richtek,rt5033-charger.yaml       |  65 +++
> >   drivers/mfd/rt5033.c                               |   8 +-
> >   drivers/power/supply/Kconfig                       |   8 +
> >   drivers/power/supply/Makefile                      |   1 +
> >   drivers/power/supply/rt5033_battery.c              |  38 +-
> >   drivers/power/supply/rt5033_charger.c              | 472 +++++++++++++++++++++
> >   include/linux/mfd/rt5033-private.h                 |  64 ++-
> >   include/linux/mfd/rt5033.h                         |  24 --
> >   10 files changed, 762 insertions(+), 58 deletions(-)
> >   create mode 100644 Documentation/devicetree/bindings/mfd/richtek,rt5033.yaml
> >   create mode 100644 Documentation/devicetree/bindings/power/supply/richtek,rt5033-charger.yaml
> >   create mode 100644 drivers/power/supply/rt5033_charger.c
> > 
> 
> I just realized that there is one patch missing in the immutable branch
> "ib-mfd-power-v6.5" [1]. Unfortunately I haven't noticed earlier. The
> immutable branch holds 9 patches, the patchset has 10 patches [2]. The
> missing patch is No. 6 "power: supply: rt5033_charger: Add cable detection
> and USB OTG supply".

Did you take this pull-request?

If so, would you like to apply the missing patch or would you like me to
take it via MFD (without a subsequent PR)?

> As this patch No. 6 affects only the file
> drivers/power/supply/rt5033_charger.c and is the last patch on that file,
> it's no problem to add this patch on top of the other patches.
> 
> Could you submit another pull request for the v6.5 merge window to add this
> patch?
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git/log/?h=ib-mfd-power-6.5
> [2] https://lore.kernel.org/linux-pm/cover.1684182964.git.jahau@rocketmail.com/T/#t

-- 
Lee Jones [李琼斯]
Re: [GIT PULL] Immutable branch between MFD and Power due for the v6.5 merge window
Posted by Jakob Hauser 2 years, 4 months ago
Hi Sebastian,

The patch 6 "power: supply: rt5033_charger: Add cable detection and USB 
OTG supply" of the series v6 RESEND of rt5033-charger is still missing.

On 19.06.23 12:35, Lee Jones wrote:
> Sebastian,
> 
> On Fri, 16 Jun 2023, Jakob Hauser wrote:

...

>> I just realized that there is one patch missing in the immutable branch
>> "ib-mfd-power-v6.5" [1]. Unfortunately I haven't noticed earlier. The
>> immutable branch holds 9 patches, the patchset has 10 patches [2]. The
>> missing patch is No. 6 "power: supply: rt5033_charger: Add cable detection
>> and USB OTG supply".
> 
> Did you take this pull-request?
> 
> If so, would you like to apply the missing patch or would you like me to
> take it via MFD (without a subsequent PR)?
> 
>> As this patch No. 6 affects only the file
>> drivers/power/supply/rt5033_charger.c and is the last patch on that file,
>> it's no problem to add this patch on top of the other patches.
>>
>> Could you submit another pull request for the v6.5 merge window to add this
>> patch?
>>
>> [1] https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git/log/?h=ib-mfd-power-6.5
>> [2] https://lore.kernel.org/linux-pm/cover.1684182964.git.jahau@rocketmail.com/T/#t
...

The lore link of the series v6 RESEND is above [2]. The patchwork link 
to v6 RESEND is:
https://patchwork.kernel.org/project/linux-pm/list/?series=747771&state=%2A&archive=both

Additionally, there were two follow-up clean-up patches. There were no 
review comments so far. Lore and patchwork links are:
https://lore.kernel.org/linux-pm/cover.1686948074.git.jahau@rocketmail.com/T/#t
https://patchwork.kernel.org/project/linux-pm/list/?series=758018&state=%2A&archive=both

Could you apply those three patches? (1x patch 6 of v6 RESEND series + 
2x clean-up patches.)

I've just noticed that a new patch by Rob was added to rt5033-charger. 
Can you rebase the other three patches by your own or do you want me to 
rebase and resend them?
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/power/supply/rt5033_charger.c?id=2ce8284c31156c432df60d4497ec68cca04e128f

Kind regards,
Jakob