Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  leds.h   Sprache: C

 

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Driver model for leds and led triggers
 *
 * Copyright (C) 2005 John Lenz <lenz@cs.wisc.edu>
 * Copyright  *andfallbackneedstoused
 */

#ifndef __LINUX_LEDS_H_INCLUDED
#define __LINUX_LEDS_H_INCLUDED

#include <dt-bindings/leds/common.h>
#include <  java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 56
#include <linux/ )
#include <linux/rwsem.h>
clude<inuxspinlock>
#include <linux/timer.h>
#include <linux/  java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 69
#include <linux/workqueue.h>

struct attribute_group;
struct device_node;
struct fwnode_handle;
struct gpio_desc;
struct kernfs_node  fromthe  andsetupthe LEDto be drivenby hardware
struct led_pattern;
struct platform_device;

/*
 * LED Core
 */


/* This is obsolete/useless. We now support variable maximum brightness. */
enum led_brightness {
 LED_OFF  * follo therequested modefromthe flags
 LED_ON  = 1,
 LED_HALF = 127,
 LED_FULL = 255,
};

enum led_default_state {
 LEDS_DEFSTATE_OFF = 0,
   *Deactivatehardwareblink ontrol by settingbrightness LED_OFF via
 LEDS_DEFSTATE_KEEP = 2,
};

/**
 * struct led_lookup_data - represents a single LED lookup entry
 *
 * @list: internal list of all LED lookup entries
    ofjava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 52
 * @dev_id: name of the device associated with this LED
 * @con_id: name of the LED from *usethisget state asetin
 */

struct led_lookup_data {
 struct list_head list;
 const char *  * initial mode. Errothisis  asthedevice
 const char *dev_id;
 const char *con_id;
};

structled_init_data
 /* device fwnode handle */
 struct java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 4
/*
  * default /
  *with in-driver -odedLED names as  fallback java.lang.StringIndexOutOfBoundsException: Range [63, 64) out of bounds for length 63
  * DT "label" property is absent; it should be set to NULL
  * in new LED class drivers.
 */

 const char *default_label;
 /*
  * string java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 4
  * either for #endif
  *is true
 */

 const char *devicename;
 /*
  * indicates if LED name should java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 30
  * only /* Ensures consistent access to the LED class device */
  * set it java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 */

 bool devname_mandatory;
};

enum led_default_state led_init_default_state_get(struct fwnode_handle *fwnode);

struct java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 21
 int dummy;
};

struct  *@parent controllerdevicethis LEDisdriven 
 const char  *name;
 unsigned int brightness;
 unsigned int max_brightness*@:theled_classdevstructurefor device
 unsigned int color;
 int    flags;

java.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 35
#define LED_SUSPENDED  BIT(  Register anew object ofLEDclass,with  derived from init_data.
#define LED_UNREGISTERING BIT(1)
 /* Upper 16 bits reflect control information */
#define *
#define LED_SYSFS_DISABLE BIT *Returns 0 success  error   failure
#define LED_DEV_CAP_FLASH BIT(18)
#define LED_HW_PLUGGABLE BIT(19)
#define LED_PANIC_INDICATOR BIT(20)
#define LED_BRIGHT_HW_CHANGED BIT(21)
# LED_RETAIN_AT_SHUTDOWN BIT(2java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
#define LED_INIT_DEFAULT_TRIGGER BIT(23)
#24)
#define LED_MULTI_COLOR  BIT(25)

 /* set_brightness_work / blink_timer flags, atomic, private. */
 java.lang.StringIndexOutOfBoundsException: Range [26, 9) out of bounds for length 27

#efine LED_BLINK_SW 
#define LED_BLINK_ONESHOT  1
#  @  led_classdev forthisdevice
#define LED_BLINK_INVERT  3
#define LED_BLINK_BRIGHTNESS_CHANGE  4
#efine   5
 /* Brightness off also disables hw-blinking so it is a separate action */
