]> Git Repo - linux.git/commitdiff
Merge tag 'leds-next-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds
authorLinus Torvalds <[email protected]>
Mon, 4 Sep 2023 20:52:58 +0000 (13:52 -0700)
committerLinus Torvalds <[email protected]>
Mon, 4 Sep 2023 20:52:58 +0000 (13:52 -0700)
Pull LED updates from Lee Jones:
 "Core Frameworks:
   - Add new framework to support Group Multi-Color (GMC) LEDs
   - Offer an 'optional' API for non-essential LEDs
   - Support obtaining 'max brightness' values from Device Tree
   - Provide new led_classdev member 'color' (settable via DT and SYFS)
   - Stop TTY Trigger from using the old LED_ON constraints
   - Statically allocate leds_class

  New Drivers:
   - Add support for NXP PCA995x I2C Constant Current LED Driver

  New Device Support:
   - Add support for Siemens Simatic IPC BX-21 to Simatic IPC

  Fix-ups:
   - Some dependency / Kconfig tweaking
   - Move final probe() functions back over from .probe_new()
   - Simplify obtaining resources (memory, device data) using unified
     API helpers
   - Bunch of Device Tree additions, conversions and adaptions
   - Fix trivial styling issues; comments
   - Ensure correct includes are present and remove some that are not
     required
   - Omit the use of redundant casts and if relevant replace with better
     ones
   - Use purpose-built APIs for various actions; sysfs_emit(),
     module_led_trigger()
   - Remove a bunch of superfluous locking

  Bug Fixes:
   - Ensure error codes are correctly propagated back up the call chain
   - Fix incorrect error values from being returned (missing '-')
   - Ensure get'ed resources are put'ed to prevent leaks
   - Use correct class when exporting module resources
   - Fixing rounding (or lack there of) issues
   - Fix 'always false' LED_COLOR_ID_MULTI BUG() check"

* tag 'leds-next-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (40 commits)
  leds: aw2013: Enable pull-up supply for interrupt and I2C
  dt-bindings: leds: Document pull-up supply for interrupt and I2C
  dt-bindings: leds: aw2013: Document interrupt
  leds: uleds: Use module_misc_device macro to simplify the code
  leds: trigger: netdev: Use module_led_trigger macro to simplify the code
  dt-bindings: leds: Fix reference to definition of default-state
  leds: turris-omnia: Drop unnecessary mutex locking
  leds: turris-omnia: Use sysfs_emit() instead of sprintf()
  leds: Make leds_class a static const structure
  leds: Remove redundant of_match_ptr()
  dt-bindings: leds: Add gpio-line-names to PCA9532 GPIO
  leds: trigger: tty: Do not use LED_ON/OFF constants, use led_blink_set_oneshot instead
  dt-bindings: leds: rohm,bd71828: Drop select:false
  leds: Fix BUG_ON check for LED_COLOR_ID_MULTI that is always false
  leds: multicolor: Use rounded division when calculating color components
  leds: rgb: Add a multicolor LED driver to group monochromatic LEDs
  dt-bindings: leds: Add binding for a multicolor group of LEDs
  leds: class: Store the color index in struct led_classdev
  leds: Provide devm_of_led_get_optional()
  leds: pca995x: Fix MODULE_DEVICE_TABLE for OF
  ...

1  2 
drivers/leds/simple/Kconfig
drivers/leds/trigger/ledtrig-netdev.c

index 609e438af9f65743c6249a3d6f28575c06c6399a,4496373bfe2439f80e1be521c0e58c53fdbeaaff..e616cc6d6051f520e2036e1f19c9cb8e2fa16d3e
@@@ -1,8 -1,8 +1,9 @@@
  # SPDX-License-Identifier: GPL-2.0-only
  config LEDS_SIEMENS_SIMATIC_IPC
        tristate "LED driver for Siemens Simatic IPCs"
+       depends on LEDS_CLASS
        depends on SIEMENS_SIMATIC_IPC
 +      default y
        help
          This option enables support for the LEDs of several Industrial PCs
          from Siemens.
