#include <linux/module.h>
#include <linux/init.h>
#include <linux/async.h>
#include <linux/cleanup.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/bitops.h>
#include <linux/platform_device.h>
#include <linux/jiffies.h>
#include <linux/debugfs.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <linux/pinctrl/consumer.h>
#include <linux/clk.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/initval.h>
#include <trace/events/asoc.h>
#define DAPM_UPDATE_STAT(widget, val) …
#define SND_SOC_DAPM_DIR_REVERSE(x) …
#define snd_soc_dapm_for_each_direction(dir) …
static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
struct snd_soc_dapm_widget *wsource, struct snd_soc_dapm_widget *wsink,
const char *control,
int (*connected)(struct snd_soc_dapm_widget *source,
struct snd_soc_dapm_widget *sink));
struct snd_soc_dapm_widget *
snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_widget *widget);
struct snd_soc_dapm_widget *
snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_widget *widget);
static unsigned int soc_dapm_read(struct snd_soc_dapm_context *dapm, int reg);
static int dapm_up_seq[] = …;
static int dapm_down_seq[] = …;
static void dapm_assert_locked(struct snd_soc_dapm_context *dapm)
{ … }
static void pop_wait(u32 pop_time)
{ … }
__printf(3, 4)
static void pop_dbg(struct device *dev, u32 pop_time, const char *fmt, ...)
{ … }
static bool dapm_dirty_widget(struct snd_soc_dapm_widget *w)
{ … }
static void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason)
{ … }
static __always_inline void dapm_widget_invalidate_paths(
struct snd_soc_dapm_widget *w, enum snd_soc_dapm_direction dir)
{ … }
static void dapm_widget_invalidate_input_paths(struct snd_soc_dapm_widget *w)
{ … }
static void dapm_widget_invalidate_output_paths(struct snd_soc_dapm_widget *w)
{ … }
static void dapm_path_invalidate(struct snd_soc_dapm_path *p)
{ … }
void dapm_mark_endpoints_dirty(struct snd_soc_card *card)
{ … }
EXPORT_SYMBOL_GPL(…);
static inline struct snd_soc_dapm_widget *dapm_cnew_widget(
const struct snd_soc_dapm_widget *_widget,
const char *prefix)
{ … }
struct dapm_kcontrol_data { … };
static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
struct snd_kcontrol *kcontrol, const char *ctrl_name)
{ … }
static void dapm_kcontrol_free(struct snd_kcontrol *kctl)
{ … }
static struct snd_soc_dapm_widget_list *dapm_kcontrol_get_wlist(
const struct snd_kcontrol *kcontrol)
{ … }
static int dapm_kcontrol_add_widget(struct snd_kcontrol *kcontrol,
struct snd_soc_dapm_widget *widget)
{ … }
static void dapm_kcontrol_add_path(const struct snd_kcontrol *kcontrol,
struct snd_soc_dapm_path *path)
{ … }
static bool dapm_kcontrol_is_powered(const struct snd_kcontrol *kcontrol)
{ … }
static struct list_head *dapm_kcontrol_get_path_list(
const struct snd_kcontrol *kcontrol)
{ … }
#define dapm_kcontrol_for_each_path(path, kcontrol) …
unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol,
unsigned int value)
{ … }
struct snd_soc_dapm_widget *snd_soc_dapm_kcontrol_widget(
struct snd_kcontrol *kcontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm(
struct snd_kcontrol *kcontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
static void dapm_reset(struct snd_soc_card *card)
{ … }
static const char *soc_dapm_prefix(struct snd_soc_dapm_context *dapm)
{ … }
static unsigned int soc_dapm_read(struct snd_soc_dapm_context *dapm, int reg)
{ … }
static int soc_dapm_update_bits(struct snd_soc_dapm_context *dapm,
int reg, unsigned int mask, unsigned int value)
{ … }
static int soc_dapm_test_bits(struct snd_soc_dapm_context *dapm,
int reg, unsigned int mask, unsigned int value)
{ … }
static void soc_dapm_async_complete(struct snd_soc_dapm_context *dapm)
{ … }
static struct snd_soc_dapm_widget *
dapm_wcache_lookup(struct snd_soc_dapm_widget *w, const char *name)
{ … }
int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level)
{ … }
EXPORT_SYMBOL_GPL(…);
static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level)
{ … }
static int dapm_connect_mux(struct snd_soc_dapm_context *dapm,
struct snd_soc_dapm_path *path, const char *control_name,
struct snd_soc_dapm_widget *w)
{ … }
static void dapm_set_mixer_path_status(struct snd_soc_dapm_path *p, int i,
int nth_path)
{ … }
static int dapm_connect_mixer(struct snd_soc_dapm_context *dapm,
struct snd_soc_dapm_path *path, const char *control_name)
{ … }
static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm,
struct snd_soc_dapm_widget *kcontrolw,
const struct snd_kcontrol_new *kcontrol_new,
struct snd_kcontrol **kcontrol)
{ … }
static int dapm_create_or_share_kcontrol(struct snd_soc_dapm_widget *w,
int kci)
{ … }
static int dapm_new_mixer(struct snd_soc_dapm_widget *w)
{ … }
static int dapm_new_mux(struct snd_soc_dapm_widget *w)
{ … }
static int dapm_new_pga(struct snd_soc_dapm_widget *w)
{ … }
static int dapm_new_dai_link(struct snd_soc_dapm_widget *w)
{ … }
static int snd_soc_dapm_suspend_check(struct snd_soc_dapm_widget *widget)
{ … }
static void dapm_widget_list_free(struct snd_soc_dapm_widget_list **list)
{ … }
static int dapm_widget_list_create(struct snd_soc_dapm_widget_list **list,
struct list_head *widgets)
{ … }
static void invalidate_paths_ep(struct snd_soc_dapm_widget *widget,
enum snd_soc_dapm_direction dir)
{ … }
static __always_inline int is_connected_ep(struct snd_soc_dapm_widget *widget,
struct list_head *list, enum snd_soc_dapm_direction dir,
int (*fn)(struct snd_soc_dapm_widget *, struct list_head *,
bool (*custom_stop_condition)(struct snd_soc_dapm_widget *,
enum snd_soc_dapm_direction)),
bool (*custom_stop_condition)(struct snd_soc_dapm_widget *,
enum snd_soc_dapm_direction))
{ … }
static int is_connected_output_ep(struct snd_soc_dapm_widget *widget,
struct list_head *list,
bool (*custom_stop_condition)(struct snd_soc_dapm_widget *i,
enum snd_soc_dapm_direction))
{ … }
static int is_connected_input_ep(struct snd_soc_dapm_widget *widget,
struct list_head *list,
bool (*custom_stop_condition)(struct snd_soc_dapm_widget *i,
enum snd_soc_dapm_direction))
{ … }
int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
struct snd_soc_dapm_widget_list **list,
bool (*custom_stop_condition)(struct snd_soc_dapm_widget *,
enum snd_soc_dapm_direction))
{ … }
EXPORT_SYMBOL_GPL(…);
void snd_soc_dapm_dai_free_widgets(struct snd_soc_dapm_widget_list **list)
{ … }
EXPORT_SYMBOL_GPL(…);
int dapm_regulator_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
EXPORT_SYMBOL_GPL(…);
int dapm_pinctrl_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
EXPORT_SYMBOL_GPL(…);
int dapm_clock_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
EXPORT_SYMBOL_GPL(…);
static int dapm_widget_power_check(struct snd_soc_dapm_widget *w)
{ … }
static int dapm_generic_check_power(struct snd_soc_dapm_widget *w)
{ … }
static int dapm_supply_check_power(struct snd_soc_dapm_widget *w)
{ … }
static int dapm_always_on_check_power(struct snd_soc_dapm_widget *w)
{ … }
static int dapm_seq_compare(struct snd_soc_dapm_widget *a,
struct snd_soc_dapm_widget *b,
bool power_up)
{ … }
static void dapm_seq_insert(struct snd_soc_dapm_widget *new_widget,
struct list_head *list,
bool power_up)
{ … }
static void dapm_seq_check_event(struct snd_soc_card *card,
struct snd_soc_dapm_widget *w, int event)
{ … }
static void dapm_seq_run_coalesced(struct snd_soc_card *card,
struct list_head *pending)
{ … }
static void dapm_seq_run(struct snd_soc_card *card,
struct list_head *list, int event, bool power_up)
{ … }
static void dapm_widget_update(struct snd_soc_card *card)
{ … }
static void dapm_pre_sequence_async(void *data, async_cookie_t cookie)
{ … }
static void dapm_post_sequence_async(void *data, async_cookie_t cookie)
{ … }
static void dapm_widget_set_peer_power(struct snd_soc_dapm_widget *peer,
bool power, bool connect)
{ … }
static void dapm_power_one_widget(struct snd_soc_dapm_widget *w,
struct list_head *up_list,
struct list_head *down_list)
{ … }
static bool dapm_idle_bias_off(struct snd_soc_dapm_context *dapm)
{ … }
static int dapm_power_widgets(struct snd_soc_card *card, int event)
{ … }
#ifdef CONFIG_DEBUG_FS
static const char * const snd_soc_dapm_type_name[] = …;
static ssize_t dapm_widget_power_read_file(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations dapm_widget_power_fops = …;
static ssize_t dapm_bias_read_file(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations dapm_bias_fops = …;
void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
struct dentry *parent)
{ … }
static void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w)
{ … }
static void dapm_debugfs_free_widget(struct snd_soc_dapm_widget *w)
{ … }
static void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm)
{ … }
#else
void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm,
struct dentry *parent)
{
}
static inline void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w)
{
}
static inline void dapm_debugfs_free_widget(struct snd_soc_dapm_widget *w)
{
}
static inline void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm)
{
}
#endif
static void soc_dapm_connect_path(struct snd_soc_dapm_path *path,
bool connect, const char *reason)
{ … }
static int soc_dapm_mux_update_power(struct snd_soc_card *card,
struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e)
{ … }
int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm,
struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e,
struct snd_soc_dapm_update *update)
{ … }
EXPORT_SYMBOL_GPL(…);
static int soc_dapm_mixer_update_power(struct snd_soc_card *card,
struct snd_kcontrol *kcontrol,
int connect, int rconnect)
{ … }
int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm,
struct snd_kcontrol *kcontrol, int connect,
struct snd_soc_dapm_update *update)
{ … }
EXPORT_SYMBOL_GPL(…);
static ssize_t dapm_widget_show_component(struct snd_soc_component *cmpnt,
char *buf, int count)
{ … }
static ssize_t dapm_widget_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(dapm_widget);
struct attribute *soc_dapm_dev_attrs[] = …;
static void dapm_free_path(struct snd_soc_dapm_path *path)
{ … }
void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w)
{ … }
EXPORT_SYMBOL_GPL(…);
static void dapm_free_widgets(struct snd_soc_dapm_context *dapm)
{ … }
static struct snd_soc_dapm_widget *dapm_find_widget(
struct snd_soc_dapm_context *dapm, const char *pin,
bool search_other_contexts)
{ … }
static int __snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
const char *pin, int status)
{ … }
static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
const char *pin, int status)
{ … }
int snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context *dapm)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm)
{ … }
EXPORT_SYMBOL_GPL(…);
static int dapm_update_dai_chan(struct snd_soc_dapm_path *p,
struct snd_soc_dapm_widget *w,
int channels)
{ … }
static int dapm_update_dai_unlocked(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
int snd_soc_dapm_update_dai(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s)
{ … }
EXPORT_SYMBOL_GPL(…);
static void dapm_update_widget_flags(struct snd_soc_dapm_widget *w)
{ … }
static int snd_soc_dapm_check_dynamic_path(struct snd_soc_dapm_context *dapm,
struct snd_soc_dapm_widget *source, struct snd_soc_dapm_widget *sink,
const char *control)
{ … }
static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
struct snd_soc_dapm_widget *wsource, struct snd_soc_dapm_widget *wsink,
const char *control,
int (*connected)(struct snd_soc_dapm_widget *source,
struct snd_soc_dapm_widget *sink))
{ … }
static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route)
{ … }
static int snd_soc_dapm_del_route(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route)
{ … }
int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route, int num)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_del_routes(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route, int num)
{ … }
EXPORT_SYMBOL_GPL(…);
static int snd_soc_dapm_weak_route(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route)
{ … }
int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route, int num)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_new_widgets(struct snd_soc_card *card)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_info_pin_switch(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
EXPORT_SYMBOL_GPL(…);
struct snd_soc_dapm_widget *
snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_widget *widget)
{ … }
struct snd_soc_dapm_widget *
snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_widget *widget)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_widget *widget,
unsigned int num)
{ … }
EXPORT_SYMBOL_GPL(…);
static int
snd_soc_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w,
struct snd_pcm_substream *substream)
{ … }
static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{ … }
static int snd_soc_dapm_dai_link_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static void
snd_soc_dapm_free_kcontrol(struct snd_soc_card *card,
unsigned long *private_value,
int num_c2c_params,
const char **w_param_text)
{ … }
static struct snd_kcontrol_new *
snd_soc_dapm_alloc_kcontrol(struct snd_soc_card *card,
char *link_name,
const struct snd_soc_pcm_stream *c2c_params,
int num_c2c_params, const char **w_param_text,
unsigned long *private_value)
{ … }
static struct snd_soc_dapm_widget *
snd_soc_dapm_new_dai(struct snd_soc_card *card,
struct snd_pcm_substream *substream,
char *id)
{ … }
int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
struct snd_soc_dai *dai)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
{ … }
static void dapm_connect_dai_routes(struct snd_soc_dapm_context *dapm,
struct snd_soc_dai *src_dai,
struct snd_soc_dapm_widget *src,
struct snd_soc_dapm_widget *dai,
struct snd_soc_dai *sink_dai,
struct snd_soc_dapm_widget *sink)
{ … }
static void dapm_connect_dai_pair(struct snd_soc_card *card,
struct snd_soc_pcm_runtime *rtd,
struct snd_soc_dai *codec_dai,
struct snd_soc_dai *cpu_dai)
{ … }
static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream,
int event)
{ … }
void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card)
{ … }
static void soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
int event)
{ … }
void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
int event)
{ … }
void snd_soc_dapm_stream_stop(struct snd_soc_pcm_runtime *rtd, int stream)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm,
const char *pin)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm,
const char *pin)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
const char *pin)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm,
const char *pin)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm,
const char *pin)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm,
const char *pin)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm,
const char *pin)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm,
const char *pin)
{ … }
EXPORT_SYMBOL_GPL(…);
void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm)
{ … }
EXPORT_SYMBOL_GPL(…);
void snd_soc_dapm_init(struct snd_soc_dapm_context *dapm,
struct snd_soc_card *card,
struct snd_soc_component *component)
{ … }
EXPORT_SYMBOL_GPL(…);
static void soc_dapm_shutdown_dapm(struct snd_soc_dapm_context *dapm)
{ … }
void snd_soc_dapm_shutdown(struct snd_soc_card *card)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;