Commit Graph

2218 Commits

Author SHA1 Message Date
Bartosz Golaszewski
d9d87d90cc treewide: rename GPIO set callbacks back to their original names
The conversion of all GPIO drivers to using the .set_rv() and
.set_multiple_rv() callbacks from struct gpio_chip (which - unlike their
predecessors - return an integer and allow the controller drivers to
indicate failures to users) is now complete and the legacy ones have
been removed. Rename the new callbacks back to their original names in
one sweeping change.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-08-07 10:07:06 +02:00
Linus Torvalds
831462ff3e LEDs for for v6.17
- Improvements & Fixes
   * A fix has been implemented in QCOM Flash to prevent incorrect register
     access when the driver is re-bound. This is solved by duplicating a static
     register array during the probe function, which prevents register addresses
     from being miscalculated after multiple binds.
   * The LP50xx driver now correctly handles the 'reg' property in device tree
     child nodes to ensure the multi_index is set correctly. This prevents
     issues where LEDs could be controlled incorrectly if the device tree nodes
     were processed in a different order. An error is returned if the reg
     property is missing or out of range.
   * A Kconfig dependency on between TPS6131x and V4L2_FLASH_LED_CLASS has been
     added to prevent a build failure when the driver is built-in and the V4L2
     flash infrastructure is a loadable module.
   * A potential buffer overflow warning in PCA955x was reported by older GCC
     versions has been fixed by using a more precise format specifier when
     creating the default LED label.
 
 - Cleanups & Refactoring
   * The MAINTAINERS file entry for the TPS6131X flash LED driver has been
     corrected to point to the correct device tree binding file name.
   * A comment in the Flash Class for the flash_timeout setter has been
     corrected to "flash timeout" from "flash duration" for accuracy.
   * The of_led_get() function is no longer exported as it has no users
     outside of its own module.
 
 - Removals
   * The commit to configure LED blink intervals for hardware offload in the
     Netdev Trigger has been reverted. This change was found to break existing
     PHY drivers by putting their LEDs into a permanent, unconditional blinking
     state.
 
 - Device Tree Bindings Updates
   * The binding for LP50xx has been updated to document that the child reg
     property is the index within the LED bank. The example was also updated to
     use correct values.
   * The JNCP5623 binding has been updated to add 0x39 as a valid I2C address,
     as it is used by the NCP5623C variant.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmiKNSgACgkQUa+KL4f8
 d2GwyA//QyWJVRmx3iK64MWnMVHZxuFdXcilYXtYFGPdQNj/aqB51X8XeUDlpfDR
 9YU9m+MZZJv4ku+BJNWMmilsOZmCSd2L0SjNcvg4EBagE7uCRGlc/zhSYQT99f4H
 VvVTNRLaiY2JS4cLt5hQFccWSFFuVpHaDDr8lU6MnogPoUWm31PLP9oyjQZdw/3s
 cEsSge6xhjQ48HLudp8t4o+OYt7SsiwGwua5dgLm65Cihiv2jI3c6xpTXsvk23Go
 oIXpYRsUnPOh2FBhiBQYtwY4mtbfPL2EjfRBXoH8wPelVF+rqufwClp4GxolcbwR
 VH9Xy1MtzW4Qe9SCV8t1UtsjzmGz1J+rO3NMCnGfYpCCwlrW0664P1tU90UDz7Uf
 W8b5brD7tbJkW+29qfbxeCZE6hSYHqDh+0p+BLvQiN3Onv7xqozW1ODdVpAEjhLe
 0okvY3WCkf0+dn08FVkQYuAmXQwYmKM2ylqr8LOlL/ESOK9vipEf48wRwPwm42VA
 kDqdgy0J9N00sSD/iHXBHj6DjXVjjtrfJiOVLicfmRgTCPpm3UasPA9K7sVj5hZ3
 TjDPPSY0MrTazMFf5AX7Q0nLEe/K7ZXK44xIn0pWw+loycmhrHNbFrcxS6D/BYV+
 zkauHl/SKprLiVXWLYvyWjxLweHDO3LhKFjUQ6cOn+YZRdz5rSY=
 =+8ND
 -----END PGP SIGNATURE-----

Merge tag 'leds-next-6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds

Pull LED updates from Lee Jones:
 "Improvements & Fixes:

   - A fix for QCOM Flash to prevent incorrect register access when the
     driver is re-bound. This is solved by duplicating a static register
     array during the probe function, which prevents register addresses
     from being miscalculated after multiple binds

   - The LP50xx driver now correctly handles the 'reg' property in
     device tree child nodes to ensure the multi_index is set correctly.
     This prevents issues where LEDs could be controlled incorrectly if
     the device tree nodes were processed in a different order. An error
     is returned if the reg property is missing or out of range

   - Add a Kconfig dependency on between TPS6131x and
     V4L2_FLASH_LED_CLASS to prevent a build failure when the driver is
     built-in and the V4L2 flash infrastructure is a loadable module

   - Fix a potential buffer overflow warning in PCA955x reported by
     older GCC versions by using a more precise format specifier when
     creating the default LED label.

  Cleanups & Refactoring:

   - Correct the MAINTAINERS file entry for the TPS6131X flash LED
     driver to point to the correct device tree binding file name

   - Fix a comment in the Flash Class for the flash_timeout setter to
     "flash timeout" from "flash duration" for accuracy

   - The of_led_get() function is no longer exported as it has no users
     outside of its own module.

  Removals:

   - Revert the commit to configure LED blink intervals for hardware
     offload in the Netdev Trigger. This change was found to break
     existing PHY drivers by putting their LEDs into a permanent,
     unconditional blinking state.

  Device Tree Bindings Updates:

   - Update the binding for LP50xx to document that the child reg
     property is the index within the LED bank. The example was also
     updated to use correct values

   - Update the JNCP5623 binding to add 0x39 as a valid I2C address, as
     it is used by the NCP5623C variant"

* tag 'leds-next-6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds:
  dt-bindings: leds: ncp5623: Add 0x39 as a valid I2C address
  Revert "leds: trigger: netdev: Configure LED blink interval for HW offload"
  leds: pca955x: Avoid potential overflow when filling default_label (take 2)
  leds: Unexport of_led_get()
  leds: tps6131x: Add V4L2_FLASH_LED_CLASS dependency
  dt-bindings: leds: lp50xx: Document child reg, fix example
  leds: leds-lp50xx: Handle reg to get correct multi_index
  leds: led-class-flash:: Fix flash_timeout comment
  MAINTAINERS: Adjust file entry in TPS6131X FLASH LED DRIVER
  leds: flash: leds-qcom-flash: Fix registry access after re-bind
2025-07-31 11:54:01 -07:00
Linus Torvalds
72b8944f14 Locking updates for v6.16:
Locking primitives:
 
   - Mark devm_mutex_init() as __must_check and fix drivers
     that didn't check the return code. (Thomas Weißschuh)
 
   - Reorganize <linux/local_lock.h> to better expose the
     internal APIs to local variables. (Sebastian Andrzej Siewior)
 
   - Remove OWNER_SPINNABLE in rwsem (Jinliang Zheng)
 
   - Remove redundant #ifdefs in the mutex code (Ran Xiaokai)
 
 Lockdep:
 
   - Avoid returning struct in lock_stats() (Arnd Bergmann)
 
   - Change `static const` into enum for LOCKF_*_IRQ_*
     (Arnd Bergmann)
 
   - Temporarily use synchronize_rcu_expedited() in
     lockdep_unregister_key() to speed things up.
     (Breno Leitao)
 
 Rust runtime:
 
   - Add #[must_use] to Lock::try_lock() (Jason Devers)
 
 Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmiIbzURHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1gxlRAAsnrbMN1yUbGbOh2fr7eQh69nn4VLZhvQ
 n/Q2+ZpvgBQiPhUnYub4n0B03pO6lQO+taiAQ9WTK6VHi7kzIKIx0MPWP5KV9FCY
 NQKQCmRccese0mmWVYccLPjyk6GW8l5gIhRK1vuEYANtLf/XLBYB/ygvE6a8ywNz
 dmt7IzYOIknCuEtapDzcJLBZFHG9mVTT8Kk2A5aqn+XCrxNnKrYyVOH0qw395uBw
 ulVKPJT7FGQ4qLkxfYguNWH5V1ZneN53tJouwqcM7Xpc+ookQFAZel0xlfWpVu+A
 Q2WF3W8GOrS7ER9RzjG0SQF4qYBq60yKPZr3przmjCJFRgFdvEkMEIDvbirl0Gfv
 Y04hMIcovsnh8x0iLTYxkrRxlZB/7jm5uLVJ1B6E19iYBXq1HCPkM51XugDQFxwz
 fDSLblpRZLf9OoWT9NPiiQXpoSLigwOiFdiGimIMQHRbPKCujF2T9w4XpKLLECN4
 UbYGMx/yAGdkTXelSStyru0ZLYhvxP2XMAaUJoMBrjI1ReL2e58Vmp2MqQcuhiuU
 PV5NEt0qhBAjilUrP+vuM/27UihPxcBrVgvriT+wDVrrPiy1t5iJVOKxFcrkbMto
 B+XHFA7z1EglkwGD7HCdoOFU8V3PM6+GNDMqvs5Ey3tifqampEssmYcP3YA6QYBt
 eO7imScWtII=
 =RExf
 -----END PGP SIGNATURE-----