@@@ -35,3 -35,16 +36,16 @@@ config LEDS_SIEMENS_SIMATIC_IPC_F7188
  
          To compile this driver as a module, choose M here: the module
          will be called simatic-ipc-leds-gpio-f7188x.
+ config LEDS_SIEMENS_SIMATIC_IPC_ELKHARTLAKE
+       tristate "LED driver for Siemens Simatic IPCs based on Intel Elkhart Lake GPIO"
+       depends on LEDS_GPIO
+       depends on PINCTRL_ELKHARTLAKE
+       depends on SIEMENS_SIMATIC_IPC
+       default LEDS_SIEMENS_SIMATIC_IPC
+       help
+         This option enables support for the LEDs of several Industrial PCs
+         from Siemens based on Elkhart Lake GPIO i.e. BX-21A.
+         To compile this driver as a module, choose M here: the module
+         will be called simatic-ipc-leds-gpio-elkhartlake.
index cc3261543a5e5dfb24c7955eeafb75a6cee19388,a2835f9fed9d52ea2ad88825d92127e2fc869cca..58f3352539e8e5404a3858768934ac5319a8c14d
@@@ -406,15 -406,15 +406,15 @@@ static ssize_t interval_store(struct de
  
  static DEVICE_ATTR_RW(interval);
  
 -static ssize_t hw_control_show(struct device *dev,
 -                             struct device_attribute *attr, char *buf)
 +static ssize_t offloaded_show(struct device *dev,
 +                            struct device_attribute *attr, char *buf)
  {
        struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev);
  
        return sprintf(buf, "%d\n", trigger_data->hw_control);
  }
  
 -static DEVICE_ATTR_RO(hw_control);
 +static DEVICE_ATTR_RO(offloaded);
  
  static struct attribute *netdev_trig_attrs[] = {
        &dev_attr_device_name.attr,
        &dev_attr_rx.attr,
        &dev_attr_tx.attr,
        &dev_attr_interval.attr,
 -      &dev_attr_hw_control.attr,
 +      &dev_attr_offloaded.attr,
        NULL
  };
  ATTRIBUTE_GROUPS(netdev_trig);
@@@ -564,17 -564,15 +564,17 @@@ static int netdev_trig_activate(struct 
        /* Check if hw control is active by default on the LED.
         * Init already enabled mode in hw control.
         */
 -      if (supports_hw_control(led_cdev) &&
 -          !led_cdev->hw_control_get(led_cdev, &mode)) {
 +      if (supports_hw_control(led_cdev)) {
                dev = led_cdev->hw_control_get_device(led_cdev);
                if (dev) {
                        const char *name = dev_name(dev);
  
                        set_device_name(trigger_data, name, strlen(name));
                        trigger_data->hw_control = true;
 -                      trigger_data->mode = mode;
 +
 +                      rc = led_cdev->hw_control_get(led_cdev, &mode);
 +                      if (!rc)
 +                              trigger_data->mode = mode;
                }
        }
  
@@@ -595,8 -593,6 +595,8 @@@ static void netdev_trig_deactivate(stru
  
        cancel_delayed_work_sync(&trigger_data->work);
  
 +      led_set_brightness(led_cdev, LED_OFF);
 +
        dev_put(trigger_data->net_dev);
  
        kfree(trigger_data);
@@@ -609,18 -605,7 +609,7 @@@ static struct led_trigger netdev_led_tr
        .groups = netdev_trig_groups,
  };
  
- static int __init netdev_trig_init(void)
- {
-       return led_trigger_register(&netdev_led_trigger);
- }
- static void __exit netdev_trig_exit(void)
- {
-       led_trigger_unregister(&netdev_led_trigger);
- }
- module_init(netdev_trig_init);
- module_exit(netdev_trig_exit);
+ module_led_trigger(netdev_led_trigger);
  
  MODULE_AUTHOR("Ben Whitten <[email protected]>");
  MODULE_AUTHOR("Oliver Jowett <[email protected]>");
This page took 0.0907249999999999 seconds and 4 git commands to generate.