diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-12-01 16:09:28 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-12-01 16:09:28 -0800 |
commit | 304220b56e8c6a99b71832427802221be472247a (patch) | |
tree | ed9fbce952e3b3796ec0fa18706a3c6b69f73dc9 /include | |
parent | ddebe839c6013ab42f376bdeaaaf66bd0c0d68d6 (diff) | |
parent | 5f820ed52371b4f5d8c43c93f03408d0dbc01e5b (diff) | |
download | linux-304220b56e8c6a99b71832427802221be472247a.tar.bz2 |
Merge tag 'leds-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds
Pull LED updates from Pavel Machek:
"This contains usual small updates to drivers, and removal of PAGE_SIZE
limits on /sys/class/leds/<led>/trigger.
We should not be really having that many triggers; but with cpu
activity triggers we do, and we'll eventually need to fix it, but...
remove the limit for now"
* tag 'leds-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: (26 commits)
leds: trigger: netdev: fix handling on interface rename
leds: an30259a: add a check for devm_regmap_init_i2c
leds: mlxreg: Fix possible buffer overflow
leds: pca953x: Use of_device_get_match_data()
leds: core: Fix leds.h structure documentation
leds: core: Fix devm_classdev_match to reference correct structure
leds: core: Remove extern from header
leds: lm3601x: Convert class registration to device managed
leds: flash: Add devm_* functions to the flash class
leds: flash: Remove extern from the header file
leds: flash: Convert non extended registration to inline
leds: Kconfig: Be consistent with the usage of "LED"
leds: remove PAGE_SIZE limit of /sys/class/leds/<led>/trigger
leds: tlc591xx: update the maximum brightness
leds: lm3692x: Use flags from LM3692X_BRT_CTRL
leds: lm3692x: Use flags from LM3692X_BOOST_CTRL
leds: lm3692x: Handle failure to probe the regulator
leds: lm3692x: Don't overwrite return value in error path
leds: lm3692x: Print error value on dev_err
leds: tlc591xx: use devm_led_classdev_register_ext()
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/led-class-flash.h | 41 | ||||
-rw-r--r-- | include/linux/leds.h | 100 |
2 files changed, 72 insertions, 69 deletions
diff --git a/include/linux/led-class-flash.h b/include/linux/led-class-flash.h index 1e824963af17..21a3358a1731 100644 --- a/include/linux/led-class-flash.h +++ b/include/linux/led-class-flash.h @@ -94,12 +94,15 @@ static inline struct led_classdev_flash *lcdev_to_flcdev( * * Returns: 0 on success or negative error value on failure */ -extern int led_classdev_flash_register_ext(struct device *parent, - struct led_classdev_flash *fled_cdev, - struct led_init_data *init_data); +int led_classdev_flash_register_ext(struct device *parent, + struct led_classdev_flash *fled_cdev, + struct led_init_data *init_data); -#define led_classdev_flash_register(parent, fled_cdev) \ - led_classdev_flash_register_ext(parent, fled_cdev, NULL) +static inline int led_classdev_flash_register(struct device *parent, + struct led_classdev_flash *fled_cdev) +{ + return led_classdev_flash_register_ext(parent, fled_cdev, NULL); +} /** * led_classdev_flash_unregister - unregisters an object of led_classdev class @@ -108,7 +111,21 @@ extern int led_classdev_flash_register_ext(struct device *parent, * * Unregister a previously registered via led_classdev_flash_register object */ -extern void led_classdev_flash_unregister(struct led_classdev_flash *fled_cdev); +void led_classdev_flash_unregister(struct led_classdev_flash *fled_cdev); + +int devm_led_classdev_flash_register_ext(struct device *parent, + struct led_classdev_flash *fled_cdev, + struct led_init_data *init_data); + + +static inline int devm_led_classdev_flash_register(struct device *parent, + struct led_classdev_flash *fled_cdev) +{ + return devm_led_classdev_flash_register_ext(parent, fled_cdev, NULL); +} + +void devm_led_classdev_flash_unregister(struct device *parent, + struct led_classdev_flash *fled_cdev); /** * led_set_flash_strobe - setup flash strobe @@ -156,8 +173,8 @@ static inline int led_get_flash_strobe(struct led_classdev_flash *fled_cdev, * * Returns: 0 on success or negative error value on failure */ -extern int led_set_flash_brightness(struct led_classdev_flash *fled_cdev, - u32 brightness); +int led_set_flash_brightness(struct led_classdev_flash *fled_cdev, + u32 brightness); /** * led_update_flash_brightness - update flash LED brightness @@ -168,7 +185,7 @@ extern int led_set_flash_brightness(struct led_classdev_flash *fled_cdev, * * Returns: 0 on success or negative error value on failure */ -extern int led_update_flash_brightness(struct led_classdev_flash *fled_cdev); +int led_update_flash_brightness(struct led_classdev_flash *fled_cdev); /** * led_set_flash_timeout - set flash LED timeout @@ -179,8 +196,7 @@ extern int led_update_flash_brightness(struct led_classdev_flash *fled_cdev); * * Returns: 0 on success or negative error value on failure */ -extern int led_set_flash_timeout(struct led_classdev_flash *fled_cdev, - u32 timeout); +int led_set_flash_timeout(struct led_classdev_flash *fled_cdev, u32 timeout); /** * led_get_flash_fault - get the flash LED fault @@ -191,7 +207,6 @@ extern int led_set_flash_timeout(struct led_classdev_flash *fled_cdev, * * Returns: 0 on success or negative error value on failure */ -extern int led_get_flash_fault(struct led_classdev_flash *fled_cdev, - u32 *fault); +int led_get_flash_fault(struct led_classdev_flash *fled_cdev, u32 *fault); #endif /* __LINUX_FLASH_LEDS_H_INCLUDED */ diff --git a/include/linux/leds.h b/include/linux/leds.h index efb309dba914..242258f7d837 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -161,7 +161,7 @@ struct led_classdev { * * Returns: 0 on success or negative error value on failure */ -extern int led_classdev_register_ext(struct device *parent, +int led_classdev_register_ext(struct device *parent, struct led_classdev *led_cdev, struct led_init_data *init_data); @@ -181,7 +181,7 @@ static inline int led_classdev_register(struct device *parent, return led_classdev_register_ext(parent, led_cdev, NULL); } -extern int devm_led_classdev_register_ext(struct device *parent, +int devm_led_classdev_register_ext(struct device *parent, struct led_classdev *led_cdev, struct led_init_data *init_data); @@ -190,11 +190,11 @@ static inline int devm_led_classdev_register(struct device *parent, { return devm_led_classdev_register_ext(parent, led_cdev, NULL); } -extern void led_classdev_unregister(struct led_classdev *led_cdev); -extern void devm_led_classdev_unregister(struct device *parent, - struct led_classdev *led_cdev); -extern void led_classdev_suspend(struct led_classdev *led_cdev); -extern void led_classdev_resume(struct led_classdev *led_cdev); +void led_classdev_unregister(struct led_classdev *led_cdev); +void devm_led_classdev_unregister(struct device *parent, + struct led_classdev *led_cdev); +void led_classdev_suspend(struct led_classdev *led_cdev); +void led_classdev_resume(struct led_classdev *led_cdev); /** * led_blink_set - set blinking with software fallback @@ -211,9 +211,8 @@ extern void led_classdev_resume(struct led_classdev *led_cdev); * led_cdev->brightness_set() will not stop the blinking, * use led_classdev_brightness_set() instead. */ -extern void led_blink_set(struct led_classdev *led_cdev, - unsigned long *delay_on, - unsigned long *delay_off); +void led_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on, + unsigned long *delay_off); /** * led_blink_set_oneshot - do a oneshot software blink * @led_cdev: the LED to start blinking @@ -228,10 +227,9 @@ extern void led_blink_set(struct led_classdev *led_cdev, * If invert is set, led blinks for delay_off first, then for * delay_on and leave the led on after the on-off cycle. */ -extern void led_blink_set_oneshot(struct led_classdev *led_cdev, - unsigned long *delay_on, - unsigned long *delay_off, - int invert); +void led_blink_set_oneshot(struct led_classdev *led_cdev, + unsigned long *delay_on, unsigned long *delay_off, + int invert); /** * led_set_brightness - set LED brightness * @led_cdev: the LED to set @@ -241,8 +239,8 @@ extern void led_blink_set_oneshot(struct led_classdev *led_cdev, * software blink timer that implements blinking when the * hardware doesn't. This function is guaranteed not to sleep. */ -extern void led_set_brightness(struct led_classdev *led_cdev, - enum led_brightness brightness); +void led_set_brightness(struct led_classdev *led_cdev, + enum led_brightness brightness); /** * led_set_brightness_sync - set LED brightness synchronously @@ -255,8 +253,8 @@ extern void led_set_brightness(struct led_classdev *led_cdev, * * Returns: 0 on success or negative error value on failure */ -extern int led_set_brightness_sync(struct led_classdev *led_cdev, - enum led_brightness value); +int led_set_brightness_sync(struct led_classdev *led_cdev, + enum led_brightness value); /** * led_update_brightness - update LED brightness @@ -267,7 +265,7 @@ extern int led_set_brightness_sync(struct led_classdev *led_cdev, * * Returns: 0 on success or negative error value on failure */ -extern int led_update_brightness(struct led_classdev *led_cdev); +int led_update_brightness(struct led_classdev *led_cdev); /** * led_get_default_pattern - return default pattern @@ -279,8 +277,7 @@ extern int led_update_brightness(struct led_classdev *led_cdev); * Return: Allocated array of integers with default pattern from device tree * or NULL. Caller is responsible for kfree(). */ -extern u32 *led_get_default_pattern(struct led_classdev *led_cdev, - unsigned int *size); +u32 *led_get_default_pattern(struct led_classdev *led_cdev, unsigned int *size); /** * led_sysfs_disable - disable LED sysfs interface @@ -288,7 +285,7 @@ extern u32 *led_get_default_pattern(struct led_classdev *led_cdev, * * Disable the led_cdev's sysfs interface. */ -extern void led_sysfs_disable(struct led_classdev *led_cdev); +void led_sysfs_disable(struct led_classdev *led_cdev); /** * led_sysfs_enable - enable LED sysfs interface @@ -296,7 +293,7 @@ extern void led_sysfs_disable(struct led_classdev *led_cdev); * * Enable the led_cdev's sysfs interface. */ -extern void led_sysfs_enable(struct led_classdev *led_cdev); +void led_sysfs_enable(struct led_classdev *led_cdev); /** * led_compose_name - compose LED class device name @@ -310,8 +307,8 @@ extern void led_sysfs_enable(struct led_classdev *led_cdev); * * Returns: 0 on success or negative error value on failure */ -extern int led_compose_name(struct device *dev, struct led_init_data *init_data, - char *led_classdev_name); +int led_compose_name(struct device *dev, struct led_init_data *init_data, + char *led_classdev_name); /** * led_sysfs_is_disabled - check if LED sysfs interface is disabled @@ -360,33 +357,25 @@ struct led_trigger { #define led_trigger_get_led(dev) ((struct led_classdev *)dev_get_drvdata((dev))) #define led_trigger_get_drvdata(dev) (led_get_trigger_data(led_trigger_get_led(dev))) -ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count); -ssize_t led_trigger_show(struct device *dev, struct device_attribute *attr, - char *buf); - /* Registration functions for complex triggers */ -extern int led_trigger_register(struct led_trigger *trigger); -extern void led_trigger_unregister(struct led_trigger *trigger); -extern int devm_led_trigger_register(struct device *dev, +int led_trigger_register(struct led_trigger *trigger); +void led_trigger_unregister(struct led_trigger *trigger); +int devm_led_trigger_register(struct device *dev, struct led_trigger *trigger); -extern void led_trigger_register_simple(const char *name, +void led_trigger_register_simple(const char *name, struct led_trigger **trigger); -extern void led_trigger_unregister_simple(struct led_trigger *trigger); -extern void led_trigger_event(struct led_trigger *trigger, - enum led_brightness event); -extern void led_trigger_blink(struct led_trigger *trigger, - unsigned long *delay_on, - unsigned long *delay_off); -extern void led_trigger_blink_oneshot(struct led_trigger *trigger, - unsigned long *delay_on, - unsigned long *delay_off, - int invert); -extern void led_trigger_set_default(struct led_classdev *led_cdev); -extern int led_trigger_set(struct led_classdev *led_cdev, - struct led_trigger *trigger); -extern void led_trigger_remove(struct led_classdev *led_cdev); +void led_trigger_unregister_simple(struct led_trigger *trigger); +void led_trigger_event(struct led_trigger *trigger, enum led_brightness event); +void led_trigger_blink(struct led_trigger *trigger, unsigned long *delay_on, + unsigned long *delay_off); +void led_trigger_blink_oneshot(struct led_trigger *trigger, + unsigned long *delay_on, + unsigned long *delay_off, + int invert); +void led_trigger_set_default(struct led_classdev *led_cdev); +int led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger); +void led_trigger_remove(struct led_classdev *led_cdev); static inline void led_set_trigger_data(struct led_classdev *led_cdev, void *trigger_data) @@ -414,8 +403,7 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev) * This is meant to be used on triggers with statically * allocated name. */ -extern void led_trigger_rename_static(const char *name, - struct led_trigger *trig); +void led_trigger_rename_static(const char *name, struct led_trigger *trig); #define module_led_trigger(__led_trigger) \ module_driver(__led_trigger, led_trigger_register, \ @@ -457,20 +445,20 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev) /* Trigger specific functions */ #ifdef CONFIG_LEDS_TRIGGER_DISK -extern void ledtrig_disk_activity(bool write); +void ledtrig_disk_activity(bool write); #else static inline void ledtrig_disk_activity(bool write) {} #endif #ifdef CONFIG_LEDS_TRIGGER_MTD -extern void ledtrig_mtd_activity(void); +void ledtrig_mtd_activity(void); #else static inline void ledtrig_mtd_activity(void) {} #endif #if defined(CONFIG_LEDS_TRIGGER_CAMERA) || defined(CONFIG_LEDS_TRIGGER_CAMERA_MODULE) -extern void ledtrig_flash_ctrl(bool on); -extern void ledtrig_torch_ctrl(bool on); +void ledtrig_flash_ctrl(bool on); +void ledtrig_torch_ctrl(bool on); #else static inline void ledtrig_flash_ctrl(bool on) {} static inline void ledtrig_torch_ctrl(bool on) {} @@ -550,7 +538,7 @@ enum cpu_led_event { CPU_LED_HALTED, /* Machine shutdown */ }; #ifdef CONFIG_LEDS_TRIGGER_CPU -extern void ledtrig_cpu(enum cpu_led_event evt); +void ledtrig_cpu(enum cpu_led_event evt); #else static inline void ledtrig_cpu(enum cpu_led_event evt) { @@ -559,7 +547,7 @@ static inline void ledtrig_cpu(enum cpu_led_event evt) #endif #ifdef CONFIG_LEDS_BRIGHTNESS_HW_CHANGED -extern void led_classdev_notify_brightness_hw_changed( +void led_classdev_notify_brightness_hw_changed( struct led_classdev *led_cdev, enum led_brightness brightness); #else static inline void led_classdev_notify_brightness_hw_changed( |