Merge tag 'locking-core-2025-07-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking updates from Ingo Molnar:
 "Locking primitives:

   - Mark devm_mutex_init() as __must_check and fix drivers that didn't
     check the return code (Thomas Weißschuh)

   - Reorganize <linux/local_lock.h> to better expose the internal APIs
     to local variables (Sebastian Andrzej Siewior)

   - Remove OWNER_SPINNABLE in rwsem (Jinliang Zheng)

   - Remove redundant #ifdefs in the mutex code (Ran Xiaokai)

  Lockdep:

   - Avoid returning struct in lock_stats() (Arnd Bergmann)

   - Change `static const` into enum for LOCKF_*_IRQ_* (Arnd Bergmann)

   - Temporarily use synchronize_rcu_expedited() in
     lockdep_unregister_key() to speed things up. (Breno Leitao)

  Rust runtime:

   - Add #[must_use] to Lock::try_lock() (Jason Devers)"

* tag 'locking-core-2025-07-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  lockdep: Speed up lockdep_unregister_key() with expedited RCU synchronization
  locking/mutex: Remove redundant #ifdefs
  locking/lockdep: Change 'static const' variables to enum values
  locking/lockdep: Avoid struct return in lock_stats()
  locking/rwsem: Use OWNER_NONSPINNABLE directly instead of OWNER_SPINNABLE
  rust: sync: Add #[must_use] to Lock::try_lock()
  locking/mutex: Mark devm_mutex_init() as __must_check
  leds: lp8860: Check return value of devm_mutex_init()
  spi: spi-nxp-fspi: Check return value of devm_mutex_init()
  local_lock: Move this_cpu_ptr() notation from internal to main header
2025-07-29 18:11:32 -07:00
Daniel Golle
26f732791f Revert "leds: trigger: netdev: Configure LED blink interval for HW offload"
This reverts commit c629c972b3.

While .led_blink_set() would previously put an LED into an unconditional
permanently blinking state, the offending commit now uses same operation
to (also?) set the blink timing of the netdev trigger when offloading.

This breaks many if not all of the existing PHY drivers which offer
offloading LED operations, as those drivers would just put the LED into
blinking state after .led_blink_set() has been called.

Unfortunately the change even made it into stable kernels for unknown
reasons, so it should be reverted there as well.

Fixes: c629c972b3 ("leds: trigger: netdev: Configure LED blink interval for HW offload")
Link: https://lore.kernel.org/linux-leds/c6134e26-2e45-4121-aa15-58aaef327201@lunn.ch/T/#m9d6fe81bbcb273e59f12bbedbd633edd32118387
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/6dcc77ee1c9676891d6250d8994850f521426a0f.1752334655.git.daniel@makrotopia.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-07-18 14:26:32 +01:00
Thomas Weißschuh
3b07bb900a leds: lp8860: Check return value of devm_mutex_init()
devm_mutex_init() can fail. With CONFIG_DEBUG_MUTEXES=y the mutex will be
marked as unusable and trigger errors on usage.

Add the missed check.

Fixes: 87a59548af ("leds: lp8860: Use new mutex guards to cleanup function exits")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Andrew Davis <afd@ti.com>
Acked-by: Lee Jones <lee@kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://lore.kernel.org/r/20250617-must_check-devm_mutex_init-v7-2-d9e449f4d224@weissschuh.net
2025-07-11 15:11:19 -07:00
Andy Shevchenko
239afba8b9 leds: pca955x: Avoid potential overflow when filling default_label (take 2)
GCC compiler v8.5.0 is not happy about printing
into a too short buffer (when build with `make W=1`):

  drivers/leds/leds-pca955x.c:696:5: note: 'snprintf' output between 2 and 11 bytes into a destination of size 8

Unfortunately this is a false positive from the old GCC versions,
but we may still improve the code by using '%hhu' format specifier
and reduce buffer size by 4 bytes.

Fixes: bd3d149329 ("leds: pca955x: Avoid potential overflow when filling default_label")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506282159.TXfvorYl-lkp@intel.com/
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250630093906.1715800-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-07-02 17:18:44 +01:00
Andy Shevchenko
cb335325b1 leds: Unexport of_led_get()
There are no users outside the module.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250630092639.1574860-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-07-02 17:18:01 +01:00
Arnd Bergmann
c3c38e8001 leds: tps6131x: Add V4L2_FLASH_LED_CLASS dependency
This driver can optionally use the v4l2_flash infrastructure, but fails to
link built=in if that is in a loadable module:

ld.lld-21: error: undefined symbol: v4l2_flash_release
>>> referenced by leds-tps6131x.c:792 (drivers/leds/flash/leds-tps6131x.c:792)

Add the usual Kconfig dependency for it, still allowing it to be built when
CONFIG_V4L2_FLASH_LED_CLASS is disabled.

