linux/drivers/leds/led-triggers.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * LED Triggers Core
 *
 * Copyright 2005-2007 Openedhand Ltd.
 *
 * Author: Richard Purdie <[email protected]>
 */

#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/device.h>
#include <linux/timer.h>
#include <linux/rwsem.h>
#include <linux/leds.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include "leds.h"

/*
 * Nests outside led_cdev->trigger_lock
 */
static DECLARE_RWSEM(triggers_list_lock);
static LIST_HEAD(trigger_list);

 /* Used by LED Class */

static inline bool
trigger_relevant(struct led_classdev *led_cdev, struct led_trigger *trig)
{}

ssize_t led_trigger_write(struct file *filp, struct kobject *kobj,
			  struct bin_attribute *bin_attr, char *buf,
			  loff_t pos, size_t count)
{}
EXPORT_SYMBOL_GPL();

__printf(3, 4)
static int led_trigger_snprintf(char *buf, ssize_t size, const char *fmt, ...)
{}

static int led_trigger_format(char *buf, size_t size,
			      struct led_classdev *led_cdev)
{}

/*
 * It was stupid to create 10000 cpu triggers, but we are stuck with it now.
 * Don't make that mistake again. We work around it here by creating binary
 * attribute, which is not limited by length. This is _not_ good design, do not
 * copy it.
 */
ssize_t led_trigger_read(struct file *filp, struct kobject *kobj,
			struct bin_attribute *attr, char *buf,
			loff_t pos, size_t count)
{}
EXPORT_SYMBOL_GPL();

/* Caller must ensure led_cdev->trigger_lock held */
int led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig)
{}
EXPORT_SYMBOL_GPL();

void led_trigger_remove(struct led_classdev *led_cdev)
{}
EXPORT_SYMBOL_GPL();

static bool led_match_default_trigger(struct led_classdev *led_cdev,
				      struct led_trigger *trig)
{}

void led_trigger_set_default(struct led_classdev *led_cdev)
{}
EXPORT_SYMBOL_GPL();

/* LED Trigger Interface */

int led_trigger_register(struct led_trigger *trig)
{}
EXPORT_SYMBOL_GPL();

void led_trigger_unregister(struct led_trigger *trig)
{}
EXPORT_SYMBOL_GPL();

static void devm_led_trigger_release(struct device *dev, void *res)
{}

int devm_led_trigger_register(struct device *dev,
			      struct led_trigger *trig)
{}
EXPORT_SYMBOL_GPL();

/* Simple LED Trigger Interface */

void led_trigger_event(struct led_trigger *trig,
			enum led_brightness brightness)
{}
EXPORT_SYMBOL_GPL();

void led_mc_trigger_event(struct led_trigger *trig,
			  unsigned int *intensity_value, unsigned int num_colors,
			  enum led_brightness brightness)
{}
EXPORT_SYMBOL_GPL();

static void led_trigger_blink_setup(struct led_trigger *trig,
			     unsigned long delay_on,
			     unsigned long delay_off,
			     int oneshot,
			     int invert)
{}

void led_trigger_blink(struct led_trigger *trig,
		       unsigned long delay_on,
		       unsigned long delay_off)
{}
EXPORT_SYMBOL_GPL();

void led_trigger_blink_oneshot(struct led_trigger *trig,
			       unsigned long delay_on,
			       unsigned long delay_off,
			       int invert)
{}
EXPORT_SYMBOL_GPL();

void led_trigger_register_simple(const char *name, struct led_trigger **tp)
{}
EXPORT_SYMBOL_GPL();

void led_trigger_unregister_simple(struct led_trigger *trig)
{}
EXPORT_SYMBOL_GPL();