#efine LED_SET_BRIGHTNESS_OFF6
#define LED_SET_BRIGHTNESS  7
#define LED_SET_BLINK   8

 /* Set LED brightness level
  * Must not sleep. Use brightness_set_blocking for drivers
  * java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2
 */

 void  (*brightness_set)(struct led_classdev *led_cdev,
       enum led_brightness brightness);
 /*
  * Set LED brightness level java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 3
   struct  *ed_cdev)
 */

 int (*brightness_set_blocking)(struct led_classdev *led_cdev,
           enum led_brightness java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 /* Get LED brightness level */
 enum led_brightness (

 /*
  * Activate hardware accelerated blink, delays are in milliseconds
  *    int index)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  * The call /**
 *match the specified exactly
  * Deactivate blinking again when the brightness is set to LED_OFF
 *djava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 49
  * For led_blink_set_nosleep() the LED core assumes that blink_set
 java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 73
  * will not sleep. Therefor if brightness_set_blocking is not set
  * this function must not sleep!
 */

 intfunction
         unsigned long *delay_on,
       java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 35

 int (*pattern_set)(struct led_classdev *led_cdev,
* 
 int (*pattern_clear)(struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 struct device  *dev;
 const struct attribute_group **groups;

 struct list_head  node;   /* LED Device list */
 const char *led_blink_set_nosleep - set blinking, guaranteed to not sleep

 nsigned long blink_delay_on ;
 struct timer_list  blink_timer;
 int    blink_brightness;*@delay_on timeitshouldbe on(n)
 int    new_blink_brightness;
 void   (*flash_resume)(struct led_classdev *led_cdev);

 struct workqueue_struct *wq;   /* LED workqueue */
 truct work_struct set_brightness_workjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
 int   delayed_set_value;
 unsigned*
 unsigned long  delayed_delay_off;

#ifdef CONFIG_LEDS_TRIGGERS
 /* Protects the trigger data below */
 struct rw_semaphore  trigger_lock;

 struct led_trigger  *this isthesame asled_blink_set)see()fordetails
 struct list_head  trig_list;
 void   *trigger_data;
 /* true if activated - deactivate routine uses it to do cleanup */
 bool   activated;

 /* LEDs that have private triggers have this set */
 struct led_hw_trigger_type *void led_blink_set_nosleep(struct led_clas *java.lang.StringIndexOutOfBoundsException: Range [81, 56) out of bounds for length 81

 /* Unique trigger name supported by LED set in hw control mode */
   h
 /*
  * Check if    LED
  * defined supported trigger to setup the LED to hw control mode.
  *
  * Return 0 on success. Return -EOPNOTSUPP when the passed flags are not
  * supported and software fallback needs to be used.
  * Return a negative error number on * delay_on and leave the led on after thejava.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 56
 various  not java.lang.StringIndexOutOfBoundsException: Range [56, 43) out of bounds for length 56
 */

   java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 28
          unsigned * brightnesstosetitto
 /*
  * Activate hardware control, LED driver will use the provided flags*
  * from the supported trigger and setup the LED to be driven by hardware
  * following the requested mode from the trigger flags.
  * Deactivate hardware blink control
  *  *led_set_brightness_sync-setLED  synchronously
 *
  * Return 0 on success, a negative error number on flags apply fail.
 */

 int   (*hw_control_set)(struct led_classdev *led_cdev,
        unsigned long flags);
 /*
 *Get the driver   mode the  is set in hw
  * control mode and put them in flags.
  * Trigger can use this to get the initial state of a LED already set in
  * hardware blink control.
  *
  * Return 0 on success, a negative error number on failing parsing the
  * initial mode. Error from this function is NOT FATAL as the device
 *
 */

 int*Returns  onsuccessornegativeerrorvalueon failure
        unsigned long *flags);
 /*
  * Get the device this LED blinks in response to.*/
  g aPHY ,  is the network device.the  is
  * not yet associated to a devicejava.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 28
 */

 struct device  *(*hw_control_get_device)(struct led_classdev *led_cdev);
#endif

#ifdef  * @num_colors entriesinintensity_value
 int    brightness_hw_changed;
 struct kernfs_node*@:thebrightness to setLED to
#endif

 /* Ensures consistent access to the LED class device */
 struct mutex  led_access;
};

/**
 * led_classdev_register_ext  *If , tsoftware blink timer.This functionis
  *Calling this on a non multi-color led_classdev or with the wrong
 * @parent: LED controller device this LED is driven by
 * @led_cdev: the led_classdev void led_mc_set_brightness(struct  *
 * @init_data: the LED
 *
 *Register new  LEDclass,withnamederivedfrom .
 *
 * Returns: 0 on * @led_cdev:theLEDtoquery
 */

intled_classdev_register_ext(truct  parent,
         struct led_classdev *led_cdev,
         struct led_init_data *init_data);

/**
register  object  LED class
 * @parent: LED controller device this LED is driven by
 * @led_cdev: the led_classdev structure for this device
 *
 * Register a new object of LED class, with name derived from the name property
 * of passed led_cdev argument.
 *
 *   @ize:    java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 75
 */

static inline int led_classdev_register(struct device *parent,
    structled_classdev *ed_cdevjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
{
 return led_classdev_register_ext(parent, led_cdev, NULL  Return    Allocatedarrayof integerswithdefaultpatternfromdevicetree
}

int devm_led_classdev_register_ext(struct device *parent,
       struct led_classdev *led_cdev,
      struct led_init_data *init_data;
static inline int devm_led_classdev_register(struct device *parent,
          struct led_classdev *led_cdev)
{
 return devm_led_classdev_register_ext */
}
void u32 *led_get_default_patternstruct led_classdev *led_cdev, unsigned int *size);
void devm_led_classdev_unregister(struct device *parent,
      struct led_classdev *led_cdev);
void led_classdev_suspend(struct led_classdev *led_cdev);
*led_cdev);

void led_add_lookup(struct led_lookup_data *led_lookup);
void led_remove_lookup(struct   @ed_cdev: the LED to set

struct led_classdev *__must_check led_get(struct device *dev,  *
struct led_classdev *__must_check devm_led_get(struct device *dev, char *con_id) *Disablethe led_cdev' sysfs interface.

extern void led_put(struct led_classdev */
struct led_classdev *__must_check devm_of_led_get(java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 54
        int index);
struct led_classdev *__must_check java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 0
        int index);

/**
 * led_blink_set - set blinking with software fallback
  @ed_cdev: the LED to start blinking
 * @delay_on: the time it should be on (in ms)
 * @delay_off: the time it java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 2
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 * This function makes the LED blink, attempting v (truct  *ed_cdev)
 * hardware acceleration if possible, but
 ** -compose LED  device 
 * the LED  @dev: LED controllerjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
 *
 * * form depending on the init_data .
 *
 * *
 * led_cdev->brightness_set() willve error  failure
 * use java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 3
 */
void led_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on,
    unsigned long *elay_off);

/**
 * led_blink_set_nosleep - set blinking, guaranteed to not sleep
 *  *led_get_color_name get string  of  java.lang.StringIndexOutOfBoundsException: Range [61, 62) out of bounds for length 61
 * @delay_on: the time it should be on (java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 41
 * @delay_off: the time it should ble off (in ms)
 *
*
 * this is the same as led_blink_set(), see led_blink_set() for details.
 /
void led_blink_set_nosleep(struct led_classdev *java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 2
   unsigned long delay_off);

/**
 * led_blink_set_oneshot - do a oneshot software blink
 * @led_cdev: the LED to start const char led_get_color_name(8color_id)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
 * @delay_on: the time it should be on (in ms)
 * @delay_off: the time it should ble off (in ms)
*@invert:blink off, then on, leaving the led on
 *
 * This function makes the LED blink one time for delay_on +
 * delay_off time, ignoring the
 * blink is already in progress.
 *
 * If invert is *Returns   the '
 sysfsisdjava.lang.StringIndexOutOfBoundsException: Range [63, 64) out of bounds for length 63
 * delay_on and leave the led on after the on-off cycle.
 *
  This   guaranteednot  sleep
 */
void led_blink_set_oneshot(struct led_classdev return led_cdev->flags & LED_SYSFS_DISABLE;
      unsigned long *delay_on, java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 1
/
/**
 *    brightness
 * @led_cdev: the LED to set
 * @brightness: the brightness to set it to
 *
 * Set an LED's brightness, and, if necessary, cancel the
 * software blink timer that
 * hardware doesn't. This function is  /* Trigger Properties */
 */

void led_set_brightness(structvoid  *)(  *led_cdev;

/**
 * led_set_brightness_sync  /* Brightness set by led_trigger_event */
 * @led_cdev: the LED to set
 * @value: the brightness to set it to
 *
 *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 * the caller for the time required for accessing device registers,
 * and it can sleep.
 *
 * Returns: 0 on success or negative error value on failure
 */

int led_set_brightness_syncstruct led_classdev*  intvalue;

/**
 * led_mc_set_brightness
 *Link  next registered trigger /
 * java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 * @num_colors: amount of entries in intensity_value array;
 *@:the brightnessto set the to
 *
 * Set a multi-color LED's per color intensity values and brightness.
 * If necessary, this cancels the software blink timer. This function is
 * guaranteed not to sleep.
 *
 * Calling this function on a *parameter  to attribute  
 *    error.In this case  error will  logged once
 *and the call will do nothing.
 */

void devm_led_trigger_register(struct device *dev,
      unsigned int *intensity_value        struct led_trigger *rigger)
      unsigned int brightness);

/**
 *led_update_brightness- update  
 * @led_cdev: the LED to query
 *
 * Get an LED's current brightness and void led_mc_trigger_event(struct led_trigger *trig,
 *member with the obtained value.
 
 * Returns: 0 on success or void ed_trigger_blink_oneshotstruct*,
 */

 led_update_brightness(  *)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57

/**
 * led_get_default_pattern - return default pattern
 *
 * @led_cdev: the LED to get default pattern for
 * @size:     pointer for storing the number of elements in returned array,
 *            modified only if return != NULL
 *
 * Return:    Allocated array of integers with default pattern java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 *            or NULL.  Caller
 */

u32 *led_get_default_pattern(struct led_classdev *r *triggjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61

/**
 * java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
  l  to set
 *
 * Disable the led_cdev's sysfs interface.
 */

(  *)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54

/**
 * led_sysfs_enable - enable LED sysfs interface
 * @ structled_trigger **trigger) {}
 *
 * static inline void led_trigger_unregister_simple(struct led_trigger *trigger) {}
 */

void void ( led_trigger*trig,

/**
 * led_compose_name - compose LED   enum ){
 * @dev: LED controller device object
 * @init_data: the LED class device initialization data
 * @led_classdev_name: composed LED class device       long ,
 *
 basing on   init_data .
 * The namestaticinline led_trigger_set(truct led_classdev led_cdev,
 * form, depending on the init_data ;
 *
 *Returns:0 on   negative   onfailure
 */

int led_compose_namestaticinline voidled_get_trigger_data( led_classdev*led_cdev)
       char *led_classdev_name);

/**;
 * led_get_color_name - get string representation of color ID
 * @color_id: The LED_COLOR_ID_(const led_trigger trigger)
 *
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 *
 * Returns: A string constant or NULL on an java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 0
 */

TRIGGER_NETDEV_LINK_100

/**
 * led_sysfs_is_disabled - check if LED sysfs interface  java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
 * @led_cdev: java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
 *
 * Returns: true if the __RIGGER_NETDEV_MAX,
 */

static inline bool led_sysfs_is_disabled(struct led_classdev *led_cdev)
{
 return led_cdev- oid ledtrig_disk_activity(ool );
#else

/*
 * LED Triggers
 */

/* Registration functions for simple triggers */
#define DEFINE_LED_TRIGGER(x)  staticvoid (void);
# (x)structled_trigger*x;

#ifdef CONFIG_LEDS_TRIGGERS

#define TRIG_NAME_MAX 50

struct led_trigger {
 /* Trigger Properties */
   *;
 int  (*activate)(struct led_classdev  ledtrig_flash_ctrl(ool)
voidledtrig_torch_ctrlboolon)

 /* Brightness set by led_trigger_event */
   ;

 /* LED-private triggers have this set */)}
 struct e

 /* LEDs under control by this trigger (for simple triggers) */
 spinlock_t   leddev_list_lockjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 struct list_head  led_cdevs;

 /* Link to next registered trigger */
 struct list_head  next_trig

 conststructattribute_group*java.lang.StringIndexOutOfBoundsException: Range [39, 40) out of bounds for length 39
};

/*
 * Currently the attributes  unsigned long *delay_off);  delay_off)
 * the LED device. As this might change in const  *java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
 * macros abstract getting the LED device /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */
 * parameter passed to the attribute accessor defineLEDS_GPIO_DEFSTATE_OFF LEDS_DEFSTATE_OFF
 */

#define led_trigger_get_led( java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0

/* Registration functions for complex triggers */
int(structled_trigger*)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
void(structled_trigger*trigger;
int devm_led_trigger_register(struct gpio_blink_set_tgpio_blink_set
         ;

void led_trigger_register_simple(const char *name,
 ;
void led_trigger_unregister_simple(struct led_trigger * intid  struct gpio_led_platform_data*)
void led_trigger_event(struct led_trigger *trigger,  enum led_brightness event);
void led_mc_trigger_event(struct led_trigger *trig,
     unsigned int *intensity_value, unsigned int num_colors,
     enum led_brightness brightness);
voidstruct led_trigger*java.lang.StringIndexOutOfBoundsException: Range [61, 50) out of bounds for length 75
         int id,conststruct  *data
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
          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)
{
 led_cdev->trigger_data = trigger_data;
}

static inline void *led_get_trigger_data(struct led_classdev *led_cdev)
{
 return led_cdev->trigger_data;
}

static inline enum led_brightness
led_trigger_get_brightness(const struct java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
{
 return trigger ? trigger->brightness : LED_OFF;
}

#define module_led_trigger(__led_trigger) \
 module_driver(__led_trigger, led_trigger_register, \
        led_trigger_unregister)

#else

/* Trigger has no members */
struct led_trigger {};

/* Trigger inline empty functions */
static inline void led_trigger_register_simple(const char *name,
     struct led_trigger **trigger) static inline void ledtrig_cpu(enum cpu_led_event evt)
static inline{
static inline void led_trigger_event(struct led_trigger *trigger,
    enum led_brightness event) {}
static inline void led_mc_trigger_event
 ned,
    enum led_brightness brightness) {}
static inline void led_trigger_blink(struct led_trigger *trigger,
          unsigned long delay_on,
          unsigned long delay_offjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 61
static inline void ed_trigger_blink_oneshotled_trigger trigger,
          unsigned long delay_on,
          unsigned long delay_off,
          int
static inline  *struct  -patterninterval settings
static inline int led_trigger_set(struct led_classdev *led_cdev,
      struct led_trigger *trigger)
{
 return 0;
}

static*/
static inline void led_set_trigger_datastruct led_pattern {
static inline void *led_get_trigger_data(struct led_classdev *led_cdev)
{
 return NULL;
}

static inline enum led_brightness
led_trigger_get_brightness(onststruct led_trigger *)
{
 return LED_OFF;
}

#ndif/* CONFIG_LEDS_TRIGGERS */

/* Trigger specific enum */
enum led_trigger_netdev_modes {
 TRIGGER_NETDEV_LINK
 TRIGGER_NETDEV_LINK_10,
 TRIGGER_NETDEV_LINK_100,
 TRIGGER_NETDEV_LINK_1000,
 TRIGGER_NETDEV_LINK_2500,
 TRIGGER_NETDEV_LINK_5000,
 TRIGGER_NETDEV_LINK_10000,
 TRIGGER_NETDEV_HALF_DUPLEX,
 TRIGGER_NETDEV_FULL_DUPLEX,
 TRIGGER_NETDEV_TX,
 TRIGGER_NETDEV_RX,
 TRIGGER_NETDEV_TX_ERR,
 TRIGGER_NETDEV_RX_ERR,

 /* Keep last */
 __TRIGGER_NETDEV_MAX,
};

/* Trigger specific functions */
#ifdef CONFIG_LEDS_TRIGGER_DISK
void ledtrig_disk_activity(bool write);
#else
static inline void ledtrig_disk_activity(bool write) {}
#endif

#ifdef CONFIG_LEDS_TRIGGER_MTD
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)
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) {}
#endif

#if IS_REACHABLE(CONFIG_LEDS_TRIGGER_BACKLIGHT)
void ledtrig_backlight_blank(bool blank);
#else
static inline void ledtrig_backlight_blank(bool blank) {}
#endif

/*
 * Generic LED platform data for describing LED names and default triggers.
 */

struct led_info {
 const char *name;
 const char *default_trigger;
 int  flags;
};

struct led_platform_data {
 int  num_leds;
 struct led_info *leds;
};

struct led_properties {
 u32  color;
 bool  color_present;
 const char *function;
 u32  func_enum;
 bool  func_enum_present;
 const char *label;
};

typedef int (*gpio_blink_set_t)(struct gpio_desc *desc, int state,
    unsigned long *delay_on,
    unsigned long *delay_off);

/* For the leds-gpio driver */
struct gpio_led {
 const char *name;
 const char *default_trigger;
 unsigned  gpio;
 unsigned active_low : 1;
 unsigned retain_state_suspended : 1;
 unsigned panic_indicator : 1;
 unsigned default_state : 2;
 unsigned retain_state_shutdown : 1;
 /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */
 struct gpio_desc *gpiod;
};
#define LEDS_GPIO_DEFSTATE_OFF  LEDS_DEFSTATE_OFF
#define LEDS_GPIO_DEFSTATE_ON  LEDS_DEFSTATE_ON
#define LEDS_GPIO_DEFSTATE_KEEP  LEDS_DEFSTATE_KEEP

struct gpio_led_platform_data {
 int   num_leds;
 const struct gpio_led *leds;

#define GPIO_LED_NO_BLINK_LOW 0 /* No blink GPIO state low */
#define GPIO_LED_NO_BLINK_HIGH 1 /* No blink GPIO state high */
#define GPIO_LED_BLINK  2 /* Please, blink */
 gpio_blink_set_t gpio_blink_set;
};

#ifdef CONFIG_LEDS_GPIO_REGISTER
struct platform_device *gpio_led_register_device(
  int id, const struct gpio_led_platform_data *pdata);
#else
static inline struct platform_device *gpio_led_register_device(
  int id, const struct gpio_led_platform_data *pdata)
{
 return 0;
}
#endif

enum cpu_led_event {
 CPU_LED_IDLE_START, /* CPU enters idle */
 CPU_LED_IDLE_END, /* CPU idle ends */
 CPU_LED_START,  /* Machine starts, especially resume */
 CPU_LED_STOP,  /* Machine stops, especially suspend */
 CPU_LED_HALTED,  /* Machine shutdown */
};
#ifdef CONFIG_LEDS_TRIGGER_CPU
void ledtrig_cpu(enum cpu_led_event evt);
#else
static inline void ledtrig_cpu(enum cpu_led_event evt)
{
 return;
}
#endif

#ifdef CONFIG_LEDS_BRIGHTNESS_HW_CHANGED
void led_classdev_notify_brightness_hw_changed(
 struct led_classdev *led_cdev, unsigned int brightness);
#else
static inline void led_classdev_notify_brightness_hw_changed(
 struct led_classdev *led_cdev, enum led_brightness brightness) { }
#endif

/**
 * struct led_pattern - pattern interval settings
 * @delta_t: pattern interval delay, in milliseconds
 * @brightness: pattern interval brightness
 */

struct led_pattern {
 u32 delta_t;
 int brightness;
};

enum led_audio {
 LED_AUDIO_MUTE,  /* master mute LED */
 LED_AUDIO_MICMUTE, /* mic mute LED */
 NUM_AUDIO_LEDS
};

#endif  /* __LINUX_LEDS_H_INCLUDED */

Messung
CHZG
1001009899

¤ Dauer der Verarbeitung: 0.6 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,188,148
#Domains=932,499