Fixes: b338a2ae9b ("leds: tps6131x: Add support for Texas Instruments TPS6131X flash LED driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20250620114440.4080938-1-arnd@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-07-01 14:26:03 +01:00
Johan Adolfsson
2e84a5e537 leds: leds-lp50xx: Handle reg to get correct multi_index
mc_subled used for multi_index needs well defined array indexes,
to guarantee the desired result, use reg for that.

If devicetree child nodes is processed in random or reverse order
you may end up with multi_index "blue green red" instead of the expected
"red green blue".
If user space apps uses multi_index to deduce how to control the leds
they would most likely be broken without this patch if devicetree
processing is reversed (which it appears to be).

arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts has reg set
but I don't see how it can have worked without this change.

If reg is not set, an error is returned,
If reg is out of range, an error is returned.
reg within led child nodes starts with 0, to map to the iout in each bank.

Signed-off-by: Johan Adolfsson <johan.adolfsson@axis.com>
Reviewed-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Link: https://lore.kernel.org/r/20250617-led-fix-v7-1-cdbe8efc88fa@axis.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-06-27 13:58:31 +01:00
Thomas Weißschuh
fb506e31b3 sysfs: treewide: switch back to attribute_group::bin_attrs
The normal bin_attrs field can now handle const pointers.
This makes the _new variant unnecessary.
Switch all users back.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250530-sysfs-const-bin_attr-final-v3-4-724bfcf05b99@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-17 10:44:15 +02:00
Krzysztof Kozlowski
fab15f5736 leds: flash: leds-qcom-flash: Fix registry access after re-bind
Driver in probe() updates each of 'reg_field' with 'reg_base':

	for (i = 0; i < REG_MAX_COUNT; i++)
		regs[i].reg += reg_base;

'reg_field' array (under variable 'regs' above) is statically allocated,
thus each re-bind would add another 'reg_base' leading to bogus
register addresses.  Constify the local 'reg_field' array and duplicate
it in probe to solve this.

Fixes: 96a2e242a5 ("leds: flash: Add driver to support flash LED module in QCOM PMICs")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250529063335.8785-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-06-13 14:41:34 +01:00
Ingo Molnar
41cb08555c treewide, timers: Rename from_timer() to timer_container_of()
Move this API to the canonical timer_*() namespace.

[ tglx: Redone against pre rc1 ]

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/aB2X0jCKQO56WdMt@gmail.com
2025-06-08 09:07:37 +02:00
Linus Torvalds
a9dfb7db96 Backlight for v6.16
* Framebuffer Subsystem (fbdev):
     * The display's blanking status is now tracked in `struct fb_info`
     * `framebuffer_alloc()` initializes the blank state to `FB_BLANK_UNBLANK`
     * `register_framebuffer()` sets the state to `FB_BLANK_POWERDOWN` if an `fb_blank`
       callback exists, ensuring `FB_EVENT_BLANK` listeners correctly see the display
       being turned on during the first modeset
     * The `FB_EVENT_BLANK` event data now includes both the new and the old blank states
   * Qualcomm WLED Backlight:
     * Added a NULL check after `devm_kasprintf()` in `wled_configure()` to prevent a
       potential NULL pointer dereference if memory allocation fails
 
   * Framebuffer Subsystem (fbdev):
     * `fb_blank()` has been reworked to return early on errors, without functional
       changes, in preparation for further state tracking improvements
     * Fbdev now calls dedicated functions in the backlight subsystems to notify them
       of blank state changes, instead of relying on fbdev event notifiers
     * For LCDs, fbdev also calls a dedicated function to notify of mode changes
   * Backlight Subsystem:
     * Implemented fbdev blank state tracking using the (newly enhanced) blank state
       information provided directly by `FB_EVENT_BLANK`
     * Removed internal blank state tracking fields (`fb_bl_on`) from
       `struct backlight_device`
     * Moved the handling of blank-state updates into a separate internal helper
       function, `backlight_notify_blank()`
     * Removed support for fbdev events and replaced it with a dedicated function call
       interface (`backlight_notify_blank()` and `backlight_notify_blank_all()`) for
       display drivers to update backlight status
   * LCD Subsystem:
     * Moved the handling of display updates (blank events and mode changes) from
       fbdev event notifiers to separate internal helper functions (`lcd_notify_blank`,
       `lcd_notify_mode_change`)
     * Removed support for fbdev events and replaced it with dedicated function call
       interfaces (`lcd_notify_blank_all()`, `lcd_notify_mode_change_all()`)
     * The LCD subsystem now maintains its own internal list of LCD devices instead of
       relying on fbdev notifiers
   * LED Backlight Trigger:
     * Moved the handling of blank-state updates into a separate internal helper,
       `ledtrig_backlight_notify_blank()`
     * Removed support for fbdev events and replaced it with a dedicated function call,
       `ledtrig_backlight_blank()`, for fbdev to notify trigger of blank state changes
     * The LED backlight trigger now maintains its own internal list of triggers
       instead of relying on fbdev notifiers
 
   * Framebuffer Subsystem (fbdev):
     * Removed the definitions for the unused fbdev event constants
       `FB_EVENT_MODE_CHANGE` and `FB_EVENT_BLANK` from the header file
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmg+xqwACgkQUa+KL4f8
 d2EIgA//SGigE46rNLd1+s87V4latrf672BtTs+2sioAGY7f9nzEdntMjk7o9/2G
 U//hJXP2Qr5WLdPVUQOi2ZZUMCks7sMgVx0KfCFiiYW8W0Vwhvl+17ZF3HLOqCCf
 JdQ9m69B1ubdAuyxD91ad84lofZtYEjDw/gK95gNrTaLhx4s/T5G9MrDU+qlZs3y
 npDhrnoQCclFcawSSDDhTUjiRcJFs3V1h3jUGi0Pz8PL1K/maR4fwgvw4ovkDjsR
 5on6cBjpuQoxz1KqlauuSc6OKWZUq8OHrFl7T9YIbn5ACuq2z47XBO0uluCJjrip
 MLvDCpxb7BcDRwcKDMZff6PWJMm4czVnNMgeGlQIUeIvZ/oD4CLCbas9BRYLiDpG
 jIzQOk7TSLiZaPwZFNoxRMJFKdC63K9+dLmncpKuAGf9Lh7fYdDv2Ch605zy1Zxf
 wumU9Bw2rj32iLaIUrsQHN6liIj41tHocRJHOUDkKb2fqzxq17+6NAe2qriRMHoS
 n4Mp+FmKUeBothw5bgRUKRZP4ff8stM0mCDL7ChKxNqJi4Wal8ok+hg3jhNZfW+O
 8ulSwrhJW/hjLrW29RyQIyB2Bz19H4/ZKdRjxfHgWgUdXQZLH5zBhtE0IISbdrBC
 FiRtrDyeWN1btvatEp4CKeKi6gEO+ZktxsFr5Zi7IYIN685iyug=
 =jhYi
 -----END PGP SIGNATURE-----

Merge tag 'backlight-next-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight

Pull backlight updates from Lee Jones:
 "Framebuffer Subsystem (fbdev):
   - The display's blanking status is now tracked in 'struct fb_info'
   - 'framebuffer_alloc()' initializes the blank state to FB_BLANK_UNBLANK
   - 'register_framebuffer()' sets the state to 'FB_BLANK_POWERDOWN' if
     an 'fb_blank' callback exists, ensuring 'FB_EVENT_BLANK' listeners
     correctly see the display being turned on during the first modeset
   - The 'FB_EVENT_BLANK' event data now includes both the new and the
     old blank states
   - 'fb_blank()' has been reworked to return early on errors, without
     functional changes, in preparation for further state tracking
     improvements
   - Fbdev now calls dedicated functions in the backlight subsystems to
     notify them of blank state changes, instead of relying on fbdev
     event notifiers
   - For LCDs, fbdev also calls a dedicated function to notify of mode
     changes
   - Removed the definitions for the unused fbdev event constants
     'FB_EVENT_MODE_CHANGE' and 'FB_EVENT_BLANK' from the header file

  Backlight Subsystem:
   - Implemented fbdev blank state tracking using the (newly enhanced)
     blank state information provided directly by 'FB_EVENT_BLANK'
   - Removed internal blank state tracking fields ('fb_bl_on') from
     'struct backlight_device'
   - Moved the handling of blank-state updates into a separate internal
     helper function, 'backlight_notify_blank()'
   - Removed support for fbdev events and replaced it with a dedicated
     function call interface ('backlight_notify_blank()' and
     'backlight_notify_blank_all()') for display drivers to update
     backlight status

  LCD Subsystem:
   - Moved the handling of display updates (blank events and mode
     changes) from fbdev event notifiers to separate internal helper
     functions ('lcd_notify_blank',
     'lcd_notify_mode_change')
   - Removed support for fbdev events and replaced it with dedicated
     function call interfaces ('lcd_notify_blank_all()',
     'lcd_notify_mode_change_all()')
   - The LCD subsystem now maintains its own internal list of LCD
     devices instead of relying on fbdev notifiers

  LED Backlight Trigger:
   - Moved the handling of blank-state updates into a separate internal
     helper, 'ledtrig_backlight_notify_blank()'
   - Removed support for fbdev events and replaced it with a dedicated
     function call, 'ledtrig_backlight_blank()', for fbdev to notify
     trigger of blank state changes
   - The LED backlight trigger now maintains its own internal list of
     triggers instead of relying on fbdev notifiers

  Qualcomm WLED Backlight:
   - Added a NULL check after 'devm_kasprintf()' in 'wled_configure()'
     to prevent a potential NULL pointer dereference if memory
     allocation fails"

* tag 'backlight-next-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
  backlight: pm8941: Add NULL check in wled_configure()
  fbdev: Remove constants of unused events
  leds: backlight trigger: Replace fb events with a dedicated function call
  leds: backlight trigger: Move blank-state handling into helper
  backlight: lcd: Replace fb events with a dedicated function call
  backlight: lcd: Move event handling into helpers
  backlight: Replace fb events with a dedicated function call
  backlight: Move blank-state handling into helper
  backlight: Implement fbdev tracking with blank state from event
  fbdev: Send old blank state in FB_EVENT_BLANK
  fbdev: Track display blanking state
  fbdev: Rework fb_blank()
2025-06-03 12:52:25 -07:00
Matthias Fend
b338a2ae9b leds: tps6131x: Add support for Texas Instruments TPS6131X flash LED driver
The TPS61310/TPS61311 is a flash LED driver with I2C interface. Its power
stage is capable of supplying a maximum total current of roughly 1500mA.
The TPS6131x provides three constant-current sinks, capable of sinking up
to 2 x 400mA (LED1 and LED3) and 800mA (LED2) in flash mode. In torch mode
each sink (LED1, LED2, LED3) supports currents up to 175mA.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
Link: https://lore.kernel.org/r/20250514-leds-tps6131x-v5-2-a4fb9e7f2c47@emfend.at
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-22 09:24:51 +01:00
Richard Leitner
6a09ae8281 leds: flash: Add support for flash/strobe duration
Add support for the new V4L2_CID_FLASH_DURATION control to the LEDs
driver.

Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
Link: https://lore.kernel.org/r/20250507-ov9282-flash-strobe-v4-2-72b299c1b7c9@linux.dev
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:25:09 +01:00
Christophe JAILLET
f1c86ab986 leds: rgb: leds-mt6370-rgb: Improve definition of some struct linear_range
Use LINEAR_RANGE() instead of hand-writing it. It is more robust, should
the layout of the structure change one day.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/1ce4245107e0a51dce502a007a69899bda018d5f.1746197460.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:25:08 +01:00
Lee Jones
cfa40f29df leds: led-test: Provide tests for the lookup and get infrastructure
This API allows providers to offer an specific LED to be looked-up by a
consumer.  Consumers are then able to describe the aforementioned LED
and take a reference on it.

For convenience, we're testing both sides of the API in just one test
function here.  In reality, both the provider and the consumer would be
logistically orthogonal.

CMD:
  tools/testing/kunit/kunit.py run --kunitconfig drivers/leds

RESULTS:
  [16:38:57] Configuring KUnit Kernel ...
  [16:38:57] Building KUnit Kernel ...
  Populating config with:
  $ make ARCH=um O=.kunit olddefconfig
  Building with:
  $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=20
  [16:39:02] Starting KUnit Kernel (1/1)...
  [16:39:02] ============================================================
  Running tests with:
  $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
  [16:39:03] ===================== led (2 subtests) =====================
  [16:39:03] [PASSED] led_test_class_register
  [16:39:03] [PASSED] led_test_class_add_lookup_and_get
  [16:39:03] ======================= [PASSED] led =======================
  [16:39:03] ============================================================
  [16:39:03] Testing complete. Ran 2 tests: passed: 2
  [16:39:03] Elapsed time: 6.255s total, 0.001s configuring, 5.131s building, 1.106s running

Link: https://lore.kernel.org/r/20250501081918.3621432-3-lee@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:25:07 +01:00
Lee Jones
eb58933b78 leds: led-test: Fill out the registration test to cover more test cases
Upon successful LED class device registration, it is expected that
certain attributes are filled out in pre-defined ways.  For instance, if
provided, the .brightness_get() call-back should be called to populate
the class device 'brightness' attribute, 'max_brightness' should be
initialised as LED_FULL (at least until we can rid these pesky enums)
and the sysfs group should be created with the class device name
supplied by the caller.

If subsequent registrations take place that would result in name
conflicts, various outcomes are expected depending on which flags are
set.  If LED_REJECT_NAME_CONFLICT is disabled, registration should
succeed resulting in an iteration on the provided name.  Conversely, if
it's enabled, then registration is expected to fail outright.

We test for all of these scenarios here.

Link: https://lore.kernel.org/r/20250501081918.3621432-2-lee@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:25:06 +01:00
Lee Jones
1d7f25483c leds: led-test: Remove standard error checking after KUNIT_ASSERT_*()
If a KUNIT_ASSERT_*() call ends up in an assertion, the test is marked
as a failure and the subsequent error checking is never executed, making
it superfluous.  Remove it for simplicity and to avoid confusion.

Link: https://lore.kernel.org/r/20250501081918.3621432-1-lee@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:25:05 +01:00
Jesse Karjalainen
b441b95a59 leds: pca995x: Fix typo in pca995x_of_match's of_device_id entry
Remove the stray space between the '.' and the 'data' field name in
the PCA995x device-tree match table.

Signed-off-by: Jesse Karjalainen <jesse@ponkila.com>
Link: https://lore.kernel.org/r/20250426020454.47059-1-jesse@ponkila.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:25:04 +01:00
Lee Jones
5039a33fed leds: Provide skeleton KUnit testing for the LEDs framework
Apply a very basic implementation of KUnit LED testing.

More tests / use-cases will be added steadily over time.

CMD:
  tools/testing/kunit/kunit.py run --kunitconfig drivers/leds

OUTPUT:
  [15:34:19] Configuring KUnit Kernel ...
  [15:34:19] Building KUnit Kernel ...
  Populating config with:
  $ make ARCH=um O=.kunit olddefconfig
  Building with:
  $ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=20
  [15:34:22] Starting KUnit Kernel (1/1)...
  [15:34:22] ============================================================
  Running tests with:
  $ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
  [15:34:23] ===================== led (1 subtest) ======================
  [15:34:23] [PASSED] led_test_class_register
  [15:34:23] ======================= [PASSED] led =======================
  [15:34:23] ============================================================
  [15:34:23] Testing complete. Ran 1 tests: passed: 1
  [15:34:23] Elapsed time: 4.268s total, 0.001s configuring, 3.048s building, 1.214s running

Link: https://lore.kernel.org/r/20250424144544.1438584-1-lee@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:25:02 +01:00
Bartosz Golaszewski
d1d3205730 leds: tca6507: Use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-leds-v1-4-2f42d8fbb525@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:25:01 +01:00
Bartosz Golaszewski
e1cc2c8cc7 leds: pca9532: Use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-leds-v1-3-2f42d8fbb525@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:25:00 +01:00
Bartosz Golaszewski
2aafd2e41c leds: pca955x: Use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-leds-v1-2-2f42d8fbb525@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:59 +01:00
Bartosz Golaszewski
ee08ec51a0 leds: lgm-sso: Use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-leds-v1-1-2f42d8fbb525@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:58 +01:00
Krzysztof Kozlowski
4c6c3ca07b leds: Do not enable by default during compile testing
Enabling the compile test should not cause automatic enabling of all
drivers, but only allow to choose to compile them.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250417074656.81626-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:58 +01:00
Marek Behún
f9a2eacb91 leds: turris-omnia: Drop commas in the terminator entries
Drop commas in terminator entries of `struct attribute` array and
`struct of_device_id` array.

Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://lore.kernel.org/r/20250417070507.24929-1-kabel@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:57 +01:00
Andrew Davis
982e0f0425 leds: lp8860: Disable GPIO with devm action
This helps prevent mistakes like disable out of order in cleanup functions
and forgetting to free on error paths (as was done here).

This was the last thing the .remove() function did, so remove that too.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20250407183555.409687-6-afd@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:56 +01:00
Andrew Davis
e0b95ba33c leds: lp8860: Only unlock in lp8860_unlock_eeprom()
Locking is a single register write, so no need to have the unlock
function also lock. This removes the need to pass in the option
and reduces the nesting level in the function.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20250407183555.409687-5-afd@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:55 +01:00
Andrew Davis
b0d6394094 leds: lp8860: Enable regulator using enable_optional helper
This allows the regulator to be optional which is the same as
done here with all the checks for NULL. This also disables
on remove for us, so remove the manual disabling.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20250407183555.409687-4-afd@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:54 +01:00
Andrew Davis
0cb55e16bd leds: lp8860: Remove default regs when not caching
If we are not using regmap caches, then the value will be read
in every time, having a default value does not change anything in
that case. Remove the unused defaults.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20250407183555.409687-3-afd@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:53 +01:00
Andrew Davis
87a59548af leds: lp8860: Use new mutex guards to cleanup function exits
Use scoped mutex guards to simplify return paths. While here use
devm_mutex_init() to register the muxex so it also is cleaned
up automatically.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20250407183555.409687-2-afd@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:52 +01:00
Andrew Davis
4bab18dcb4 leds: lp8860: Use regmap_multi_reg_write for EEPROM writes
This helper does the same thing as manual looping, use it instead.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20250407183555.409687-1-afd@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:51 +01:00
Andy Shevchenko
bd3d149329 leds: pca955x: Avoid potential overflow when filling default_label
GCC compiler (Debian 14.2.0-17) is not happy about printing
into a too short buffer (when build with `make W=1`):

  drivers/leds/leds-pca955x.c:554:33: note: ‘snprintf’ output between 2 and 12 bytes into a destination of size 8

Indeed, the buffer size is chosen based on some assumptions,
while in general the assigned value might not fit (GCC can't
prove it does).

Fix this by changing the bits field in the struct pca955x_chipdef to u8,
with a positive side effect of the better memory footprint, and convert
loop iterator to be unsigned. With that done, update format specifiers
accordingly.

In one case join back string literal as it improves the grepping over the code
based on the message and remove duplicating information (the driver name is
printed as pert of the dev_*() output [1]) as we touch the same line anyway.

Link: https://lore.kernel.org/r/4ac527f2-c59e-70a2-efd4-da52370ea557@dave.eu/ [1]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250407151441.706378-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:51 +01:00
Sven Schwermer
e35ca991a7 leds: multicolor: Fix intensity setting while SW blinking
When writing to the multi_intensity file, don't unconditionally call
led_set_brightness. By only doing this if blinking is inactive we
prevent blinking from stopping if the blinking is in its off phase while
the file is written.

Instead, if blinking is active, the changed intensity values are applied
upon the next blink. This is consistent with changing the brightness on
monochrome LEDs with active blinking.

Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Tobias Deiminger <tobias.deiminger@linutronix.de>
Tested-by: Sven Schuchmann <schuchmann@schleissheimer.de>
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
Link: https://lore.kernel.org/r/20250404184043.227116-1-sven@svenschwermer.de
Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-14 09:24:45 +01:00
Gustavo A. R. Silva
b2661df9fe leds: leds-cros_ec: Avoid -Wflex-array-member-not-at-end warning
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Replace an on-stack definition of a flexible structure with a call
to utility function cros_ec_cmd().

So, with these changes, fix the following warning:

drivers/leds/leds-cros_ec.c:70:40: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Acked-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/Z-rKcgFjsyKvd58q@kspp
Signed-off-by: Lee Jones <lee@kernel.org>
2025-04-15 17:57:57 +01:00
Andy Shevchenko
ee44a1def7 leds: core: Bail out when composed name can't fit the buffer
GCC compiler complains about snprintf() calls that may potentially cut
the output:

 drivers/leds/led-core.c:551:78: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
 drivers/leds/led-core.c:554:78: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
 ...

Fix these by checking for the potential overflow. This requires
to align all the branches to use the same callee, i.e. snprintf(),
otherwise the code will be blown up and return different error codes
for the different branches.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250318160524.2979982-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-04-15 17:57:55 +01:00
Craig McQueen
06d99fcf1f leds: led-triggers: Improvements for default trigger
Accept "default" written to sysfs trigger attr.
If the text "default" is written to the LED's sysfs 'trigger' attr, then
call led_trigger_set_default() to set the LED to its default trigger.

If the default trigger is set to "none", then led_trigger_set_default()
will remove a trigger. This is in contrast to the default trigger being
unset, in which case led_trigger_set_default() does nothing.

Signed-off-by: Craig McQueen <craig@mcqueen.au>
Reviewed-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Link: https://lore.kernel.org/r/20250317022630.424015-1-craig@mcqueen.au
Signed-off-by: Lee Jones <lee@kernel.org>
2025-04-15 17:57:54 +01:00
Thomas Zimmermann
dc2139c0aa leds: backlight trigger: Replace fb events with a dedicated function call
Remove support for fb events from the led backlight trigger. Provide
the helper ledtrig_backlight_blank() instead. Call it from fbdev to
inform the trigger of changes to a display's blank state.

Fbdev maintains a list of all installed notifiers. Instead of the fbdev
notifiers, maintain an internal list of led backlight triggers.

v3:
- export ledtrig_backlight_blank()
v2:
- maintain global list of led backlight triggers (Lee)
- avoid IS_REACHABLE() in source file (Lee)
- notify on changes to blank state instead of display state
- use lock guards
- initialize led list and list mutex

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Simona Vetter <simona.vetter@ffwll.ch>
Link: https://lore.kernel.org/r/20250321095517.313713-11-tzimmermann@suse.de
Signed-off-by: Lee Jones <lee@kernel.org>
2025-04-10 10:39:13 +01:00
Thomas Zimmermann
28f8bab711 leds: backlight trigger: Move blank-state handling into helper
Move the handling of blank-state updates into a separate helper,
so that is can be called without the fbdev event. No functional
changes.

v2:
- rename helper to avoid renaming in a later patch (Lee)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Simona Vetter <simona.vetter@ffwll.ch>
Link: https://lore.kernel.org/r/20250321095517.313713-10-tzimmermann@suse.de
Signed-off-by: Lee Jones <lee@kernel.org>
2025-04-10 10:39:12 +01:00
Andy Shevchenko
53762bb44b leds: ncp5623: Use fwnode_get_child_node_count()
Since fwnode_get_child_node_count() was split from its device property
counterpart, we may utilise it in the driver and drop custom implementation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20250310150835.3139322-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-04-10 10:12:24 +01:00
Andy Shevchenko
4623cc4e9a leds: pwm-multicolor: Use fwnode_get_child_node_count()
Since fwnode_get_child_node_count() was split from its device property
counterpart, we may utilise it in the driver and drop custom implementation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20250310150835.3139322-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-04-10 10:12:20 +01:00
Thomas Gleixner
8fa7292fee treewide: Switch/rename to timer_delete[_sync]()
timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree
over and remove the historical wrapper inlines.

Conversion was done with coccinelle plus manual fixups where necessary.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-04-05 10:30:12 +02:00
Linus Torvalds
cb9b4c3403 * pca955x: Add HW blink support, utilizing PWM0. It supports one frequency
across all blinking LEDs and falls back to software blink if different
     frequencies are requested.
 
   * trigger: netdev: Allow configuring LED blink interval via .blink_set
     even when HW offload (.hw_control) is enabled.
   * led-core: Fix a race condition where a quick LED_OFF followed by another
     brightness set could leave the LED off incorrectly, especially
     noticeable after the introduction of the ordered workqueue.
   * qcom-lpg: Add support for 6-bit PWM resolution alongside the existing
     9-bit support.
   * qcom-lpg: Fix PWM value capping to respect the selected resolution
     (6-bit or 9-bit) for normal PWMs.
   * qcom-lpg: Fix PWM value capping to respect the selected resolution for
     Hi-Res PWMs.
   * qcom-lpg: Fix calculation of the best period for Hi-Res PWMs to prevent
     requested duty cycles from exceeding the maximum allowed by the
     selected resolution.
   * st1202: Add a check for the error code returned by devm_mutex_init().
   * pwm-multicolor: Add a check for the return value of
     fwnode_property_read_u32().
   * st1202: Ensure hardware initialization (st1202_setup) happens before DT
     node processing (st1202_dt_init).
   * Kconfig: leds-st1202: Add select LEDS_TRIGGER_PATTERN as it's required
     by the driver.
 
   * lp8860: Drop unneeded explicit assignment to REGCACHE_NONE.
   * pca955x: Refactor code with helper functions and rename some
     functions/variables for clarity.
   * pca955x: Pass driver data pointers instead of the I2C client to helper
     functions.
   * pca955x: Optimize probe LED selection logic to reduce I2C operations.
   * pca955x: Revert the removal of pca95xx_num_led_regs() (renaming it to
     pca955x_num_led_regs) as it's needed for HW blink support.
   * st1202: Refactor st1202_led_set() to use the !! operator for boolean
     conversion.
   * st1202: Minor spacing and proofreading edits in comments.
   * Directory Rename: Rename the drivers/leds/simple directory to
     drivers/leds/simatic as the drivers within are not simple.
   * mlxcpld: Remove unused include of acpi.h.
   * nic78bx: Tidy up the ACPI ID table (remove ACPI_PTR, use
     mod_devicetable.h, remove explicit driver_data initializer).
 
   * tlc591xx: Convert text binding to YAML format, add child node
     constraints, and fix typos/formatting in the example.
   * qcom-lpg: Document the qcom,pm8937-pwm compatible string as a
     fallback for qcom,pm8916-pwm.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmfmqRcACgkQUa+KL4f8
 d2EIjg//cmG4xqmhs5u38pAVL30ZYphGL3AlSVnAtMbBgP3u6AzzppjrDHQuPbZC
 Iw8VGRbl1JTu1kazlQ4B4VR1b0KBAScz0oIrLqb/qJUWFw9DsIeKxCsTjukRr+/O
 FaQJRwhSPd4x+RW6+yGrug0ciR+f6ZfaQl7SLP7Puo2TqQukaA28aVG+KPeVxUzi
 CdVNDyMLSpDBNvWq1zRzlGEHDUprFO+lwV5kVy9V5qT7t5WkayMkOE4qsopJVQqh
 jkbxpKfxfWh7Mi3BxACqiVVTZRlzPu8hCmm+9OwT08m+coXGkSNzhXni3dSNugOL
 XMFQatfmsRgqSt68icHA993xhNytkLN8yj98mzUcpky8VfwUMNXKN2JhTJT+QG19
 +W4/Xt1WROMr/FTi4JBLzQe3dmyXPiVpONtUuO4vVtPeXyUMOUxKU9opVF6KHu/v
 +9xF4qDYVbxvV0NysB6unsqyEL+su+//wBhR+7gSpc7Gg8gquE9kFeP+1jkK5K4d
 mKhijFr1BGP1f6nJA5wivnKJ9EIie7wnJcrLFCDDYV2uACJDwmaBIx+VLb2yf/FY
 usd1bj/4mMobtSGrYnOZf4IK8erDt/+ozm0t7pqshmI/SM54xMvF3L7CttOPPh6K
 j69dTkKJ9FzfSqy2RZ9gvbga+WoCD3++lhw5ivGJjF9lRaQQo7I=
 =cEhV
 -----END PGP SIGNATURE-----

Merge tag 'leds-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds

Pull LED updates from Lee Jones:

 - pca955x: Add HW blink support, utilizing PWM0. It supports one
   frequency across all blinking LEDs and falls back to software blink
   if different frequencies are requested.

 - trigger: netdev: Allow configuring LED blink interval via .blink_set
   even when HW offload (.hw_control) is enabled.

 - led-core: Fix a race condition where a quick LED_OFF followed by
   another brightness set could leave the LED off incorrectly,
   especially noticeable after the introduction of the ordered
   workqueue.

 - qcom-lpg: Add support for 6-bit PWM resolution alongside the existing
   9-bit support.

 - qcom-lpg: Fix PWM value capping to respect the selected resolution
   (6-bit or 9-bit) for normal PWMs.

 - qcom-lpg: Fix PWM value capping to respect the selected resolution
   for Hi-Res PWMs.

 - qcom-lpg: Fix calculation of the best period for Hi-Res PWMs to
   prevent requested duty cycles from exceeding the maximum allowed by
   the selected resolution.

 - st1202: Add a check for the error code returned by devm_mutex_init().

 - pwm-multicolor: Add a check for the return value of
   fwnode_property_read_u32().

 - st1202: Ensure hardware initialization (st1202_setup) happens before
   DT node processing (st1202_dt_init).

 - Kconfig: leds-st1202: Add select LEDS_TRIGGER_PATTERN as it's
   required by the driver.

 - lp8860: Drop unneeded explicit assignment to REGCACHE_NONE.

 - pca955x: Refactor code with helper functions and rename some
   functions/variables for clarity.

 - pca955x: Pass driver data pointers instead of the I2C client to
   helper functions.

 - pca955x: Optimize probe LED selection logic to reduce I2C operations.

 - pca955x: Revert the removal of pca95xx_num_led_regs() (renaming it to
   pca955x_num_led_regs) as it's needed for HW blink support.

 - st1202: Refactor st1202_led_set() to use the !! operator for boolean
   conversion.

 - st1202: Minor spacing and proofreading edits in comments.

 - Directory Rename: Rename the drivers/leds/simple directory to
   drivers/leds/simatic as the drivers within are not simple.

 - mlxcpld: Remove unused include of acpi.h.

 - nic78bx: Tidy up the ACPI ID table (remove ACPI_PTR, use
   mod_devicetable.h, remove explicit driver_data initializer).

 - tlc591xx: Convert text binding to YAML format, add child node
   constraints, and fix typos/formatting in the example.

 - qcom-lpg: Document the qcom,pm8937-pwm compatible string as a
   fallback for qcom,pm8916-pwm.

* tag 'leds-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (23 commits)
  leds: nic78bx: Tidy up ACPI ID table
  leds: mlxcpld: Remove unused ACPI header inclusion
  leds: rgb: leds-qcom-lpg: Fix calculation of best period Hi-Res PWMs
  leds: rgb: leds-qcom-lpg: Fix pwm resolution max for Hi-Res PWMs
  leds: rgb: leds-qcom-lpg: Fix pwm resolution max for normal PWMs
  leds: Rename simple directory to simatic
  leds: Kconfig: leds-st1202: Add select for required LEDS_TRIGGER_PATTERN
  leds: leds-st1202: Spacing and proofreading editing
  leds: leds-st1202: Initialize hardware before DT node child operations
  leds: pwm-multicolor: Add check for fwnode_property_read_u32
  leds: rgb: leds-qcom-lpg: Add support for 6-bit PWM resolution
  leds: Fix LED_OFF brightness race
  Revert "leds-pca955x: Remove the unused function pca95xx_num_led_regs()"
  leds: st1202: Refactor st1202_led_set() to use !! operator for boolean conversion
  dt-bindings: leds: qcom-lpg: Document PM8937 PWM compatible
  leds: pca955x: Add HW blink support
  leds: pca955x: Optimize probe LED selection
  leds: pca955x: Use pointers to driver data rather than I2C client
  leds: pca955x: Refactor with helper functions and renaming
  dt-bindings: leds: Convert leds-tlc591xx.txt to yaml format
  ...
2025-03-29 14:42:59 -07:00
Linus Torvalds
dcab75a3c8 * Maxim MAX77705:
* Added core MFD driver.
     * Added charger driver.
     * Added devicetree bindings for the charger and MFD core.
     * Added Haptic controller support via the input subsystem.
     * Added LED support.
     * Added support to simple-mfd-i2c for fuel gauge and hwmon.
   * Samsung S2MPU05 (Exynos7870 PMIC):
     * Added core MFD support.
     * Added Regulator support for 21 LDOs and 5 BUCKs.
     * Added devicetree bindings for regulators and the PMIC core.
   * TI TPS65215 & TPS65214:
     * Added support to the existing TPS65219 driver.
     * Added devicetree bindings.
   * STMicroelectronics STM32MP25:
     * Added support to the stm32-timers MFD driver.
     * Added devicetree bindings.
   * Congatec Board Controller (CGBC):
     * Added HWMON support for internal sensors.
     * Added support for the conga-SA8 module.
   * Microchip LAN969X:
     * Enabled the at91-usart MFD driver for this architecture.
   * MediaTek MT6359:
     * Added mfd_cell for mt6359-accdet to allow its driver to probe.
 
   * AXP20X (AXP717): Added AXP717_TS_PIN_CFG register to writeable
     regs for temperature sensor configuration.
   * SM501: Switched to using BIT() macro to mitigate potential
     integer overflows in GPIO functions.
   * ENE KB3930: Added a NULL pointer check for off_gpios during
     probe to prevent potential dereference.
   * SYSCON: Added a check for invalid resource size to prevent
     issues from DT misconfiguration.
   * CGBC: Corrected signedness issues in cgbc_session_request.
 
   * intel_soc_pmic_chtdc_ti / intel_soc_pmic_crc: Removed unneeded
     explicit assignment to REGCACHE_NONE.
   * ipaq-micro / tps65010: Switched to using str_enable_disable()
     helpers for clarity and potential size reduction.
   * upboard-fpga: Removed unnecessary ACPI_PTR() annotation.
   * max8997: Removed unused max8997_irq_exit() function, using
     devm_* helpers instead.
   * lp3943: Dropped unused #include <linux/pwm.h> from the header
     file.
   * db8500-prcmu: Removed needless return statements in void APIs.
   * qnap-mcu: Replaced commas with semicolons between expressions
     for correctness.
 
   * STA2X11: Removed the core MFD driver as the underlying
     platform support was removed.
   * EZX-PCAP: Removed the unused pcap_adc_sync function.
   * PCF50633 (OpenMoko PMIC): Removed the entire driver (core, adc,
     gpio, irq) as the underlying s3c24xx platform support was removed.
 
   * Converted fsl,mcu-mpc8349emitx binding to YAML.
   * Added qcom,msm8937-tcsr compatible.
   * Added microchip,sama7d65-flexcom compatible.
   * Added rockchip,rk3528-qos syscon compatible.
   * Added airoha,en7581-pbus-csr syscon compatible.
   * Added microchip,sama7d65-ddr3phy syscon compatible.
   * Added microchip,sama7d65-sfrbu syscon compatible.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmfmqKQACgkQUa+KL4f8
 d2G+rA//UU3UixCD8FsNN+o4DS7FbxdiSUCrATOBKia9MGfor4xCl6Qk9ZyO4sE1
 Rr9zUrTb1xlCmMZupZlkV8TDHHcaiUbgmnKB161d4HMxCbju10MKlm7faz2vRMz3
 a73ehTmUeNDiWG3t1/2zAyRt7PHPC2zakUlnXlLhLir12uR2jsDSeGOZh4xR7Hdi
 5nkOA2xWbbeW4b+ybwZ32afbLtZFkLo80QvqDx/D9lMUnQO0FqKak0Zope7IzeqC
 ilg+tIJOQRGEbjEVQ+pVXsPI6zfmO8eAja70F7sm+Q6TVDw2JhHU/YElHw+quiP+
 aLYeE+DuSun1EYlK4ATQ0vzUdgsaOEWblF0eythctXFTfM9ZKhzWYdXEOvco7N4u
 R9BYRtM/zGkxiScbr6igyjWZx7NPOsKEKIi5tOv+C2BAKb53om7vsNuMgvMDL/8W
 gztmG0SMKwJSx2Dg7h1LLUfa3tG9QRFd0I+Yfaso3MtYmxnZVcJtM5IQbvzf6i/B
 3fSiGP6PDNeJqbn9k3/7SB8Tb4XmJUN2LFdDtDuWVhgZpSDULkjpYxAXDIrbp+il
 QNdLPiU1x7OzPkFZQxtXLt7yRmlEc2lu9jJHkGVM1M18TMexQiFxoSY9NxkbUj3o
 T4s/PKGmRKHP9XxCmRSfu6Veql0MPUwtvkErlUf4GTLWK4oshag=
 =ntF1
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "Maxim MAX77705:
   - Added core MFD driver.
   - Added charger driver.
   - Added devicetree bindings for the charger and MFD core.
   - Added Haptic controller support via the input subsystem.
   - Added LED support.
   - Added support to simple-mfd-i2c for fuel gauge and hwmon.

  Samsung S2MPU05 (Exynos7870 PMIC):
   - Added core MFD support.
   - Added Regulator support for 21 LDOs and 5 BUCKs.
   - Added devicetree bindings for regulators and the PMIC core.

  TI TPS65215 & TPS65214:
   - Added support to the existing TPS65219 driver.
   - Added devicetree bindings.

  STMicroelectronics STM32MP25:
   - Added support to the stm32-timers MFD driver.
   - Added devicetree bindings.

  Congatec Board Controller (CGBC):
   - Added HWMON support for internal sensors.
   - Added support for the conga-SA8 module.

  Microchip LAN969X:
   - Enabled the at91-usart MFD driver for this architecture.

  MediaTek MT6359:
   - Added mfd_cell for mt6359-accdet to allow its driver to probe.

  Other misc driver updates:
   - AXP20X (AXP717): Added AXP717_TS_PIN_CFG register to writeable regs
     for temperature sensor configuration.
   - SM501: Switched to using BIT() macro to mitigate potential integer
     overflows in GPIO functions.
   - ENE KB3930: Added a NULL pointer check for off_gpios during probe
     to prevent potential dereference.
   - SYSCON: Added a check for invalid resource size to prevent issues
     from DT misconfiguration.
   - CGBC: Corrected signedness issues in cgbc_session_request
   - intel_soc_pmic_chtdc_ti / intel_soc_pmic_crc: Removed unneeded
     explicit assignment to REGCACHE_NONE.
   - ipaq-micro / tps65010: Switched to using str_enable_disable()
     helpers for clarity and potential size reduction.
   - upboard-fpga: Removed unnecessary ACPI_PTR() annotation.
   - max8997: Removed unused max8997_irq_exit() function, using devm_*
     helpers instead.
   - lp3943: Dropped unused #include <linux/pwm.h> from the header file.
   - db8500-prcmu: Removed needless return statements in void APIs.
   - qnap-mcu: Replaced commas with semicolons between expressions for
     correctness.
   - STA2X11: Removed the core MFD driver as the underlying platform
     support was removed.
   - EZX-PCAP: Removed the unused pcap_adc_sync function.
   - PCF50633 (OpenMoko PMIC): Removed the entire driver (core, adc,
     gpio, irq) as the underlying s3c24xx platform support was removed.

  Devicetree updates:
   - Converted fsl,mcu-mpc8349emitx binding to YAML
   - Added qcom,msm8937-tcsr compatible
   - Added microchip,sama7d65-flexcom compatible
   - Added rockchip,rk3528-qos syscon compatible
   - Added airoha,en7581-pbus-csr syscon compatible
   - Added microchip,sama7d65-ddr3phy syscon compatible
   - Added microchip,sama7d65-sfrbu syscon compatible"

* tag 'mfd-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (49 commits)
  mfd: cgbc-core: Add support for conga-SA8
  dt-bindings: mfd: syscon: Add microchip,sama7d65-sfrbu
  dt-bindings: mfd: syscon: Add microchip,sama7d65-ddr3phy
  mfd: cgbc: Add support for HWMON
  dt-bindings: mfd: syscon: Add the pbus-csr node for Airoha EN7581 SoC
  mfd: cgbc-core: Cleanup signedness in cgbc_session_request()
  mfd: pcf50633: Remove remaining PCF50633 support
  mfd: pcf50633: Remove unused platform IRQ code
  mfd: pcF50633-gpio: Remove unused driver
  mfd: pcf50633-adc: Remove unused driver
  mfd: qnap-mcu: Convert commas to semicolons in qnap_mcu_exec()
  mfd: mt6397-core: Add mfd_cell for mt6359-accdet
  dt-bindings: mfd: syscon: Add rk3528 QoS register compatible
  dt-bindings: mfd: atmel,sama5d2-flexcom: Add microchip,sama7d65-flexcom
  mfd: ezx-pcap: Remove unused pcap_adc_sync
  mfd: db8500-prcmu: Remove needless return in three void APIs
  mfd: Remove STA2x11 core driver
  mfd: max77620: Allow building as a module
  mfd: ene-kb3930: Fix a potential NULL pointer dereference
  dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8937
  ...
2025-03-29 14:33:13 -07:00
Linus Torvalds
5143840cef gpio updates for v6.15-rc1
GPIO core:
 - add sanitization of return values of GPIO provider callbacks so that invalid
   ones don't get propagated to user-space
 - add new variants of the line setter callbacks for GPIO providers that return
   an integer and allow to indicate driver errors to the GPIO core
 - change the interface of all gpiod_set_value() variants to return an integer
   thus becoming able to indicate failures in the underlying layer to callers
 - drop unneeded ERR_CAST in gpiolib-acpi
 - use for_each_if() where applicable
 - provide gpiod_multi_set_value_cansleep() as a new, simpler interface to
   gpiod_set_array_value_cansleep() and use it across several drivers treewide
 - reduce the number of atomic reads of the descriptor flags in gpiolib debugfs
   code
 - simplify for_each_hwgpio_in_range() and for_each_requested_gpio_in_range()
 - add support for three-cell GPIO specifiers in GPIO OF code
 - don't build HTE (hardware timestamp engine) GPIO code with the HTE subsystem
   disabled in Kconfig
 - unduplicate calls to gpiod_direction_input_nonotify()
 - rework the handling of the valid_mask property of GPIO chips: don't allow
   drivers to set it as it should only be handled by GPIO core and start
   actually enforcing it in GPIO core for *all* drivers, not only the ones
   implementing a custom request() callback
 - get the `ngpios` property from the fwnode of the GPIO chip, not its device in
   order to handle multi-bank GPIO chips
 
 Driver improvements:
 - convert a part of the GPIO drivers under drivers/gpio/ to using the new value
   setter callbacks
 - convert several drivers to using automatic lock guards from cleanup.h
 - allow building gpio-bt8xx with COMPILE_TEST=y
 - refactor gpio-74x164 (use devres, cleanup helpers, __counted_by() and bits.h
   macros)
 - refactor gpio-latch (use generic device properties, lock guards and some
   local variables for better readability)
 - refactor gpio-xilinx (improve the usage of the bitmap API)
 - support multiple virtual GPIO controller instances in gpio-virtio
 - allow gpio-regmap to use the standard `ngpios` property from GPIOLIB
 - factor out the common code for synchronous probing of virtual GPIO devices
   into its own library
 - use str_enable_disable(), str_high_low() and other string helpers where
   applicable
 - extend the gpio-mmio abstraction layer to allow calling into the pinctrl
   back-end when setting direction
 - convert gpio-vf610 to using the gpio-mmio library
 - use more devres in gpio-adnp
 - add support for reset-gpios in gpio-pcf857x
 - add support for more models to gpio-loongson-64bit
 
 DT bindings:
 - add new compatibles to gpio-vf610 and gpio-loongson
 - add missing gpio-ranges property to gpio-mvebu
 - add reset-gpios to nxp,pcf8575
 - enable gpio-hog parsing in ast2400-gpio
 
 Misc:
 - coding style improvements
 - kerneldoc fixes
 - includes reordering
 - updates to the TODO list
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmfigbMACgkQEacuoBRx
 13IX7Q/9GohFf6WvjJ4eKUJqmYcQdES/PVPdHUUVpDTMkuljUbkEmDXwu3qjWF+t
 mD7Co2Fk9sndQrmAI2YqWzDObzNHn/TLhDY8WVVzvJdL7kABPchJ6ZfJ9J92SEcU
 3KbaFnih+q6M4EcM3P30pnkYEAdZ6y5mbOAB4zFCqlf3qAUGIaC2phxN767ucu/m
 kQRQInwFs5lt3H/LfJ4lplUmMF4+x64pb19tRvo/vErtuaiU61Vhu4tFbgIe3d2R
 otTqmKuZwTUZCwFsZY1DVIcF00CxxIH5riZ/S+ejkWqETsSZUSbp48q2jpWeKnrG
 n8Op6zaOrXJEDTqBK+Uxp7vvO62GV7KrcI2JvTIHmriiTYxAGhRgGMzd6swZA9Ha
 EvnDwx742iNclB3KbL3eXbGWVxxjkTiDQvEHRHB73121jjM3py+HzSmb5OZdqOMr
 NPDIAZKr5RdXdx6CXTEVDqy4+aubSyPt2AFiD9T3kiwwOeqvBmEGSda6cT89gVEJ
 QccHNWG8/91xargLyllc9eiSiN4SLqj0Pdw9IkjIQi9zoF3te5QSNdezbEPTqhAk
 Ybp4krWJFunfsbERYfZ14H841oJk1a2rAYpEET2EQzhRlGS3zOJWGOjqQPE5g319
 3gjEEQRtm2UMKv+zUsijG4BBBgbOtkWOUihCob05lzsOPw3GwKI=
 =h7Hv
 -----END PGP SIGNATURE-----

Merge tag 'gpio-updates-for-v6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio updates from Bartosz Golaszewski:
 "There are no new drivers this time but several changes to the core
  GPIO framework and various driver updates.

  This release cycle, we're starting a relatively straightforward but
  tedious rework of the GPIO consumer API: for historical reasons, the
  gpiod_set_value() variants would return void. Not only that but the
  GPIO provider interface does not even allow drivers to return a value
  to GPIO core. This is because initial GPIO controllers would be MMIO
  based and could not fail. We've had I2C, SPI and USB controllers for
  years too but no way of indicating failures to callers.

  This changes the consumer interface, adds new provider callbacks and
  starts converting the drivers under drivers/gpio/ to using them. Once
  this gets upstream, we'll keep on converting GPIO drivers that live
  elsewhere and once there are no more users of the old callbacks, we'll
  remove them and rename the new ones to the previous name. I imagine
  the last step would happen in one sweeping change like what you did
  for the remove_new() -> remove() renaming.

  We've also addressed an issue where invalid return values from GPIO
  drivers would get propagated to user-space by adding some
  GPIO-core-level sanitization. Again: not a complex change but way
  overdue.

  Other than that: lots of driver and core refactoring, DT-bindings
  changes and some other minor changes like coding style fixes or header
  reordering.

  GPIO core:
   - add sanitization of return values of GPIO provider callbacks so
     that invalid ones don't get propagated to user-space
   - add new variants of the line setter callbacks for GPIO providers
     that return an integer and allow to indicate driver errors to the
     GPIO core
   - change the interface of all gpiod_set_value() variants to return an
     integer thus becoming able to indicate failures in the underlying
     layer to callers
   - drop unneeded ERR_CAST in gpiolib-acpi
   - use for_each_if() where applicable
   - provide gpiod_multi_set_value_cansleep() as a new, simpler
     interface to gpiod_set_array_value_cansleep() and use it across
     several drivers treewide
   - reduce the number of atomic reads of the descriptor flags in
     gpiolib debugfs code
   - simplify for_each_hwgpio_in_range() and
     for_each_requested_gpio_in_range()
   - add support for three-cell GPIO specifiers in GPIO OF code
   - don't build HTE (hardware timestamp engine) GPIO code with the HTE
     subsystem disabled in Kconfig
   - unduplicate calls to gpiod_direction_input_nonotify()
   - rework the handling of the valid_mask property of GPIO chips: don't
     allow drivers to set it as it should only be handled by GPIO core
     and start actually enforcing it in GPIO core for *all* drivers, not
     only the ones implementing a custom request() callback
   - get the `ngpios` property from the fwnode of the GPIO chip, not its
     device in order to handle multi-bank GPIO chips

  Driver improvements:
   - convert a part of the GPIO drivers under drivers/gpio/ to using the
     new value setter callbacks
   - convert several drivers to using automatic lock guards from
     cleanup.h
   - allow building gpio-bt8xx with COMPILE_TEST=y
   - refactor gpio-74x164 (use devres, cleanup helpers, __counted_by()
     and bits.h macros)
   - refactor gpio-latch (use generic device properties, lock guards and
     some local variables for better readability)
   - refactor gpio-xilinx (improve the usage of the bitmap API)
   - support multiple virtual GPIO controller instances in gpio-virtio
   - allow gpio-regmap to use the standard `ngpios` property from
     GPIOLIB
   - factor out the common code for synchronous probing of virtual GPIO
     devices into its own library
   - use str_enable_disable(), str_high_low() and other string helpers
     where applicable
   - extend the gpio-mmio abstraction layer to allow calling into the
     pinctrl back-end when setting direction
   - convert gpio-vf610 to using the gpio-mmio library
   - use more devres in gpio-adnp
   - add support for reset-gpios in gpio-pcf857x
   - add support for more models to gpio-loongson-64bit

  DT bindings:
   - add new compatibles to gpio-vf610 and gpio-loongson
   - add missing gpio-ranges property to gpio-mvebu
   - add reset-gpios to nxp,pcf8575
   - enable gpio-hog parsing in ast2400-gpio

  Misc:
   - coding style improvements
   - kerneldoc fixes
   - includes reordering
   - updates to the TODO list"

* tag 'gpio-updates-for-v6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (119 commits)
  gpio: TODO: add an item to track reworking the sysfs interface
  gpio: TODO: add an item to track the conversion to the new value setters
  gpio: TODO: add delimiters between tasks for better readability
  gpio: TODO: remove the pinctrl integration task
  gpio: TODO: remove task duplication
  gpio: TODO: remove the item about the new debugfs interface
  gpio: da9055: use new line value setter callbacks
  gpio: da9052: use new line value setter callbacks
  gpio: cs5535: use new line value setter callbacks
  gpio: crystalcove: use new line value setter callbacks
  gpio: cros-ec: use new line value setter callbacks
  gpio: creg-snps: use new line value setter callbacks
  gpio: cgbc: use new line value setter callbacks
  gpio: bt8xx: use new line value setter callbacks
  gpio: bt8xx: use lock guards
  gpio: bt8xx: allow to build the module with COMPILE_TEST=y
  gpio: bd9571mwv: use new line value setter callbacks
  gpio: bd71828: use new line value setter callbacks
  gpio: bd71815: use new line value setter callbacks
  gpio: bcm-kona: use new line value setter callbacks
  ...
2025-03-25 20:05:43 -07:00
Linus Torvalds
a50b4fe095 A treewide hrtimer timer cleanup
hrtimers are initialized with hrtimer_init() and a subsequent store to
   the callback pointer. This turned out to be suboptimal for the upcoming
   Rust integration and is obviously a silly implementation to begin with.
 
   This cleanup replaces the hrtimer_init(T); T->function = cb; sequence
   with hrtimer_setup(T, cb);
 
   The conversion was done with Coccinelle and a few manual fixups.
 
   Once the conversion has completely landed in mainline, hrtimer_init()
   will be removed and the hrtimer::function becomes a private member.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCgAxFiEEQp8+kY+LLUocC4bMphj1TA10mKEFAmff5jQTHHRnbHhAbGlu
 dXRyb25peC5kZQAKCRCmGPVMDXSYoVvRD/wKtuwmiA66NJFgXC0qVq82A6fO3bY8
 GBdbfysDJIbqGu5PTcULTbJ8qkqv3jeLUv6CcXvS4sZ7y/uJQl2lzf8yrD/0bbwc
 rLI6sHiPSZmK93kNVN4X5H7kvt7cE/DYC9nnEOgK3BY5FgKc4n9887d4aVBhL8Lv
 ODwVXvZ+xi351YCj7qRyPU24zt/p4tkkT1o2k4a0HBluqLI0D+V20fke9IERUL8r
 d1uWKlcn0TqYDesE8HXKIhbst3gx52rMJrXBJDHwFmG6v8Pj1fkTXCVpPo8QcBz8
 OTVkpomN9f/Tx4+GZwhZOF86LhLL3OhxD6pT7JhFCXdmSGv+Ez8uyk1YZysM/XpV
 Juy/1yAcBpDIDkmhMFGdAAn48Nn9Fotty0r4je60zSEp1d/4QMXcFme29qr2JTUE
 iWnQ/HD6DxUjVHqy7CYvvo26Xegg1C7qgyOVt4PYZwAM1VKF5P3kzYTb4SAdxtop
 Tpji1sfW9QV08jqMNo6XntD32DSP9S2HqjO9LwBw700jnx2jjJ35fcJs6iodMOUn
 gckIZLMn3L0OoglPdyA5O7SNTbKE7aFiRKdnT/cJtR3Fa39Qu27CwC5gfiyuie9I
 Q+LG8GLuYSBHXAR+PBK4GWlzJ7Dn8k3eqmbnLeKpRMsU6ZzcttgA64xhaviN2wN0
 iJbvLJeisXr3GA==
 =bYAX
 -----END PGP SIGNATURE-----

Merge tag 'timers-cleanups-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer cleanups from Thomas Gleixner:
 "A treewide hrtimer timer cleanup

  hrtimers are initialized with hrtimer_init() and a subsequent store to
  the callback pointer. This turned out to be suboptimal for the
  upcoming Rust integration and is obviously a silly implementation to
  begin with.

  This cleanup replaces the hrtimer_init(T); T->function = cb; sequence
  with hrtimer_setup(T, cb);

  The conversion was done with Coccinelle and a few manual fixups.

  Once the conversion has completely landed in mainline, hrtimer_init()
  will be removed and the hrtimer::function becomes a private member"

* tag 'timers-cleanups-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (100 commits)
  wifi: rt2x00: Switch to use hrtimer_update_function()
  io_uring: Use helper function hrtimer_update_function()
  serial: xilinx_uartps: Use helper function hrtimer_update_function()
  ASoC: fsl: imx-pcm-fiq: Switch to use hrtimer_setup()
  RDMA: Switch to use hrtimer_setup()
  virtio: mem: Switch to use hrtimer_setup()
  drm/vmwgfx: Switch to use hrtimer_setup()
  drm/xe/oa: Switch to use hrtimer_setup()
  drm/vkms: Switch to use hrtimer_setup()
  drm/msm: Switch to use hrtimer_setup()
  drm/i915/request: Switch to use hrtimer_setup()
  drm/i915/uncore: Switch to use hrtimer_setup()
  drm/i915/pmu: Switch to use hrtimer_setup()
  drm/i915/perf: Switch to use hrtimer_setup()
  drm/i915/gvt: Switch to use hrtimer_setup()
  drm/i915/huc: Switch to use hrtimer_setup()
  drm/amdgpu: Switch to use hrtimer_setup()
  stm class: heartbeat: Switch to use hrtimer_setup()
  i2c: Switch to use hrtimer_setup()
  iio: Switch to use hrtimer_setup()
  ...
2025-03-25 10:54:15 -07:00
Andy Shevchenko
161e3bea8f leds: nic78bx: Tidy up ACPI ID table
Tidy up ACPI ID table:

- Drop ACPI_PTR() and hence replace acpi.h with mod_devicetable.h and
  other necessary headers

- Remove explicit driver_data initializer

- Drop comma in the terminator entry

With that done, extend compile test coverage.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250313161630.415515-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-21 09:49:37 +00:00
Andy Shevchenko
52fc80729b leds: mlxcpld: Remove unused ACPI header inclusion
acpi.h is not used by the driver. Remove it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250313161206.415160-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-21 09:48:11 +00:00
Abel Vesa
2528eec7da leds: rgb: leds-qcom-lpg: Fix calculation of best period Hi-Res PWMs
When determining the actual best period by looping through all
possible PWM configs, the resolution currently used is based on
bit shift value which is off-by-one above the possible maximum
PWM value allowed.

So subtract one from the resolution before determining the best
period so that the maximum duty cycle requested by the PWM user
won't result in a value above the maximum allowed by the selected
resolution.

Cc: stable@vger.kernel.org    # 6.4
Fixes: b00d2ed376 ("leds: rgb: leds-qcom-lpg: Add support for high resolution PWM")
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Link: https://lore.kernel.org/r/20250305-leds-qcom-lpg-fix-max-pwm-on-hi-res-v4-3-bfe124a53a9f@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-21 09:21:59 +00:00