[PATCH v6 00/14] mfd: lm3533: convert to OF bindings, improve support

Svyatoslav Ryhel posted 14 patches 2 months ago
Only 13 patches received!
.../leds/backlight/ti,lm3533-backlight.yaml   |  69 ++++
.../bindings/leds/ti,lm3533-leds.yaml         |  67 ++++
.../devicetree/bindings/leds/ti,lm3533.yaml   | 169 ++++++++
drivers/iio/light/lm3533-als.c                | 179 ++++-----
drivers/leds/leds-lm3533.c                    | 181 ++++++---
drivers/mfd/lm3533-core.c                     | 378 +++++++-----------
drivers/mfd/lm3533-ctrlbank.c                 |  33 +-
drivers/video/backlight/lm3533_bl.c           | 231 ++++++-----
include/linux/mfd/lm3533.h                    |  75 +---
9 files changed, 818 insertions(+), 564 deletions(-)
create mode 100644 Documentation/devicetree/bindings/leds/backlight/ti,lm3533-backlight.yaml
create mode 100644 Documentation/devicetree/bindings/leds/ti,lm3533-leds.yaml
create mode 100644 Documentation/devicetree/bindings/leds/ti,lm3533.yaml
[PATCH v6 00/14] mfd: lm3533: convert to OF bindings, improve support
Posted by Svyatoslav Ryhel 2 months ago
Convert LM3533 to OF bindings, add missing VIN supply, add support for
setting mapping mode and LED sources based on device tree. 

---
Changes in v2:

schema
- maximum led sources for leds set to 4
- anyOf > oneOf in ALS
- improved ALS descriptions
- adjusted example
drivers
- dropped devm convertion of irq and mfd helpers
- all als configuration moved into lm3533_als_setup
- added regulator/consumer.h
- lm3533_bl_setup set before sysfs_create_group in backlight
- added check if LVLED is valid
- LM3533_REG_OUTPUT_CONF1 > LM3533_REG_OUTPUT_CONF2 for LVLED4 and LVLED5

Changes in v3:

- ohm -> ohms
- added default PWM mask to schema
- added commit removing driver regmap wrappers
- added commits which flatten pdata helpers
- adjusted check if als->irq > 0 since als->irq can be negative if error/missing
- added count for children defined in device tree and mfd_cell is allocated
  via devm_kcalloc to be able to contain all of them
- fixed backlight boundary check
- fixed count increased unconditionally
- dev_err returns node name instead of reg value
- LM3533_MAX_CURRENT_* defines moved to common header since they are used to clamp
  current values read from the tree
- mapping mode commit splitted into 2 (sysfs logic improvement > mode from DT)
- backlight mode configuration set before sysfs group is created
- fixed LVLED check on LEDs setup
- added check if HVLED is valid
- fixed wrong err_sysfs_remove goto in lm3533_bl
- added commit implementing backlight_scale property

Changes in v4:

- fixed regmap_update_bits val and mask swap in lm3533_als_set_int_mode
- fixed als->irq check in store_thresh_either_en
- removed clamping of r_select in als driver
- added use_of_reg and of_reg for backlight and leds registration
- added intermediate step in asigning props.brightness
- fixed HVLED/LVLED configuration overwriting
- added bounds check for num_leds in leds and backlight driver
- switched to regmap_clean/set/assign/test_bits helpers where appropriate
- dropped extern from header function declartions
- switched lm3533 pointer in cell structures to regmap
- sysfs_create_group > device_add_group
- changes in backlight sysfs were expanded to all properties

Changes in v5:

- aligned driver helpers to use u32
- child nodes parsing linked with 'else if' to ensure there is one call per node
- removed redundant pwm var init for leds
- fixed regmap_test_bits return check
- fixed leds and backlight counting handling
- iterator variables made scoped
- lm3533_als_setup() set to exit after mode set if m0de is pwm

Changes in v6:

- expanded commit message in OF conversion commit
- restored original comment regarding PWM mode of ALS
- switched to FIELD_PREP macro in core for helper flattening
---

