#define DAPM_UPDATE_STAT(widget, val) widget->dapm->card->dapm_stats.val++;
-#define SND_SOC_DAPM_DIR_REVERSE(x) ((x == SND_SOC_DAPM_DIR_IN) ? \
+#define DAPM_DIR_REVERSE(x) ((x == SND_SOC_DAPM_DIR_IN) ? \
SND_SOC_DAPM_DIR_OUT : SND_SOC_DAPM_DIR_IN)
-#define snd_soc_dapm_for_each_direction(dir) \
+#define dapm_for_each_direction(dir) \
for ((dir) = SND_SOC_DAPM_DIR_IN; (dir) <= SND_SOC_DAPM_DIR_OUT; \
(dir)++)
snd_soc_dapm_mutex_assert_held(dapm);
}
-static void pop_wait(u32 pop_time)
+static void dapm_pop_wait(u32 pop_time)
{
if (pop_time)
schedule_timeout_uninterruptible(msecs_to_jiffies(pop_time));
}
__printf(3, 4)
-static void pop_dbg(struct device *dev, u32 pop_time, const char *fmt, ...)
+static void dapm_pop_dbg(struct device *dev, u32 pop_time, const char *fmt, ...)
{
va_list args;
char *buf;
static __always_inline void dapm_widget_invalidate_paths(
struct snd_soc_dapm_widget *w, enum snd_soc_dapm_direction dir)
{
- enum snd_soc_dapm_direction rdir = SND_SOC_DAPM_DIR_REVERSE(dir);
+ enum snd_soc_dapm_direction rdir = DAPM_DIR_REVERSE(dir);
struct snd_soc_dapm_widget *node;
struct snd_soc_dapm_path *p;
LIST_HEAD(list);
struct snd_soc_dapm_widget_list *wlist;
};
-static unsigned int soc_dapm_read(struct snd_soc_dapm_context *dapm, int reg)
+static unsigned int dapm_read(struct snd_soc_dapm_context *dapm, int reg)
{
if (!dapm->component)
return -EIO;
unsigned int shift = mc->shift;
unsigned int max = mc->max;
unsigned int mask = (1 << fls(max)) - 1;
- unsigned int val = soc_dapm_read(p->sink->dapm, reg);
+ unsigned int val = dapm_read(p->sink->dapm, reg);
/*
* The nth_path argument allows this function to know
*/
if (snd_soc_volsw_is_stereo(mc) && nth_path > 0) {
if (reg != mc->rreg)
- val = soc_dapm_read(p->sink->dapm, mc->rreg);
+ val = dapm_read(p->sink->dapm, mc->rreg);
val = (val >> mc->rshift) & mask;
} else {
val = (val >> shift) & mask;
if (e->reg != SND_SOC_NOPM) {
unsigned int val;
- val = soc_dapm_read(dapm, e->reg);
+ val = dapm_read(dapm, e->reg);
val = (val >> e->shift_l) & e->mask;
item = snd_soc_enum_val_to_item(e, val);
} else {
break;
case snd_soc_dapm_line:
ep = 0;
- snd_soc_dapm_for_each_direction(dir) {
+ dapm_for_each_direction(dir) {
if (!list_empty(&w->edges[dir]))
ep |= SND_SOC_DAPM_DIR_TO_EP(dir);
}
w->is_ep = ep;
}
-static int snd_soc_dapm_check_dynamic_path(
+static int 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)
return 0;
}
-static int snd_soc_dapm_add_path(
+static int dapm_add_path(
struct snd_soc_dapm_context *dapm,
struct snd_soc_dapm_widget *wsource, struct snd_soc_dapm_widget *wsink,
const char *control,
return -EINVAL;
}
- ret = snd_soc_dapm_check_dynamic_path(dapm, wsource, wsink, control);
+ ret = dapm_check_dynamic_path(dapm, wsource, wsink, control);
if (ret)
return ret;
list_add(&path->list, &dapm->card->paths);
- snd_soc_dapm_for_each_direction(dir)
+ dapm_for_each_direction(dir)
list_add(&path->list_node[dir], &path->node[dir]->edges[dir]);
- snd_soc_dapm_for_each_direction(dir) {
+ dapm_for_each_direction(dir) {
dapm_update_widget_flags(path->node[dir]);
dapm_mark_dirty(path->node[dir], "Route added");
}
goto err_data;
}
- snd_soc_dapm_add_path(widget->dapm, data->widget,
- widget, NULL, NULL);
+ dapm_add_path(widget->dapm, data->widget,
+ widget, NULL, NULL);
} else if (e->reg != SND_SOC_NOPM) {
- data->value = soc_dapm_read(widget->dapm, e->reg) &
+ data->value = dapm_read(widget->dapm, e->reg) &
(e->mask << e->shift_l);
}
break;
}
}
-static const char *soc_dapm_prefix(struct snd_soc_dapm_context *dapm)
+static const char *dapm_prefix(struct snd_soc_dapm_context *dapm)
{
if (!dapm->component)
return NULL;
return dapm->component->name_prefix;
}
-static int soc_dapm_update_bits(struct snd_soc_dapm_context *dapm,
+static int dapm_update_bits(struct snd_soc_dapm_context *dapm,
int reg, unsigned int mask, unsigned int value)
{
if (!dapm->component)
mask, value);
}
-static int soc_dapm_test_bits(struct snd_soc_dapm_context *dapm,
+static int dapm_test_bits(struct snd_soc_dapm_context *dapm,
int reg, unsigned int mask, unsigned int value)
{
if (!dapm->component)
return snd_soc_component_test_bits(dapm->component, reg, mask, value);
}
-static void soc_dapm_async_complete(struct snd_soc_dapm_context *dapm)
+static void dapm_async_complete(struct snd_soc_dapm_context *dapm)
{
if (dapm->component)
snd_soc_component_async_complete(dapm->component);
const char *name;
int ret = 0;
- prefix = soc_dapm_prefix(dapm);
+ prefix = dapm_prefix(dapm);
if (prefix)
prefix_len = strlen(prefix) + 1;
else
data = snd_kcontrol_chip(w->kcontrols[i]);
if (data->widget)
- snd_soc_dapm_add_path(data->widget->dapm,
- data->widget,
- path->source,
- NULL, NULL);
+ dapm_add_path(data->widget->dapm,
+ data->widget,
+ path->source,
+ NULL, NULL);
}
}
* the ALSA card - when we are suspending the ALSA state for the card
* is set to D3.
*/
-static int snd_soc_dapm_suspend_check(struct snd_soc_dapm_widget *widget)
+static int dapm_suspend_check(struct snd_soc_dapm_widget *widget)
{
struct device *dev = snd_soc_dapm_to_dev(widget->dapm);
int level = snd_power_get_state(widget->dapm->card->snd_card);
* widget and all widgets that can be reached via incoming or outcoming paths
* from the widget.
*/
-static void invalidate_paths_ep(struct snd_soc_dapm_widget *widget,
+static void dapm_invalidate_paths_ep(struct snd_soc_dapm_widget *widget,
enum snd_soc_dapm_direction dir)
{
- enum snd_soc_dapm_direction rdir = SND_SOC_DAPM_DIR_REVERSE(dir);
+ enum snd_soc_dapm_direction rdir = DAPM_DIR_REVERSE(dir);
struct snd_soc_dapm_path *path;
widget->endpoints[dir] = -1;
if (path->connect) {
path->walking = 1;
- invalidate_paths_ep(path->node[dir], dir);
+ dapm_invalidate_paths_ep(path->node[dir], dir);
path->walking = 0;
}
}
* generic function and at the same time the fast path of the specialized
* functions is significantly smaller than the generic function.
*/
-static __always_inline int is_connected_ep(struct snd_soc_dapm_widget *widget,
+static __always_inline int dapm_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 *,
bool (*custom_stop_condition)(struct snd_soc_dapm_widget *,
enum snd_soc_dapm_direction))
{
- enum snd_soc_dapm_direction rdir = SND_SOC_DAPM_DIR_REVERSE(dir);
+ enum snd_soc_dapm_direction rdir = DAPM_DIR_REVERSE(dir);
struct snd_soc_dapm_path *path;
int con = 0;
}
if ((widget->is_ep & SND_SOC_DAPM_DIR_TO_EP(dir)) && widget->connected) {
- widget->endpoints[dir] = snd_soc_dapm_suspend_check(widget);
+ widget->endpoints[dir] = dapm_suspend_check(widget);
return widget->endpoints[dir];
}
* direction as an arguments, it should return true if widgets from that point
* in the graph onwards should not be added to the widget list.
*/
-static int is_connected_output_ep(struct snd_soc_dapm_widget *widget,
+static int dapm_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))
{
- return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_OUT,
- is_connected_output_ep, custom_stop_condition);
+ return dapm_is_connected_ep(widget, list, SND_SOC_DAPM_DIR_OUT,
+ dapm_is_connected_output_ep, custom_stop_condition);
}
/*
* direction as an arguments, it should return true if the walk should be
* stopped and false otherwise.
*/
-static int is_connected_input_ep(struct snd_soc_dapm_widget *widget,
+static int dapm_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))
{
- return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_IN,
- is_connected_input_ep, custom_stop_condition);
+ return dapm_is_connected_ep(widget, list, SND_SOC_DAPM_DIR_IN,
+ dapm_is_connected_input_ep, custom_stop_condition);
}
/**
snd_soc_dapm_mutex_lock(card);
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
- invalidate_paths_ep(w, SND_SOC_DAPM_DIR_OUT);
- paths = is_connected_output_ep(w, &widgets,
+ dapm_invalidate_paths_ep(w, SND_SOC_DAPM_DIR_OUT);
+ paths = dapm_is_connected_output_ep(w, &widgets,
custom_stop_condition);
} else {
- invalidate_paths_ep(w, SND_SOC_DAPM_DIR_IN);
- paths = is_connected_input_ep(w, &widgets,
+ dapm_invalidate_paths_ep(w, SND_SOC_DAPM_DIR_IN);
+ paths = dapm_is_connected_input_ep(w, &widgets,
custom_stop_condition);
}
struct device *dev = snd_soc_dapm_to_dev(w->dapm);
int ret;
- soc_dapm_async_complete(w->dapm);
+ dapm_async_complete(w->dapm);
if (SND_SOC_DAPM_EVENT_ON(event)) {
if (w->on_val & SND_SOC_DAPM_REGULATOR_BYPASS) {
if (!w->clk)
return -EIO;
- soc_dapm_async_complete(w->dapm);
+ dapm_async_complete(w->dapm);
if (SND_SOC_DAPM_EVENT_ON(event)) {
return clk_prepare_enable(w->clk);
DAPM_UPDATE_STAT(w, power_checks);
- in = is_connected_input_ep(w, NULL, NULL);
- out = is_connected_output_ep(w, NULL, NULL);
+ in = dapm_is_connected_input_ep(w, NULL, NULL);
+ out = dapm_is_connected_output_ep(w, NULL, NULL);
return out != 0 && in != 0;
}
if (w->event && (w->event_flags & event)) {
int ret;
- pop_dbg(dev, card->pop_time, "pop test : %s %s\n",
+ dapm_pop_dbg(dev, card->pop_time, "pop test : %s %s\n",
w->name, ev_name);
- soc_dapm_async_complete(w->dapm);
+ dapm_async_complete(w->dapm);
trace_snd_soc_dapm_widget_event_start(w, event);
ret = w->event(w, NULL, event);
trace_snd_soc_dapm_widget_event_done(w, event);
else
value |= w->off_val << w->shift;
- pop_dbg(dev, card->pop_time,
+ dapm_pop_dbg(dev, card->pop_time,
"pop test : Queue %s: reg=0x%x, 0x%x/0x%x\n",
w->name, reg, value, mask);
* same register.
*/
- pop_dbg(dev, card->pop_time,
+ dapm_pop_dbg(dev, card->pop_time,
"pop test : Applying 0x%x/0x%x to %x in %dms\n",
value, mask, reg, card->pop_time);
- pop_wait(card->pop_time);
- soc_dapm_update_bits(dapm, reg, mask, value);
+ dapm_pop_wait(card->pop_time);
+ dapm_update_bits(dapm, reg, mask, value);
}
list_for_each_entry(w, pending, power_list) {
}
if (cur_dapm && w->dapm != cur_dapm)
- soc_dapm_async_complete(cur_dapm);
+ dapm_async_complete(cur_dapm);
INIT_LIST_HEAD(&pending);
cur_sort = -1;
}
for_each_card_dapms(card, d)
- soc_dapm_async_complete(d);
+ dapm_async_complete(d);
}
static void dapm_widget_update(struct snd_soc_card *card, struct snd_soc_dapm_update *update)
if (!w)
return;
- ret = soc_dapm_update_bits(w->dapm, update->reg, update->mask,
+ ret = dapm_update_bits(w->dapm, update->reg, update->mask,
update->val);
if (ret < 0)
dev_err(dev, "ASoC: %s DAPM update failed: %d\n",
w->name, ret);
if (update->has_second_set) {
- ret = soc_dapm_update_bits(w->dapm, update->reg2,
+ ret = dapm_update_bits(w->dapm, update->reg2,
update->mask2, update->val2);
if (ret < 0)
dev_err(dev,
return ret;
}
- pop_dbg(card->dev, card->pop_time,
+ dapm_pop_dbg(card->dev, card->pop_time,
"DAPM sequencing finished, waiting %dms\n", card->pop_time);
- pop_wait(card->pop_time);
+ dapm_pop_wait(card->pop_time);
trace_snd_soc_dapm_done(card, event);
#ifdef CONFIG_DEBUG_FS
-static const char * const snd_soc_dapm_type_name[] = {
+static const char * const dapm_type_name[] = {
[snd_soc_dapm_input] = "input",
[snd_soc_dapm_output] = "output",
[snd_soc_dapm_mux] = "mux",
struct snd_soc_dapm_path *p = NULL;
const char *c_name;
- BUILD_BUG_ON(ARRAY_SIZE(snd_soc_dapm_type_name) != SND_SOC_DAPM_TYPE_COUNT);
+ BUILD_BUG_ON(ARRAY_SIZE(dapm_type_name) != SND_SOC_DAPM_TYPE_COUNT);
buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!buf)
snd_soc_dapm_mutex_lock_root(w->dapm);
- /* Supply widgets are not handled by is_connected_{input,output}_ep() */
+ /* Supply widgets are not handled by dapm_is_connected_{input,output}_ep() */
if (w->is_supply) {
in = 0;
out = 0;
} else {
- in = is_connected_input_ep(w, NULL, NULL);
- out = is_connected_output_ep(w, NULL, NULL);
+ in = dapm_is_connected_input_ep(w, NULL, NULL);
+ out = dapm_is_connected_output_ep(w, NULL, NULL);
}
ret = scnprintf(buf, PAGE_SIZE, "%s: %s%s in %d out %d",
w->active ? "active" : "inactive");
ret += scnprintf(buf + ret, PAGE_SIZE - ret, " widget-type %s\n",
- snd_soc_dapm_type_name[w->id]);
+ dapm_type_name[w->id]);
- snd_soc_dapm_for_each_direction(dir) {
- rdir = SND_SOC_DAPM_DIR_REVERSE(dir);
+ dapm_for_each_direction(dir) {
+ rdir = DAPM_DIR_REVERSE(dir);
snd_soc_dapm_widget_for_each_path(w, dir, p) {
if (p->connected && !p->connected(p->source, p->sink))
continue;
#endif
/*
- * soc_dapm_connect_path() - Connects or disconnects a path
+ * dapm_connect_path() - Connects or disconnects a path
* @path: The path to update
* @connect: The new connect state of the path. True if the path is connected,
* false if it is disconnected.
* @reason: The reason why the path changed (for debugging only)
*/
-static void soc_dapm_connect_path(struct snd_soc_dapm_path *path,
+static void dapm_connect_path(struct snd_soc_dapm_path *path,
bool connect, const char *reason)
{
if (path->connect == connect)
}
/* test and update the power status of a mux widget */
-static int soc_dapm_mux_update_power(struct snd_soc_card *card,
- struct snd_kcontrol *kcontrol,
- struct snd_soc_dapm_update *update,
- int mux, struct soc_enum *e)
+static int dapm_mux_update_power(struct snd_soc_card *card,
+ struct snd_kcontrol *kcontrol,
+ struct snd_soc_dapm_update *update,
+ int mux, struct soc_enum *e)
{
struct snd_soc_dapm_path *path;
int found = 0;
else
connect = false;
- soc_dapm_connect_path(path, connect, "mux update");
+ dapm_connect_path(path, connect, "mux update");
}
if (found)
int ret;
snd_soc_dapm_mutex_lock(card);
- ret = soc_dapm_mux_update_power(card, kcontrol, update, mux, e);
+ ret = dapm_mux_update_power(card, kcontrol, update, mux, e);
snd_soc_dapm_mutex_unlock(card);
if (ret > 0)
snd_soc_dpcm_runtime_update(card);
EXPORT_SYMBOL_GPL(snd_soc_dapm_mux_update_power);
/* test and update the power status of a mixer or switch widget */
-static int soc_dapm_mixer_update_power(struct snd_soc_card *card,
- struct snd_kcontrol *kcontrol,
- struct snd_soc_dapm_update *update,
- int connect, int rconnect)
+static int dapm_mixer_update_power(struct snd_soc_card *card,
+ struct snd_kcontrol *kcontrol,
+ struct snd_soc_dapm_update *update,
+ int connect, int rconnect)
{
struct snd_soc_dapm_path *path;
int found = 0;
* channel.
*/
if (found && rconnect >= 0)
- soc_dapm_connect_path(path, rconnect, "mixer update");
+ dapm_connect_path(path, rconnect, "mixer update");
else
- soc_dapm_connect_path(path, connect, "mixer update");
+ dapm_connect_path(path, connect, "mixer update");
found = 1;
}
int ret;
snd_soc_dapm_mutex_lock(card);
- ret = soc_dapm_mixer_update_power(card, kcontrol, update, connect, -1);
+ ret = dapm_mixer_update_power(card, kcontrol, update, connect, -1);
snd_soc_dapm_mutex_unlock(card);
if (ret > 0)
snd_soc_dpcm_runtime_update(card);
* While removing the path, remove reference to it from both
* source and sink widgets so that path is removed only once.
*/
- snd_soc_dapm_for_each_direction(dir) {
+ dapm_for_each_direction(dir) {
snd_soc_dapm_widget_for_each_path_safe(w, dir, p, next_p)
dapm_free_path(p);
}
struct snd_soc_dapm_widget *fallback = NULL;
char prefixed_pin[80];
const char *pin_name;
- const char *prefix = soc_dapm_prefix(dapm);
+ const char *prefix = dapm_prefix(dapm);
if (prefix) {
snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s",
* returns 1 when the value has been updated, 0 when unchanged, or a negative
* error code; called from kcontrol put callback
*/
-static int __snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
- const char *pin, int status)
+static int __dapm_set_pin(struct snd_soc_dapm_context *dapm,
+ const char *pin, int status)
{
struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true);
struct device *dev = snd_soc_dapm_to_dev(dapm);
}
/*
- * similar as __snd_soc_dapm_set_pin(), but returns 0 when successful;
+ * similar as __dapm_set_pin(), but returns 0 when successful;
* called from several API functions below
*/
-static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
+static int dapm_set_pin(struct snd_soc_dapm_context *dapm,
const char *pin, int status)
{
- int ret = __snd_soc_dapm_set_pin(dapm, pin, status);
+ int ret = __dapm_set_pin(dapm, pin, status);
return ret < 0 ? ret : 0;
}
p->source->name, p->sink->name);
if (w->channel < channels)
- soc_dapm_connect_path(p, true, "dai update");
+ dapm_connect_path(p, true, "dai update");
else
- soc_dapm_connect_path(p, false, "dai update");
+ dapm_connect_path(p, false, "dai update");
return 0;
}
unsigned int source_ref = 0;
int ret;
- prefix = soc_dapm_prefix(dapm);
+ prefix = dapm_prefix(dapm);
if (prefix) {
snprintf(prefixed_sink, sizeof(prefixed_sink), "%s %s",
prefix, route->sink);
dapm->wcache_sink = wsink;
dapm->wcache_source = wsource;
- ret = snd_soc_dapm_add_path(dapm, wsource, wsink, route->control,
+ ret = dapm_add_path(dapm, wsource, wsink, route->control,
route->connected);
err:
if (ret)
return -EINVAL;
}
- prefix = soc_dapm_prefix(dapm);
+ prefix = dapm_prefix(dapm);
if (prefix) {
snprintf(prefixed_sink, sizeof(prefixed_sink), "%s %s",
prefix, route->sink);
/* Read the initial power state from the device */
if (w->reg >= 0) {
- val = soc_dapm_read(w->dapm, w->reg);
+ val = dapm_read(w->dapm, w->reg);
val = val >> w->shift;
val &= w->mask;
if (val == w->on_val)
snd_soc_dapm_mutex_lock(dapm);
if (dapm_kcontrol_is_powered(kcontrol) && reg != SND_SOC_NOPM) {
- reg_val = soc_dapm_read(dapm, reg);
+ reg_val = dapm_read(dapm, reg);
val = (reg_val >> shift) & mask;
if (reg != mc->rreg)
- reg_val = soc_dapm_read(dapm, mc->rreg);
+ reg_val = dapm_read(dapm, mc->rreg);
if (snd_soc_volsw_is_stereo(mc))
rval = (reg_val >> mc->rshift) & mask;
val = val << shift;
rval = rval << mc->rshift;
- reg_change = soc_dapm_test_bits(dapm, reg, mask << shift, val);
+ reg_change = dapm_test_bits(dapm, reg, mask << shift, val);
if (snd_soc_volsw_is_stereo(mc))
- reg_change |= soc_dapm_test_bits(dapm, mc->rreg,
- mask << mc->rshift,
- rval);
+ reg_change |= dapm_test_bits(dapm, mc->rreg,
+ mask << mc->rshift,
+ rval);
}
if (change || reg_change) {
update.val = val;
pupdate = &update;
}
- ret = soc_dapm_mixer_update_power(card, kcontrol, pupdate, connect, rconnect);
+ ret = dapm_mixer_update_power(card, kcontrol, pupdate, connect, rconnect);
}
snd_soc_dapm_mutex_unlock(card);
snd_soc_dapm_mutex_lock(dapm);
if (e->reg != SND_SOC_NOPM && dapm_kcontrol_is_powered(kcontrol)) {
- reg_val = soc_dapm_read(dapm, e->reg);
+ reg_val = dapm_read(dapm, e->reg);
} else {
reg_val = snd_soc_dapm_kcontrol_get_value(kcontrol);
}
change = dapm_kcontrol_set_value(kcontrol, val);
if (e->reg != SND_SOC_NOPM)
- reg_change = soc_dapm_test_bits(dapm, e->reg, mask, val);
+ reg_change = dapm_test_bits(dapm, e->reg, mask, val);
if (change || reg_change) {
if (reg_change) {
update.val = val;
pupdate = &update;
}
- ret = soc_dapm_mux_update_power(card, kcontrol, pupdate, item[0], e);
+ ret = dapm_mux_update_power(card, kcontrol, pupdate, item[0], e);
}
snd_soc_dapm_mutex_unlock(card);
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_get_component_pin_switch);
-static int __snd_soc_dapm_put_pin_switch(struct snd_soc_dapm_context *dapm,
- const char *pin,
- struct snd_ctl_elem_value *ucontrol)
+static int __dapm_put_pin_switch(struct snd_soc_dapm_context *dapm,
+ const char *pin,
+ struct snd_ctl_elem_value *ucontrol)
{
int ret;
snd_soc_dapm_mutex_lock(dapm);
- ret = __snd_soc_dapm_set_pin(dapm, pin, !!ucontrol->value.integer.value[0]);
+ ret = __dapm_set_pin(dapm, pin, !!ucontrol->value.integer.value[0]);
snd_soc_dapm_mutex_unlock(dapm);
snd_soc_dapm_sync(dapm);
struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
const char *pin = (const char *)kcontrol->private_value;
- return __snd_soc_dapm_put_pin_switch(dapm, pin, ucontrol);
+ return __dapm_put_pin_switch(dapm, pin, ucontrol);
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_put_pin_switch);
struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
const char *pin = (const char *)kcontrol->private_value;
- return __snd_soc_dapm_put_pin_switch(dapm, pin, ucontrol);
+ return __dapm_put_pin_switch(dapm, pin, ucontrol);
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_put_component_pin_switch);
struct snd_soc_dapm_widget *w;
int ret = -ENOMEM;
- w = dapm_cnew_widget(widget, soc_dapm_prefix(dapm));
+ w = dapm_cnew_widget(widget, dapm_prefix(dapm));
if (!w)
goto cnew_failed;
/* see for_each_card_widgets */
list_add_tail(&w->list, &dapm->card->widgets);
- snd_soc_dapm_for_each_direction(dir) {
+ dapm_for_each_direction(dir) {
INIT_LIST_HEAD(&w->edges[dir]);
w->endpoints[dir] = -1;
}
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_new_controls);
-static int
-snd_soc_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w,
- struct snd_pcm_substream *substream)
+static int dapm_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w,
+ struct snd_pcm_substream *substream)
{
struct device *dev = snd_soc_dapm_to_dev(w->dapm);
struct snd_soc_dapm_path *path;
return 0;
}
-static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
- struct snd_kcontrol *kcontrol, int event)
+static int dapm_dai_link_event(struct snd_soc_dapm_widget *w,
+ struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_dapm_path *path;
struct snd_soc_dai *source, *sink;
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- ret = snd_soc_dai_link_event_pre_pmu(w, substream);
+ ret = dapm_dai_link_event_pre_pmu(w, substream);
if (ret < 0)
goto out;
return ret;
}
-static int snd_soc_dapm_dai_link_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+static int dapm_dai_link_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol);
struct snd_soc_pcm_runtime *rtd = w->priv;
return 0;
}
-static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
+static int dapm_dai_link_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_dapm_widget *w = snd_kcontrol_chip(kcontrol);
struct snd_soc_pcm_runtime *rtd = w->priv;
return 1;
}
-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 void dapm_free_kcontrol(struct snd_soc_card *card,
+ unsigned long *private_value,
+ int num_c2c_params,
+ const char **w_param_text)
{
int count;
}
static struct snd_kcontrol_new *
-snd_soc_dapm_alloc_kcontrol(struct snd_soc_card *card,
+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,
};
struct snd_kcontrol_new kcontrol_dai_link[] = {
SOC_ENUM_EXT(NULL, w_param_enum[0],
- snd_soc_dapm_dai_link_get,
- snd_soc_dapm_dai_link_put),
+ dapm_dai_link_get,
+ dapm_dai_link_put),
};
struct snd_kcontrol_new *kcontrol_news;
const struct snd_soc_pcm_stream *config = c2c_params;
return kcontrol_news;
outfree_w_param:
- snd_soc_dapm_free_kcontrol(card, private_value, num_c2c_params, w_param_text);
+ dapm_free_kcontrol(card, private_value, num_c2c_params, w_param_text);
+
return NULL;
}
-static struct snd_soc_dapm_widget *
-snd_soc_dapm_new_dai(struct snd_soc_card *card,
- struct snd_pcm_substream *substream,
- char *id)
+static struct snd_soc_dapm_widget *dapm_new_dai(struct snd_soc_card *card,
+ struct snd_pcm_substream *substream,
+ char *id)
{
struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
goto param_fail;
num_kcontrols = 1;
- kcontrol_news = snd_soc_dapm_alloc_kcontrol(card, link_name,
- rtd->dai_link->c2c_params,
- rtd->dai_link->num_c2c_params,
- w_param_text, &private_value);
+ kcontrol_news = dapm_alloc_kcontrol(card, link_name,
+ rtd->dai_link->c2c_params,
+ rtd->dai_link->num_c2c_params,
+ w_param_text, &private_value);
if (!kcontrol_news)
goto param_fail;
}
template.reg = SND_SOC_NOPM;
template.id = snd_soc_dapm_dai_link;
template.name = link_name;
- template.event = snd_soc_dai_link_event;
+ template.event = dapm_dai_link_event;
template.event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD;
template.kcontrol_news = kcontrol_news;
outfree_kcontrol_news:
devm_kfree(card->dev, (void *)template.kcontrol_news);
- snd_soc_dapm_free_kcontrol(card, &private_value,
+ dapm_free_kcontrol(card, &private_value,
rtd->dai_link->num_c2c_params, w_param_text);
param_fail:
devm_kfree(card->dev, link_name);
sink = dai_w;
}
dev_dbg(dai->dev, "%s -> %s\n", src->name, sink->name);
- snd_soc_dapm_add_path(w->dapm, src, sink, NULL, NULL);
+ dapm_add_path(w->dapm, src, sink, NULL, NULL);
}
}
sink_dai->component->name, sink->name);
if (dai) {
- snd_soc_dapm_add_path(dapm, src, dai, NULL, NULL);
+ dapm_add_path(dapm, src, dai, NULL, NULL);
src = dai;
}
- snd_soc_dapm_add_path(dapm, src, sink, NULL, NULL);
+ dapm_add_path(dapm, src, sink, NULL, NULL);
}
static void dapm_connect_dai_pair(struct snd_soc_card *card,
/* special handling for [Codec2Codec] */
if (dai_link->c2c_params && !rtd->c2c_widget[stream]) {
struct snd_pcm_substream *substream = rtd->pcm->streams[stream].substream;
- struct snd_soc_dapm_widget *dai = snd_soc_dapm_new_dai(card, substream,
- widget_name[stream]);
+ struct snd_soc_dapm_widget *dai = dapm_new_dai(card, substream,
+ widget_name[stream]);
if (IS_ERR(dai))
continue;
}
}
-static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream,
- int event)
+static void dapm_dai_stream_event(struct snd_soc_dai *dai, int stream, int event)
{
struct snd_soc_dapm_widget *w;
}
}
-static void soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
- int event)
+static void dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, int event)
{
struct snd_soc_dai *dai;
int i;
for_each_rtd_dais(rtd, i, dai)
- soc_dapm_dai_stream_event(dai, stream, event);
+ dapm_dai_stream_event(dai, stream, event);
dapm_power_widgets(rtd->card, event, NULL);
}
struct snd_soc_card *card = rtd->card;
snd_soc_dapm_mutex_lock(card);
- soc_dapm_stream_event(rtd, stream, event);
+ dapm_stream_event(rtd, stream, event);
snd_soc_dapm_mutex_unlock(card);
}
int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm,
const char *pin)
{
- return snd_soc_dapm_set_pin(dapm, pin, 1);
+ return dapm_set_pin(dapm, pin, 1);
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_enable_pin_unlocked);
snd_soc_dapm_mutex_lock(dapm);
- ret = snd_soc_dapm_set_pin(dapm, pin, 1);
+ ret = dapm_set_pin(dapm, pin, 1);
snd_soc_dapm_mutex_unlock(dapm);
int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm,
const char *pin)
{
- return snd_soc_dapm_set_pin(dapm, pin, 0);
+ return dapm_set_pin(dapm, pin, 0);
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_disable_pin_unlocked);
snd_soc_dapm_mutex_lock(dapm);
- ret = snd_soc_dapm_set_pin(dapm, pin, 0);
+ ret = dapm_set_pin(dapm, pin, 0);
snd_soc_dapm_mutex_unlock(dapm);
list_add(&dapm->list, &card->dapm_list);
}
-static void soc_dapm_shutdown_dapm(struct snd_soc_dapm_context *dapm)
+static void dapm_shutdown(struct snd_soc_dapm_context *dapm)
{
struct snd_soc_card *card = dapm->card;
struct snd_soc_dapm_widget *w;
for_each_card_dapms(card, dapm) {
if (dapm != card_dapm) {
- soc_dapm_shutdown_dapm(dapm);
+ dapm_shutdown(dapm);
if (dapm->bias_level == SND_SOC_BIAS_STANDBY)
snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_OFF);
}
}
- soc_dapm_shutdown_dapm(card_dapm);
+ dapm_shutdown(card_dapm);
if (card_dapm->bias_level == SND_SOC_BIAS_STANDBY)
snd_soc_dapm_set_bias_level(card_dapm, SND_SOC_BIAS_OFF);
}