linux/drivers/leds/trigger/ledtrig-pattern.c

// SPDX-License-Identifier: GPL-2.0

/*
 * LED pattern trigger
 *
 * Idea discussed with Pavel Machek. Raphael Teysseyre implemented
 * the first version, Baolin Wang simplified and improved the approach.
 */

#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/timer.h>
#include <linux/hrtimer.h>

#define MAX_PATTERNS
/*
 * When doing gradual dimming, the led brightness will be updated
 * every 50 milliseconds.
 */
#define UPDATE_INTERVAL

enum pattern_type {};

struct pattern_trig_data {};

static void pattern_trig_update_patterns(struct pattern_trig_data *data)
{}

static int pattern_trig_compute_brightness(struct pattern_trig_data *data)
{}

static void pattern_trig_timer_start(struct pattern_trig_data *data)
{}

static void pattern_trig_timer_cancel(struct pattern_trig_data *data)
{}

static void pattern_trig_timer_restart(struct pattern_trig_data *data,
				       unsigned long interval)
{}

static void pattern_trig_timer_common_function(struct pattern_trig_data *data)
{}

static void pattern_trig_timer_function(struct timer_list *t)
{}

static enum hrtimer_restart pattern_trig_hrtimer_function(struct hrtimer *t)
{}

static int pattern_trig_start_pattern(struct led_classdev *led_cdev)
{}

static ssize_t repeat_show(struct device *dev, struct device_attribute *attr,
			   char *buf)
{}

static ssize_t repeat_store(struct device *dev, struct device_attribute *attr,
			    const char *buf, size_t count)
{}

static DEVICE_ATTR_RW(repeat);

static ssize_t pattern_trig_show_patterns(struct pattern_trig_data *data,
					  char *buf, enum pattern_type type)
{}

static int pattern_trig_store_patterns_string(struct pattern_trig_data *data,
					      const char *buf, size_t count)
{}

static int pattern_trig_store_patterns_int(struct pattern_trig_data *data,
					   const u32 *buf, size_t count)
{}

static ssize_t pattern_trig_store_patterns(struct led_classdev *led_cdev,
					   const char *buf, const u32 *buf_int,
					   size_t count, enum pattern_type type)
{}

static ssize_t pattern_show(struct device *dev, struct device_attribute *attr,
			    char *buf)
{}

static ssize_t pattern_store(struct device *dev, struct device_attribute *attr,
			     const char *buf, size_t count)
{}

static DEVICE_ATTR_RW(pattern);

static ssize_t hw_pattern_show(struct device *dev,
			       struct device_attribute *attr, char *buf)
{}

static ssize_t hw_pattern_store(struct device *dev,
				struct device_attribute *attr,
				const char *buf, size_t count)
{}

static DEVICE_ATTR_RW(hw_pattern);

static ssize_t hr_pattern_show(struct device *dev,
			       struct device_attribute *attr, char *buf)
{}

static ssize_t hr_pattern_store(struct device *dev,
				struct device_attribute *attr,
				const char *buf, size_t count)
{}

static DEVICE_ATTR_RW(hr_pattern);

static umode_t pattern_trig_attrs_mode(struct kobject *kobj,
				       struct attribute *attr, int index)
{}

static struct attribute *pattern_trig_attrs[] =;

static const struct attribute_group pattern_trig_group =;

static const struct attribute_group *pattern_trig_groups[] =;

static void pattern_init(struct led_classdev *led_cdev)
{}

static int pattern_trig_activate(struct led_classdev *led_cdev)
{}

static void pattern_trig_deactivate(struct led_classdev *led_cdev)
{}

static struct led_trigger pattern_led_trigger =;

static int __init pattern_trig_init(void)
{}

static void __exit pattern_trig_exit(void)
{}

module_init();
module_exit(pattern_trig_exit);

MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();