Svyatoslav Ryhel (14):
  dt-bindings: leds: Document TI LM3533 LED controller
  mfd: lm3533: Remove driver specific regmap wrappers
  mfd: lm3533: Remove extern from shared functions in the header
  mfd: lm3533: Pass only regmap and light sensor presence to child
    devices
  iio: light: lm3533-als: Remove redundant pdata helpers
  mfd: lm3533-core: Remove redundant pdata helpers
  mfd: lm3533: Use dev_groups in struct device_driver
  mfd: lm3533: Convert to use OF bindings
  mfd: lm3533: Add support for VIN power supply
  mfd: lm3533: Set DMA mask
  video: backlight: lm3533_bl: Improve logic of sysfs functions
  video: backlight: lm3533_bl: Set initial mapping mode from DT
  video: backlight: lm3533_bl: Implement backlight_scale property
  video: leds: backlight: lm3533: Support getting LED sources from DT

 .../leds/backlight/ti,lm3533-backlight.yaml   |  69 ++++
 .../bindings/leds/ti,lm3533-leds.yaml         |  67 ++++
 .../devicetree/bindings/leds/ti,lm3533.yaml   | 169 ++++++++
 drivers/iio/light/lm3533-als.c                | 179 ++++-----
 drivers/leds/leds-lm3533.c                    | 181 ++++++---
 drivers/mfd/lm3533-core.c                     | 378 +++++++-----------
 drivers/mfd/lm3533-ctrlbank.c                 |  33 +-
 drivers/video/backlight/lm3533_bl.c           | 231 ++++++-----
 include/linux/mfd/lm3533.h                    |  75 +---
 9 files changed, 818 insertions(+), 564 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/leds/backlight/ti,lm3533-backlight.yaml
 create mode 100644 Documentation/devicetree/bindings/leds/ti,lm3533-leds.yaml
 create mode 100644 Documentation/devicetree/bindings/leds/ti,lm3533.yaml

-- 
2.53.0
Re: [PATCH v6 00/14] mfd: lm3533: convert to OF bindings, improve support
Posted by Johan Hovold 2 months ago
On Fri, Jul 31, 2026 at 02:36:18PM +0300, Svyatoslav Ryhel wrote:
> Convert LM3533 to OF bindings, add missing VIN supply, add support for
> setting mapping mode and LED sources based on device tree. 
> 
> ---

> Changes in v6:
> 
> - expanded commit message in OF conversion commit
> - restored original comment regarding PWM mode of ALS
> - switched to FIELD_PREP macro in core for helper flattening

You seem to have ignored many issues pointed out in v5 so please go back
and review those comments again.

Johan
Re: [PATCH v6 00/14] mfd: lm3533: convert to OF bindings, improve support
Posted by Lee Jones 3 weeks ago
On Fri, 31 Jul 2026 14:36:18 +0300, Svyatoslav Ryhel wrote:
> Convert LM3533 to OF bindings, add missing VIN supply, add support for
> setting mapping mode and LED sources based on device tree.

Applied, thanks!

[01/14] dt-bindings: leds: Document TI LM3533 LED controller
        commit: 0747740a123b844a87f7b86977845ccaca15362b
[02/14] mfd: lm3533: Remove driver specific regmap wrappers
        commit: f022c47f4843462cd02f1163f624631f7f4e409e
[03/14] mfd: lm3533: Remove extern from shared functions in the header
        commit: 06ea59b4135ed6c999bc33daca1abf51071f5f53
[04/14] mfd: lm3533: Pass only regmap and light sensor presence to child devices
        commit: f6420210fbaf563de34c769f4a408790523bc36c
[05/14] iio: light: lm3533-als: Remove redundant pdata helpers
        commit: 948c42932e0b696de11a2aee69a81d8a6f83dd12
[06/14] mfd: lm3533-core: Remove redundant pdata helpers
        commit: cdc9de135bc4bac7b7a344e76bef8e7e6cfb3e16
[07/14] mfd: lm3533: Use dev_groups in struct device_driver
        commit: d172f3814461c91db5af71fb628601af8389a3ee
[08/14] mfd: lm3533: Convert to use OF bindings
        commit: 5669316d7055325d981b5a37f574299c848af581
[09/14] mfd: lm3533: Add support for VIN power supply
        commit: 4a2300981a68c8f6ef5c667d6f81667c4036b269
[10/14] mfd: lm3533: Set DMA mask
        commit: 95a968ec7c31d70d4e38840409c3983ca7cac937
[11/14] video: backlight: lm3533_bl: Improve logic of sysfs functions
        commit: 92992a77a4c471064cec8398310c3f9486340c16
[12/14] video: backlight: lm3533_bl: Set initial mapping mode from DT
        commit: 879dd08125dbec68ea0d5b624aa8c42175232637
[13/14] video: backlight: lm3533_bl: Implement backlight_scale property
        commit: 0077e5ed836a01a0c82f23b91afdd38e42ace8b8

--
Lee Jones [李琼斯]

Re: [PATCH v6 00/14] mfd: lm3533: convert to OF bindings, improve support
Posted by Lee Jones 3 weeks ago
On Thu, 10 Sep 2026, Lee Jones wrote:

