1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2c72a1d60SRichard Purdie /* 3c72a1d60SRichard Purdie * LED Core 4c72a1d60SRichard Purdie * 5c72a1d60SRichard Purdie * Copyright 2005 Openedhand Ltd. 6c72a1d60SRichard Purdie * 7c72a1d60SRichard Purdie * Author: Richard Purdie <rpurdie@openedhand.com> 8c72a1d60SRichard Purdie */ 9c72a1d60SRichard Purdie #ifndef __LEDS_H_INCLUDED 10c72a1d60SRichard Purdie #define __LEDS_H_INCLUDED 11c72a1d60SRichard Purdie 1272f8da32SRichard Purdie #include <linux/rwsem.h> 13c72a1d60SRichard Purdie #include <linux/leds.h> 14c72a1d60SRichard Purdie 150013b23dSNémeth Márton static inline int led_get_brightness(struct led_classdev *led_cdev) 160013b23dSNémeth Márton { 170013b23dSNémeth Márton return led_cdev->brightness; 180013b23dSNémeth Márton } 190013b23dSNémeth Márton 20757b06aeSJacek Anaszewski void led_init_core(struct led_classdev *led_cdev); 21d23a22a7SFabio Baltieri void led_stop_software_blink(struct led_classdev *led_cdev); 2281fe8e5bSJacek Anaszewski void led_set_brightness_nopm(struct led_classdev *led_cdev, 2381fe8e5bSJacek Anaszewski enum led_brightness value); 2481fe8e5bSJacek Anaszewski void led_set_brightness_nosleep(struct led_classdev *led_cdev, 2581fe8e5bSJacek Anaszewski enum led_brightness value); 26*11f70002SAkinobu Mita ssize_t led_trigger_read(struct file *filp, struct kobject *kobj, 27*11f70002SAkinobu Mita struct bin_attribute *attr, char *buf, 28*11f70002SAkinobu Mita loff_t pos, size_t count); 29*11f70002SAkinobu Mita ssize_t led_trigger_write(struct file *filp, struct kobject *kobj, 30*11f70002SAkinobu Mita struct bin_attribute *bin_attr, char *buf, 31*11f70002SAkinobu Mita loff_t pos, size_t count); 32d23a22a7SFabio Baltieri 3372f8da32SRichard Purdie extern struct rw_semaphore leds_list_lock; 34c72a1d60SRichard Purdie extern struct list_head leds_list; 35ba93cdceSEzequiel Garcia extern struct list_head trigger_list; 36bb4e9af0SJacek Anaszewski extern const char * const led_colors[LED_COLOR_ID_MAX]; 37c72a1d60SRichard Purdie 38c72a1d60SRichard Purdie #endif /* __LEDS_H_INCLUDED */ 39