#include <linux/slab.h>
#include <linux/module.h>
#include <linux/leds.h>
#include <sound/core.h>
#include <sound/control.h>
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#define MAX_LED …
#define to_led_card_dev(_dev) …
enum snd_ctl_led_mode { … };
struct snd_ctl_led_card { … };
struct snd_ctl_led { … };
struct snd_ctl_led_ctl { … };
static DEFINE_MUTEX(snd_ctl_led_mutex);
static bool snd_ctl_led_card_valid[SNDRV_CARDS];
static struct led_trigger *snd_ctl_ledtrig_audio[NUM_AUDIO_LEDS];
static struct snd_ctl_led snd_ctl_leds[MAX_LED] = …;
static void snd_ctl_led_sysfs_add(struct snd_card *card);
static void snd_ctl_led_sysfs_remove(struct snd_card *card);
#define UPDATE_ROUTE(route, cb) …
static inline unsigned int access_to_group(unsigned int access)
{ … }
static inline unsigned int group_to_access(unsigned int group)
{ … }
static struct snd_ctl_led *snd_ctl_led_get_by_access(unsigned int access)
{ … }
static int snd_ctl_led_get(struct snd_ctl_led_ctl *lctl)
{ … }
static void snd_ctl_led_set_state(struct snd_card *card, unsigned int access,
struct snd_kcontrol *kctl, unsigned int ioff)
{ … }
static struct snd_ctl_led_ctl *snd_ctl_led_find(struct snd_kcontrol *kctl, unsigned int ioff)
{ … }
static unsigned int snd_ctl_led_remove(struct snd_kcontrol *kctl, unsigned int ioff,
unsigned int access)
{ … }
static void snd_ctl_led_notify(struct snd_card *card, unsigned int mask,
struct snd_kcontrol *kctl, unsigned int ioff)
{ … }
DEFINE_FREE(…)
static int snd_ctl_led_set_id(int card_number, struct snd_ctl_elem_id *id,
unsigned int group, bool set)
{ … }
static void snd_ctl_led_refresh(void)
{ … }
static void snd_ctl_led_ctl_destroy(struct snd_ctl_led_ctl *lctl)
{ … }
static void snd_ctl_led_clean(struct snd_card *card)
{ … }
static int snd_ctl_led_reset(int card_number, unsigned int group)
{ … }
static void snd_ctl_led_register(struct snd_card *card)
{ … }
static void snd_ctl_led_disconnect(struct snd_card *card)
{ … }
static void snd_ctl_led_card_release(struct device *dev)
{ … }
static void snd_ctl_led_release(struct device *dev)
{ … }
static void snd_ctl_led_dev_release(struct device *dev)
{ … }
static ssize_t mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t mode_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t brightness_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RW(mode);
static DEVICE_ATTR_RO(brightness);
static struct attribute *snd_ctl_led_dev_attrs[] = …;
static const struct attribute_group snd_ctl_led_dev_attr_group = …;
static const struct attribute_group *snd_ctl_led_dev_attr_groups[] = …;
static char *find_eos(char *s)
{ … }
static char *parse_uint(char *s, unsigned int *val)
{ … }
static char *parse_string(char *s, char *val, size_t val_size)
{ … }
static char *parse_iface(char *s, snd_ctl_elem_iface_t *val)
{ … }
static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, size_t count,
bool attach)
{ … }
static ssize_t attach_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t detach_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t reset_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t list_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_WO(attach);
static DEVICE_ATTR_WO(detach);
static DEVICE_ATTR_WO(reset);
static DEVICE_ATTR_RO(list);
static struct attribute *snd_ctl_led_card_attrs[] = …;
static const struct attribute_group snd_ctl_led_card_attr_group = …;
static const struct attribute_group *snd_ctl_led_card_attr_groups[] = …;
static struct device snd_ctl_led_dev;
static void snd_ctl_led_sysfs_add(struct snd_card *card)
{ … }
static void snd_ctl_led_sysfs_remove(struct snd_card *card)
{ … }
static struct snd_ctl_layer_ops snd_ctl_led_lops = …;
static int __init snd_ctl_led_init(void)
{ … }
static void __exit snd_ctl_led_exit(void)
{ … }
module_init(…) …
module_exit(…)
MODULE_ALIAS(…) …;
MODULE_ALIAS(…) …;