#include <linux/init.h>
#include <linux/slab.h>
#include <linux/compat.h>
#include <linux/mutex.h>
#include <linux/ctype.h>
#include <linux/string.h>
#include <linux/export.h>
#include <sound/core.h>
#include <sound/hda_codec.h>
#include "hda_local.h"
#include <sound/hda_hwdep.h>
#include <sound/minors.h>
struct hda_hint { … };
static ssize_t power_on_acct_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t power_off_acct_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(power_on_acct);
static DEVICE_ATTR_RO(power_off_acct);
#define CODEC_INFO_SHOW(type, field) …
#define CODEC_INFO_STR_SHOW(type, field) …
CODEC_INFO_SHOW(vendor_id, core.vendor_id);
CODEC_INFO_SHOW(subsystem_id, core.subsystem_id);
CODEC_INFO_SHOW(revision_id, core.revision_id);
CODEC_INFO_SHOW(afg, core.afg);
CODEC_INFO_SHOW(mfg, core.mfg);
CODEC_INFO_STR_SHOW(vendor_name, core.vendor_name);
CODEC_INFO_STR_SHOW(chip_name, core.chip_name);
CODEC_INFO_STR_SHOW(modelname, modelname);
static ssize_t pin_configs_show(struct hda_codec *codec,
struct snd_array *list,
char *buf)
{ … }
static ssize_t init_pin_configs_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t driver_pin_configs_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
#ifdef CONFIG_SND_HDA_RECONFIG
static int clear_codec(struct hda_codec *codec)
{ … }
static int reconfig_codec(struct hda_codec *codec)
{ … }
static char *kstrndup_noeol(const char *src, size_t len)
{ … }
#define CODEC_INFO_STORE(type, field) …
#define CODEC_INFO_STR_STORE(type, field) …
CODEC_INFO_STORE(vendor_id, core.vendor_id);
CODEC_INFO_STORE(subsystem_id, core.subsystem_id);
CODEC_INFO_STORE(revision_id, core.revision_id);
CODEC_INFO_STR_STORE(vendor_name, core.vendor_name);
CODEC_INFO_STR_STORE(chip_name, core.chip_name);
CODEC_INFO_STR_STORE(modelname, modelname);
#define CODEC_ACTION_STORE(type) …
CODEC_ACTION_STORE(reconfig);
CODEC_ACTION_STORE(clear);
static ssize_t init_verbs_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static int parse_init_verbs(struct hda_codec *codec, const char *buf)
{ … }
static ssize_t init_verbs_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t hints_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static struct hda_hint *get_hint(struct hda_codec *codec, const char *key)
{ … }
static void remove_trail_spaces(char *str)
{ … }
#define MAX_HINTS …
static int parse_hints(struct hda_codec *codec, const char *buf)
{ … }
static ssize_t hints_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t user_pin_configs_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static int parse_user_pin_configs(struct hda_codec *codec, const char *buf)
{ … }
static ssize_t user_pin_configs_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(init_verbs);
static DEVICE_ATTR_RW(hints);
static DEVICE_ATTR_RW(user_pin_configs);
static DEVICE_ATTR_WO(reconfig);
static DEVICE_ATTR_WO(clear);
const char *snd_hda_get_hint(struct hda_codec *codec, const char *key)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
#ifdef CONFIG_SND_HDA_RECONFIG
#define RECONFIG_DEVICE_ATTR(name) …
#else
#define RECONFIG_DEVICE_ATTR …
#endif
static RECONFIG_DEVICE_ATTR(vendor_id);
static RECONFIG_DEVICE_ATTR(subsystem_id);
static RECONFIG_DEVICE_ATTR(revision_id);
static DEVICE_ATTR_RO(afg);
static DEVICE_ATTR_RO(mfg);
static RECONFIG_DEVICE_ATTR(vendor_name);
static RECONFIG_DEVICE_ATTR(chip_name);
static RECONFIG_DEVICE_ATTR(modelname);
static DEVICE_ATTR_RO(init_pin_configs);
static DEVICE_ATTR_RO(driver_pin_configs);
#ifdef CONFIG_SND_HDA_PATCH_LOADER
enum { … };
static inline int strmatch(const char *a, const char *b)
{ … }
static void parse_codec_mode(char *buf, struct hda_bus *bus,
struct hda_codec **codecp)
{ … }
static void parse_pincfg_mode(char *buf, struct hda_bus *bus,
struct hda_codec **codecp)
{ … }
static void parse_verb_mode(char *buf, struct hda_bus *bus,
struct hda_codec **codecp)
{ … }
static void parse_hint_mode(char *buf, struct hda_bus *bus,
struct hda_codec **codecp)
{ … }
static void parse_model_mode(char *buf, struct hda_bus *bus,
struct hda_codec **codecp)
{ … }
static void parse_chip_name_mode(char *buf, struct hda_bus *bus,
struct hda_codec **codecp)
{ … }
#define DEFINE_PARSE_ID_MODE(name) …
DEFINE_PARSE_ID_MODE(vendor_id);
DEFINE_PARSE_ID_MODE(subsystem_id);
DEFINE_PARSE_ID_MODE(revision_id);
struct hda_patch_item { … };
static const struct hda_patch_item patch_items[NUM_LINE_MODES] = …;
static int parse_line_mode(char *buf, struct hda_bus *bus)
{ … }
static int get_line_from_fw(char *buf, int size, size_t *fw_size_p,
const void **fw_data_p)
{ … }
int snd_hda_load_patch(struct hda_bus *bus, size_t fw_size, const void *fw_buf)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
static struct attribute *hda_dev_attrs[] = …;
static const struct attribute_group hda_dev_attr_group = …;
const struct attribute_group *snd_hda_dev_attr_groups[] = …;
void snd_hda_sysfs_init(struct hda_codec *codec)
{ … }
void snd_hda_sysfs_clear(struct hda_codec *codec)
{ … }