> On Fri, 31 Jul 2026 14:36:18 +0300, Svyatoslav Ryhel wrote:
> > Convert LM3533 to OF bindings, add missing VIN supply, add support for
> > setting mapping mode and LED sources based on device tree.
> 
> Applied, thanks!
> 
> [01/14] dt-bindings: leds: Document TI LM3533 LED controller
>         commit: 0747740a123b844a87f7b86977845ccaca15362b
> [02/14] mfd: lm3533: Remove driver specific regmap wrappers
>         commit: f022c47f4843462cd02f1163f624631f7f4e409e
> [03/14] mfd: lm3533: Remove extern from shared functions in the header
>         commit: 06ea59b4135ed6c999bc33daca1abf51071f5f53
> [04/14] mfd: lm3533: Pass only regmap and light sensor presence to child devices
>         commit: f6420210fbaf563de34c769f4a408790523bc36c
> [05/14] iio: light: lm3533-als: Remove redundant pdata helpers
>         commit: 948c42932e0b696de11a2aee69a81d8a6f83dd12
> [06/14] mfd: lm3533-core: Remove redundant pdata helpers
>         commit: cdc9de135bc4bac7b7a344e76bef8e7e6cfb3e16
> [07/14] mfd: lm3533: Use dev_groups in struct device_driver
>         commit: d172f3814461c91db5af71fb628601af8389a3ee
> [08/14] mfd: lm3533: Convert to use OF bindings
>         commit: 5669316d7055325d981b5a37f574299c848af581
> [09/14] mfd: lm3533: Add support for VIN power supply
>         commit: 4a2300981a68c8f6ef5c667d6f81667c4036b269
> [10/14] mfd: lm3533: Set DMA mask
>         commit: 95a968ec7c31d70d4e38840409c3983ca7cac937
> [11/14] video: backlight: lm3533_bl: Improve logic of sysfs functions
>         commit: 92992a77a4c471064cec8398310c3f9486340c16
> [12/14] video: backlight: lm3533_bl: Set initial mapping mode from DT
>         commit: 879dd08125dbec68ea0d5b624aa8c42175232637
> [13/14] video: backlight: lm3533_bl: Implement backlight_scale property
>         commit: 0077e5ed836a01a0c82f23b91afdd38e42ace8b8

Submitted for build testing.

I'll send out a pull-request once that passes.

Note to self: ib-mfd-backlight-iio-leds-7.4

-- 
Lee Jones
[GIT PULL] Immutable branch between MFD, Backlight, IIO and LEDs due for the v7.4 merge window
Posted by Lee Jones 3 weeks ago
Enjoy!

The following changes since commit cee9395acd8043be0644b25c34bfa86623f2b935:

  Linux 7.3-rc1 (2026-08-30 13:34:40 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-backlight-iio-leds-v7.4

for you to fetch changes up to 0077e5ed836a01a0c82f23b91afdd38e42ace8b8:

  video: backlight: lm3533_bl: Implement backlight_scale property (2026-09-10 15:02:16 +0100)

----------------------------------------------------------------
Immutable branch between MFD, Backlight, IIO and LEDs due for the v7.4 merge window

----------------------------------------------------------------
Svyatoslav Ryhel (13):
      dt-bindings: leds: Document TI LM3533 LED controller
      mfd: lm3533: Remove driver specific regmap wrappers
      mfd: lm3533: Remove extern from shared functions in the header
      mfd: lm3533: Pass only regmap and light sensor presence to child devices
      iio: light: lm3533-als: Remove redundant pdata helpers
      mfd: lm3533-core: Remove redundant pdata helpers
      mfd: lm3533: Use dev_groups in struct device_driver
      mfd: lm3533: Convert to use OF bindings
      mfd: lm3533: Add support for VIN power supply
      mfd: lm3533: Set DMA mask
      video: backlight: lm3533_bl: Improve logic of sysfs functions
      video: backlight: lm3533_bl: Set initial mapping mode from DT
      video: backlight: lm3533_bl: Implement backlight_scale property

 .../leds/backlight/ti,lm3533-backlight.yaml        |  69 ++++
 .../devicetree/bindings/leds/ti,lm3533-leds.yaml   |  67 ++++
 .../devicetree/bindings/leds/ti,lm3533.yaml        | 169 +++++++++
 drivers/iio/light/lm3533-als.c                     | 185 +++++-----
 drivers/leds/leds-lm3533.c                         | 121 +++----
 drivers/mfd/lm3533-core.c                          | 386 ++++++++-------------
 drivers/mfd/lm3533-ctrlbank.c                      |  33 +-
 drivers/video/backlight/lm3533_bl.c                | 188 +++++-----
 include/linux/mfd/lm3533.h                         |  77 +---
 9 files changed, 722 insertions(+), 573 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/leds/backlight/ti,lm3533-backlight.yaml
 create mode 100644 Documentation/devicetree/bindings/leds/ti,lm3533-leds.yaml
 create mode 100644 Documentation/devicetree/bindings/leds/ti,lm3533.yaml

-- 
Lee Jones