ASoC: convert asoc_xxx() to snd_soc_xxx()
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: ASoC is using 2 type of prefix (asoc_xxx() vs snd_soc_xxx()), but there is no particular reason about that [1]. To reduce confusing, standarding these to snd_soc_xxx() is sensible. This patch adds asoc_xxx() macro to keep compatible for a while. It will be removed if all drivers were switched to new style. Link: https://lore.kernel.org/r/87h6td3hus.wl-kuninori.morimoto.gx@renesas.com [1]
This commit is contained in:
commit
e952e89b06
@ -759,7 +759,7 @@ static int intel_prepare(struct snd_pcm_substream *substream,
|
||||
}
|
||||
|
||||
if (dai_runtime->suspended) {
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_hw_params *hw_params;
|
||||
|
||||
hw_params = &rtd->dpcm[substream->stream].hw_params;
|
||||
|
@ -327,7 +327,7 @@ static int intel_prepare(struct snd_pcm_substream *substream,
|
||||
}
|
||||
|
||||
if (dai_runtime->suspended) {
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_hw_params *hw_params;
|
||||
|
||||
hw_params = &rtd->dpcm[substream->stream].hw_params;
|
||||
|
@ -1819,7 +1819,7 @@ void sdw_shutdown_stream(void *sdw_substream)
|
||||
struct snd_soc_dai *dai;
|
||||
|
||||
/* Find stream from first CPU DAI */
|
||||
dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
|
||||
sdw_stream = snd_soc_dai_get_stream(dai, substream->stream);
|
||||
|
||||
|
@ -9,27 +9,27 @@
|
||||
|
||||
#include <sound/simple_card_utils.h>
|
||||
|
||||
typedef int (*GRAPH2_CUSTOM)(struct asoc_simple_priv *priv,
|
||||
typedef int (*GRAPH2_CUSTOM)(struct simple_util_priv *priv,
|
||||
struct device_node *lnk,
|
||||
struct link_info *li);
|
||||
|
||||
struct graph2_custom_hooks {
|
||||
int (*hook_pre)(struct asoc_simple_priv *priv);
|
||||
int (*hook_post)(struct asoc_simple_priv *priv);
|
||||
int (*hook_pre)(struct simple_util_priv *priv);
|
||||
int (*hook_post)(struct simple_util_priv *priv);
|
||||
GRAPH2_CUSTOM custom_normal;
|
||||
GRAPH2_CUSTOM custom_dpcm;
|
||||
GRAPH2_CUSTOM custom_c2c;
|
||||
};
|
||||
|
||||
int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev);
|
||||
int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
|
||||
int audio_graph_parse_of(struct simple_util_priv *priv, struct device *dev);
|
||||
int audio_graph2_parse_of(struct simple_util_priv *priv, struct device *dev,
|
||||
struct graph2_custom_hooks *hooks);
|
||||
|
||||
int audio_graph2_link_normal(struct asoc_simple_priv *priv,
|
||||
int audio_graph2_link_normal(struct simple_util_priv *priv,
|
||||
struct device_node *lnk, struct link_info *li);
|
||||
int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
|
||||
int audio_graph2_link_dpcm(struct simple_util_priv *priv,
|
||||
struct device_node *lnk, struct link_info *li);
|
||||
int audio_graph2_link_c2c(struct asoc_simple_priv *priv,
|
||||
int audio_graph2_link_c2c(struct simple_util_priv *priv,
|
||||
struct device_node *lnk, struct link_info *li);
|
||||
|
||||
#endif /* __GRAPH_CARD_H */
|
||||
|
@ -12,15 +12,18 @@
|
||||
#include <sound/soc.h>
|
||||
#include <sound/simple_card_utils.h>
|
||||
|
||||
struct asoc_simple_card_info {
|
||||
/* REMOVE ME */
|
||||
#define asoc_simple_card_info simple_util_info
|
||||
|
||||
struct simple_util_info {
|
||||
const char *name;
|
||||
const char *card;
|
||||
const char *codec;
|
||||
const char *platform;
|
||||
|
||||
unsigned int daifmt;
|
||||
struct asoc_simple_dai cpu_dai;
|
||||
struct asoc_simple_dai codec_dai;
|
||||
struct simple_util_dai cpu_dai;
|
||||
struct simple_util_dai codec_dai;
|
||||
};
|
||||
|
||||
#endif /* __SIMPLE_CARD_H */
|
||||
|
@ -11,18 +11,29 @@
|
||||
#include <linux/clk.h>
|
||||
#include <sound/soc.h>
|
||||
|
||||
#define asoc_simple_init_hp(card, sjack, prefix) \
|
||||
asoc_simple_init_jack(card, sjack, 1, prefix, NULL)
|
||||
#define asoc_simple_init_mic(card, sjack, prefix) \
|
||||
asoc_simple_init_jack(card, sjack, 0, prefix, NULL)
|
||||
/* REMOVE ME */
|
||||
#define asoc_simple_init_hp simple_util_init_hp
|
||||
#define asoc_simple_init_mic simple_util_init_mic
|
||||
|
||||
struct asoc_simple_tdm_width_map {
|
||||
#define simple_util_init_hp(card, sjack, prefix) \
|
||||
simple_util_init_jack(card, sjack, 1, prefix, NULL)
|
||||
#define simple_util_init_mic(card, sjack, prefix) \
|
||||
simple_util_init_jack(card, sjack, 0, prefix, NULL)
|
||||
|
||||
/* REMOVE ME */
|
||||
#define asoc_simple_tdm_width_map simple_util_tdm_width_map
|
||||
#define asoc_simple_dai simple_util_dai
|
||||
#define asoc_simple_data simple_util_data
|
||||
#define asoc_simple_jack simple_util_jack
|
||||
#define asoc_simple_priv simple_util_priv
|
||||
|
||||
struct simple_util_tdm_width_map {
|
||||
u8 sample_bits;
|
||||
u8 slot_count;
|
||||
u16 slot_width;
|
||||
};
|
||||
|
||||
struct asoc_simple_dai {
|
||||
struct simple_util_dai {
|
||||
const char *name;
|
||||
unsigned int sysclk;
|
||||
int clk_direction;
|
||||
@ -32,17 +43,17 @@ struct asoc_simple_dai {
|
||||
unsigned int rx_slot_mask;
|
||||
struct clk *clk;
|
||||
bool clk_fixed;
|
||||
struct asoc_simple_tdm_width_map *tdm_width_map;
|
||||
struct simple_util_tdm_width_map *tdm_width_map;
|
||||
int n_tdm_widths;
|
||||
};
|
||||
|
||||
struct asoc_simple_data {
|
||||
struct simple_util_data {
|
||||
u32 convert_rate;
|
||||
u32 convert_channels;
|
||||
const char *convert_sample_format;
|
||||
};
|
||||
|
||||
struct asoc_simple_jack {
|
||||
struct simple_util_jack {
|
||||
struct snd_soc_jack jack;
|
||||
struct snd_soc_jack_pin pin;
|
||||
struct snd_soc_jack_gpio gpio;
|
||||
@ -54,21 +65,21 @@ struct prop_nums {
|
||||
int platforms;
|
||||
};
|
||||
|
||||
struct asoc_simple_priv {
|
||||
struct simple_util_priv {
|
||||
struct snd_soc_card snd_card;
|
||||
struct simple_dai_props {
|
||||
struct asoc_simple_dai *cpu_dai;
|
||||
struct asoc_simple_dai *codec_dai;
|
||||
struct asoc_simple_data adata;
|
||||
struct simple_util_dai *cpu_dai;
|
||||
struct simple_util_dai *codec_dai;
|
||||
struct simple_util_data adata;
|
||||
struct snd_soc_codec_conf *codec_conf;
|
||||
struct prop_nums num;
|
||||
unsigned int mclk_fs;
|
||||
} *dai_props;
|
||||
struct asoc_simple_jack hp_jack;
|
||||
struct asoc_simple_jack mic_jack;
|
||||
struct simple_util_jack hp_jack;
|
||||
struct simple_util_jack mic_jack;
|
||||
struct snd_soc_jack *aux_jacks;
|
||||
struct snd_soc_dai_link *dai_link;
|
||||
struct asoc_simple_dai *dais;
|
||||
struct simple_util_dai *dais;
|
||||
struct snd_soc_dai_link_component *dlcs;
|
||||
struct snd_soc_codec_conf *codec_conf;
|
||||
struct gpio_desc *pa_gpio;
|
||||
@ -130,75 +141,104 @@ struct link_info {
|
||||
struct prop_nums num[SNDRV_MAX_LINKS];
|
||||
};
|
||||
|
||||
int asoc_simple_parse_daifmt(struct device *dev,
|
||||
/* REMOVE ME */
|
||||
#define asoc_simple_parse_daifmt simple_util_parse_daifmt
|
||||
#define asoc_simple_parse_tdm_width_map simple_util_parse_tdm_width_map
|
||||
#define asoc_simple_set_dailink_name simple_util_set_dailink_name
|
||||
#define asoc_simple_parse_card_name simple_util_parse_card_name
|
||||
#define asoc_simple_parse_clk simple_util_parse_clk
|
||||
#define asoc_simple_startup simple_util_startup
|
||||
#define asoc_simple_shutdown simple_util_shutdown
|
||||
#define asoc_simple_hw_params simple_util_hw_params
|
||||
#define asoc_simple_dai_init simple_util_dai_init
|
||||
#define asoc_simple_be_hw_params_fixup simple_util_be_hw_params_fixup
|
||||
#define asoc_simple_parse_tdm simple_util_parse_tdm
|
||||
#define asoc_simple_canonicalize_platform simple_util_canonicalize_platform
|
||||
#define asoc_simple_canonicalize_cpu simple_util_canonicalize_cpu
|
||||
#define asoc_simple_clean_reference simple_util_clean_reference
|
||||
#define asoc_simple_parse_convert simple_util_parse_convert
|
||||
#define asoc_simple_is_convert_required simple_util_is_convert_required
|
||||
#define asoc_simple_parse_routing simple_util_parse_routing
|
||||
#define asoc_simple_parse_widgets simple_util_parse_widgets
|
||||
#define asoc_simple_parse_pin_switches simple_util_parse_pin_switches
|
||||
#define asoc_simple_init_jack simple_util_init_jack
|
||||
#define asoc_simple_init_aux_jacks simple_util_init_aux_jacks
|
||||
#define asoc_simple_init_priv simple_util_init_priv
|
||||
#define asoc_simple_remove simple_util_remove
|
||||
#define asoc_simple_debug_info simple_util_debug_info
|
||||
#define asoc_graph_card_probe graph_util_card_probe
|
||||
#define asoc_graph_is_ports0 graph_util_is_ports0
|
||||
#define asoc_graph_parse_dai graph_util_parse_dai
|
||||
|
||||
int simple_util_parse_daifmt(struct device *dev,
|
||||
struct device_node *node,
|
||||
struct device_node *codec,
|
||||
char *prefix,
|
||||
unsigned int *retfmt);
|
||||
int asoc_simple_parse_tdm_width_map(struct device *dev, struct device_node *np,
|
||||
struct asoc_simple_dai *dai);
|
||||
int simple_util_parse_tdm_width_map(struct device *dev, struct device_node *np,
|
||||
struct simple_util_dai *dai);
|
||||
|
||||
__printf(3, 4)
|
||||
int asoc_simple_set_dailink_name(struct device *dev,
|
||||
int simple_util_set_dailink_name(struct device *dev,
|
||||
struct snd_soc_dai_link *dai_link,
|
||||
const char *fmt, ...);
|
||||
int asoc_simple_parse_card_name(struct snd_soc_card *card,
|
||||
int simple_util_parse_card_name(struct snd_soc_card *card,
|
||||
char *prefix);
|
||||
|
||||
int asoc_simple_parse_clk(struct device *dev,
|
||||
int simple_util_parse_clk(struct device *dev,
|
||||
struct device_node *node,
|
||||
struct asoc_simple_dai *simple_dai,
|
||||
struct simple_util_dai *simple_dai,
|
||||
struct snd_soc_dai_link_component *dlc);
|
||||
int asoc_simple_startup(struct snd_pcm_substream *substream);
|
||||
void asoc_simple_shutdown(struct snd_pcm_substream *substream);
|
||||
int asoc_simple_hw_params(struct snd_pcm_substream *substream,
|
||||
int simple_util_startup(struct snd_pcm_substream *substream);
|
||||
void simple_util_shutdown(struct snd_pcm_substream *substream);
|
||||
int simple_util_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params);
|
||||
int asoc_simple_dai_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int asoc_simple_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
|
||||
int simple_util_dai_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int simple_util_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
|
||||
struct snd_pcm_hw_params *params);
|
||||
|
||||
#define asoc_simple_parse_tdm(np, dai) \
|
||||
#define simple_util_parse_tdm(np, dai) \
|
||||
snd_soc_of_parse_tdm_slot(np, &(dai)->tx_slot_mask, \
|
||||
&(dai)->rx_slot_mask, \
|
||||
&(dai)->slots, \
|
||||
&(dai)->slot_width);
|
||||
|
||||
void asoc_simple_canonicalize_platform(struct snd_soc_dai_link_component *platforms,
|
||||
void simple_util_canonicalize_platform(struct snd_soc_dai_link_component *platforms,
|
||||
struct snd_soc_dai_link_component *cpus);
|
||||
void asoc_simple_canonicalize_cpu(struct snd_soc_dai_link_component *cpus,
|
||||
void simple_util_canonicalize_cpu(struct snd_soc_dai_link_component *cpus,
|
||||
int is_single_links);
|
||||
|
||||
void asoc_simple_clean_reference(struct snd_soc_card *card);
|
||||
void simple_util_clean_reference(struct snd_soc_card *card);
|
||||
|
||||
void asoc_simple_parse_convert(struct device_node *np, char *prefix,
|
||||
struct asoc_simple_data *data);
|
||||
bool asoc_simple_is_convert_required(const struct asoc_simple_data *data);
|
||||
void simple_util_parse_convert(struct device_node *np, char *prefix,
|
||||
struct simple_util_data *data);
|
||||
bool simple_util_is_convert_required(const struct simple_util_data *data);
|
||||
|
||||
int asoc_simple_parse_routing(struct snd_soc_card *card,
|
||||
int simple_util_parse_routing(struct snd_soc_card *card,
|
||||
char *prefix);
|
||||
int asoc_simple_parse_widgets(struct snd_soc_card *card,
|
||||
int simple_util_parse_widgets(struct snd_soc_card *card,
|
||||
char *prefix);
|
||||
int asoc_simple_parse_pin_switches(struct snd_soc_card *card,
|
||||
int simple_util_parse_pin_switches(struct snd_soc_card *card,
|
||||
char *prefix);
|
||||
|
||||
int asoc_simple_init_jack(struct snd_soc_card *card,
|
||||
struct asoc_simple_jack *sjack,
|
||||
int simple_util_init_jack(struct snd_soc_card *card,
|
||||
struct simple_util_jack *sjack,
|
||||
int is_hp, char *prefix, char *pin);
|
||||
int asoc_simple_init_aux_jacks(struct asoc_simple_priv *priv,
|
||||
int simple_util_init_aux_jacks(struct simple_util_priv *priv,
|
||||
char *prefix);
|
||||
int asoc_simple_init_priv(struct asoc_simple_priv *priv,
|
||||
int simple_util_init_priv(struct simple_util_priv *priv,
|
||||
struct link_info *li);
|
||||
int asoc_simple_remove(struct platform_device *pdev);
|
||||
int simple_util_remove(struct platform_device *pdev);
|
||||
|
||||
int asoc_graph_card_probe(struct snd_soc_card *card);
|
||||
int asoc_graph_is_ports0(struct device_node *port);
|
||||
int asoc_graph_parse_dai(struct device *dev, struct device_node *ep,
|
||||
int graph_util_card_probe(struct snd_soc_card *card);
|
||||
int graph_util_is_ports0(struct device_node *port);
|
||||
int graph_util_parse_dai(struct device *dev, struct device_node *ep,
|
||||
struct snd_soc_dai_link_component *dlc, int *is_single_link);
|
||||
|
||||
#ifdef DEBUG
|
||||
static inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,
|
||||
static inline void simple_util_debug_dai(struct simple_util_priv *priv,
|
||||
char *name,
|
||||
struct asoc_simple_dai *dai)
|
||||
struct simple_util_dai *dai)
|
||||
{
|
||||
struct device *dev = simple_priv_to_dev(priv);
|
||||
|
||||
@ -228,7 +268,7 @@ static inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,
|
||||
name, dai->clk_direction ? "OUT" : "IN");
|
||||
}
|
||||
|
||||
static inline void asoc_simple_debug_info(struct asoc_simple_priv *priv)
|
||||
static inline void simple_util_debug_info(struct simple_util_priv *priv)
|
||||
{
|
||||
struct snd_soc_card *card = simple_priv_to_card(priv);
|
||||
struct device *dev = simple_priv_to_dev(priv);
|
||||
@ -241,7 +281,7 @@ static inline void asoc_simple_debug_info(struct asoc_simple_priv *priv)
|
||||
for (i = 0; i < card->num_links; i++) {
|
||||
struct simple_dai_props *props = simple_priv_to_props(priv, i);
|
||||
struct snd_soc_dai_link *link = simple_priv_to_link(priv, i);
|
||||
struct asoc_simple_dai *dai;
|
||||
struct simple_util_dai *dai;
|
||||
struct snd_soc_codec_conf *cnf;
|
||||
int j;
|
||||
|
||||
@ -249,10 +289,10 @@ static inline void asoc_simple_debug_info(struct asoc_simple_priv *priv)
|
||||
|
||||
dev_dbg(dev, "cpu num = %d\n", link->num_cpus);
|
||||
for_each_prop_dai_cpu(props, j, dai)
|
||||
asoc_simple_debug_dai(priv, "cpu", dai);
|
||||
simple_util_debug_dai(priv, "cpu", dai);
|
||||
dev_dbg(dev, "codec num = %d\n", link->num_codecs);
|
||||
for_each_prop_dai_codec(props, j, dai)
|
||||
asoc_simple_debug_dai(priv, "codec", dai);
|
||||
simple_util_debug_dai(priv, "codec", dai);
|
||||
|
||||
if (link->name)
|
||||
dev_dbg(dev, "dai name = %s\n", link->name);
|
||||
@ -270,7 +310,7 @@ static inline void asoc_simple_debug_info(struct asoc_simple_priv *priv)
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define asoc_simple_debug_info(priv)
|
||||
#define simple_util_debug_info(priv)
|
||||
#endif /* DEBUG */
|
||||
|
||||
#endif /* __SIMPLE_CARD_UTILS_H */
|
||||
|
@ -115,8 +115,8 @@ struct snd_soc_dai *snd_soc_card_get_codec_dai(struct snd_soc_card *card,
|
||||
struct snd_soc_pcm_runtime *rtd;
|
||||
|
||||
for_each_card_rtds(card, rtd) {
|
||||
if (!strcmp(asoc_rtd_to_codec(rtd, 0)->name, dai_name))
|
||||
return asoc_rtd_to_codec(rtd, 0);
|
||||
if (!strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, dai_name))
|
||||
return snd_soc_rtd_to_codec(rtd, 0);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -775,37 +775,42 @@ struct snd_soc_dai_link {
|
||||
#endif
|
||||
};
|
||||
|
||||
/* REMOVE ME */
|
||||
#define asoc_link_to_cpu snd_soc_link_to_cpu
|
||||
#define asoc_link_to_codec snd_soc_link_to_codec
|
||||
#define asoc_link_to_platform snd_soc_link_to_platform
|
||||
|
||||
static inline struct snd_soc_dai_link_component*
|
||||
asoc_link_to_cpu(struct snd_soc_dai_link *link, int n) {
|
||||
snd_soc_link_to_cpu(struct snd_soc_dai_link *link, int n) {
|
||||
return &(link)->cpus[n];
|
||||
}
|
||||
|
||||
static inline struct snd_soc_dai_link_component*
|
||||
asoc_link_to_codec(struct snd_soc_dai_link *link, int n) {
|
||||
snd_soc_link_to_codec(struct snd_soc_dai_link *link, int n) {
|
||||
return &(link)->codecs[n];
|
||||
}
|
||||
|
||||
static inline struct snd_soc_dai_link_component*
|
||||
asoc_link_to_platform(struct snd_soc_dai_link *link, int n) {
|
||||
snd_soc_link_to_platform(struct snd_soc_dai_link *link, int n) {
|
||||
return &(link)->platforms[n];
|
||||
}
|
||||
|
||||
#define for_each_link_codecs(link, i, codec) \
|
||||
for ((i) = 0; \
|
||||
((i) < link->num_codecs) && \
|
||||
((codec) = asoc_link_to_codec(link, i)); \
|
||||
((codec) = snd_soc_link_to_codec(link, i)); \
|
||||
(i)++)
|
||||
|
||||
#define for_each_link_platforms(link, i, platform) \
|
||||
for ((i) = 0; \
|
||||
((i) < link->num_platforms) && \
|
||||
((platform) = asoc_link_to_platform(link, i)); \
|
||||
((platform) = snd_soc_link_to_platform(link, i)); \
|
||||
(i)++)
|
||||
|
||||
#define for_each_link_cpus(link, i, cpu) \
|
||||
for ((i) = 0; \
|
||||
((i) < link->num_cpus) && \
|
||||
((cpu) = asoc_link_to_cpu(link, i)); \
|
||||
((cpu) = snd_soc_link_to_cpu(link, i)); \
|
||||
(i)++)
|
||||
|
||||
/*
|
||||
@ -891,8 +896,11 @@ asoc_link_to_platform(struct snd_soc_dai_link *link, int n) {
|
||||
#define COMP_CODEC_CONF(_name) { .name = _name }
|
||||
#define COMP_DUMMY() { .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", }
|
||||
|
||||
/* REMOVE ME */
|
||||
#define asoc_dummy_dlc snd_soc_dummy_dlc
|
||||
|
||||
extern struct snd_soc_dai_link_component null_dailink_component[0];
|
||||
extern struct snd_soc_dai_link_component asoc_dummy_dlc;
|
||||
extern struct snd_soc_dai_link_component snd_soc_dummy_dlc;
|
||||
|
||||
|
||||
struct snd_soc_codec_conf {
|
||||
@ -1110,8 +1118,8 @@ struct snd_soc_pcm_runtime {
|
||||
* dais = cpu_dai + codec_dai
|
||||
* see
|
||||
* soc_new_pcm_runtime()
|
||||
* asoc_rtd_to_cpu()
|
||||
* asoc_rtd_to_codec()
|
||||
* snd_soc_rtd_to_cpu()
|
||||
* snd_soc_rtd_to_codec()
|
||||
*/
|
||||
struct snd_soc_dai **dais;
|
||||
|
||||
@ -1137,10 +1145,16 @@ struct snd_soc_pcm_runtime {
|
||||
int num_components;
|
||||
struct snd_soc_component *components[]; /* CPU/Codec/Platform */
|
||||
};
|
||||
|
||||
/* REMOVE ME */
|
||||
#define asoc_rtd_to_cpu snd_soc_rtd_to_cpu
|
||||
#define asoc_rtd_to_codec snd_soc_rtd_to_codec
|
||||
#define asoc_substream_to_rtd snd_soc_substream_to_rtd
|
||||
|
||||
/* see soc_new_pcm_runtime() */
|
||||
#define asoc_rtd_to_cpu(rtd, n) (rtd)->dais[n]
|
||||
#define asoc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->dai_link->num_cpus]
|
||||
#define asoc_substream_to_rtd(substream) \
|
||||
#define snd_soc_rtd_to_cpu(rtd, n) (rtd)->dais[n]
|
||||
#define snd_soc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->dai_link->num_cpus]
|
||||
#define snd_soc_substream_to_rtd(substream) \
|
||||
(struct snd_soc_pcm_runtime *)snd_pcm_substream_chip(substream)
|
||||
|
||||
#define for_each_rtd_components(rtd, i, component) \
|
||||
@ -1149,11 +1163,11 @@ struct snd_soc_pcm_runtime {
|
||||
(i)++)
|
||||
#define for_each_rtd_cpu_dais(rtd, i, dai) \
|
||||
for ((i) = 0; \
|
||||
((i) < rtd->dai_link->num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \
|
||||
((i) < rtd->dai_link->num_cpus) && ((dai) = snd_soc_rtd_to_cpu(rtd, i)); \
|
||||
(i)++)
|
||||
#define for_each_rtd_codec_dais(rtd, i, dai) \
|
||||
for ((i) = 0; \
|
||||
((i) < rtd->dai_link->num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \
|
||||
((i) < rtd->dai_link->num_codecs) && ((dai) = snd_soc_rtd_to_codec(rtd, i)); \
|
||||
(i)++)
|
||||
#define for_each_rtd_dais(rtd, i, dai) \
|
||||
for ((i) = 0; \
|
||||
|
@ -38,7 +38,7 @@ int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||
struct dma_slave_config config;
|
||||
int ret;
|
||||
|
||||
dma_params = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
dma_params = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
if (!dma_params)
|
||||
return 0;
|
||||
|
||||
@ -47,7 +47,7 @@ int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||
return ret;
|
||||
|
||||
snd_dmaengine_pcm_set_config_from_dai_data(substream,
|
||||
snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream),
|
||||
snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream),
|
||||
&config);
|
||||
|
||||
ret = dmaengine_slave_config(chan, &config);
|
||||
@ -86,7 +86,7 @@ int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
|
||||
|
||||
runtime->hw = pxa2xx_pcm_hardware;
|
||||
|
||||
dma_params = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
dma_params = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
if (!dma_params)
|
||||
return 0;
|
||||
|
||||
@ -111,7 +111,7 @@ int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
|
||||
return ret;
|
||||
|
||||
return snd_dmaengine_pcm_open(
|
||||
substream, dma_request_slave_channel(asoc_rtd_to_cpu(rtd, 0)->dev,
|
||||
substream, dma_request_slave_channel(snd_soc_rtd_to_cpu(rtd, 0)->dev,
|
||||
dma_params->chan_name));
|
||||
}
|
||||
EXPORT_SYMBOL(pxa2xx_pcm_open);
|
||||
|
@ -54,7 +54,7 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
int ret;
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
|
||||
dev_info(rtd->dev, "codec dai name = %s\n", codec_dai->name);
|
||||
@ -106,7 +106,7 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
|
||||
static int da7219_clk_enable(struct snd_pcm_substream *substream)
|
||||
{
|
||||
int ret = 0;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
/*
|
||||
* Set wclk to 48000 because the rate constraint of this driver is
|
||||
@ -134,7 +134,7 @@ static int cz_rt5682_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
int ret;
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
|
||||
dev_info(codec_dai->dev, "codec dai name = %s\n", codec_dai->name);
|
||||
@ -191,7 +191,7 @@ static int cz_rt5682_init(struct snd_soc_pcm_runtime *rtd)
|
||||
static int rt5682_clk_enable(struct snd_pcm_substream *substream)
|
||||
{
|
||||
int ret;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
/*
|
||||
* Set wclk to 48000 because the rate constraint of this driver is
|
||||
@ -245,7 +245,7 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = {
|
||||
static int cz_da7219_play_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
@ -266,7 +266,7 @@ static int cz_da7219_play_startup(struct snd_pcm_substream *substream)
|
||||
static int cz_da7219_cap_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
@ -288,7 +288,7 @@ static int cz_da7219_cap_startup(struct snd_pcm_substream *substream)
|
||||
static int cz_max_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
@ -309,7 +309,7 @@ static int cz_max_startup(struct snd_pcm_substream *substream)
|
||||
static int cz_dmic0_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
@ -330,7 +330,7 @@ static int cz_dmic0_startup(struct snd_pcm_substream *substream)
|
||||
static int cz_dmic1_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
@ -357,7 +357,7 @@ static void cz_da7219_shutdown(struct snd_pcm_substream *substream)
|
||||
static int cz_rt5682_play_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
@ -378,7 +378,7 @@ static int cz_rt5682_play_startup(struct snd_pcm_substream *substream)
|
||||
static int cz_rt5682_cap_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
@ -400,7 +400,7 @@ static int cz_rt5682_cap_startup(struct snd_pcm_substream *substream)
|
||||
static int cz_rt5682_max_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
@ -421,7 +421,7 @@ static int cz_rt5682_max_startup(struct snd_pcm_substream *substream)
|
||||
static int cz_rt5682_dmic0_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
@ -442,7 +442,7 @@ static int cz_rt5682_dmic0_startup(struct snd_pcm_substream *substream)
|
||||
static int cz_rt5682_dmic1_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
|
@ -62,7 +62,7 @@ static int st_es8336_init(struct snd_soc_pcm_runtime *rtd)
|
||||
struct snd_soc_card *card;
|
||||
struct snd_soc_component *codec;
|
||||
|
||||
codec = asoc_rtd_to_codec(rtd, 0)->component;
|
||||
codec = snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
card = rtd->card;
|
||||
|
||||
ret = snd_soc_card_jack_new_pins(card, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0,
|
||||
@ -111,10 +111,10 @@ static int st_es8336_codec_startup(struct snd_pcm_substream *substream)
|
||||
int ret;
|
||||
|
||||
runtime = substream->runtime;
|
||||
rtd = asoc_substream_to_rtd(substream);
|
||||
rtd = snd_soc_substream_to_rtd(substream);
|
||||
card = rtd->card;
|
||||
machine = snd_soc_card_get_drvdata(card);
|
||||
codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
ret = snd_soc_dai_set_sysclk(codec_dai, 0, ES8336_PLL_FREQ, SND_SOC_CLOCK_IN);
|
||||
if (ret < 0) {
|
||||
dev_err(rtd->dev, "can't set codec sysclk: %d\n", ret);
|
||||
|
@ -849,7 +849,7 @@ static int acp_dma_hw_params(struct snd_soc_component *component,
|
||||
u32 val = 0;
|
||||
struct snd_pcm_runtime *runtime;
|
||||
struct audio_substream_data *rtd;
|
||||
struct snd_soc_pcm_runtime *prtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *prtd = snd_soc_substream_to_rtd(substream);
|
||||
struct audio_drv_data *adata = dev_get_drvdata(component->dev);
|
||||
struct snd_soc_card *card = prtd->card;
|
||||
struct acp_platform_info *pinfo = snd_soc_card_get_drvdata(card);
|
||||
|
@ -57,8 +57,8 @@ static int cz_aif1_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
int ret = 0;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
|
||||
ret = snd_soc_dai_set_pll(codec_dai, 0, RT5645_PLL1_S_MCLK,
|
||||
CZ_PLAT_CLK, params_rate(params) * 512);
|
||||
@ -83,7 +83,7 @@ static int cz_init(struct snd_soc_pcm_runtime *rtd)
|
||||
struct snd_soc_card *card;
|
||||
struct snd_soc_component *codec;
|
||||
|
||||
codec = asoc_rtd_to_codec(rtd, 0)->component;
|
||||
codec = snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
card = rtd->card;
|
||||
|
||||
ret = snd_soc_card_jack_new_pins(card, "Headset Jack",
|
||||
|
@ -80,8 +80,8 @@ void restore_acp_pdm_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *soc_runtime;
|
||||
u32 ext_int_ctrl;
|
||||
|
||||
soc_runtime = asoc_substream_to_rtd(substream);
|
||||
dai = asoc_rtd_to_cpu(soc_runtime, 0);
|
||||
soc_runtime = snd_soc_substream_to_rtd(substream);
|
||||
dai = snd_soc_rtd_to_cpu(soc_runtime, 0);
|
||||
/* Programming channel mask and sampling rate */
|
||||
writel(adata->ch_mask, adata->acp_base + ACP_WOV_PDM_NO_OF_CHANNELS);
|
||||
writel(PDM_DEC_64, adata->acp_base + ACP_WOV_PDM_DECIMATION_FACTOR);
|
||||
@ -192,8 +192,8 @@ int restore_acp_i2s_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *soc_runtime;
|
||||
u32 tdm_fmt, reg_val, fmt_reg, val;
|
||||
|
||||
soc_runtime = asoc_substream_to_rtd(substream);
|
||||
dai = asoc_rtd_to_cpu(soc_runtime, 0);
|
||||
soc_runtime = snd_soc_substream_to_rtd(substream);
|
||||
dai = snd_soc_rtd_to_cpu(soc_runtime, 0);
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
tdm_fmt = adata->tdm_tx_fmt[stream->dai_id - 1];
|
||||
switch (stream->dai_id) {
|
||||
|
@ -117,7 +117,7 @@ static int acp_card_rt5682_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_card_drvdata *drvdata = card->drvdata;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
int ret;
|
||||
|
||||
@ -172,10 +172,10 @@ static int acp_card_rt5682_init(struct snd_soc_pcm_runtime *rtd)
|
||||
static int acp_card_hs_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_card_drvdata *drvdata = card->drvdata;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
int ret;
|
||||
unsigned int fmt;
|
||||
|
||||
@ -206,7 +206,7 @@ static int acp_card_hs_startup(struct snd_pcm_substream *substream)
|
||||
|
||||
static void acp_card_shutdown(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_card_drvdata *drvdata = card->drvdata;
|
||||
|
||||
@ -220,8 +220,8 @@ static int acp_card_rt5682_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_card_drvdata *drvdata = card->drvdata;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
int ret;
|
||||
unsigned int fmt, srate, ch, format;
|
||||
|
||||
@ -342,7 +342,7 @@ static int acp_card_rt5682s_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_card_drvdata *drvdata = card->drvdata;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
int ret;
|
||||
|
||||
@ -402,8 +402,8 @@ static int acp_card_rt5682s_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_card_drvdata *drvdata = card->drvdata;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
int ret;
|
||||
unsigned int fmt, srate, ch, format;
|
||||
|
||||
@ -573,7 +573,7 @@ static int acp_card_rt1019_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_card_drvdata *drvdata = card->drvdata;
|
||||
struct snd_soc_dai *codec_dai;
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
int i, ret = 0;
|
||||
unsigned int fmt, srate, ch, format;
|
||||
|
||||
@ -737,7 +737,7 @@ static int acp_card_maxim_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_card_drvdata *drvdata = card->drvdata;
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
unsigned int fmt, srate, ch, format;
|
||||
int ret;
|
||||
|
||||
@ -928,7 +928,7 @@ static int acp_card_nau8825_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_card_drvdata *drvdata = card->drvdata;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
int ret;
|
||||
|
||||
@ -980,11 +980,11 @@ static int acp_card_nau8825_init(struct snd_soc_pcm_runtime *rtd)
|
||||
static int acp_nau8825_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_card_drvdata *drvdata = card->drvdata;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
int ret;
|
||||
unsigned int fmt;
|
||||
|
||||
@ -1142,7 +1142,7 @@ static struct snd_pcm_hw_constraint_list constraints_sample_bits = {
|
||||
static int acp_8821_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
int ret;
|
||||
|
||||
@ -1204,10 +1204,10 @@ static int acp_8821_startup(struct snd_pcm_substream *substream)
|
||||
static int acp_nau8821_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp_card_drvdata *drvdata = card->drvdata;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
int ret;
|
||||
unsigned int fmt;
|
||||
|
||||
@ -1358,7 +1358,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
|
||||
links[i].no_pcm = 1;
|
||||
if (!drv_data->hs_codec_id) {
|
||||
/* Use dummy codec if codec id not specified */
|
||||
links[i].codecs = &asoc_dummy_dlc;
|
||||
links[i].codecs = &snd_soc_dummy_dlc;
|
||||
links[i].num_codecs = 1;
|
||||
}
|
||||
if (drv_data->hs_codec_id == RT5682) {
|
||||
@ -1395,7 +1395,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
|
||||
links[i].no_pcm = 1;
|
||||
if (!drv_data->hs_codec_id) {
|
||||
/* Use dummy codec if codec id not specified */
|
||||
links[i].codecs = &asoc_dummy_dlc;
|
||||
links[i].codecs = &snd_soc_dummy_dlc;
|
||||
links[i].num_codecs = 1;
|
||||
}
|
||||
if (drv_data->hs_codec_id == NAU8825) {
|
||||
@ -1425,7 +1425,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
|
||||
links[i].no_pcm = 1;
|
||||
if (!drv_data->amp_codec_id) {
|
||||
/* Use dummy codec if codec id not specified */
|
||||
links[i].codecs = &asoc_dummy_dlc;
|
||||
links[i].codecs = &snd_soc_dummy_dlc;
|
||||
links[i].num_codecs = 1;
|
||||
}
|
||||
if (drv_data->amp_codec_id == RT1019) {
|
||||
@ -1457,7 +1457,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
|
||||
links[i].no_pcm = 1;
|
||||
if (!drv_data->amp_codec_id) {
|
||||
/* Use dummy codec if codec id not specified */
|
||||
links[i].codecs = &asoc_dummy_dlc;
|
||||
links[i].codecs = &snd_soc_dummy_dlc;
|
||||
links[i].num_codecs = 1;
|
||||
}
|
||||
if (drv_data->amp_codec_id == MAX98360A) {
|
||||
@ -1537,7 +1537,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
|
||||
links[i].dpcm_capture = 1;
|
||||
if (!drv_data->hs_codec_id) {
|
||||
/* Use dummy codec if codec id not specified */
|
||||
links[i].codecs = &asoc_dummy_dlc;
|
||||
links[i].codecs = &snd_soc_dummy_dlc;
|
||||
links[i].num_codecs = 1;
|
||||
}
|
||||
if (drv_data->hs_codec_id == RT5682) {
|
||||
@ -1578,7 +1578,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
|
||||
links[i].dpcm_capture = 1;
|
||||
if (!drv_data->hs_codec_id) {
|
||||
/* Use dummy codec if codec id not specified */
|
||||
links[i].codecs = &asoc_dummy_dlc;
|
||||
links[i].codecs = &snd_soc_dummy_dlc;
|
||||
links[i].num_codecs = 1;
|
||||
}
|
||||
if (drv_data->hs_codec_id == NAU8825) {
|
||||
@ -1606,7 +1606,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
|
||||
links[i].dpcm_playback = 1;
|
||||
if (!drv_data->amp_codec_id) {
|
||||
/* Use dummy codec if codec id not specified */
|
||||
links[i].codecs = &asoc_dummy_dlc;
|
||||
links[i].codecs = &snd_soc_dummy_dlc;
|
||||
links[i].num_codecs = 1;
|
||||
}
|
||||
if (drv_data->amp_codec_id == RT1019) {
|
||||
@ -1641,7 +1641,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
|
||||
links[i].dpcm_playback = 1;
|
||||
if (!drv_data->amp_codec_id) {
|
||||
/* Use dummy codec if codec id not specified */
|
||||
links[i].codecs = &asoc_dummy_dlc;
|
||||
links[i].codecs = &snd_soc_dummy_dlc;
|
||||
links[i].num_codecs = 1;
|
||||
}
|
||||
if (drv_data->amp_codec_id == MAX98360A) {
|
||||
@ -1669,7 +1669,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
|
||||
links[i].num_codecs = ARRAY_SIZE(dmic_codec);
|
||||
} else {
|
||||
/* Use dummy codec if codec id not specified */
|
||||
links[i].codecs = &asoc_dummy_dlc;
|
||||
links[i].codecs = &snd_soc_dummy_dlc;
|
||||
links[i].num_codecs = 1;
|
||||
}
|
||||
links[i].cpus = pdm_dmic;
|
||||
|
@ -54,7 +54,7 @@ static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
int ret;
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
|
||||
dev_info(rtd->dev, "codec dai name = %s\n", codec_dai->name);
|
||||
@ -126,7 +126,7 @@ static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd)
|
||||
static int rt5682_clk_enable(struct snd_pcm_substream *substream)
|
||||
{
|
||||
int ret = 0;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
/* RT5682 will support only 48K output with 48M mclk */
|
||||
clk_set_rate(rt5682_dai_wclk, 48000);
|
||||
@ -194,7 +194,7 @@ static const struct snd_pcm_hw_constraint_list constraints_channels = {
|
||||
static int acp3x_5682_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp3x_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
@ -212,7 +212,7 @@ static int acp3x_5682_startup(struct snd_pcm_substream *substream)
|
||||
static int acp3x_max_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct acp3x_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
@ -228,9 +228,9 @@ static int acp3x_max_startup(struct snd_pcm_substream *substream)
|
||||
|
||||
static int acp3x_ec_dmic0_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct acp3x_platform_info *machine = snd_soc_card_get_drvdata(card);
|
||||
|
||||
machine->cap_i2s_instance = I2S_BT_INSTANCE;
|
||||
|
@ -222,7 +222,7 @@ static int acp63_sdw_dma_open(struct snd_soc_component *component,
|
||||
int ret;
|
||||
|
||||
runtime = substream->runtime;
|
||||
cpu_dai = asoc_rtd_to_cpu(prtd, 0);
|
||||
cpu_dai = snd_soc_rtd_to_cpu(prtd, 0);
|
||||
amd_manager = snd_soc_dai_get_drvdata(cpu_dai);
|
||||
stream = kzalloc(sizeof(*stream), GFP_KERNEL);
|
||||
if (!stream)
|
||||
|
@ -80,7 +80,7 @@ static int acp3x_i2s_hwparams(struct snd_pcm_substream *substream,
|
||||
u32 val;
|
||||
u32 reg_val, frmt_reg;
|
||||
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
prtd = snd_soc_substream_to_rtd(substream);
|
||||
rtd = substream->runtime->private_data;
|
||||
card = prtd->card;
|
||||
adata = snd_soc_dai_get_drvdata(dai);
|
||||
|
@ -215,7 +215,7 @@ static int acp3x_dma_open(struct snd_soc_component *component,
|
||||
int ret;
|
||||
|
||||
runtime = substream->runtime;
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
prtd = snd_soc_substream_to_rtd(substream);
|
||||
component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
|
||||
adata = dev_get_drvdata(component->dev);
|
||||
i2s_data = kzalloc(sizeof(*i2s_data), GFP_KERNEL);
|
||||
@ -252,7 +252,7 @@ static int acp3x_dma_hw_params(struct snd_soc_component *component,
|
||||
struct i2s_dev_data *adata;
|
||||
u64 size;
|
||||
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
prtd = snd_soc_substream_to_rtd(substream);
|
||||
card = prtd->card;
|
||||
pinfo = snd_soc_card_get_drvdata(card);
|
||||
adata = dev_get_drvdata(component->dev);
|
||||
@ -327,7 +327,7 @@ static int acp3x_dma_close(struct snd_soc_component *component,
|
||||
struct i2s_dev_data *adata;
|
||||
struct i2s_stream_instance *ins;
|
||||
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
prtd = snd_soc_substream_to_rtd(substream);
|
||||
component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
|
||||
adata = dev_get_drvdata(component->dev);
|
||||
ins = substream->runtime->private_data;
|
||||
|
@ -95,7 +95,7 @@ static int acp5x_i2s_hwparams(struct snd_pcm_substream *substream,
|
||||
|
||||
lrclk_div_val = 0;
|
||||
bclk_div_val = 0;
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
prtd = snd_soc_substream_to_rtd(substream);
|
||||
rtd = substream->runtime->private_data;
|
||||
card = prtd->card;
|
||||
adata = snd_soc_dai_get_drvdata(dai);
|
||||
|
@ -92,7 +92,7 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w,
|
||||
|
||||
static int acp5x_8821_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
@ -144,7 +144,7 @@ static struct snd_pcm_hw_constraint_list constraints_sample_bits = {
|
||||
static int acp5x_8821_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct acp5x_platform_info *machine = snd_soc_card_get_drvdata(rtd->card);
|
||||
|
||||
machine->play_i2s_instance = I2S_SP_INSTANCE;
|
||||
@ -165,7 +165,7 @@ static int acp5x_8821_startup(struct snd_pcm_substream *substream)
|
||||
static int acp5x_nau8821_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *dai = snd_soc_card_get_codec_dai(card, ACP5X_NAU8821_DAI_NAME);
|
||||
int ret, bclk;
|
||||
@ -197,7 +197,7 @@ static const struct snd_soc_ops acp5x_8821_ops = {
|
||||
|
||||
static int acp5x_cs35l41_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct acp5x_platform_info *machine = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
|
||||
@ -215,7 +215,7 @@ static int acp5x_cs35l41_startup(struct snd_pcm_substream *substream)
|
||||
static int acp5x_cs35l41_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
unsigned int bclk, rate = params_rate(params);
|
||||
struct snd_soc_component *comp;
|
||||
int ret, i;
|
||||
@ -334,7 +334,7 @@ static struct snd_soc_card acp5x_8821_35l41_card = {
|
||||
|
||||
static int acp5x_max98388_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct acp5x_platform_info *machine = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
|
||||
|
@ -209,7 +209,7 @@ static int acp5x_dma_open(struct snd_soc_component *component,
|
||||
int ret;
|
||||
|
||||
runtime = substream->runtime;
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
prtd = snd_soc_substream_to_rtd(substream);
|
||||
component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
|
||||
adata = dev_get_drvdata(component->dev);
|
||||
|
||||
@ -245,7 +245,7 @@ static int acp5x_dma_hw_params(struct snd_soc_component *component,
|
||||
struct i2s_dev_data *adata;
|
||||
u64 size;
|
||||
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
prtd = snd_soc_substream_to_rtd(substream);
|
||||
card = prtd->card;
|
||||
pinfo = snd_soc_card_get_drvdata(card);
|
||||
adata = dev_get_drvdata(component->dev);
|
||||
@ -322,7 +322,7 @@ static int acp5x_dma_close(struct snd_soc_component *component,
|
||||
struct i2s_dev_data *adata;
|
||||
struct i2s_stream_instance *ins;
|
||||
|
||||
prtd = asoc_substream_to_rtd(substream);
|
||||
prtd = snd_soc_substream_to_rtd(substream);
|
||||
component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
|
||||
adata = dev_get_drvdata(component->dev);
|
||||
ins = substream->runtime->private_data;
|
||||
|
@ -546,7 +546,7 @@ static int mca_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
|
||||
|
||||
static int mca_fe_get_port(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *fe = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *be;
|
||||
struct snd_soc_dpcm *dpcm;
|
||||
|
||||
@ -559,7 +559,7 @@ static int mca_fe_get_port(struct snd_pcm_substream *substream)
|
||||
if (!be)
|
||||
return -EINVAL;
|
||||
|
||||
return mca_dai_to_cluster(asoc_rtd_to_cpu(be, 0))->no;
|
||||
return mca_dai_to_cluster(snd_soc_rtd_to_cpu(be, 0))->no;
|
||||
}
|
||||
|
||||
static int mca_fe_hw_params(struct snd_pcm_substream *substream,
|
||||
@ -700,7 +700,7 @@ static bool mca_be_started(struct mca_cluster *cl)
|
||||
static int mca_be_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *be = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *be = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *fe;
|
||||
struct mca_cluster *cl = mca_dai_to_cluster(dai);
|
||||
struct mca_cluster *fe_cl;
|
||||
@ -721,7 +721,7 @@ static int mca_be_startup(struct snd_pcm_substream *substream,
|
||||
if (!fe)
|
||||
return -EINVAL;
|
||||
|
||||
fe_cl = mca_dai_to_cluster(asoc_rtd_to_cpu(fe, 0));
|
||||
fe_cl = mca_dai_to_cluster(snd_soc_rtd_to_cpu(fe, 0));
|
||||
|
||||
if (mca_be_started(cl)) {
|
||||
/*
|
||||
@ -811,8 +811,8 @@ static int mca_set_runtime_hwparams(struct snd_soc_component *component,
|
||||
static int mca_pcm_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct mca_cluster *cl = mca_dai_to_cluster(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct mca_cluster *cl = mca_dai_to_cluster(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
struct dma_chan *chan = cl->dma_chans[substream->stream];
|
||||
int ret;
|
||||
|
||||
@ -830,7 +830,7 @@ static int mca_hw_params(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream);
|
||||
struct dma_slave_config slave_config;
|
||||
int ret;
|
||||
@ -857,7 +857,7 @@ static int mca_hw_params(struct snd_soc_component *component,
|
||||
static int mca_close(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
if (rtd->dai_link->no_pcm)
|
||||
return 0;
|
||||
@ -868,7 +868,7 @@ static int mca_close(struct snd_soc_component *component,
|
||||
static int mca_trigger(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream, int cmd)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
if (rtd->dai_link->no_pcm)
|
||||
return 0;
|
||||
@ -877,7 +877,7 @@ static int mca_trigger(struct snd_soc_component *component,
|
||||
* Before we do the PCM trigger proper, insert an opportunity
|
||||
* to reset the frontend's SERDES.
|
||||
*/
|
||||
mca_fe_early_trigger(substream, cmd, asoc_rtd_to_cpu(rtd, 0));
|
||||
mca_fe_early_trigger(substream, cmd, snd_soc_rtd_to_cpu(rtd, 0));
|
||||
|
||||
return snd_dmaengine_pcm_trigger(substream, cmd);
|
||||
}
|
||||
@ -885,7 +885,7 @@ static int mca_trigger(struct snd_soc_component *component,
|
||||
static snd_pcm_uframes_t mca_pointer(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
if (rtd->dai_link->no_pcm)
|
||||
return -ENOTSUPP;
|
||||
@ -911,7 +911,7 @@ static void mca_pcm_free(struct snd_soc_component *component,
|
||||
struct snd_pcm *pcm)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = snd_pcm_chip(pcm);
|
||||
struct mca_cluster *cl = mca_dai_to_cluster(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct mca_cluster *cl = mca_dai_to_cluster(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
unsigned int i;
|
||||
|
||||
if (rtd->dai_link->no_pcm)
|
||||
@ -933,7 +933,7 @@ static void mca_pcm_free(struct snd_soc_component *component,
|
||||
static int mca_pcm_new(struct snd_soc_component *component,
|
||||
struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct mca_cluster *cl = mca_dai_to_cluster(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct mca_cluster *cl = mca_dai_to_cluster(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
unsigned int i;
|
||||
|
||||
if (rtd->dai_link->no_pcm)
|
||||
|
@ -118,7 +118,7 @@ static const struct snd_pcm_hardware atmel_classd_hw = {
|
||||
static int atmel_classd_cpu_dai_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *cpu_dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card);
|
||||
int err;
|
||||
|
||||
@ -141,7 +141,7 @@ atmel_classd_platform_configure_dma(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
struct dma_slave_config *slave_config)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card);
|
||||
|
||||
if (params_physical_width(params) != 16) {
|
||||
@ -338,7 +338,7 @@ atmel_classd_cpu_dai_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
struct snd_soc_dai *cpu_dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct snd_soc_component *component = cpu_dai->component;
|
||||
int fs;
|
||||
@ -381,7 +381,7 @@ static void
|
||||
atmel_classd_cpu_dai_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *cpu_dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct atmel_classd *dd = snd_soc_card_get_drvdata(rtd->card);
|
||||
|
||||
clk_disable_unprepare(dd->gclk);
|
||||
@ -478,7 +478,7 @@ static int atmel_classd_asoc_card_init(struct device *dev,
|
||||
return -ENOMEM;
|
||||
|
||||
dai_link->cpus = comp;
|
||||
dai_link->codecs = &asoc_dummy_dlc;
|
||||
dai_link->codecs = &snd_soc_dummy_dlc;
|
||||
|
||||
dai_link->num_cpus = 1;
|
||||
dai_link->num_codecs = 1;
|
||||
|
@ -52,10 +52,10 @@ static const struct snd_pcm_hardware atmel_pcm_dma_hardware = {
|
||||
static void atmel_pcm_dma_irq(u32 ssc_sr,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct atmel_pcm_dma_params *prtd;
|
||||
|
||||
prtd = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
prtd = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
|
||||
if (ssc_sr & prtd->mask->ssc_error) {
|
||||
if (snd_pcm_running(substream))
|
||||
@ -77,12 +77,12 @@ static void atmel_pcm_dma_irq(u32 ssc_sr,
|
||||
static int atmel_pcm_configure_dma(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct atmel_pcm_dma_params *prtd;
|
||||
struct ssc_device *ssc;
|
||||
int ret;
|
||||
|
||||
prtd = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
prtd = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
ssc = prtd->ssc;
|
||||
|
||||
ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config);
|
||||
|
@ -140,12 +140,12 @@ static int atmel_pcm_hw_params(struct snd_soc_component *component,
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct atmel_runtime_data *prtd = runtime->private_data;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
/* this may get called several times by oss emulation
|
||||
* with different params */
|
||||
|
||||
prtd->params = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
prtd->params = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
prtd->params->dma_intr_handler = atmel_pcm_dma_irq;
|
||||
|
||||
prtd->dma_buffer = runtime->dma_addr;
|
||||
|
@ -104,7 +104,7 @@ static struct atmel_pdmic_pdata *atmel_pdmic_dt_init(struct device *dev)
|
||||
static int atmel_pdmic_cpu_dai_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *cpu_dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct atmel_pdmic *dd = snd_soc_card_get_drvdata(rtd->card);
|
||||
int ret;
|
||||
|
||||
@ -132,7 +132,7 @@ static int atmel_pdmic_cpu_dai_startup(struct snd_pcm_substream *substream,
|
||||
static void atmel_pdmic_cpu_dai_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *cpu_dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct atmel_pdmic *dd = snd_soc_card_get_drvdata(rtd->card);
|
||||
|
||||
/* Disable the overrun error interrupt */
|
||||
@ -145,7 +145,7 @@ static void atmel_pdmic_cpu_dai_shutdown(struct snd_pcm_substream *substream,
|
||||
static int atmel_pdmic_cpu_dai_prepare(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *cpu_dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct atmel_pdmic *dd = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct snd_soc_component *component = cpu_dai->component;
|
||||
u32 val;
|
||||
@ -191,7 +191,7 @@ atmel_pdmic_platform_configure_dma(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
struct dma_slave_config *slave_config)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct atmel_pdmic *dd = snd_soc_card_get_drvdata(rtd->card);
|
||||
int ret;
|
||||
|
||||
@ -356,7 +356,7 @@ atmel_pdmic_cpu_dai_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
struct snd_soc_dai *cpu_dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct atmel_pdmic *dd = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct snd_soc_component *component = cpu_dai->component;
|
||||
unsigned int rate_min = substream->runtime->hw.rate_min;
|
||||
@ -501,7 +501,7 @@ static int atmel_pdmic_asoc_card_init(struct device *dev,
|
||||
return -ENOMEM;
|
||||
|
||||
dai_link->cpus = comp;
|
||||
dai_link->codecs = &asoc_dummy_dlc;
|
||||
dai_link->codecs = &snd_soc_dummy_dlc;
|
||||
|
||||
dai_link->num_cpus = 1;
|
||||
dai_link->num_codecs = 1;
|
||||
|
@ -26,8 +26,8 @@ static const struct snd_soc_dapm_widget atmel_asoc_wm8904_dapm_widgets[] = {
|
||||
static int atmel_asoc_wm8904_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
int ret;
|
||||
|
||||
ret = snd_soc_dai_set_pll(codec_dai, WM8904_FLL_MCLK, WM8904_FLL_MCLK,
|
||||
|
@ -21,7 +21,7 @@
|
||||
static int snd_proto_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
|
||||
/* Set proto sysclk */
|
||||
int ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL,
|
||||
|
@ -66,7 +66,7 @@ static const struct snd_soc_dapm_route intercon[] = {
|
||||
*/
|
||||
static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct device *dev = rtd->dev;
|
||||
int ret;
|
||||
|
||||
|
@ -40,7 +40,7 @@ struct sam9x5_drvdata {
|
||||
*/
|
||||
static int sam9x5_wm8731_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct device *dev = rtd->dev;
|
||||
int ret;
|
||||
|
||||
|
@ -94,8 +94,8 @@ static struct snd_soc_card db1550_ac97_machine = {
|
||||
|
||||
static int db1200_i2s_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
|
||||
/* WM8731 has its own 12MHz crystal */
|
||||
snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL,
|
||||
|
@ -278,10 +278,10 @@ static int au1xpsc_pcm_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct au1xpsc_audio_dmadata *pcd = to_dmadata(substream, component);
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
int stype = substream->stream, *dmaids;
|
||||
|
||||
dmaids = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
dmaids = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
if (!dmaids)
|
||||
return -ENODEV; /* whoa, has ordering changed? */
|
||||
|
||||
|
@ -191,11 +191,11 @@ static int alchemy_pcm_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct alchemy_pcm_ctx *ctx = ss_to_ctx(substream, component);
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
int *dmaids, s = substream->stream;
|
||||
char *name;
|
||||
|
||||
dmaids = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
dmaids = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
if (!dmaids)
|
||||
return -ENODEV; /* whoa, has ordering changed? */
|
||||
|
||||
|
@ -58,7 +58,7 @@ static struct au1xpsc_audio_data *au1xpsc_ac97_workdata;
|
||||
static inline struct au1xpsc_audio_data *ac97_to_pscdata(struct snd_ac97 *x)
|
||||
{
|
||||
struct snd_soc_card *c = x->bus->card->private_data;
|
||||
return snd_soc_dai_get_drvdata(c->asoc_rtd_to_cpu(rtd, 0));
|
||||
return snd_soc_dai_get_drvdata(c->snd_soc_rtd_to_cpu(rtd, 0));
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -46,13 +46,13 @@ static int bcm63xx_pcm_hw_params(struct snd_soc_component *component,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct i2s_dma_desc *dma_desc;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
dma_desc = kzalloc(sizeof(*dma_desc), GFP_NOWAIT);
|
||||
if (!dma_desc)
|
||||
return -ENOMEM;
|
||||
|
||||
snd_soc_dai_set_dma_data(asoc_rtd_to_cpu(rtd, 0), substream, dma_desc);
|
||||
snd_soc_dai_set_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream, dma_desc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -61,9 +61,9 @@ static int bcm63xx_pcm_hw_free(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct i2s_dma_desc *dma_desc;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
dma_desc = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
dma_desc = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
kfree(dma_desc);
|
||||
|
||||
return 0;
|
||||
@ -77,8 +77,8 @@ static int bcm63xx_pcm_trigger(struct snd_soc_component *component,
|
||||
struct bcm_i2s_priv *i2s_priv;
|
||||
struct regmap *regmap_i2s;
|
||||
|
||||
rtd = asoc_substream_to_rtd(substream);
|
||||
i2s_priv = dev_get_drvdata(asoc_rtd_to_cpu(rtd, 0)->dev);
|
||||
rtd = snd_soc_substream_to_rtd(substream);
|
||||
i2s_priv = dev_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)->dev);
|
||||
regmap_i2s = i2s_priv->regmap_i2s;
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
@ -144,11 +144,11 @@ static int bcm63xx_pcm_prepare(struct snd_soc_component *component,
|
||||
struct i2s_dma_desc *dma_desc;
|
||||
struct regmap *regmap_i2s;
|
||||
struct bcm_i2s_priv *i2s_priv;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
uint32_t regaddr_desclen, regaddr_descaddr;
|
||||
|
||||
dma_desc = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
dma_desc = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
dma_desc->dma_len = snd_pcm_lib_period_bytes(substream);
|
||||
dma_desc->dma_addr = runtime->dma_addr;
|
||||
dma_desc->dma_area = runtime->dma_area;
|
||||
@ -161,7 +161,7 @@ static int bcm63xx_pcm_prepare(struct snd_soc_component *component,
|
||||
regaddr_descaddr = I2S_RX_DESC_IFF_ADDR;
|
||||
}
|
||||
|
||||
i2s_priv = dev_get_drvdata(asoc_rtd_to_cpu(rtd, 0)->dev);
|
||||
i2s_priv = dev_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)->dev);
|
||||
regmap_i2s = i2s_priv->regmap_i2s;
|
||||
|
||||
regmap_write(regmap_i2s, regaddr_desclen, dma_desc->dma_len);
|
||||
@ -250,9 +250,9 @@ static irqreturn_t i2s_dma_isr(int irq, void *bcm_i2s_priv)
|
||||
if (int_status & I2S_RX_DESC_OFF_INTR_EN_MSK) {
|
||||
substream = i2s_priv->capture_substream;
|
||||
runtime = substream->runtime;
|
||||
rtd = asoc_substream_to_rtd(substream);
|
||||
rtd = snd_soc_substream_to_rtd(substream);
|
||||
prtd = runtime->private_data;
|
||||
dma_desc = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
dma_desc = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
|
||||
offlevel = (int_status & I2S_RX_DESC_OFF_LEVEL_MASK) >>
|
||||
I2S_RX_DESC_OFF_LEVEL_SHIFT;
|
||||
@ -298,9 +298,9 @@ static irqreturn_t i2s_dma_isr(int irq, void *bcm_i2s_priv)
|
||||
if (int_status & I2S_TX_DESC_OFF_INTR_EN_MSK) {
|
||||
substream = i2s_priv->play_substream;
|
||||
runtime = substream->runtime;
|
||||
rtd = asoc_substream_to_rtd(substream);
|
||||
rtd = snd_soc_substream_to_rtd(substream);
|
||||
prtd = runtime->private_data;
|
||||
dma_desc = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
dma_desc = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
|
||||
offlevel = (int_status & I2S_TX_DESC_OFF_LEVEL_MASK) >>
|
||||
I2S_TX_DESC_OFF_LEVEL_SHIFT;
|
||||
@ -352,7 +352,7 @@ static int bcm63xx_soc_pcm_new(struct snd_soc_component *component,
|
||||
struct bcm_i2s_priv *i2s_priv;
|
||||
int ret;
|
||||
|
||||
i2s_priv = dev_get_drvdata(asoc_rtd_to_cpu(rtd, 0)->dev);
|
||||
i2s_priv = dev_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)->dev);
|
||||
|
||||
of_dma_configure(pcm->card->dev, pcm->card->dev->of_node, 1);
|
||||
|
||||
|
@ -197,9 +197,9 @@ static u64 cygnus_dma_dmamask = DMA_BIT_MASK(32);
|
||||
static struct cygnus_aio_port *cygnus_dai_get_dma_data(
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *soc_runtime = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *soc_runtime = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
return snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(soc_runtime, 0), substream);
|
||||
return snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(soc_runtime, 0), substream);
|
||||
}
|
||||
|
||||
static void ringbuf_set_initial(void __iomem *audio_io,
|
||||
@ -343,13 +343,13 @@ static void enable_intr(struct snd_pcm_substream *substream)
|
||||
|
||||
static void disable_intr(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct cygnus_aio_port *aio;
|
||||
u32 set_mask;
|
||||
|
||||
aio = cygnus_dai_get_dma_data(substream);
|
||||
|
||||
dev_dbg(asoc_rtd_to_cpu(rtd, 0)->dev, "%s on port %d\n", __func__, aio->portnum);
|
||||
dev_dbg(snd_soc_rtd_to_cpu(rtd, 0)->dev, "%s on port %d\n", __func__, aio->portnum);
|
||||
|
||||
/* The port number maps to the bit position to be set */
|
||||
set_mask = BIT(aio->portnum);
|
||||
@ -571,7 +571,7 @@ static irqreturn_t cygnus_dma_irq(int irq, void *data)
|
||||
static int cygnus_pcm_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct cygnus_aio_port *aio;
|
||||
int ret;
|
||||
@ -580,7 +580,7 @@ static int cygnus_pcm_open(struct snd_soc_component *component,
|
||||
if (!aio)
|
||||
return -ENODEV;
|
||||
|
||||
dev_dbg(asoc_rtd_to_cpu(rtd, 0)->dev, "%s port %d\n", __func__, aio->portnum);
|
||||
dev_dbg(snd_soc_rtd_to_cpu(rtd, 0)->dev, "%s port %d\n", __func__, aio->portnum);
|
||||
|
||||
snd_soc_set_runtime_hwparams(substream, &cygnus_pcm_hw);
|
||||
|
||||
@ -608,12 +608,12 @@ static int cygnus_pcm_open(struct snd_soc_component *component,
|
||||
static int cygnus_pcm_close(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct cygnus_aio_port *aio;
|
||||
|
||||
aio = cygnus_dai_get_dma_data(substream);
|
||||
|
||||
dev_dbg(asoc_rtd_to_cpu(rtd, 0)->dev, "%s port %d\n", __func__, aio->portnum);
|
||||
dev_dbg(snd_soc_rtd_to_cpu(rtd, 0)->dev, "%s port %d\n", __func__, aio->portnum);
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
aio->play_stream = NULL;
|
||||
@ -621,7 +621,7 @@ static int cygnus_pcm_close(struct snd_soc_component *component,
|
||||
aio->capture_stream = NULL;
|
||||
|
||||
if (!aio->play_stream && !aio->capture_stream)
|
||||
dev_dbg(asoc_rtd_to_cpu(rtd, 0)->dev, "freed port %d\n", aio->portnum);
|
||||
dev_dbg(snd_soc_rtd_to_cpu(rtd, 0)->dev, "freed port %d\n", aio->portnum);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -629,7 +629,7 @@ static int cygnus_pcm_close(struct snd_soc_component *component,
|
||||
static int cygnus_pcm_prepare(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct cygnus_aio_port *aio;
|
||||
unsigned long bufsize, periodsize;
|
||||
@ -638,12 +638,12 @@ static int cygnus_pcm_prepare(struct snd_soc_component *component,
|
||||
struct ringbuf_regs *p_rbuf = NULL;
|
||||
|
||||
aio = cygnus_dai_get_dma_data(substream);
|
||||
dev_dbg(asoc_rtd_to_cpu(rtd, 0)->dev, "%s port %d\n", __func__, aio->portnum);
|
||||
dev_dbg(snd_soc_rtd_to_cpu(rtd, 0)->dev, "%s port %d\n", __func__, aio->portnum);
|
||||
|
||||
bufsize = snd_pcm_lib_buffer_bytes(substream);
|
||||
periodsize = snd_pcm_lib_period_bytes(substream);
|
||||
|
||||
dev_dbg(asoc_rtd_to_cpu(rtd, 0)->dev, "%s (buf_size %lu) (period_size %lu)\n",
|
||||
dev_dbg(snd_soc_rtd_to_cpu(rtd, 0)->dev, "%s (buf_size %lu) (period_size %lu)\n",
|
||||
__func__, bufsize, periodsize);
|
||||
|
||||
configure_ringbuf_regs(substream);
|
||||
|
@ -22,9 +22,9 @@
|
||||
static int edb93xx_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
int err;
|
||||
unsigned int mclk_rate;
|
||||
unsigned int rate = params_rate(params);
|
||||
|
@ -1246,12 +1246,12 @@ static int cs47l15_open(struct snd_soc_component *component,
|
||||
struct madera *madera = priv->madera;
|
||||
int n_adsp;
|
||||
|
||||
if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l15-dsp-trace") == 0) {
|
||||
if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l15-dsp-trace") == 0) {
|
||||
n_adsp = 0;
|
||||
} else {
|
||||
dev_err(madera->dev,
|
||||
"No suitable compressed stream for DAI '%s'\n",
|
||||
asoc_rtd_to_codec(rtd, 0)->name);
|
||||
snd_soc_rtd_to_codec(rtd, 0)->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1080,14 +1080,14 @@ static int cs47l24_open(struct snd_soc_component *component,
|
||||
struct arizona *arizona = priv->core.arizona;
|
||||
int n_adsp;
|
||||
|
||||
if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l24-dsp-voicectrl") == 0) {
|
||||
if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l24-dsp-voicectrl") == 0) {
|
||||
n_adsp = 2;
|
||||
} else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l24-dsp-trace") == 0) {
|
||||
} else if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l24-dsp-trace") == 0) {
|
||||
n_adsp = 1;
|
||||
} else {
|
||||
dev_err(arizona->dev,
|
||||
"No suitable compressed stream for DAI '%s'\n",
|
||||
asoc_rtd_to_codec(rtd, 0)->name);
|
||||
snd_soc_rtd_to_codec(rtd, 0)->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1510,14 +1510,14 @@ static int cs47l35_open(struct snd_soc_component *component,
|
||||
struct madera *madera = priv->madera;
|
||||
int n_adsp;
|
||||
|
||||
if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l35-dsp-voicectrl") == 0) {
|
||||
if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l35-dsp-voicectrl") == 0) {
|
||||
n_adsp = 2;
|
||||
} else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l35-dsp-trace") == 0) {
|
||||
} else if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l35-dsp-trace") == 0) {
|
||||
n_adsp = 0;
|
||||
} else {
|
||||
dev_err(madera->dev,
|
||||
"No suitable compressed stream for DAI '%s'\n",
|
||||
asoc_rtd_to_codec(rtd, 0)->name);
|
||||
snd_soc_rtd_to_codec(rtd, 0)->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -2452,14 +2452,14 @@ static int cs47l85_open(struct snd_soc_component *component,
|
||||
struct madera *madera = priv->madera;
|
||||
int n_adsp;
|
||||
|
||||
if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l85-dsp-voicectrl") == 0) {
|
||||
if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l85-dsp-voicectrl") == 0) {
|
||||
n_adsp = 5;
|
||||
} else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l85-dsp-trace") == 0) {
|
||||
} else if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l85-dsp-trace") == 0) {
|
||||
n_adsp = 0;
|
||||
} else {
|
||||
dev_err(madera->dev,
|
||||
"No suitable compressed stream for DAI '%s'\n",
|
||||
asoc_rtd_to_codec(rtd, 0)->name);
|
||||
snd_soc_rtd_to_codec(rtd, 0)->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -2371,14 +2371,14 @@ static int cs47l90_open(struct snd_soc_component *component,
|
||||
struct madera *madera = priv->madera;
|
||||
int n_adsp;
|
||||
|
||||
if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l90-dsp-voicectrl") == 0) {
|
||||
if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l90-dsp-voicectrl") == 0) {
|
||||
n_adsp = 5;
|
||||
} else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l90-dsp-trace") == 0) {
|
||||
} else if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l90-dsp-trace") == 0) {
|
||||
n_adsp = 0;
|
||||
} else {
|
||||
dev_err(madera->dev,
|
||||
"No suitable compressed stream for DAI '%s'\n",
|
||||
asoc_rtd_to_codec(rtd, 0)->name);
|
||||
snd_soc_rtd_to_codec(rtd, 0)->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1850,12 +1850,12 @@ static int cs47l92_open(struct snd_soc_component *component,
|
||||
struct madera *madera = priv->madera;
|
||||
int n_adsp;
|
||||
|
||||
if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l92-dsp-trace") == 0) {
|
||||
if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "cs47l92-dsp-trace") == 0) {
|
||||
n_adsp = 0;
|
||||
} else {
|
||||
dev_err(madera->dev,
|
||||
"No suitable compressed stream for DAI '%s'\n",
|
||||
asoc_rtd_to_codec(rtd, 0)->name);
|
||||
snd_soc_rtd_to_codec(rtd, 0)->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ static int rt5677_spi_pcm_close(
|
||||
struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_component *codec_component =
|
||||
snd_soc_rtdcom_lookup(rtd, "rt5677");
|
||||
struct rt5677_priv *rt5677 =
|
||||
@ -158,7 +158,7 @@ static int rt5677_spi_prepare(
|
||||
struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_component *rt5677_component =
|
||||
snd_soc_rtdcom_lookup(rtd, "rt5677");
|
||||
struct rt5677_priv *rt5677 =
|
||||
|
@ -2253,14 +2253,14 @@ static int wm5110_open(struct snd_soc_component *component,
|
||||
struct arizona *arizona = priv->core.arizona;
|
||||
int n_adsp;
|
||||
|
||||
if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "wm5110-dsp-voicectrl") == 0) {
|
||||
if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "wm5110-dsp-voicectrl") == 0) {
|
||||
n_adsp = 2;
|
||||
} else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "wm5110-dsp-trace") == 0) {
|
||||
} else if (strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, "wm5110-dsp-trace") == 0) {
|
||||
n_adsp = 0;
|
||||
} else {
|
||||
dev_err(arizona->dev,
|
||||
"No suitable compressed stream for DAI '%s'\n",
|
||||
asoc_rtd_to_codec(rtd, 0)->name);
|
||||
snd_soc_rtd_to_codec(rtd, 0)->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1236,22 +1236,22 @@ int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream)
|
||||
|
||||
if (wm_adsp_fw[dsp->fw].num_caps == 0) {
|
||||
adsp_err(dsp, "%s: Firmware does not support compressed API\n",
|
||||
asoc_rtd_to_codec(rtd, 0)->name);
|
||||
snd_soc_rtd_to_codec(rtd, 0)->name);
|
||||
ret = -ENXIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (wm_adsp_fw[dsp->fw].compr_direction != stream->direction) {
|
||||
adsp_err(dsp, "%s: Firmware does not support stream direction\n",
|
||||
asoc_rtd_to_codec(rtd, 0)->name);
|
||||
snd_soc_rtd_to_codec(rtd, 0)->name);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
list_for_each_entry(tmp, &dsp->compr_list, list) {
|
||||
if (!strcmp(tmp->name, asoc_rtd_to_codec(rtd, 0)->name)) {
|
||||
if (!strcmp(tmp->name, snd_soc_rtd_to_codec(rtd, 0)->name)) {
|
||||
adsp_err(dsp, "%s: Only a single stream supported per dai\n",
|
||||
asoc_rtd_to_codec(rtd, 0)->name);
|
||||
snd_soc_rtd_to_codec(rtd, 0)->name);
|
||||
ret = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
@ -1265,7 +1265,7 @@ int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream)
|
||||
|
||||
compr->dsp = dsp;
|
||||
compr->stream = stream;
|
||||
compr->name = asoc_rtd_to_codec(rtd, 0)->name;
|
||||
compr->name = snd_soc_rtd_to_codec(rtd, 0)->name;
|
||||
|
||||
list_add_tail(&compr->list, &dsp->compr_list);
|
||||
|
||||
|
@ -235,7 +235,7 @@ static int dw_i2s_startup(struct snd_pcm_substream *substream,
|
||||
struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(cpu_dai);
|
||||
|
||||
if (dev->is_jh7110) {
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai_link *dai_link = rtd->dai_link;
|
||||
|
||||
dai_link->trigger_stop = SND_SOC_TRIGGER_ORDER_LDC;
|
||||
|
@ -139,8 +139,8 @@ static int dw_pcm_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
|
||||
snd_soc_set_runtime_hwparams(substream, &dw_pcm_hardware);
|
||||
snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
|
||||
|
@ -30,9 +30,9 @@
|
||||
static int eukrea_tlv320_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
int ret;
|
||||
|
||||
ret = snd_soc_dai_set_sysclk(codec_dai, 0,
|
||||
|
@ -94,8 +94,8 @@ struct cpu_priv {
|
||||
|
||||
struct fsl_asoc_card_priv {
|
||||
struct snd_soc_dai_link dai_link[3];
|
||||
struct asoc_simple_jack hp_jack;
|
||||
struct asoc_simple_jack mic_jack;
|
||||
struct simple_util_jack hp_jack;
|
||||
struct simple_util_jack mic_jack;
|
||||
struct platform_device *pdev;
|
||||
struct codec_priv codec_priv;
|
||||
struct cpu_priv cpu_priv;
|
||||
@ -167,7 +167,7 @@ static bool fsl_asoc_card_is_ac97(struct fsl_asoc_card_priv *priv)
|
||||
static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
||||
struct codec_priv *codec_priv = &priv->codec_priv;
|
||||
@ -184,7 +184,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream,
|
||||
return 0;
|
||||
|
||||
/* Specific configurations of DAIs starts from here */
|
||||
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0), cpu_priv->sysclk_id[tx],
|
||||
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_cpu(rtd, 0), cpu_priv->sysclk_id[tx],
|
||||
cpu_priv->sysclk_freq[tx],
|
||||
cpu_priv->sysclk_dir[tx]);
|
||||
if (ret && ret != -ENOTSUPP) {
|
||||
@ -196,7 +196,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream,
|
||||
if (!cpu_priv->slot_num)
|
||||
cpu_priv->slot_num = 2;
|
||||
|
||||
ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_cpu(rtd, 0), 0x3, 0x3,
|
||||
ret = snd_soc_dai_set_tdm_slot(snd_soc_rtd_to_cpu(rtd, 0), 0x3, 0x3,
|
||||
cpu_priv->slot_num,
|
||||
cpu_priv->slot_width);
|
||||
if (ret && ret != -ENOTSUPP) {
|
||||
@ -212,7 +212,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream,
|
||||
else
|
||||
pll_out = priv->sample_rate * 256;
|
||||
|
||||
ret = snd_soc_dai_set_pll(asoc_rtd_to_codec(rtd, 0),
|
||||
ret = snd_soc_dai_set_pll(snd_soc_rtd_to_codec(rtd, 0),
|
||||
codec_priv->pll_id,
|
||||
codec_priv->mclk_id,
|
||||
codec_priv->mclk_freq, pll_out);
|
||||
@ -221,7 +221,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0),
|
||||
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_codec(rtd, 0),
|
||||
codec_priv->fll_id,
|
||||
pll_out, SND_SOC_CLOCK_IN);
|
||||
|
||||
@ -250,7 +250,7 @@ static int fsl_asoc_card_hw_free(struct snd_pcm_substream *substream)
|
||||
|
||||
if (!priv->streams && codec_priv->pll_id && codec_priv->fll_id) {
|
||||
/* Force freq to be free_freq to avoid error message in codec */
|
||||
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0),
|
||||
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_codec(rtd, 0),
|
||||
codec_priv->mclk_id,
|
||||
codec_priv->free_freq,
|
||||
SND_SOC_CLOCK_IN);
|
||||
@ -259,7 +259,7 @@ static int fsl_asoc_card_hw_free(struct snd_pcm_substream *substream)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = snd_soc_dai_set_pll(asoc_rtd_to_codec(rtd, 0),
|
||||
ret = snd_soc_dai_set_pll(snd_soc_rtd_to_codec(rtd, 0),
|
||||
codec_priv->pll_id, 0, 0, 0);
|
||||
if (ret && ret != -ENOTSUPP) {
|
||||
dev_err(dev, "failed to stop FLL: %d\n", ret);
|
||||
@ -503,14 +503,14 @@ static int fsl_asoc_card_late_probe(struct snd_soc_card *card)
|
||||
struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(card);
|
||||
struct snd_soc_pcm_runtime *rtd = list_first_entry(
|
||||
&card->rtd_list, struct snd_soc_pcm_runtime, list);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct codec_priv *codec_priv = &priv->codec_priv;
|
||||
struct device *dev = card->dev;
|
||||
int ret;
|
||||
|
||||
if (fsl_asoc_card_is_ac97(priv)) {
|
||||
#if IS_ENABLED(CONFIG_SND_AC97_CODEC)
|
||||
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct snd_ac97 *ac97 = snd_soc_component_get_drvdata(component);
|
||||
|
||||
/*
|
||||
@ -883,14 +883,14 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
|
||||
|
||||
/*
|
||||
* Properties "hp-det-gpio" and "mic-det-gpio" are optional, and
|
||||
* asoc_simple_init_jack uses these properties for creating
|
||||
* simple_util_init_jack() uses these properties for creating
|
||||
* Headphone Jack and Microphone Jack.
|
||||
*
|
||||
* The notifier is initialized in snd_soc_card_jack_new(), then
|
||||
* snd_soc_jack_notifier_register can be called.
|
||||
*/
|
||||
if (of_property_read_bool(np, "hp-det-gpio")) {
|
||||
ret = asoc_simple_init_jack(&priv->card, &priv->hp_jack,
|
||||
ret = simple_util_init_jack(&priv->card, &priv->hp_jack,
|
||||
1, NULL, "Headphone Jack");
|
||||
if (ret)
|
||||
goto asrc_fail;
|
||||
@ -899,7 +899,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
if (of_property_read_bool(np, "mic-det-gpio")) {
|
||||
ret = asoc_simple_init_jack(&priv->card, &priv->mic_jack,
|
||||
ret = simple_util_init_jack(&priv->card, &priv->mic_jack,
|
||||
0, NULL, "Mic Jack");
|
||||
if (ret)
|
||||
goto asrc_fail;
|
||||
|
@ -130,7 +130,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,
|
||||
{
|
||||
enum dma_slave_buswidth buswidth = DMA_SLAVE_BUSWIDTH_2_BYTES;
|
||||
enum sdma_peripheral_type be_peripheral_type = IMX_DMATYPE_SSI;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
||||
struct snd_dmaengine_dai_dma_data *dma_params_fe = NULL;
|
||||
struct snd_dmaengine_dai_dma_data *dma_params_be = NULL;
|
||||
@ -156,7 +156,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,
|
||||
for_each_dpcm_be(rtd, stream, dpcm) {
|
||||
struct snd_soc_pcm_runtime *be = dpcm->be;
|
||||
struct snd_pcm_substream *substream_be;
|
||||
struct snd_soc_dai *dai = asoc_rtd_to_cpu(be, 0);
|
||||
struct snd_soc_dai *dai = snd_soc_rtd_to_cpu(be, 0);
|
||||
|
||||
if (dpcm->fe != rtd)
|
||||
continue;
|
||||
@ -173,7 +173,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,
|
||||
}
|
||||
|
||||
/* Override dma_data of the Front-End and config its dmaengine */
|
||||
dma_params_fe = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
dma_params_fe = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
dma_params_fe->addr = asrc->paddr + asrc->get_fifo_addr(!dir, index);
|
||||
dma_params_fe->maxburst = dma_params_be->maxburst;
|
||||
|
||||
@ -330,7 +330,7 @@ static int fsl_asrc_dma_startup(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_dmaengine_dai_dma_data *dma_data;
|
||||
struct device *dev = component->dev;
|
||||
@ -375,7 +375,7 @@ static int fsl_asrc_dma_startup(struct snd_soc_component *component,
|
||||
goto dma_chan_err;
|
||||
}
|
||||
|
||||
dma_data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
dma_data = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
|
||||
/* Refine the snd_imx_hardware according to caps of DMA. */
|
||||
ret = snd_dmaengine_pcm_refine_runtime_hwparams(substream,
|
||||
|
@ -200,7 +200,7 @@ static irqreturn_t fsl_dma_isr(int irq, void *dev_id)
|
||||
{
|
||||
struct fsl_dma_private *dma_private = dev_id;
|
||||
struct snd_pcm_substream *substream = dma_private->substream;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct device *dev = rtd->dev;
|
||||
struct ccsr_dma_channel __iomem *dma_channel = dma_private->dma_channel;
|
||||
irqreturn_t ret = IRQ_NONE;
|
||||
|
@ -502,8 +502,8 @@ static int fsl_spdif_probe_txclk(struct fsl_spdif_priv *spdif_priv, enum spdif_t
|
||||
static int spdif_set_sample_rate(struct snd_pcm_substream *substream,
|
||||
int sample_rate)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
struct spdif_mixer_control *ctrl = &spdif_priv->fsl_spdif_control;
|
||||
struct regmap *regmap = spdif_priv->regmap;
|
||||
struct platform_device *pdev = spdif_priv->pdev;
|
||||
@ -605,8 +605,8 @@ clk_set_bypass:
|
||||
static int fsl_spdif_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *cpu_dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
struct platform_device *pdev = spdif_priv->pdev;
|
||||
struct regmap *regmap = spdif_priv->regmap;
|
||||
u32 scr, mask;
|
||||
@ -647,8 +647,8 @@ static int fsl_spdif_startup(struct snd_pcm_substream *substream,
|
||||
static void fsl_spdif_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *cpu_dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
struct regmap *regmap = spdif_priv->regmap;
|
||||
u32 scr, mask;
|
||||
|
||||
@ -701,8 +701,8 @@ static int fsl_spdif_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
struct spdif_mixer_control *ctrl = &spdif_priv->fsl_spdif_control;
|
||||
struct platform_device *pdev = spdif_priv->pdev;
|
||||
u32 sample_rate = params_rate(params);
|
||||
@ -736,8 +736,8 @@ static int fsl_spdif_hw_params(struct snd_pcm_substream *substream,
|
||||
static int fsl_spdif_trigger(struct snd_pcm_substream *substream,
|
||||
int cmd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
struct regmap *regmap = spdif_priv->regmap;
|
||||
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
||||
u32 intr = SIE_INTR_FOR(tx);
|
||||
|
@ -634,8 +634,8 @@ static void fsl_ssi_setup_ac97(struct fsl_ssi *ssi)
|
||||
static int fsl_ssi_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
int ret;
|
||||
|
||||
ret = clk_prepare_enable(ssi->clk);
|
||||
@ -658,8 +658,8 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
|
||||
static void fsl_ssi_shutdown(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
|
||||
clk_disable_unprepare(ssi->clk);
|
||||
}
|
||||
@ -890,8 +890,8 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream,
|
||||
static int fsl_ssi_hw_free(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
|
||||
if (fsl_ssi_is_i2s_clock_provider(ssi) &&
|
||||
ssi->baudclk_streams & BIT(substream->stream)) {
|
||||
@ -1107,8 +1107,8 @@ static int fsl_ssi_set_dai_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask,
|
||||
static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
||||
|
||||
switch (cmd) {
|
||||
|
@ -43,7 +43,7 @@ static const struct snd_pcm_hw_constraint_list imx_audmix_rate_constraints = {
|
||||
|
||||
static int imx_audmix_fe_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct imx_audmix *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct device *dev = rtd->card->dev;
|
||||
@ -72,7 +72,7 @@ static int imx_audmix_fe_startup(struct snd_pcm_substream *substream)
|
||||
static int imx_audmix_fe_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct device *dev = rtd->card->dev;
|
||||
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
||||
unsigned int fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF;
|
||||
@ -84,13 +84,13 @@ static int imx_audmix_fe_hw_params(struct snd_pcm_substream *substream,
|
||||
dir = tx ? SND_SOC_CLOCK_OUT : SND_SOC_CLOCK_IN;
|
||||
|
||||
/* set DAI configuration */
|
||||
ret = snd_soc_dai_set_fmt(asoc_rtd_to_cpu(rtd, 0), fmt);
|
||||
ret = snd_soc_dai_set_fmt(snd_soc_rtd_to_cpu(rtd, 0), fmt);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to set cpu dai fmt: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0), FSL_SAI_CLK_MAST1, 0, dir);
|
||||
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_cpu(rtd, 0), FSL_SAI_CLK_MAST1, 0, dir);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to set cpu sysclk: %d\n", ret);
|
||||
return ret;
|
||||
@ -100,7 +100,7 @@ static int imx_audmix_fe_hw_params(struct snd_pcm_substream *substream,
|
||||
* Per datasheet, AUDMIX expects 8 slots and 32 bits
|
||||
* for every slot in TDM mode.
|
||||
*/
|
||||
ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_cpu(rtd, 0), BIT(channels) - 1,
|
||||
ret = snd_soc_dai_set_tdm_slot(snd_soc_rtd_to_cpu(rtd, 0), BIT(channels) - 1,
|
||||
BIT(channels) - 1, 8, 32);
|
||||
if (ret)
|
||||
dev_err(dev, "failed to set cpu dai tdm slot: %d\n", ret);
|
||||
@ -111,7 +111,7 @@ static int imx_audmix_fe_hw_params(struct snd_pcm_substream *substream,
|
||||
static int imx_audmix_be_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct device *dev = rtd->card->dev;
|
||||
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
||||
unsigned int fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF;
|
||||
@ -124,7 +124,7 @@ static int imx_audmix_be_hw_params(struct snd_pcm_substream *substream,
|
||||
fmt |= SND_SOC_DAIFMT_BC_FC;
|
||||
|
||||
/* set AUDMIX DAI configuration */
|
||||
ret = snd_soc_dai_set_fmt(asoc_rtd_to_cpu(rtd, 0), fmt);
|
||||
ret = snd_soc_dai_set_fmt(snd_soc_rtd_to_cpu(rtd, 0), fmt);
|
||||
if (ret)
|
||||
dev_err(dev, "failed to set AUDMIX DAI fmt: %d\n", ret);
|
||||
|
||||
@ -247,7 +247,7 @@ static int imx_audmix_probe(struct platform_device *pdev)
|
||||
*/
|
||||
priv->dai[i].cpus =
|
||||
priv->dai[i].platforms = &dlc[0];
|
||||
priv->dai[i].codecs = &asoc_dummy_dlc;
|
||||
priv->dai[i].codecs = &snd_soc_dummy_dlc;
|
||||
|
||||
priv->dai[i].num_cpus = 1;
|
||||
priv->dai[i].num_codecs = 1;
|
||||
@ -274,7 +274,7 @@ static int imx_audmix_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
priv->dai[num_dai + i].cpus = &dlc[1];
|
||||
priv->dai[num_dai + i].codecs = &asoc_dummy_dlc;
|
||||
priv->dai[num_dai + i].codecs = &snd_soc_dummy_dlc;
|
||||
|
||||
priv->dai[num_dai + i].num_cpus = 1;
|
||||
priv->dai[num_dai + i].num_codecs = 1;
|
||||
|
@ -291,7 +291,7 @@ static int imx_aif_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct imx_card_data *data = snd_soc_card_get_drvdata(card);
|
||||
struct dai_link_data *link_data = &data->link_data[rtd->num];
|
||||
@ -607,7 +607,7 @@ static int imx_card_parse_of(struct imx_card_data *data)
|
||||
plat_data->type = CODEC_AK5552;
|
||||
|
||||
} else {
|
||||
link->codecs = &asoc_dummy_dlc;
|
||||
link->codecs = &snd_soc_dummy_dlc;
|
||||
link->num_codecs = 1;
|
||||
}
|
||||
|
||||
@ -655,7 +655,7 @@ static int imx_card_parse_of(struct imx_card_data *data)
|
||||
snd_soc_dai_link_set_capabilities(link);
|
||||
|
||||
/* Get dai fmt */
|
||||
ret = asoc_simple_parse_daifmt(dev, np, codec,
|
||||
ret = simple_util_parse_daifmt(dev, np, codec,
|
||||
NULL, &link->dai_fmt);
|
||||
if (ret)
|
||||
link->dai_fmt = SND_SOC_DAIFMT_NB_NF |
|
||||
|
@ -35,7 +35,7 @@ static int imx_hdmi_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct imx_hdmi_data *data = snd_soc_card_get_drvdata(rtd->card);
|
||||
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct device *dev = card->dev;
|
||||
u32 slot_width = data->cpu_priv.slot_width;
|
||||
@ -70,7 +70,7 @@ static const struct snd_soc_dapm_widget imx_hdmi_widgets[] = {
|
||||
static int imx_hdmi_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
struct imx_hdmi_data *data = snd_soc_card_get_drvdata(card);
|
||||
int ret;
|
||||
|
@ -229,8 +229,8 @@ static int imx_rpmsg_pcm_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct rpmsg_info *info = dev_get_drvdata(component->dev);
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct fsl_rpmsg *rpmsg = dev_get_drvdata(cpu_dai->dev);
|
||||
struct snd_pcm_hardware pcm_hardware;
|
||||
struct rpmsg_msg *msg;
|
||||
@ -284,7 +284,7 @@ static int imx_rpmsg_pcm_open(struct snd_soc_component *component,
|
||||
static int imx_rpmsg_pcm_close(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct rpmsg_info *info = dev_get_drvdata(component->dev);
|
||||
struct rpmsg_msg *msg;
|
||||
|
||||
@ -317,7 +317,7 @@ static int imx_rpmsg_pcm_prepare(struct snd_soc_component *component,
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct fsl_rpmsg *rpmsg = dev_get_drvdata(cpu_dai->dev);
|
||||
|
||||
/*
|
||||
@ -462,7 +462,7 @@ static int imx_rpmsg_pcm_trigger(struct snd_soc_component *component,
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct fsl_rpmsg *rpmsg = dev_get_drvdata(cpu_dai->dev);
|
||||
int ret = 0;
|
||||
|
||||
@ -516,7 +516,7 @@ static int imx_rpmsg_pcm_ack(struct snd_soc_component *component,
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct fsl_rpmsg *rpmsg = dev_get_drvdata(cpu_dai->dev);
|
||||
struct rpmsg_info *info = dev_get_drvdata(component->dev);
|
||||
snd_pcm_uframes_t period_size = runtime->period_size;
|
||||
@ -595,7 +595,7 @@ static int imx_rpmsg_pcm_new(struct snd_soc_component *component,
|
||||
{
|
||||
struct snd_card *card = rtd->card->snd_card;
|
||||
struct snd_pcm *pcm = rtd->pcm;
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct fsl_rpmsg *rpmsg = dev_get_drvdata(cpu_dai->dev);
|
||||
int ret;
|
||||
|
||||
|
@ -34,7 +34,7 @@ static int imx_rpmsg_late_probe(struct snd_soc_card *card)
|
||||
struct imx_rpmsg *data = snd_soc_card_get_drvdata(card);
|
||||
struct snd_soc_pcm_runtime *rtd = list_first_entry(&card->rtd_list,
|
||||
struct snd_soc_pcm_runtime, list);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct device *dev = card->dev;
|
||||
int ret;
|
||||
|
||||
@ -92,7 +92,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
|
||||
/* Optional codec node */
|
||||
ret = of_parse_phandle_with_fixed_args(np, "audio-codec", 0, 0, &args);
|
||||
if (ret) {
|
||||
*data->dai.codecs = asoc_dummy_dlc;
|
||||
*data->dai.codecs = snd_soc_dummy_dlc;
|
||||
} else {
|
||||
struct clk *clk;
|
||||
|
||||
|
@ -30,7 +30,7 @@ static int imx_sgtl5000_dai_init(struct snd_soc_pcm_runtime *rtd)
|
||||
struct device *dev = rtd->card->dev;
|
||||
int ret;
|
||||
|
||||
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0), SGTL5000_SYSCLK,
|
||||
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_codec(rtd, 0), SGTL5000_SYSCLK,
|
||||
data->clk_frequency, SND_SOC_CLOCK_IN);
|
||||
if (ret) {
|
||||
dev_err(dev, "could not set codec driver clock params\n");
|
||||
|
@ -38,7 +38,7 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
|
||||
*/
|
||||
data->dai.cpus =
|
||||
data->dai.platforms = comp;
|
||||
data->dai.codecs = &asoc_dummy_dlc;
|
||||
data->dai.codecs = &snd_soc_dummy_dlc;
|
||||
|
||||
data->dai.num_cpus = 1;
|
||||
data->dai.num_codecs = 1;
|
||||
|
@ -107,8 +107,8 @@ static irqreturn_t psc_dma_bcom_irq(int irq, void *_psc_dma_stream)
|
||||
static int psc_dma_trigger(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream, int cmd)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct psc_dma_stream *s = to_psc_dma_stream(substream, psc_dma);
|
||||
struct mpc52xx_psc __iomem *regs = psc_dma->psc_regs;
|
||||
@ -209,8 +209,8 @@ static int psc_dma_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
struct psc_dma_stream *s;
|
||||
int rc;
|
||||
|
||||
@ -237,8 +237,8 @@ static int psc_dma_open(struct snd_soc_component *component,
|
||||
static int psc_dma_close(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
struct psc_dma_stream *s;
|
||||
|
||||
dev_dbg(psc_dma->dev, "psc_dma_close(substream=%p)\n", substream);
|
||||
@ -263,8 +263,8 @@ static snd_pcm_uframes_t
|
||||
psc_dma_pointer(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
struct psc_dma_stream *s;
|
||||
dma_addr_t count;
|
||||
|
||||
@ -282,7 +282,7 @@ static int psc_dma_new(struct snd_soc_component *component,
|
||||
struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_card *card = rtd->card->snd_card;
|
||||
struct snd_soc_dai *dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_pcm *pcm = rtd->pcm;
|
||||
size_t size = psc_dma_hardware.buffer_bytes_max;
|
||||
int rc;
|
||||
|
@ -38,8 +38,8 @@ static int psc_i2s_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
u32 mode;
|
||||
|
||||
dev_dbg(psc_dma->dev, "%s(substream=%p) p_size=%i p_bytes=%i"
|
||||
|
@ -98,14 +98,14 @@ static int mpc8610_hpcd_machine_probe(struct snd_soc_card *card)
|
||||
*/
|
||||
static int mpc8610_hpcd_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct mpc8610_hpcd_data *machine_data =
|
||||
container_of(rtd->card, struct mpc8610_hpcd_data, card);
|
||||
struct device *dev = rtd->card->dev;
|
||||
int ret = 0;
|
||||
|
||||
/* Tell the codec driver what the serial protocol is. */
|
||||
ret = snd_soc_dai_set_fmt(asoc_rtd_to_codec(rtd, 0), machine_data->dai_format);
|
||||
ret = snd_soc_dai_set_fmt(snd_soc_rtd_to_codec(rtd, 0), machine_data->dai_format);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "could not set codec driver audio format\n");
|
||||
return ret;
|
||||
@ -115,7 +115,7 @@ static int mpc8610_hpcd_startup(struct snd_pcm_substream *substream)
|
||||
* Tell the codec driver what the MCLK frequency is, and whether it's
|
||||
* a slave or master.
|
||||
*/
|
||||
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0), 0,
|
||||
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_codec(rtd, 0), 0,
|
||||
machine_data->clk_frequency,
|
||||
machine_data->codec_clk_direction);
|
||||
if (ret < 0) {
|
||||
|
@ -121,14 +121,14 @@ static int p1022_ds_machine_probe(struct snd_soc_card *card)
|
||||
*/
|
||||
static int p1022_ds_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct machine_data *mdata =
|
||||
container_of(rtd->card, struct machine_data, card);
|
||||
struct device *dev = rtd->card->dev;
|
||||
int ret = 0;
|
||||
|
||||
/* Tell the codec driver what the serial protocol is. */
|
||||
ret = snd_soc_dai_set_fmt(asoc_rtd_to_codec(rtd, 0), mdata->dai_format);
|
||||
ret = snd_soc_dai_set_fmt(snd_soc_rtd_to_codec(rtd, 0), mdata->dai_format);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "could not set codec driver audio format\n");
|
||||
return ret;
|
||||
@ -138,7 +138,7 @@ static int p1022_ds_startup(struct snd_pcm_substream *substream)
|
||||
* Tell the codec driver what the MCLK frequency is, and whether it's
|
||||
* a slave or master.
|
||||
*/
|
||||
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0), 0, mdata->clk_frequency,
|
||||
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_codec(rtd, 0), 0, mdata->clk_frequency,
|
||||
mdata->codec_clk_direction);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "could not set codec driver clock params\n");
|
||||
|
@ -127,21 +127,21 @@ static int p1022_rdk_machine_probe(struct snd_soc_card *card)
|
||||
*/
|
||||
static int p1022_rdk_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct machine_data *mdata =
|
||||
container_of(rtd->card, struct machine_data, card);
|
||||
struct device *dev = rtd->card->dev;
|
||||
int ret = 0;
|
||||
|
||||
/* Tell the codec driver what the serial protocol is. */
|
||||
ret = snd_soc_dai_set_fmt(asoc_rtd_to_codec(rtd, 0), mdata->dai_format);
|
||||
ret = snd_soc_dai_set_fmt(snd_soc_rtd_to_codec(rtd, 0), mdata->dai_format);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "could not set codec driver audio format (ret=%i)\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = snd_soc_dai_set_pll(asoc_rtd_to_codec(rtd, 0), 0, 0, mdata->clk_frequency,
|
||||
ret = snd_soc_dai_set_pll(snd_soc_rtd_to_codec(rtd, 0), 0, 0, mdata->clk_frequency,
|
||||
mdata->clk_frequency);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "could not set codec PLL frequency (ret=%i)\n",
|
||||
|
@ -27,7 +27,7 @@ static int graph_outdrv_event(struct snd_soc_dapm_widget *w,
|
||||
int event)
|
||||
{
|
||||
struct snd_soc_dapm_context *dapm = w->dapm;
|
||||
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(dapm->card);
|
||||
struct simple_util_priv *priv = snd_soc_card_get_drvdata(dapm->card);
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_POST_PMU:
|
||||
@ -50,9 +50,9 @@ static const struct snd_soc_dapm_widget graph_dapm_widgets[] = {
|
||||
};
|
||||
|
||||
static const struct snd_soc_ops graph_ops = {
|
||||
.startup = asoc_simple_startup,
|
||||
.shutdown = asoc_simple_shutdown,
|
||||
.hw_params = asoc_simple_hw_params,
|
||||
.startup = simple_util_startup,
|
||||
.shutdown = simple_util_shutdown,
|
||||
.hw_params = simple_util_hw_params,
|
||||
};
|
||||
|
||||
static bool soc_component_is_pcm(struct snd_soc_dai_link_component *dlc)
|
||||
@ -68,18 +68,18 @@ static bool soc_component_is_pcm(struct snd_soc_dai_link_component *dlc)
|
||||
|
||||
static void graph_parse_convert(struct device *dev,
|
||||
struct device_node *ep,
|
||||
struct asoc_simple_data *adata)
|
||||
struct simple_util_data *adata)
|
||||
{
|
||||
struct device_node *top = dev->of_node;
|
||||
struct device_node *port = of_get_parent(ep);
|
||||
struct device_node *ports = of_get_parent(port);
|
||||
struct device_node *node = of_graph_get_port_parent(ep);
|
||||
|
||||
asoc_simple_parse_convert(top, NULL, adata);
|
||||
simple_util_parse_convert(top, NULL, adata);
|
||||
if (of_node_name_eq(ports, "ports"))
|
||||
asoc_simple_parse_convert(ports, NULL, adata);
|
||||
asoc_simple_parse_convert(port, NULL, adata);
|
||||
asoc_simple_parse_convert(ep, NULL, adata);
|
||||
simple_util_parse_convert(ports, NULL, adata);
|
||||
simple_util_parse_convert(port, NULL, adata);
|
||||
simple_util_parse_convert(ep, NULL, adata);
|
||||
|
||||
of_node_put(port);
|
||||
of_node_put(ports);
|
||||
@ -103,7 +103,7 @@ static void graph_parse_mclk_fs(struct device_node *top,
|
||||
of_node_put(ports);
|
||||
}
|
||||
|
||||
static int graph_parse_node(struct asoc_simple_priv *priv,
|
||||
static int graph_parse_node(struct simple_util_priv *priv,
|
||||
struct device_node *ep,
|
||||
struct link_info *li,
|
||||
int *cpu)
|
||||
@ -113,35 +113,35 @@ static int graph_parse_node(struct asoc_simple_priv *priv,
|
||||
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
|
||||
struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
|
||||
struct snd_soc_dai_link_component *dlc;
|
||||
struct asoc_simple_dai *dai;
|
||||
struct simple_util_dai *dai;
|
||||
int ret;
|
||||
|
||||
if (cpu) {
|
||||
dlc = asoc_link_to_cpu(dai_link, 0);
|
||||
dlc = snd_soc_link_to_cpu(dai_link, 0);
|
||||
dai = simple_props_to_dai_cpu(dai_props, 0);
|
||||
} else {
|
||||
dlc = asoc_link_to_codec(dai_link, 0);
|
||||
dlc = snd_soc_link_to_codec(dai_link, 0);
|
||||
dai = simple_props_to_dai_codec(dai_props, 0);
|
||||
}
|
||||
|
||||
graph_parse_mclk_fs(top, ep, dai_props);
|
||||
|
||||
ret = asoc_graph_parse_dai(dev, ep, dlc, cpu);
|
||||
ret = graph_util_parse_dai(dev, ep, dlc, cpu);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_parse_tdm(ep, dai);
|
||||
ret = simple_util_parse_tdm(ep, dai);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_parse_clk(dev, ep, dai, dlc);
|
||||
ret = simple_util_parse_clk(dev, ep, dai, dlc);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int graph_link_init(struct asoc_simple_priv *priv,
|
||||
static int graph_link_init(struct simple_util_priv *priv,
|
||||
struct device_node *cpu_ep,
|
||||
struct device_node *codec_ep,
|
||||
struct link_info *li,
|
||||
@ -151,20 +151,20 @@ static int graph_link_init(struct asoc_simple_priv *priv,
|
||||
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
|
||||
int ret;
|
||||
|
||||
ret = asoc_simple_parse_daifmt(dev, cpu_ep, codec_ep,
|
||||
ret = simple_util_parse_daifmt(dev, cpu_ep, codec_ep,
|
||||
NULL, &dai_link->dai_fmt);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
dai_link->init = asoc_simple_dai_init;
|
||||
dai_link->init = simple_util_dai_init;
|
||||
dai_link->ops = &graph_ops;
|
||||
if (priv->ops)
|
||||
dai_link->ops = priv->ops;
|
||||
|
||||
return asoc_simple_set_dailink_name(dev, dai_link, name);
|
||||
return simple_util_set_dailink_name(dev, dai_link, name);
|
||||
}
|
||||
|
||||
static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
|
||||
static int graph_dai_link_of_dpcm(struct simple_util_priv *priv,
|
||||
struct device_node *cpu_ep,
|
||||
struct device_node *codec_ep,
|
||||
struct link_info *li)
|
||||
@ -181,8 +181,8 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
|
||||
|
||||
if (li->cpu) {
|
||||
struct snd_soc_card *card = simple_priv_to_card(priv);
|
||||
struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *cpus = snd_soc_link_to_cpu(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *platforms = snd_soc_link_to_platform(dai_link, 0);
|
||||
int is_single_links = 0;
|
||||
|
||||
/* Codec is dummy */
|
||||
@ -209,14 +209,14 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
|
||||
*/
|
||||
if (card->component_chaining && !soc_component_is_pcm(cpus)) {
|
||||
dai_link->no_pcm = 1;
|
||||
dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup;
|
||||
dai_link->be_hw_params_fixup = simple_util_be_hw_params_fixup;
|
||||
}
|
||||
|
||||
asoc_simple_canonicalize_cpu(cpus, is_single_links);
|
||||
asoc_simple_canonicalize_platform(platforms, cpus);
|
||||
simple_util_canonicalize_cpu(cpus, is_single_links);
|
||||
simple_util_canonicalize_platform(platforms, cpus);
|
||||
} else {
|
||||
struct snd_soc_codec_conf *cconf = simple_props_to_codec_conf(dai_props, 0);
|
||||
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, 0);
|
||||
struct device_node *port;
|
||||
struct device_node *ports;
|
||||
|
||||
@ -224,7 +224,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
|
||||
|
||||
/* BE settings */
|
||||
dai_link->no_pcm = 1;
|
||||
dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup;
|
||||
dai_link->be_hw_params_fixup = simple_util_be_hw_params_fixup;
|
||||
|
||||
ret = graph_parse_node(priv, codec_ep, li, NULL);
|
||||
if (ret < 0)
|
||||
@ -258,16 +258,16 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int graph_dai_link_of(struct asoc_simple_priv *priv,
|
||||
static int graph_dai_link_of(struct simple_util_priv *priv,
|
||||
struct device_node *cpu_ep,
|
||||
struct device_node *codec_ep,
|
||||
struct link_info *li)
|
||||
{
|
||||
struct device *dev = simple_priv_to_dev(priv);
|
||||
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
|
||||
struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *cpus = snd_soc_link_to_cpu(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *platforms = snd_soc_link_to_platform(dai_link, 0);
|
||||
char dai_name[64];
|
||||
int ret, is_single_links = 0;
|
||||
|
||||
@ -284,8 +284,8 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
|
||||
snprintf(dai_name, sizeof(dai_name),
|
||||
"%s-%s", cpus->dai_name, codecs->dai_name);
|
||||
|
||||
asoc_simple_canonicalize_cpu(cpus, is_single_links);
|
||||
asoc_simple_canonicalize_platform(platforms, cpus);
|
||||
simple_util_canonicalize_cpu(cpus, is_single_links);
|
||||
simple_util_canonicalize_platform(platforms, cpus);
|
||||
|
||||
ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name);
|
||||
if (ret < 0)
|
||||
@ -296,9 +296,9 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool parse_as_dpcm_link(struct asoc_simple_priv *priv,
|
||||
static inline bool parse_as_dpcm_link(struct simple_util_priv *priv,
|
||||
struct device_node *codec_port,
|
||||
struct asoc_simple_data *adata)
|
||||
struct simple_util_data *adata)
|
||||
{
|
||||
if (priv->force_dpcm)
|
||||
return true;
|
||||
@ -312,19 +312,19 @@ static inline bool parse_as_dpcm_link(struct asoc_simple_priv *priv,
|
||||
* or has convert-xxx property
|
||||
*/
|
||||
if ((of_get_child_count(codec_port) > 1) ||
|
||||
asoc_simple_is_convert_required(adata))
|
||||
simple_util_is_convert_required(adata))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static int __graph_for_each_link(struct asoc_simple_priv *priv,
|
||||
static int __graph_for_each_link(struct simple_util_priv *priv,
|
||||
struct link_info *li,
|
||||
int (*func_noml)(struct asoc_simple_priv *priv,
|
||||
int (*func_noml)(struct simple_util_priv *priv,
|
||||
struct device_node *cpu_ep,
|
||||
struct device_node *codec_ep,
|
||||
struct link_info *li),
|
||||
int (*func_dpcm)(struct asoc_simple_priv *priv,
|
||||
int (*func_dpcm)(struct simple_util_priv *priv,
|
||||
struct device_node *cpu_ep,
|
||||
struct device_node *codec_ep,
|
||||
struct link_info *li))
|
||||
@ -337,7 +337,7 @@ static int __graph_for_each_link(struct asoc_simple_priv *priv,
|
||||
struct device_node *codec_ep;
|
||||
struct device_node *codec_port;
|
||||
struct device_node *codec_port_old = NULL;
|
||||
struct asoc_simple_data adata;
|
||||
struct simple_util_data adata;
|
||||
int rc, ret = 0;
|
||||
|
||||
/* loop for all listed CPU port */
|
||||
@ -392,13 +392,13 @@ static int __graph_for_each_link(struct asoc_simple_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int graph_for_each_link(struct asoc_simple_priv *priv,
|
||||
static int graph_for_each_link(struct simple_util_priv *priv,
|
||||
struct link_info *li,
|
||||
int (*func_noml)(struct asoc_simple_priv *priv,
|
||||
int (*func_noml)(struct simple_util_priv *priv,
|
||||
struct device_node *cpu_ep,
|
||||
struct device_node *codec_ep,
|
||||
struct link_info *li),
|
||||
int (*func_dpcm)(struct asoc_simple_priv *priv,
|
||||
int (*func_dpcm)(struct simple_util_priv *priv,
|
||||
struct device_node *cpu_ep,
|
||||
struct device_node *codec_ep,
|
||||
struct link_info *li))
|
||||
@ -425,7 +425,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int graph_count_noml(struct asoc_simple_priv *priv,
|
||||
static int graph_count_noml(struct simple_util_priv *priv,
|
||||
struct device_node *cpu_ep,
|
||||
struct device_node *codec_ep,
|
||||
struct link_info *li)
|
||||
@ -454,7 +454,7 @@ static int graph_count_noml(struct asoc_simple_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int graph_count_dpcm(struct asoc_simple_priv *priv,
|
||||
static int graph_count_dpcm(struct simple_util_priv *priv,
|
||||
struct device_node *cpu_ep,
|
||||
struct device_node *codec_ep,
|
||||
struct link_info *li)
|
||||
@ -487,7 +487,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int graph_get_dais_count(struct asoc_simple_priv *priv,
|
||||
static int graph_get_dais_count(struct simple_util_priv *priv,
|
||||
struct link_info *li)
|
||||
{
|
||||
/*
|
||||
@ -541,7 +541,7 @@ static int graph_get_dais_count(struct asoc_simple_priv *priv,
|
||||
graph_count_dpcm);
|
||||
}
|
||||
|
||||
int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
|
||||
int audio_graph_parse_of(struct simple_util_priv *priv, struct device *dev)
|
||||
{
|
||||
struct snd_soc_card *card = simple_priv_to_card(priv);
|
||||
struct link_info *li;
|
||||
@ -561,7 +561,7 @@ int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
|
||||
if (!li->link)
|
||||
return -EINVAL;
|
||||
|
||||
ret = asoc_simple_init_priv(priv, li);
|
||||
ret = simple_util_init_priv(priv, li);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@ -572,11 +572,11 @@ int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = asoc_simple_parse_widgets(card, NULL);
|
||||
ret = simple_util_parse_widgets(card, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_parse_routing(card, NULL);
|
||||
ret = simple_util_parse_routing(card, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@ -587,13 +587,13 @@ int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
ret = asoc_simple_parse_card_name(card, NULL);
|
||||
ret = simple_util_parse_card_name(card, NULL);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
snd_soc_card_set_drvdata(card, priv);
|
||||
|
||||
asoc_simple_debug_info(priv);
|
||||
simple_util_debug_info(priv);
|
||||
|
||||
ret = devm_snd_soc_register_card(dev, card);
|
||||
if (ret < 0)
|
||||
@ -603,7 +603,7 @@ int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev)
|
||||
return 0;
|
||||
|
||||
err:
|
||||
asoc_simple_clean_reference(card);
|
||||
simple_util_clean_reference(card);
|
||||
|
||||
return dev_err_probe(dev, ret, "parse error\n");
|
||||
}
|
||||
@ -611,7 +611,7 @@ EXPORT_SYMBOL_GPL(audio_graph_parse_of);
|
||||
|
||||
static int graph_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct asoc_simple_priv *priv;
|
||||
struct simple_util_priv *priv;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct snd_soc_card *card;
|
||||
|
||||
@ -623,7 +623,7 @@ static int graph_probe(struct platform_device *pdev)
|
||||
card = simple_priv_to_card(priv);
|
||||
card->dapm_widgets = graph_dapm_widgets;
|
||||
card->num_dapm_widgets = ARRAY_SIZE(graph_dapm_widgets);
|
||||
card->probe = asoc_graph_card_probe;
|
||||
card->probe = graph_util_card_probe;
|
||||
|
||||
if (of_device_get_match_data(dev))
|
||||
priv->dpcm_selectable = 1;
|
||||
@ -646,7 +646,7 @@ static struct platform_driver graph_card = {
|
||||
.of_match_table = graph_of_match,
|
||||
},
|
||||
.probe = graph_probe,
|
||||
.remove = asoc_simple_remove,
|
||||
.remove = simple_util_remove,
|
||||
};
|
||||
module_platform_driver(graph_card);
|
||||
|
||||
|
@ -12,10 +12,10 @@
|
||||
|
||||
/*
|
||||
* Custom driver can have own priv
|
||||
* which includes asoc_simple_priv.
|
||||
* which includes simple_util_priv.
|
||||
*/
|
||||
struct custom_priv {
|
||||
struct asoc_simple_priv simple_priv;
|
||||
struct simple_util_priv simple_priv;
|
||||
|
||||
/* custom driver's own params */
|
||||
int custom_params;
|
||||
@ -26,7 +26,7 @@ struct custom_priv {
|
||||
|
||||
static int custom_card_probe(struct snd_soc_card *card)
|
||||
{
|
||||
struct asoc_simple_priv *simple_priv = snd_soc_card_get_drvdata(card);
|
||||
struct simple_util_priv *simple_priv = snd_soc_card_get_drvdata(card);
|
||||
struct custom_priv *custom_priv = simple_to_custom(simple_priv);
|
||||
struct device *dev = simple_priv_to_dev(simple_priv);
|
||||
|
||||
@ -35,10 +35,10 @@ static int custom_card_probe(struct snd_soc_card *card)
|
||||
custom_priv->custom_params = 1;
|
||||
|
||||
/* you can use generic probe function */
|
||||
return asoc_graph_card_probe(card);
|
||||
return graph_util_card_probe(card);
|
||||
}
|
||||
|
||||
static int custom_hook_pre(struct asoc_simple_priv *priv)
|
||||
static int custom_hook_pre(struct simple_util_priv *priv)
|
||||
{
|
||||
struct device *dev = simple_priv_to_dev(priv);
|
||||
|
||||
@ -48,7 +48,7 @@ static int custom_hook_pre(struct asoc_simple_priv *priv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int custom_hook_post(struct asoc_simple_priv *priv)
|
||||
static int custom_hook_post(struct simple_util_priv *priv)
|
||||
{
|
||||
struct device *dev = simple_priv_to_dev(priv);
|
||||
struct snd_soc_card *card;
|
||||
@ -63,7 +63,7 @@ static int custom_hook_post(struct asoc_simple_priv *priv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int custom_normal(struct asoc_simple_priv *priv,
|
||||
static int custom_normal(struct simple_util_priv *priv,
|
||||
struct device_node *lnk,
|
||||
struct link_info *li)
|
||||
{
|
||||
@ -78,7 +78,7 @@ static int custom_normal(struct asoc_simple_priv *priv,
|
||||
return audio_graph2_link_normal(priv, lnk, li);
|
||||
}
|
||||
|
||||
static int custom_dpcm(struct asoc_simple_priv *priv,
|
||||
static int custom_dpcm(struct simple_util_priv *priv,
|
||||
struct device_node *lnk,
|
||||
struct link_info *li)
|
||||
{
|
||||
@ -93,7 +93,7 @@ static int custom_dpcm(struct asoc_simple_priv *priv,
|
||||
return audio_graph2_link_dpcm(priv, lnk, li);
|
||||
}
|
||||
|
||||
static int custom_c2c(struct asoc_simple_priv *priv,
|
||||
static int custom_c2c(struct simple_util_priv *priv,
|
||||
struct device_node *lnk,
|
||||
struct link_info *li)
|
||||
{
|
||||
@ -121,26 +121,26 @@ static struct graph2_custom_hooks custom_hooks = {
|
||||
|
||||
static int custom_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct device *dev = simple_priv_to_dev(priv);
|
||||
|
||||
dev_info(dev, "custom startup\n");
|
||||
|
||||
return asoc_simple_startup(substream);
|
||||
return simple_util_startup(substream);
|
||||
}
|
||||
|
||||
/* You can use custom ops */
|
||||
static const struct snd_soc_ops custom_ops = {
|
||||
.startup = custom_startup,
|
||||
.shutdown = asoc_simple_shutdown,
|
||||
.hw_params = asoc_simple_hw_params,
|
||||
.shutdown = simple_util_shutdown,
|
||||
.hw_params = simple_util_hw_params,
|
||||
};
|
||||
|
||||
static int custom_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct custom_priv *custom_priv;
|
||||
struct asoc_simple_priv *simple_priv;
|
||||
struct simple_util_priv *simple_priv;
|
||||
struct device *dev = &pdev->dev;
|
||||
int ret;
|
||||
|
||||
@ -176,7 +176,7 @@ static struct platform_driver custom_card = {
|
||||
.of_match_table = custom_of_match,
|
||||
},
|
||||
.probe = custom_probe,
|
||||
.remove = asoc_simple_remove,
|
||||
.remove = simple_util_remove,
|
||||
};
|
||||
module_platform_driver(custom_card);
|
||||
|
||||
|
@ -282,7 +282,7 @@ out_put:
|
||||
|
||||
}
|
||||
|
||||
static enum graph_type graph_get_type(struct asoc_simple_priv *priv,
|
||||
static enum graph_type graph_get_type(struct simple_util_priv *priv,
|
||||
struct device_node *lnk)
|
||||
{
|
||||
enum graph_type type = __graph_get_type(lnk);
|
||||
@ -298,7 +298,7 @@ static enum graph_type graph_get_type(struct asoc_simple_priv *priv,
|
||||
|
||||
switch (type) {
|
||||
case GRAPH_DPCM:
|
||||
if (asoc_graph_is_ports0(lnk))
|
||||
if (graph_util_is_ports0(lnk))
|
||||
str = "DPCM Front-End";
|
||||
else
|
||||
str = "DPCM Back-End";
|
||||
@ -360,9 +360,9 @@ static struct device_node *graph_get_next_multi_ep(struct device_node **port)
|
||||
}
|
||||
|
||||
static const struct snd_soc_ops graph_ops = {
|
||||
.startup = asoc_simple_startup,
|
||||
.shutdown = asoc_simple_shutdown,
|
||||
.hw_params = asoc_simple_hw_params,
|
||||
.startup = simple_util_startup,
|
||||
.shutdown = simple_util_shutdown,
|
||||
.hw_params = simple_util_hw_params,
|
||||
};
|
||||
|
||||
static void graph_parse_convert(struct device_node *ep,
|
||||
@ -370,12 +370,12 @@ static void graph_parse_convert(struct device_node *ep,
|
||||
{
|
||||
struct device_node *port = of_get_parent(ep);
|
||||
struct device_node *ports = of_get_parent(port);
|
||||
struct asoc_simple_data *adata = &props->adata;
|
||||
struct simple_util_data *adata = &props->adata;
|
||||
|
||||
if (of_node_name_eq(ports, "ports"))
|
||||
asoc_simple_parse_convert(ports, NULL, adata);
|
||||
asoc_simple_parse_convert(port, NULL, adata);
|
||||
asoc_simple_parse_convert(ep, NULL, adata);
|
||||
simple_util_parse_convert(ports, NULL, adata);
|
||||
simple_util_parse_convert(port, NULL, adata);
|
||||
simple_util_parse_convert(ep, NULL, adata);
|
||||
|
||||
of_node_put(port);
|
||||
of_node_put(ports);
|
||||
@ -396,7 +396,7 @@ static void graph_parse_mclk_fs(struct device_node *ep,
|
||||
of_node_put(ports);
|
||||
}
|
||||
|
||||
static int __graph_parse_node(struct asoc_simple_priv *priv,
|
||||
static int __graph_parse_node(struct simple_util_priv *priv,
|
||||
enum graph_type gtype,
|
||||
struct device_node *ep,
|
||||
struct link_info *li,
|
||||
@ -406,32 +406,32 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,
|
||||
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
|
||||
struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
|
||||
struct snd_soc_dai_link_component *dlc;
|
||||
struct asoc_simple_dai *dai;
|
||||
struct simple_util_dai *dai;
|
||||
int ret, is_single_links = 0;
|
||||
|
||||
if (is_cpu) {
|
||||
dlc = asoc_link_to_cpu(dai_link, idx);
|
||||
dlc = snd_soc_link_to_cpu(dai_link, idx);
|
||||
dai = simple_props_to_dai_cpu(dai_props, idx);
|
||||
} else {
|
||||
dlc = asoc_link_to_codec(dai_link, idx);
|
||||
dlc = snd_soc_link_to_codec(dai_link, idx);
|
||||
dai = simple_props_to_dai_codec(dai_props, idx);
|
||||
}
|
||||
|
||||
graph_parse_mclk_fs(ep, dai_props);
|
||||
|
||||
ret = asoc_graph_parse_dai(dev, ep, dlc, &is_single_links);
|
||||
ret = graph_util_parse_dai(dev, ep, dlc, &is_single_links);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_parse_tdm(ep, dai);
|
||||
ret = simple_util_parse_tdm(ep, dai);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_parse_tdm_width_map(dev, ep, dai);
|
||||
ret = simple_util_parse_tdm_width_map(dev, ep, dai);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_parse_clk(dev, ep, dai, dlc);
|
||||
ret = simple_util_parse_clk(dev, ep, dai, dlc);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@ -440,7 +440,7 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,
|
||||
*/
|
||||
if (!dai_link->name) {
|
||||
struct snd_soc_dai_link_component *cpus = dlc;
|
||||
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, idx);
|
||||
struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, idx);
|
||||
char *cpu_multi = "";
|
||||
char *codec_multi = "";
|
||||
|
||||
@ -453,22 +453,22 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,
|
||||
case GRAPH_NORMAL:
|
||||
/* run is_cpu only. see audio_graph2_link_normal() */
|
||||
if (is_cpu)
|
||||
asoc_simple_set_dailink_name(dev, dai_link, "%s%s-%s%s",
|
||||
simple_util_set_dailink_name(dev, dai_link, "%s%s-%s%s",
|
||||
cpus->dai_name, cpu_multi,
|
||||
codecs->dai_name, codec_multi);
|
||||
break;
|
||||
case GRAPH_DPCM:
|
||||
if (is_cpu)
|
||||
asoc_simple_set_dailink_name(dev, dai_link, "fe.%pOFP.%s%s",
|
||||
simple_util_set_dailink_name(dev, dai_link, "fe.%pOFP.%s%s",
|
||||
cpus->of_node, cpus->dai_name, cpu_multi);
|
||||
else
|
||||
asoc_simple_set_dailink_name(dev, dai_link, "be.%pOFP.%s%s",
|
||||
simple_util_set_dailink_name(dev, dai_link, "be.%pOFP.%s%s",
|
||||
codecs->of_node, codecs->dai_name, codec_multi);
|
||||
break;
|
||||
case GRAPH_C2C:
|
||||
/* run is_cpu only. see audio_graph2_link_c2c() */
|
||||
if (is_cpu)
|
||||
asoc_simple_set_dailink_name(dev, dai_link, "c2c.%s%s-%s%s",
|
||||
simple_util_set_dailink_name(dev, dai_link, "c2c.%s%s-%s%s",
|
||||
cpus->dai_name, cpu_multi,
|
||||
codecs->dai_name, codec_multi);
|
||||
break;
|
||||
@ -482,7 +482,7 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,
|
||||
* if DPCM-BE case
|
||||
*/
|
||||
if (!is_cpu && gtype == GRAPH_DPCM) {
|
||||
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, idx);
|
||||
struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, idx);
|
||||
struct snd_soc_codec_conf *cconf = simple_props_to_codec_conf(dai_props, idx);
|
||||
struct device_node *rport = of_get_parent(ep);
|
||||
struct device_node *rports = of_get_parent(rport);
|
||||
@ -497,16 +497,16 @@ static int __graph_parse_node(struct asoc_simple_priv *priv,
|
||||
|
||||
if (is_cpu) {
|
||||
struct snd_soc_dai_link_component *cpus = dlc;
|
||||
struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, idx);
|
||||
struct snd_soc_dai_link_component *platforms = snd_soc_link_to_platform(dai_link, idx);
|
||||
|
||||
asoc_simple_canonicalize_cpu(cpus, is_single_links);
|
||||
asoc_simple_canonicalize_platform(platforms, cpus);
|
||||
simple_util_canonicalize_cpu(cpus, is_single_links);
|
||||
simple_util_canonicalize_platform(platforms, cpus);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int graph_parse_node(struct asoc_simple_priv *priv,
|
||||
static int graph_parse_node(struct simple_util_priv *priv,
|
||||
enum graph_type gtype,
|
||||
struct device_node *port,
|
||||
struct link_info *li, int is_cpu)
|
||||
@ -590,7 +590,7 @@ static void graph_parse_daifmt(struct device_node *node,
|
||||
update_daifmt(INV);
|
||||
}
|
||||
|
||||
static void graph_link_init(struct asoc_simple_priv *priv,
|
||||
static void graph_link_init(struct simple_util_priv *priv,
|
||||
struct device_node *port,
|
||||
struct link_info *li,
|
||||
int is_cpu_node)
|
||||
@ -638,13 +638,13 @@ static void graph_link_init(struct asoc_simple_priv *priv,
|
||||
daiclk = snd_soc_daifmt_clock_provider_flipped(daiclk);
|
||||
|
||||
dai_link->dai_fmt = daifmt | daiclk;
|
||||
dai_link->init = asoc_simple_dai_init;
|
||||
dai_link->init = simple_util_dai_init;
|
||||
dai_link->ops = &graph_ops;
|
||||
if (priv->ops)
|
||||
dai_link->ops = priv->ops;
|
||||
}
|
||||
|
||||
int audio_graph2_link_normal(struct asoc_simple_priv *priv,
|
||||
int audio_graph2_link_normal(struct simple_util_priv *priv,
|
||||
struct device_node *lnk,
|
||||
struct link_info *li)
|
||||
{
|
||||
@ -678,7 +678,7 @@ err:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(audio_graph2_link_normal);
|
||||
|
||||
int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
|
||||
int audio_graph2_link_dpcm(struct simple_util_priv *priv,
|
||||
struct device_node *lnk,
|
||||
struct link_info *li)
|
||||
{
|
||||
@ -687,7 +687,7 @@ int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
|
||||
struct device_node *rport = of_graph_get_remote_port(ep);
|
||||
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
|
||||
struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
|
||||
int is_cpu = asoc_graph_is_ports0(lnk);
|
||||
int is_cpu = graph_util_is_ports0(lnk);
|
||||
int ret;
|
||||
|
||||
if (is_cpu) {
|
||||
@ -713,7 +713,7 @@ int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
|
||||
/*
|
||||
* setup CPU here, Codec is already set as dummy.
|
||||
* see
|
||||
* asoc_simple_init_priv()
|
||||
* simple_util_init_priv()
|
||||
*/
|
||||
dai_link->dynamic = 1;
|
||||
dai_link->dpcm_merged_format = 1;
|
||||
@ -744,12 +744,12 @@ int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
|
||||
/*
|
||||
* setup Codec here, CPU is already set as dummy.
|
||||
* see
|
||||
* asoc_simple_init_priv()
|
||||
* simple_util_init_priv()
|
||||
*/
|
||||
|
||||
/* BE settings */
|
||||
dai_link->no_pcm = 1;
|
||||
dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup;
|
||||
dai_link->be_hw_params_fixup = simple_util_be_hw_params_fixup;
|
||||
|
||||
ret = graph_parse_node(priv, GRAPH_DPCM, rport, li, 0);
|
||||
if (ret < 0)
|
||||
@ -771,7 +771,7 @@ err:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(audio_graph2_link_dpcm);
|
||||
|
||||
int audio_graph2_link_c2c(struct asoc_simple_priv *priv,
|
||||
int audio_graph2_link_c2c(struct simple_util_priv *priv,
|
||||
struct device_node *lnk,
|
||||
struct link_info *li)
|
||||
{
|
||||
@ -807,7 +807,7 @@ int audio_graph2_link_c2c(struct asoc_simple_priv *priv,
|
||||
* Card2 can use original Codec2Codec settings if DT has.
|
||||
* It will use default settings if no settings on DT.
|
||||
* see
|
||||
* asoc_simple_init_for_codec2codec()
|
||||
* simple_util_init_for_codec2codec()
|
||||
*
|
||||
* Add more settings here if needed
|
||||
*/
|
||||
@ -868,7 +868,7 @@ err1:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(audio_graph2_link_c2c);
|
||||
|
||||
static int graph_link(struct asoc_simple_priv *priv,
|
||||
static int graph_link(struct simple_util_priv *priv,
|
||||
struct graph2_custom_hooks *hooks,
|
||||
enum graph_type gtype,
|
||||
struct device_node *lnk,
|
||||
@ -940,7 +940,7 @@ static int graph_counter(struct device_node *lnk)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int graph_count_normal(struct asoc_simple_priv *priv,
|
||||
static int graph_count_normal(struct simple_util_priv *priv,
|
||||
struct device_node *lnk,
|
||||
struct link_info *li)
|
||||
{
|
||||
@ -969,7 +969,7 @@ static int graph_count_normal(struct asoc_simple_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int graph_count_dpcm(struct asoc_simple_priv *priv,
|
||||
static int graph_count_dpcm(struct simple_util_priv *priv,
|
||||
struct device_node *lnk,
|
||||
struct link_info *li)
|
||||
{
|
||||
@ -991,7 +991,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
|
||||
* };
|
||||
*/
|
||||
|
||||
if (asoc_graph_is_ports0(lnk)) {
|
||||
if (graph_util_is_ports0(lnk)) {
|
||||
/*
|
||||
* DON'T REMOVE platforms
|
||||
* see
|
||||
@ -1009,7 +1009,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int graph_count_c2c(struct asoc_simple_priv *priv,
|
||||
static int graph_count_c2c(struct simple_util_priv *priv,
|
||||
struct device_node *lnk,
|
||||
struct link_info *li)
|
||||
{
|
||||
@ -1051,7 +1051,7 @@ static int graph_count_c2c(struct asoc_simple_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int graph_count(struct asoc_simple_priv *priv,
|
||||
static int graph_count(struct simple_util_priv *priv,
|
||||
struct graph2_custom_hooks *hooks,
|
||||
enum graph_type gtype,
|
||||
struct device_node *lnk,
|
||||
@ -1094,10 +1094,10 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int graph_for_each_link(struct asoc_simple_priv *priv,
|
||||
static int graph_for_each_link(struct simple_util_priv *priv,
|
||||
struct graph2_custom_hooks *hooks,
|
||||
struct link_info *li,
|
||||
int (*func)(struct asoc_simple_priv *priv,
|
||||
int (*func)(struct simple_util_priv *priv,
|
||||
struct graph2_custom_hooks *hooks,
|
||||
enum graph_type gtype,
|
||||
struct device_node *lnk,
|
||||
@ -1124,7 +1124,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
|
||||
int audio_graph2_parse_of(struct simple_util_priv *priv, struct device *dev,
|
||||
struct graph2_custom_hooks *hooks)
|
||||
{
|
||||
struct snd_soc_card *card = simple_priv_to_card(priv);
|
||||
@ -1135,7 +1135,7 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
|
||||
if (!li)
|
||||
return -ENOMEM;
|
||||
|
||||
card->probe = asoc_graph_card_probe;
|
||||
card->probe = graph_util_card_probe;
|
||||
card->owner = THIS_MODULE;
|
||||
card->dev = dev;
|
||||
|
||||
@ -1151,7 +1151,7 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
ret = asoc_simple_init_priv(priv, li);
|
||||
ret = simple_util_init_priv(priv, li);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
@ -1162,11 +1162,11 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
|
||||
goto err;
|
||||
}
|
||||
|
||||
ret = asoc_simple_parse_widgets(card, NULL);
|
||||
ret = simple_util_parse_widgets(card, NULL);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
ret = asoc_simple_parse_routing(card, NULL);
|
||||
ret = simple_util_parse_routing(card, NULL);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
@ -1175,7 +1175,7 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
ret = asoc_simple_parse_card_name(card, NULL);
|
||||
ret = simple_util_parse_card_name(card, NULL);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
@ -1187,7 +1187,7 @@ int audio_graph2_parse_of(struct asoc_simple_priv *priv, struct device *dev,
|
||||
goto err;
|
||||
}
|
||||
|
||||
asoc_simple_debug_info(priv);
|
||||
simple_util_debug_info(priv);
|
||||
|
||||
ret = devm_snd_soc_register_card(dev, card);
|
||||
err:
|
||||
@ -1202,7 +1202,7 @@ EXPORT_SYMBOL_GPL(audio_graph2_parse_of);
|
||||
|
||||
static int graph_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct asoc_simple_priv *priv;
|
||||
struct simple_util_priv *priv;
|
||||
struct device *dev = &pdev->dev;
|
||||
|
||||
/* Allocate the private data and the DAI link array */
|
||||
@ -1226,7 +1226,7 @@ static struct platform_driver graph_card = {
|
||||
.of_match_table = graph_of_match,
|
||||
},
|
||||
.probe = graph_probe,
|
||||
.remove = asoc_simple_remove,
|
||||
.remove = simple_util_remove,
|
||||
};
|
||||
module_platform_driver(graph_card);
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <sound/pcm_params.h>
|
||||
#include <sound/simple_card_utils.h>
|
||||
|
||||
static void asoc_simple_fixup_sample_fmt(struct asoc_simple_data *data,
|
||||
static void simple_fixup_sample_fmt(struct simple_util_data *data,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
int i;
|
||||
@ -41,9 +41,9 @@ static void asoc_simple_fixup_sample_fmt(struct asoc_simple_data *data,
|
||||
}
|
||||
}
|
||||
|
||||
void asoc_simple_parse_convert(struct device_node *np,
|
||||
void simple_util_parse_convert(struct device_node *np,
|
||||
char *prefix,
|
||||
struct asoc_simple_data *data)
|
||||
struct simple_util_data *data)
|
||||
{
|
||||
char prop[128];
|
||||
|
||||
@ -62,24 +62,24 @@ void asoc_simple_parse_convert(struct device_node *np,
|
||||
snprintf(prop, sizeof(prop), "%s%s", prefix, "convert-sample-format");
|
||||
of_property_read_string(np, prop, &data->convert_sample_format);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_parse_convert);
|
||||
EXPORT_SYMBOL_GPL(simple_util_parse_convert);
|
||||
|
||||
/**
|
||||
* asoc_simple_is_convert_required() - Query if HW param conversion was requested
|
||||
* simple_util_is_convert_required() - Query if HW param conversion was requested
|
||||
* @data: Link data.
|
||||
*
|
||||
* Returns true if any HW param conversion was requested for this DAI link with
|
||||
* any "convert-xxx" properties.
|
||||
*/
|
||||
bool asoc_simple_is_convert_required(const struct asoc_simple_data *data)
|
||||
bool simple_util_is_convert_required(const struct simple_util_data *data)
|
||||
{
|
||||
return data->convert_rate ||
|
||||
data->convert_channels ||
|
||||
data->convert_sample_format;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_is_convert_required);
|
||||
EXPORT_SYMBOL_GPL(simple_util_is_convert_required);
|
||||
|
||||
int asoc_simple_parse_daifmt(struct device *dev,
|
||||
int simple_util_parse_daifmt(struct device *dev,
|
||||
struct device_node *node,
|
||||
struct device_node *codec,
|
||||
char *prefix,
|
||||
@ -113,10 +113,10 @@ int asoc_simple_parse_daifmt(struct device *dev,
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_parse_daifmt);
|
||||
EXPORT_SYMBOL_GPL(simple_util_parse_daifmt);
|
||||
|
||||
int asoc_simple_parse_tdm_width_map(struct device *dev, struct device_node *np,
|
||||
struct asoc_simple_dai *dai)
|
||||
int simple_util_parse_tdm_width_map(struct device *dev, struct device_node *np,
|
||||
struct simple_util_dai *dai)
|
||||
{
|
||||
u32 *array_values, *p;
|
||||
int n, i, ret;
|
||||
@ -158,9 +158,9 @@ out:
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_parse_tdm_width_map);
|
||||
EXPORT_SYMBOL_GPL(simple_util_parse_tdm_width_map);
|
||||
|
||||
int asoc_simple_set_dailink_name(struct device *dev,
|
||||
int simple_util_set_dailink_name(struct device *dev,
|
||||
struct snd_soc_dai_link *dai_link,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
@ -181,9 +181,9 @@ int asoc_simple_set_dailink_name(struct device *dev,
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_set_dailink_name);
|
||||
EXPORT_SYMBOL_GPL(simple_util_set_dailink_name);
|
||||
|
||||
int asoc_simple_parse_card_name(struct snd_soc_card *card,
|
||||
int simple_util_parse_card_name(struct snd_soc_card *card,
|
||||
char *prefix)
|
||||
{
|
||||
int ret;
|
||||
@ -207,9 +207,9 @@ int asoc_simple_parse_card_name(struct snd_soc_card *card,
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_parse_card_name);
|
||||
EXPORT_SYMBOL_GPL(simple_util_parse_card_name);
|
||||
|
||||
static int asoc_simple_clk_enable(struct asoc_simple_dai *dai)
|
||||
static int simple_clk_enable(struct simple_util_dai *dai)
|
||||
{
|
||||
if (dai)
|
||||
return clk_prepare_enable(dai->clk);
|
||||
@ -217,15 +217,15 @@ static int asoc_simple_clk_enable(struct asoc_simple_dai *dai)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void asoc_simple_clk_disable(struct asoc_simple_dai *dai)
|
||||
static void simple_clk_disable(struct simple_util_dai *dai)
|
||||
{
|
||||
if (dai)
|
||||
clk_disable_unprepare(dai->clk);
|
||||
}
|
||||
|
||||
int asoc_simple_parse_clk(struct device *dev,
|
||||
int simple_util_parse_clk(struct device *dev,
|
||||
struct device_node *node,
|
||||
struct asoc_simple_dai *simple_dai,
|
||||
struct simple_util_dai *simple_dai,
|
||||
struct snd_soc_dai_link_component *dlc)
|
||||
{
|
||||
struct clk *clk;
|
||||
@ -258,10 +258,10 @@ int asoc_simple_parse_clk(struct device *dev,
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_parse_clk);
|
||||
EXPORT_SYMBOL_GPL(simple_util_parse_clk);
|
||||
|
||||
static int asoc_simple_check_fixed_sysclk(struct device *dev,
|
||||
struct asoc_simple_dai *dai,
|
||||
static int simple_check_fixed_sysclk(struct device *dev,
|
||||
struct simple_util_dai *dai,
|
||||
unsigned int *fixed_sysclk)
|
||||
{
|
||||
if (dai->clk_fixed) {
|
||||
@ -276,30 +276,30 @@ static int asoc_simple_check_fixed_sysclk(struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int asoc_simple_startup(struct snd_pcm_substream *substream)
|
||||
int simple_util_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
|
||||
struct asoc_simple_dai *dai;
|
||||
struct simple_util_dai *dai;
|
||||
unsigned int fixed_sysclk = 0;
|
||||
int i1, i2, i;
|
||||
int ret;
|
||||
|
||||
for_each_prop_dai_cpu(props, i1, dai) {
|
||||
ret = asoc_simple_clk_enable(dai);
|
||||
ret = simple_clk_enable(dai);
|
||||
if (ret)
|
||||
goto cpu_err;
|
||||
ret = asoc_simple_check_fixed_sysclk(rtd->dev, dai, &fixed_sysclk);
|
||||
ret = simple_check_fixed_sysclk(rtd->dev, dai, &fixed_sysclk);
|
||||
if (ret)
|
||||
goto cpu_err;
|
||||
}
|
||||
|
||||
for_each_prop_dai_codec(props, i2, dai) {
|
||||
ret = asoc_simple_clk_enable(dai);
|
||||
ret = simple_clk_enable(dai);
|
||||
if (ret)
|
||||
goto codec_err;
|
||||
ret = asoc_simple_check_fixed_sysclk(rtd->dev, dai, &fixed_sysclk);
|
||||
ret = simple_check_fixed_sysclk(rtd->dev, dai, &fixed_sysclk);
|
||||
if (ret)
|
||||
goto codec_err;
|
||||
}
|
||||
@ -324,49 +324,49 @@ codec_err:
|
||||
for_each_prop_dai_codec(props, i, dai) {
|
||||
if (i >= i2)
|
||||
break;
|
||||
asoc_simple_clk_disable(dai);
|
||||
simple_clk_disable(dai);
|
||||
}
|
||||
cpu_err:
|
||||
for_each_prop_dai_cpu(props, i, dai) {
|
||||
if (i >= i1)
|
||||
break;
|
||||
asoc_simple_clk_disable(dai);
|
||||
simple_clk_disable(dai);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_startup);
|
||||
EXPORT_SYMBOL_GPL(simple_util_startup);
|
||||
|
||||
void asoc_simple_shutdown(struct snd_pcm_substream *substream)
|
||||
void simple_util_shutdown(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
|
||||
struct asoc_simple_dai *dai;
|
||||
struct simple_util_dai *dai;
|
||||
int i;
|
||||
|
||||
for_each_prop_dai_cpu(props, i, dai) {
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, i);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, i);
|
||||
|
||||
if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(cpu_dai))
|
||||
snd_soc_dai_set_sysclk(cpu_dai,
|
||||
0, 0, SND_SOC_CLOCK_OUT);
|
||||
|
||||
asoc_simple_clk_disable(dai);
|
||||
simple_clk_disable(dai);
|
||||
}
|
||||
for_each_prop_dai_codec(props, i, dai) {
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, i);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, i);
|
||||
|
||||
if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(codec_dai))
|
||||
snd_soc_dai_set_sysclk(codec_dai,
|
||||
0, 0, SND_SOC_CLOCK_IN);
|
||||
|
||||
asoc_simple_clk_disable(dai);
|
||||
simple_clk_disable(dai);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_shutdown);
|
||||
EXPORT_SYMBOL_GPL(simple_util_shutdown);
|
||||
|
||||
static int asoc_simple_set_clk_rate(struct device *dev,
|
||||
struct asoc_simple_dai *simple_dai,
|
||||
static int simple_set_clk_rate(struct device *dev,
|
||||
struct simple_util_dai *simple_dai,
|
||||
unsigned long rate)
|
||||
{
|
||||
if (!simple_dai)
|
||||
@ -386,8 +386,8 @@ static int asoc_simple_set_clk_rate(struct device *dev,
|
||||
return clk_set_rate(simple_dai->clk, rate);
|
||||
}
|
||||
|
||||
static int asoc_simple_set_tdm(struct snd_soc_dai *dai,
|
||||
struct asoc_simple_dai *simple_dai,
|
||||
static int simple_set_tdm(struct snd_soc_dai *dai,
|
||||
struct simple_util_dai *simple_dai,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
int sample_bits = params_width(params);
|
||||
@ -424,13 +424,13 @@ static int asoc_simple_set_tdm(struct snd_soc_dai *dai,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int asoc_simple_hw_params(struct snd_pcm_substream *substream,
|
||||
int simple_util_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct asoc_simple_dai *pdai;
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct simple_util_dai *pdai;
|
||||
struct snd_soc_dai *sdai;
|
||||
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
|
||||
unsigned int mclk, mclk_fs = 0;
|
||||
int i, ret;
|
||||
@ -443,13 +443,13 @@ int asoc_simple_hw_params(struct snd_pcm_substream *substream,
|
||||
mclk = params_rate(params) * mclk_fs;
|
||||
|
||||
for_each_prop_dai_codec(props, i, pdai) {
|
||||
ret = asoc_simple_set_clk_rate(rtd->dev, pdai, mclk);
|
||||
ret = simple_set_clk_rate(rtd->dev, pdai, mclk);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
for_each_prop_dai_cpu(props, i, pdai) {
|
||||
ret = asoc_simple_set_clk_rate(rtd->dev, pdai, mclk);
|
||||
ret = simple_set_clk_rate(rtd->dev, pdai, mclk);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
@ -479,29 +479,29 @@ int asoc_simple_hw_params(struct snd_pcm_substream *substream,
|
||||
}
|
||||
|
||||
for_each_prop_dai_codec(props, i, pdai) {
|
||||
sdai = asoc_rtd_to_codec(rtd, i);
|
||||
ret = asoc_simple_set_tdm(sdai, pdai, params);
|
||||
sdai = snd_soc_rtd_to_codec(rtd, i);
|
||||
ret = simple_set_tdm(sdai, pdai, params);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
for_each_prop_dai_cpu(props, i, pdai) {
|
||||
sdai = asoc_rtd_to_cpu(rtd, i);
|
||||
ret = asoc_simple_set_tdm(sdai, pdai, params);
|
||||
sdai = snd_soc_rtd_to_cpu(rtd, i);
|
||||
ret = simple_set_tdm(sdai, pdai, params);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_hw_params);
|
||||
EXPORT_SYMBOL_GPL(simple_util_hw_params);
|
||||
|
||||
int asoc_simple_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
|
||||
int simple_util_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num);
|
||||
struct asoc_simple_data *data = &dai_props->adata;
|
||||
struct simple_util_data *data = &dai_props->adata;
|
||||
struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
|
||||
struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
|
||||
|
||||
@ -514,14 +514,13 @@ int asoc_simple_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
|
||||
channels->max = data->convert_channels;
|
||||
|
||||
if (data->convert_sample_format)
|
||||
asoc_simple_fixup_sample_fmt(data, params);
|
||||
simple_fixup_sample_fmt(data, params);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_be_hw_params_fixup);
|
||||
EXPORT_SYMBOL_GPL(simple_util_be_hw_params_fixup);
|
||||
|
||||
static int asoc_simple_init_dai(struct snd_soc_dai *dai,
|
||||
struct asoc_simple_dai *simple_dai)
|
||||
static int simple_init_dai(struct snd_soc_dai *dai, struct simple_util_dai *simple_dai)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -552,12 +551,12 @@ static int asoc_simple_init_dai(struct snd_soc_dai *dai,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int asoc_simple_component_is_codec(struct snd_soc_component *component)
|
||||
static inline int simple_component_is_codec(struct snd_soc_component *component)
|
||||
{
|
||||
return component->driver->endianness;
|
||||
}
|
||||
|
||||
static int asoc_simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
|
||||
static int simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
|
||||
struct simple_dai_props *dai_props)
|
||||
{
|
||||
struct snd_soc_dai_link *dai_link = rtd->dai_link;
|
||||
@ -576,7 +575,7 @@ static int asoc_simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
|
||||
|
||||
/* Only Codecs */
|
||||
for_each_rtd_components(rtd, i, component) {
|
||||
if (!asoc_simple_component_is_codec(component))
|
||||
if (!simple_component_is_codec(component))
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -609,33 +608,33 @@ static int asoc_simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int asoc_simple_dai_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int simple_util_dai_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct simple_util_priv *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
|
||||
struct asoc_simple_dai *dai;
|
||||
struct simple_util_dai *dai;
|
||||
int i, ret;
|
||||
|
||||
for_each_prop_dai_codec(props, i, dai) {
|
||||
ret = asoc_simple_init_dai(asoc_rtd_to_codec(rtd, i), dai);
|
||||
ret = simple_init_dai(snd_soc_rtd_to_codec(rtd, i), dai);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
for_each_prop_dai_cpu(props, i, dai) {
|
||||
ret = asoc_simple_init_dai(asoc_rtd_to_cpu(rtd, i), dai);
|
||||
ret = simple_init_dai(snd_soc_rtd_to_cpu(rtd, i), dai);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = asoc_simple_init_for_codec2codec(rtd, props);
|
||||
ret = simple_init_for_codec2codec(rtd, props);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_dai_init);
|
||||
EXPORT_SYMBOL_GPL(simple_util_dai_init);
|
||||
|
||||
void asoc_simple_canonicalize_platform(struct snd_soc_dai_link_component *platforms,
|
||||
void simple_util_canonicalize_platform(struct snd_soc_dai_link_component *platforms,
|
||||
struct snd_soc_dai_link_component *cpus)
|
||||
{
|
||||
/*
|
||||
@ -651,9 +650,9 @@ void asoc_simple_canonicalize_platform(struct snd_soc_dai_link_component *platfo
|
||||
if (!platforms->of_node)
|
||||
snd_soc_dlc_use_cpu_as_platform(platforms, cpus);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_canonicalize_platform);
|
||||
EXPORT_SYMBOL_GPL(simple_util_canonicalize_platform);
|
||||
|
||||
void asoc_simple_canonicalize_cpu(struct snd_soc_dai_link_component *cpus,
|
||||
void simple_util_canonicalize_cpu(struct snd_soc_dai_link_component *cpus,
|
||||
int is_single_links)
|
||||
{
|
||||
/*
|
||||
@ -668,9 +667,9 @@ void asoc_simple_canonicalize_cpu(struct snd_soc_dai_link_component *cpus,
|
||||
if (is_single_links)
|
||||
cpus->dai_name = NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_canonicalize_cpu);
|
||||
EXPORT_SYMBOL_GPL(simple_util_canonicalize_cpu);
|
||||
|
||||
void asoc_simple_clean_reference(struct snd_soc_card *card)
|
||||
void simple_util_clean_reference(struct snd_soc_card *card)
|
||||
{
|
||||
struct snd_soc_dai_link *dai_link;
|
||||
struct snd_soc_dai_link_component *cpu;
|
||||
@ -684,9 +683,9 @@ void asoc_simple_clean_reference(struct snd_soc_card *card)
|
||||
of_node_put(codec->of_node);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_clean_reference);
|
||||
EXPORT_SYMBOL_GPL(simple_util_clean_reference);
|
||||
|
||||
int asoc_simple_parse_routing(struct snd_soc_card *card,
|
||||
int simple_util_parse_routing(struct snd_soc_card *card,
|
||||
char *prefix)
|
||||
{
|
||||
struct device_node *node = card->dev->of_node;
|
||||
@ -702,9 +701,9 @@ int asoc_simple_parse_routing(struct snd_soc_card *card,
|
||||
|
||||
return snd_soc_of_parse_audio_routing(card, prop);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_parse_routing);
|
||||
EXPORT_SYMBOL_GPL(simple_util_parse_routing);
|
||||
|
||||
int asoc_simple_parse_widgets(struct snd_soc_card *card,
|
||||
int simple_util_parse_widgets(struct snd_soc_card *card,
|
||||
char *prefix)
|
||||
{
|
||||
struct device_node *node = card->dev->of_node;
|
||||
@ -721,9 +720,9 @@ int asoc_simple_parse_widgets(struct snd_soc_card *card,
|
||||
/* no widgets is not error */
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_parse_widgets);
|
||||
EXPORT_SYMBOL_GPL(simple_util_parse_widgets);
|
||||
|
||||
int asoc_simple_parse_pin_switches(struct snd_soc_card *card,
|
||||
int simple_util_parse_pin_switches(struct snd_soc_card *card,
|
||||
char *prefix)
|
||||
{
|
||||
char prop[128];
|
||||
@ -735,10 +734,10 @@ int asoc_simple_parse_pin_switches(struct snd_soc_card *card,
|
||||
|
||||
return snd_soc_of_parse_pin_switches(card, prop);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_parse_pin_switches);
|
||||
EXPORT_SYMBOL_GPL(simple_util_parse_pin_switches);
|
||||
|
||||
int asoc_simple_init_jack(struct snd_soc_card *card,
|
||||
struct asoc_simple_jack *sjack,
|
||||
int simple_util_init_jack(struct snd_soc_card *card,
|
||||
struct simple_util_jack *sjack,
|
||||
int is_hp, char *prefix,
|
||||
char *pin)
|
||||
{
|
||||
@ -793,9 +792,9 @@ int asoc_simple_init_jack(struct snd_soc_card *card,
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_init_jack);
|
||||
EXPORT_SYMBOL_GPL(simple_util_init_jack);
|
||||
|
||||
int asoc_simple_init_aux_jacks(struct asoc_simple_priv *priv, char *prefix)
|
||||
int simple_util_init_aux_jacks(struct simple_util_priv *priv, char *prefix)
|
||||
{
|
||||
struct snd_soc_card *card = simple_priv_to_card(priv);
|
||||
struct snd_soc_component *component;
|
||||
@ -842,16 +841,16 @@ int asoc_simple_init_aux_jacks(struct asoc_simple_priv *priv, char *prefix)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_init_aux_jacks);
|
||||
EXPORT_SYMBOL_GPL(simple_util_init_aux_jacks);
|
||||
|
||||
int asoc_simple_init_priv(struct asoc_simple_priv *priv,
|
||||
int simple_util_init_priv(struct simple_util_priv *priv,
|
||||
struct link_info *li)
|
||||
{
|
||||
struct snd_soc_card *card = simple_priv_to_card(priv);
|
||||
struct device *dev = simple_priv_to_dev(priv);
|
||||
struct snd_soc_dai_link *dai_link;
|
||||
struct simple_dai_props *dai_props;
|
||||
struct asoc_simple_dai *dais;
|
||||
struct simple_util_dai *dais;
|
||||
struct snd_soc_dai_link_component *dlcs;
|
||||
struct snd_soc_codec_conf *cconf = NULL;
|
||||
int i, dai_num = 0, dlc_num = 0, cnf_num = 0;
|
||||
@ -912,7 +911,7 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
|
||||
dais += li->num[i].cpus;
|
||||
} else {
|
||||
/* DPCM Be's CPU = dummy */
|
||||
dai_link[i].cpus = &asoc_dummy_dlc;
|
||||
dai_link[i].cpus = &snd_soc_dummy_dlc;
|
||||
dai_props[i].num.cpus =
|
||||
dai_link[i].num_cpus = 1;
|
||||
}
|
||||
@ -934,7 +933,7 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
|
||||
}
|
||||
} else {
|
||||
/* DPCM Fe's Codec = dummy */
|
||||
dai_link[i].codecs = &asoc_dummy_dlc;
|
||||
dai_link[i].codecs = &snd_soc_dummy_dlc;
|
||||
dai_props[i].num.codecs =
|
||||
dai_link[i].num_codecs = 1;
|
||||
}
|
||||
@ -956,36 +955,36 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_init_priv);
|
||||
EXPORT_SYMBOL_GPL(simple_util_init_priv);
|
||||
|
||||
int asoc_simple_remove(struct platform_device *pdev)
|
||||
int simple_util_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card = platform_get_drvdata(pdev);
|
||||
|
||||
asoc_simple_clean_reference(card);
|
||||
simple_util_clean_reference(card);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_simple_remove);
|
||||
EXPORT_SYMBOL_GPL(simple_util_remove);
|
||||
|
||||
int asoc_graph_card_probe(struct snd_soc_card *card)
|
||||
int graph_util_card_probe(struct snd_soc_card *card)
|
||||
{
|
||||
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
|
||||
struct simple_util_priv *priv = snd_soc_card_get_drvdata(card);
|
||||
int ret;
|
||||
|
||||
ret = asoc_simple_init_hp(card, &priv->hp_jack, NULL);
|
||||
ret = simple_util_init_hp(card, &priv->hp_jack, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_init_mic(card, &priv->mic_jack, NULL);
|
||||
ret = simple_util_init_mic(card, &priv->mic_jack, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_graph_card_probe);
|
||||
EXPORT_SYMBOL_GPL(graph_util_card_probe);
|
||||
|
||||
int asoc_graph_is_ports0(struct device_node *np)
|
||||
int graph_util_is_ports0(struct device_node *np)
|
||||
{
|
||||
struct device_node *port, *ports, *ports0, *top;
|
||||
int ret;
|
||||
@ -1011,7 +1010,7 @@ int asoc_graph_is_ports0(struct device_node *np)
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_graph_is_ports0);
|
||||
EXPORT_SYMBOL_GPL(graph_util_is_ports0);
|
||||
|
||||
static int graph_get_dai_id(struct device_node *ep)
|
||||
{
|
||||
@ -1066,7 +1065,7 @@ static int graph_get_dai_id(struct device_node *ep)
|
||||
return id;
|
||||
}
|
||||
|
||||
int asoc_graph_parse_dai(struct device *dev, struct device_node *ep,
|
||||
int graph_util_parse_dai(struct device *dev, struct device_node *ep,
|
||||
struct snd_soc_dai_link_component *dlc, int *is_single_link)
|
||||
{
|
||||
struct device_node *node;
|
||||
@ -1129,7 +1128,7 @@ parse_dai_end:
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(asoc_graph_parse_dai);
|
||||
EXPORT_SYMBOL_GPL(graph_util_parse_dai);
|
||||
|
||||
/* Module information */
|
||||
MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
|
||||
|
@ -23,13 +23,12 @@
|
||||
#define PREFIX "simple-audio-card,"
|
||||
|
||||
static const struct snd_soc_ops simple_ops = {
|
||||
.startup = asoc_simple_startup,
|
||||
.shutdown = asoc_simple_shutdown,
|
||||
.hw_params = asoc_simple_hw_params,
|
||||
.startup = simple_util_startup,
|
||||
.shutdown = simple_util_shutdown,
|
||||
.hw_params = simple_util_hw_params,
|
||||
};
|
||||
|
||||
static int asoc_simple_parse_platform(struct device_node *node,
|
||||
struct snd_soc_dai_link_component *dlc)
|
||||
static int simple_parse_platform(struct device_node *node, struct snd_soc_dai_link_component *dlc)
|
||||
{
|
||||
struct of_phandle_args args;
|
||||
int ret;
|
||||
@ -52,7 +51,7 @@ static int asoc_simple_parse_platform(struct device_node *node,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int asoc_simple_parse_dai(struct device *dev,
|
||||
static int simple_parse_dai(struct device *dev,
|
||||
struct device_node *node,
|
||||
struct snd_soc_dai_link_component *dlc,
|
||||
int *is_single_link)
|
||||
@ -117,15 +116,15 @@ parse_dai_end:
|
||||
|
||||
static void simple_parse_convert(struct device *dev,
|
||||
struct device_node *np,
|
||||
struct asoc_simple_data *adata)
|
||||
struct simple_util_data *adata)
|
||||
{
|
||||
struct device_node *top = dev->of_node;
|
||||
struct device_node *node = of_get_parent(np);
|
||||
|
||||
asoc_simple_parse_convert(top, PREFIX, adata);
|
||||
asoc_simple_parse_convert(node, PREFIX, adata);
|
||||
asoc_simple_parse_convert(node, NULL, adata);
|
||||
asoc_simple_parse_convert(np, NULL, adata);
|
||||
simple_util_parse_convert(top, PREFIX, adata);
|
||||
simple_util_parse_convert(node, PREFIX, adata);
|
||||
simple_util_parse_convert(node, NULL, adata);
|
||||
simple_util_parse_convert(np, NULL, adata);
|
||||
|
||||
of_node_put(node);
|
||||
}
|
||||
@ -148,7 +147,7 @@ static void simple_parse_mclk_fs(struct device_node *top,
|
||||
of_node_put(node);
|
||||
}
|
||||
|
||||
static int simple_parse_node(struct asoc_simple_priv *priv,
|
||||
static int simple_parse_node(struct simple_util_priv *priv,
|
||||
struct device_node *np,
|
||||
struct link_info *li,
|
||||
char *prefix,
|
||||
@ -159,35 +158,35 @@ static int simple_parse_node(struct asoc_simple_priv *priv,
|
||||
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
|
||||
struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link);
|
||||
struct snd_soc_dai_link_component *dlc;
|
||||
struct asoc_simple_dai *dai;
|
||||
struct simple_util_dai *dai;
|
||||
int ret;
|
||||
|
||||
if (cpu) {
|
||||
dlc = asoc_link_to_cpu(dai_link, 0);
|
||||
dlc = snd_soc_link_to_cpu(dai_link, 0);
|
||||
dai = simple_props_to_dai_cpu(dai_props, 0);
|
||||
} else {
|
||||
dlc = asoc_link_to_codec(dai_link, 0);
|
||||
dlc = snd_soc_link_to_codec(dai_link, 0);
|
||||
dai = simple_props_to_dai_codec(dai_props, 0);
|
||||
}
|
||||
|
||||
simple_parse_mclk_fs(top, np, dai_props, prefix);
|
||||
|
||||
ret = asoc_simple_parse_dai(dev, np, dlc, cpu);
|
||||
ret = simple_parse_dai(dev, np, dlc, cpu);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_parse_clk(dev, np, dai, dlc);
|
||||
ret = simple_util_parse_clk(dev, np, dai, dlc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_parse_tdm(np, dai);
|
||||
ret = simple_util_parse_tdm(np, dai);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int simple_link_init(struct asoc_simple_priv *priv,
|
||||
static int simple_link_init(struct simple_util_priv *priv,
|
||||
struct device_node *node,
|
||||
struct device_node *codec,
|
||||
struct link_info *li,
|
||||
@ -197,18 +196,18 @@ static int simple_link_init(struct asoc_simple_priv *priv,
|
||||
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
|
||||
int ret;
|
||||
|
||||
ret = asoc_simple_parse_daifmt(dev, node, codec,
|
||||
ret = simple_util_parse_daifmt(dev, node, codec,
|
||||
prefix, &dai_link->dai_fmt);
|
||||
if (ret < 0)
|
||||
return 0;
|
||||
|
||||
dai_link->init = asoc_simple_dai_init;
|
||||
dai_link->init = simple_util_dai_init;
|
||||
dai_link->ops = &simple_ops;
|
||||
|
||||
return asoc_simple_set_dailink_name(dev, dai_link, name);
|
||||
return simple_util_set_dailink_name(dev, dai_link, name);
|
||||
}
|
||||
|
||||
static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv,
|
||||
static int simple_dai_link_of_dpcm(struct simple_util_priv *priv,
|
||||
struct device_node *np,
|
||||
struct device_node *codec,
|
||||
struct link_info *li,
|
||||
@ -230,8 +229,8 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv,
|
||||
prefix = PREFIX;
|
||||
|
||||
if (li->cpu) {
|
||||
struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *cpus = snd_soc_link_to_cpu(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *platforms = snd_soc_link_to_platform(dai_link, 0);
|
||||
int is_single_links = 0;
|
||||
|
||||
/* Codec is dummy */
|
||||
@ -246,17 +245,17 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv,
|
||||
|
||||
snprintf(dai_name, sizeof(dai_name), "fe.%s", cpus->dai_name);
|
||||
|
||||
asoc_simple_canonicalize_cpu(cpus, is_single_links);
|
||||
asoc_simple_canonicalize_platform(platforms, cpus);
|
||||
simple_util_canonicalize_cpu(cpus, is_single_links);
|
||||
simple_util_canonicalize_platform(platforms, cpus);
|
||||
} else {
|
||||
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, 0);
|
||||
struct snd_soc_codec_conf *cconf;
|
||||
|
||||
/* CPU is dummy */
|
||||
|
||||
/* BE settings */
|
||||
dai_link->no_pcm = 1;
|
||||
dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup;
|
||||
dai_link->be_hw_params_fixup = simple_util_be_hw_params_fixup;
|
||||
|
||||
cconf = simple_props_to_codec_conf(dai_props, 0);
|
||||
|
||||
@ -288,7 +287,7 @@ out_put_node:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int simple_dai_link_of(struct asoc_simple_priv *priv,
|
||||
static int simple_dai_link_of(struct simple_util_priv *priv,
|
||||
struct device_node *np,
|
||||
struct device_node *codec,
|
||||
struct link_info *li,
|
||||
@ -296,9 +295,9 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
|
||||
{
|
||||
struct device *dev = simple_priv_to_dev(priv);
|
||||
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
|
||||
struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *cpus = snd_soc_link_to_cpu(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *codecs = snd_soc_link_to_codec(dai_link, 0);
|
||||
struct snd_soc_dai_link_component *platforms = snd_soc_link_to_platform(dai_link, 0);
|
||||
struct device_node *cpu = NULL;
|
||||
struct device_node *node = NULL;
|
||||
struct device_node *plat = NULL;
|
||||
@ -327,15 +326,15 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
|
||||
if (ret < 0)
|
||||
goto dai_link_of_err;
|
||||
|
||||
ret = asoc_simple_parse_platform(plat, platforms);
|
||||
ret = simple_parse_platform(plat, platforms);
|
||||
if (ret < 0)
|
||||
goto dai_link_of_err;
|
||||
|
||||
snprintf(dai_name, sizeof(dai_name),
|
||||
"%s-%s", cpus->dai_name, codecs->dai_name);
|
||||
|
||||
asoc_simple_canonicalize_cpu(cpus, single_cpu);
|
||||
asoc_simple_canonicalize_platform(platforms, cpus);
|
||||
simple_util_canonicalize_cpu(cpus, single_cpu);
|
||||
simple_util_canonicalize_platform(platforms, cpus);
|
||||
|
||||
ret = simple_link_init(priv, node, codec, li, prefix, dai_name);
|
||||
|
||||
@ -348,13 +347,13 @@ dai_link_of_err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __simple_for_each_link(struct asoc_simple_priv *priv,
|
||||
static int __simple_for_each_link(struct simple_util_priv *priv,
|
||||
struct link_info *li,
|
||||
int (*func_noml)(struct asoc_simple_priv *priv,
|
||||
int (*func_noml)(struct simple_util_priv *priv,
|
||||
struct device_node *np,
|
||||
struct device_node *codec,
|
||||
struct link_info *li, bool is_top),
|
||||
int (*func_dpcm)(struct asoc_simple_priv *priv,
|
||||
int (*func_dpcm)(struct simple_util_priv *priv,
|
||||
struct device_node *np,
|
||||
struct device_node *codec,
|
||||
struct link_info *li, bool is_top))
|
||||
@ -378,7 +377,7 @@ static int __simple_for_each_link(struct asoc_simple_priv *priv,
|
||||
|
||||
/* loop for all dai-link */
|
||||
do {
|
||||
struct asoc_simple_data adata;
|
||||
struct simple_util_data adata;
|
||||
struct device_node *codec;
|
||||
struct device_node *plat;
|
||||
struct device_node *np;
|
||||
@ -419,7 +418,7 @@ static int __simple_for_each_link(struct asoc_simple_priv *priv,
|
||||
* or has convert-xxx property
|
||||
*/
|
||||
if (dpcm_selectable &&
|
||||
(num > 2 || asoc_simple_is_convert_required(&adata))) {
|
||||
(num > 2 || simple_util_is_convert_required(&adata))) {
|
||||
/*
|
||||
* np
|
||||
* |1(CPU)|0(Codec) li->cpu
|
||||
@ -459,13 +458,13 @@ static int __simple_for_each_link(struct asoc_simple_priv *priv,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int simple_for_each_link(struct asoc_simple_priv *priv,
|
||||
static int simple_for_each_link(struct simple_util_priv *priv,
|
||||
struct link_info *li,
|
||||
int (*func_noml)(struct asoc_simple_priv *priv,
|
||||
int (*func_noml)(struct simple_util_priv *priv,
|
||||
struct device_node *np,
|
||||
struct device_node *codec,
|
||||
struct link_info *li, bool is_top),
|
||||
int (*func_dpcm)(struct asoc_simple_priv *priv,
|
||||
int (*func_dpcm)(struct simple_util_priv *priv,
|
||||
struct device_node *np,
|
||||
struct device_node *codec,
|
||||
struct link_info *li, bool is_top))
|
||||
@ -494,12 +493,12 @@ static int simple_for_each_link(struct asoc_simple_priv *priv,
|
||||
|
||||
static void simple_depopulate_aux(void *data)
|
||||
{
|
||||
struct asoc_simple_priv *priv = data;
|
||||
struct simple_util_priv *priv = data;
|
||||
|
||||
of_platform_depopulate(simple_priv_to_dev(priv));
|
||||
}
|
||||
|
||||
static int simple_populate_aux(struct asoc_simple_priv *priv)
|
||||
static int simple_populate_aux(struct simple_util_priv *priv)
|
||||
{
|
||||
struct device *dev = simple_priv_to_dev(priv);
|
||||
struct device_node *node;
|
||||
@ -517,20 +516,20 @@ static int simple_populate_aux(struct asoc_simple_priv *priv)
|
||||
return devm_add_action_or_reset(dev, simple_depopulate_aux, priv);
|
||||
}
|
||||
|
||||
static int simple_parse_of(struct asoc_simple_priv *priv, struct link_info *li)
|
||||
static int simple_parse_of(struct simple_util_priv *priv, struct link_info *li)
|
||||
{
|
||||
struct snd_soc_card *card = simple_priv_to_card(priv);
|
||||
int ret;
|
||||
|
||||
ret = asoc_simple_parse_widgets(card, PREFIX);
|
||||
ret = simple_util_parse_widgets(card, PREFIX);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_parse_routing(card, PREFIX);
|
||||
ret = simple_util_parse_routing(card, PREFIX);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_parse_pin_switches(card, PREFIX);
|
||||
ret = simple_util_parse_pin_switches(card, PREFIX);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@ -542,7 +541,7 @@ static int simple_parse_of(struct asoc_simple_priv *priv, struct link_info *li)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_parse_card_name(card, PREFIX);
|
||||
ret = simple_util_parse_card_name(card, PREFIX);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@ -555,7 +554,7 @@ static int simple_parse_of(struct asoc_simple_priv *priv, struct link_info *li)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int simple_count_noml(struct asoc_simple_priv *priv,
|
||||
static int simple_count_noml(struct simple_util_priv *priv,
|
||||
struct device_node *np,
|
||||
struct device_node *codec,
|
||||
struct link_info *li, bool is_top)
|
||||
@ -579,7 +578,7 @@ static int simple_count_noml(struct asoc_simple_priv *priv,
|
||||
* ignored by snd_soc_rtd_add_component().
|
||||
*
|
||||
* see
|
||||
* simple-card-utils.c :: asoc_simple_canonicalize_platform()
|
||||
* simple-card-utils.c :: simple_util_canonicalize_platform()
|
||||
*/
|
||||
li->num[li->link].cpus = 1;
|
||||
li->num[li->link].platforms = 1;
|
||||
@ -591,7 +590,7 @@ static int simple_count_noml(struct asoc_simple_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int simple_count_dpcm(struct asoc_simple_priv *priv,
|
||||
static int simple_count_dpcm(struct simple_util_priv *priv,
|
||||
struct device_node *np,
|
||||
struct device_node *codec,
|
||||
struct link_info *li, bool is_top)
|
||||
@ -622,7 +621,7 @@ static int simple_count_dpcm(struct asoc_simple_priv *priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int simple_get_dais_count(struct asoc_simple_priv *priv,
|
||||
static int simple_get_dais_count(struct simple_util_priv *priv,
|
||||
struct link_info *li)
|
||||
{
|
||||
struct device *dev = simple_priv_to_dev(priv);
|
||||
@ -690,27 +689,27 @@ static int simple_get_dais_count(struct asoc_simple_priv *priv,
|
||||
|
||||
static int simple_soc_probe(struct snd_soc_card *card)
|
||||
{
|
||||
struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
|
||||
struct simple_util_priv *priv = snd_soc_card_get_drvdata(card);
|
||||
int ret;
|
||||
|
||||
ret = asoc_simple_init_hp(card, &priv->hp_jack, PREFIX);
|
||||
ret = simple_util_init_hp(card, &priv->hp_jack, PREFIX);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_init_mic(card, &priv->mic_jack, PREFIX);
|
||||
ret = simple_util_init_mic(card, &priv->mic_jack, PREFIX);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = asoc_simple_init_aux_jacks(priv, PREFIX);
|
||||
ret = simple_util_init_aux_jacks(priv, PREFIX);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int asoc_simple_probe(struct platform_device *pdev)
|
||||
static int simple_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct asoc_simple_priv *priv;
|
||||
struct simple_util_priv *priv;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
struct snd_soc_card *card;
|
||||
@ -739,7 +738,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
|
||||
if (!li->link)
|
||||
return -EINVAL;
|
||||
|
||||
ret = asoc_simple_init_priv(priv, li);
|
||||
ret = simple_util_init_priv(priv, li);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@ -752,7 +751,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
} else {
|
||||
struct asoc_simple_card_info *cinfo;
|
||||
struct simple_util_info *cinfo;
|
||||
struct snd_soc_dai_link_component *cpus;
|
||||
struct snd_soc_dai_link_component *codecs;
|
||||
struct snd_soc_dai_link_component *platform;
|
||||
@ -770,7 +769,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
|
||||
!cinfo->codec ||
|
||||
!cinfo->platform ||
|
||||
!cinfo->cpu_dai.name) {
|
||||
dev_err(dev, "insufficient asoc_simple_card_info settings\n");
|
||||
dev_err(dev, "insufficient simple_util_info settings\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -788,7 +787,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
|
||||
dai_link->name = cinfo->name;
|
||||
dai_link->stream_name = cinfo->name;
|
||||
dai_link->dai_fmt = cinfo->daifmt;
|
||||
dai_link->init = asoc_simple_dai_init;
|
||||
dai_link->init = simple_util_dai_init;
|
||||
memcpy(dai_props->cpu_dai, &cinfo->cpu_dai,
|
||||
sizeof(*dai_props->cpu_dai));
|
||||
memcpy(dai_props->codec_dai, &cinfo->codec_dai,
|
||||
@ -797,7 +796,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
|
||||
|
||||
snd_soc_card_set_drvdata(card, priv);
|
||||
|
||||
asoc_simple_debug_info(priv);
|
||||
simple_util_debug_info(priv);
|
||||
|
||||
ret = devm_snd_soc_register_card(dev, card);
|
||||
if (ret < 0)
|
||||
@ -806,7 +805,7 @@ static int asoc_simple_probe(struct platform_device *pdev)
|
||||
devm_kfree(dev, li);
|
||||
return 0;
|
||||
err:
|
||||
asoc_simple_clean_reference(card);
|
||||
simple_util_clean_reference(card);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -819,17 +818,17 @@ static const struct of_device_id simple_of_match[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, simple_of_match);
|
||||
|
||||
static struct platform_driver asoc_simple_card = {
|
||||
static struct platform_driver simple_card = {
|
||||
.driver = {
|
||||
.name = "asoc-simple-card",
|
||||
.pm = &snd_soc_pm_ops,
|
||||
.of_match_table = simple_of_match,
|
||||
},
|
||||
.probe = asoc_simple_probe,
|
||||
.remove = asoc_simple_remove,
|
||||
.probe = simple_probe,
|
||||
.remove = simple_util_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(asoc_simple_card);
|
||||
module_platform_driver(simple_card);
|
||||
|
||||
MODULE_ALIAS("platform:asoc-simple-card");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
@ -352,7 +352,7 @@ static const struct snd_pcm_hardware test_component_hardware = {
|
||||
static int test_component_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
mile_stone(component);
|
||||
|
||||
|
@ -131,8 +131,8 @@ static irqreturn_t chv3_i2s_isr(int irq, void *data)
|
||||
static int chv3_dma_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
int res;
|
||||
|
||||
snd_soc_set_runtime_hwparams(substream, &chv3_dma_hw);
|
||||
@ -152,8 +152,8 @@ static int chv3_dma_open(struct snd_soc_component *component,
|
||||
static int chv3_dma_close(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
|
||||
if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE)
|
||||
chv3_i2s_wr(i2s, I2S_RX_ENABLE, 0);
|
||||
@ -166,7 +166,7 @@ static int chv3_dma_close(struct snd_soc_component *component,
|
||||
static int chv3_dma_pcm_construct(struct snd_soc_component *component,
|
||||
struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_pcm_substream *substream;
|
||||
int res;
|
||||
|
||||
@ -200,8 +200,8 @@ static int chv3_dma_hw_params(struct snd_soc_component *component,
|
||||
static int chv3_dma_prepare(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
unsigned int buffer_bytes, period_bytes, period_size;
|
||||
|
||||
buffer_bytes = snd_pcm_lib_buffer_bytes(substream);
|
||||
@ -229,8 +229,8 @@ static int chv3_dma_prepare(struct snd_soc_component *component,
|
||||
static snd_pcm_uframes_t chv3_dma_pointer(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
u32 frame_bytes, buffer_bytes;
|
||||
u32 idx_bytes;
|
||||
|
||||
@ -252,8 +252,8 @@ static int chv3_dma_ack(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(rtd, 0));
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0));
|
||||
unsigned int bytes, idx;
|
||||
|
||||
bytes = frames_to_bytes(runtime, runtime->control->appl_ptr);
|
||||
|
@ -399,7 +399,7 @@ static int img_i2s_in_dma_prepare_slave_config(struct snd_pcm_substream *st,
|
||||
struct snd_dmaengine_dai_dma_data *dma_data;
|
||||
int ret;
|
||||
|
||||
dma_data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), st);
|
||||
dma_data = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), st);
|
||||
|
||||
ret = snd_hwparams_to_dma_slave_config(st, params, sc);
|
||||
if (ret)
|
||||
|
@ -405,7 +405,7 @@ static int img_i2s_out_dma_prepare_slave_config(struct snd_pcm_substream *st,
|
||||
struct snd_dmaengine_dai_dma_data *dma_data;
|
||||
int ret;
|
||||
|
||||
dma_data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), st);
|
||||
dma_data = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), st);
|
||||
|
||||
ret = snd_hwparams_to_dma_slave_config(st, params, sc);
|
||||
if (ret)
|
||||
|
@ -90,7 +90,7 @@ static const struct snd_soc_jack_pin card_headset_pins[] = {
|
||||
|
||||
static int avs_da7219_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
{
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
struct snd_soc_card *card = runtime->card;
|
||||
struct snd_soc_jack_pin *pins;
|
||||
@ -140,7 +140,7 @@ static int avs_da7219_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
|
||||
static void avs_da7219_codec_exit(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -97,7 +97,7 @@ static struct snd_soc_jack_pin card_headset_pins[] = {
|
||||
|
||||
static int avs_es8336_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
{
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
struct snd_soc_card *card = runtime->card;
|
||||
struct snd_soc_jack_pin *pins;
|
||||
@ -138,7 +138,7 @@ static int avs_es8336_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
static void avs_es8336_codec_exit(struct snd_soc_pcm_runtime *runtime)
|
||||
{
|
||||
struct avs_card_drvdata *data = snd_soc_card_get_drvdata(runtime->card);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
|
||||
|
||||
snd_soc_component_set_jack(codec_dai->component, NULL, NULL);
|
||||
gpiod_put(data->gpiod);
|
||||
@ -147,8 +147,8 @@ static void avs_es8336_codec_exit(struct snd_soc_pcm_runtime *runtime)
|
||||
static int avs_es8336_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *runtime = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0);
|
||||
struct snd_soc_pcm_runtime *runtime = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
|
||||
int clk_freq;
|
||||
int ret;
|
||||
|
||||
|
@ -32,7 +32,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
|
||||
return -ENOMEM;
|
||||
|
||||
dl->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", ssp_port);
|
||||
dl->codecs = &asoc_dummy_dlc;
|
||||
dl->codecs = &snd_soc_dummy_dlc;
|
||||
if (!dl->cpus->dai_name || !dl->codecs->name || !dl->codecs->dai_name)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -66,7 +66,7 @@ avs_max98373_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_par
|
||||
static int avs_max98373_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *runtime = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *runtime = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
int ret, i;
|
||||
|
||||
|
@ -66,7 +66,7 @@ avs_max98927_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_par
|
||||
static int avs_max98927_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *runtime = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *runtime = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
int ret = 0;
|
||||
int i;
|
||||
|
@ -106,12 +106,12 @@ static int avs_nau8825_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
|
||||
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
|
||||
|
||||
return snd_soc_component_set_jack(asoc_rtd_to_codec(runtime, 0)->component, jack, NULL);
|
||||
return snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, jack, NULL);
|
||||
}
|
||||
|
||||
static void avs_nau8825_codec_exit(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -138,8 +138,8 @@ avs_nau8825_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_para
|
||||
static int avs_nau8825_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct snd_soc_pcm_runtime *rtm = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtm, 0);
|
||||
struct snd_soc_pcm_runtime *rtm = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtm, 0);
|
||||
int ret = 0;
|
||||
|
||||
switch (cmd) {
|
||||
|
@ -87,7 +87,7 @@ static struct snd_soc_jack_pin card_headset_pins[] = {
|
||||
|
||||
static int avs_rt274_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
{
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
|
||||
struct snd_soc_component *component = codec_dai->component;
|
||||
struct snd_soc_jack_pin *pins;
|
||||
struct snd_soc_jack *jack;
|
||||
@ -121,7 +121,7 @@ static int avs_rt274_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
|
||||
static void avs_rt274_codec_exit(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
}
|
||||
|
||||
static int avs_rt274_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params)
|
||||
|
@ -67,12 +67,12 @@ static int avs_rt286_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return snd_soc_component_set_jack(asoc_rtd_to_codec(runtime, 0)->component, jack, NULL);
|
||||
return snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, jack, NULL);
|
||||
}
|
||||
|
||||
static void avs_rt286_codec_exit(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
}
|
||||
|
||||
static int avs_rt286_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params)
|
||||
@ -98,8 +98,8 @@ static int avs_rt286_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pc
|
||||
static int
|
||||
avs_rt286_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *runtime = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0);
|
||||
struct snd_soc_pcm_runtime *runtime = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
|
||||
int ret;
|
||||
|
||||
ret = snd_soc_dai_set_sysclk(codec_dai, RT286_SCLK_S_PLL, 24000000, SND_SOC_CLOCK_IN);
|
||||
|
@ -78,12 +78,12 @@ static int avs_rt298_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return snd_soc_component_set_jack(asoc_rtd_to_codec(runtime, 0)->component, jack, NULL);
|
||||
return snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, jack, NULL);
|
||||
}
|
||||
|
||||
static void avs_rt298_codec_exit(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
}
|
||||
|
||||
static int avs_rt298_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params)
|
||||
@ -109,8 +109,8 @@ static int avs_rt298_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pc
|
||||
static int
|
||||
avs_rt298_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
unsigned int clk_freq;
|
||||
int ret;
|
||||
|
||||
|
@ -79,14 +79,14 @@ static int avs_rt5663_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
|
||||
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
|
||||
|
||||
snd_soc_component_set_jack(asoc_rtd_to_codec(runtime, 0)->component, jack, NULL);
|
||||
snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, jack, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void avs_rt5663_codec_exit(struct snd_soc_pcm_runtime *runtime)
|
||||
{
|
||||
snd_soc_component_set_jack(asoc_rtd_to_codec(runtime, 0)->component, NULL, NULL);
|
||||
snd_soc_component_set_jack(snd_soc_rtd_to_codec(runtime, 0)->component, NULL, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -113,8 +113,8 @@ avs_rt5663_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_param
|
||||
static int avs_rt5663_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
int ret;
|
||||
|
||||
/* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */
|
||||
|
@ -92,7 +92,7 @@ static struct snd_soc_jack_pin card_jack_pins[] = {
|
||||
|
||||
static int avs_rt5682_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
{
|
||||
struct snd_soc_component *component = asoc_rtd_to_codec(runtime, 0)->component;
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(runtime, 0)->component;
|
||||
struct snd_soc_card *card = runtime->card;
|
||||
struct snd_soc_jack_pin *pins;
|
||||
struct snd_soc_jack *jack;
|
||||
@ -137,14 +137,14 @@ static int avs_rt5682_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
|
||||
static void avs_rt5682_codec_exit(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
snd_soc_component_set_jack(snd_soc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
avs_rt5682_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *runtime = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0);
|
||||
struct snd_soc_pcm_runtime *runtime = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(runtime, 0);
|
||||
int pll_source, freq_in, freq_out;
|
||||
int ret;
|
||||
|
||||
|
@ -50,12 +50,12 @@ static int avs_ssm4567_codec_init(struct snd_soc_pcm_runtime *runtime)
|
||||
int ret;
|
||||
|
||||
/* Slot 1 for left */
|
||||
ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_codec(runtime, 0), 0x01, 0x01, 2, 48);
|
||||
ret = snd_soc_dai_set_tdm_slot(snd_soc_rtd_to_codec(runtime, 0), 0x01, 0x01, 2, 48);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/* Slot 2 for right */
|
||||
ret = snd_soc_dai_set_tdm_slot(asoc_rtd_to_codec(runtime, 1), 0x02, 0x02, 2, 48);
|
||||
ret = snd_soc_dai_set_tdm_slot(snd_soc_rtd_to_codec(runtime, 1), 0x02, 0x02, 2, 48);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -58,7 +58,7 @@ avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction)
|
||||
static int avs_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai, bool is_fe,
|
||||
const struct snd_soc_dai_ops *ops)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct avs_dev *adev = to_avs_dev(dai->dev);
|
||||
struct avs_tplg_path_template *template;
|
||||
struct avs_dma_data *data;
|
||||
@ -127,7 +127,7 @@ static int avs_dai_be_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_pcm_runtime *fe, *be;
|
||||
struct snd_soc_dpcm *dpcm;
|
||||
|
||||
be = asoc_substream_to_rtd(substream);
|
||||
be = snd_soc_substream_to_rtd(substream);
|
||||
for_each_dpcm_fe(be, substream->stream, dpcm) {
|
||||
fe = dpcm->fe;
|
||||
fe_hw_params = &fe->dpcm[substream->stream].hw_params;
|
||||
@ -167,7 +167,7 @@ static int avs_dai_nonhda_be_startup(struct snd_pcm_substream *substream, struct
|
||||
|
||||
static void avs_dai_nonhda_be_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct avs_dev *adev = to_avs_dev(dai->dev);
|
||||
struct avs_dma_data *data;
|
||||
|
||||
@ -216,7 +216,7 @@ static int avs_dai_nonhda_be_prepare(struct snd_pcm_substream *substream, struct
|
||||
static int avs_dai_nonhda_be_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct avs_dma_data *data;
|
||||
int ret = 0;
|
||||
|
||||
@ -303,7 +303,7 @@ static int avs_dai_hda_be_hw_params(struct snd_pcm_substream *substream,
|
||||
static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct avs_dma_data *data;
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct hdac_ext_stream *link_stream;
|
||||
struct hdac_ext_link *link;
|
||||
struct hda_codec *codec;
|
||||
@ -320,7 +320,7 @@ static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct sn
|
||||
data->path = NULL;
|
||||
|
||||
/* clear link <-> stream mapping */
|
||||
codec = dev_to_hda_codec(asoc_rtd_to_codec(rtd, 0)->dev);
|
||||
codec = dev_to_hda_codec(snd_soc_rtd_to_codec(rtd, 0)->dev);
|
||||
link = snd_hdac_ext_bus_get_hlink_by_addr(&codec->bus->core, codec->core.addr);
|
||||
if (!link)
|
||||
return -EINVAL;
|
||||
@ -333,7 +333,7 @@ static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct sn
|
||||
|
||||
static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct hdac_ext_stream *link_stream = runtime->private_data;
|
||||
struct hdac_ext_link *link;
|
||||
@ -345,7 +345,7 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn
|
||||
if (link_stream->link_prepared)
|
||||
return 0;
|
||||
|
||||
codec = dev_to_hda_codec(asoc_rtd_to_codec(rtd, 0)->dev);
|
||||
codec = dev_to_hda_codec(snd_soc_rtd_to_codec(rtd, 0)->dev);
|
||||
bus = &codec->bus->core;
|
||||
format_val = snd_hdac_calc_stream_format(runtime->rate, runtime->channels, runtime->format,
|
||||
runtime->sample_bits, 0);
|
||||
@ -372,7 +372,7 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn
|
||||
static int avs_dai_hda_be_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct hdac_ext_stream *link_stream;
|
||||
struct avs_dma_data *data;
|
||||
int ret = 0;
|
||||
@ -500,7 +500,7 @@ err:
|
||||
|
||||
static void avs_dai_fe_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct avs_dev *adev = to_avs_dev(dai->dev);
|
||||
struct avs_dma_data *data;
|
||||
|
||||
@ -534,7 +534,7 @@ static int avs_dai_fe_hw_params(struct snd_pcm_substream *substream,
|
||||
hdac_stream(host_stream)->period_bytes = 0;
|
||||
hdac_stream(host_stream)->format_val = 0;
|
||||
|
||||
fe = asoc_substream_to_rtd(substream);
|
||||
fe = snd_soc_substream_to_rtd(substream);
|
||||
for_each_dpcm_be(fe, substream->stream, dpcm) {
|
||||
be = dpcm->be;
|
||||
be_hw_params = &be->dpcm[substream->stream].hw_params;
|
||||
@ -639,7 +639,7 @@ static int avs_dai_fe_prepare(struct snd_pcm_substream *substream, struct snd_so
|
||||
|
||||
static int avs_dai_fe_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct avs_dma_data *data;
|
||||
struct hdac_ext_stream *host_stream;
|
||||
struct hdac_bus *bus;
|
||||
@ -869,7 +869,7 @@ static int avs_dai_resume_hw_params(struct snd_soc_dai *dai, struct avs_dma_data
|
||||
int ret;
|
||||
|
||||
substream = data->substream;
|
||||
rtd = asoc_substream_to_rtd(substream);
|
||||
rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
ret = dai->driver->ops->hw_params(substream, &rtd->dpcm[substream->stream].hw_params, dai);
|
||||
if (ret)
|
||||
@ -964,7 +964,7 @@ static int avs_component_pm_op(struct snd_soc_component *component, bool be,
|
||||
for_each_component_dais(component, dai) {
|
||||
data = snd_soc_dai_dma_data_get_playback(dai);
|
||||
if (data) {
|
||||
rtd = asoc_substream_to_rtd(data->substream);
|
||||
rtd = snd_soc_substream_to_rtd(data->substream);
|
||||
if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) {
|
||||
ret = op(dai, data);
|
||||
if (ret < 0) {
|
||||
@ -977,7 +977,7 @@ static int avs_component_pm_op(struct snd_soc_component *component, bool be,
|
||||
|
||||
data = snd_soc_dai_dma_data_get_capture(dai);
|
||||
if (data) {
|
||||
rtd = asoc_substream_to_rtd(data->substream);
|
||||
rtd = snd_soc_substream_to_rtd(data->substream);
|
||||
if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) {
|
||||
ret = op(dai, data);
|
||||
if (ret < 0) {
|
||||
@ -1081,7 +1081,7 @@ static const struct snd_pcm_hardware avs_pcm_hardware = {
|
||||
static int avs_component_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
|
||||
/* only FE DAI links are handled here */
|
||||
if (rtd->dai_link->no_pcm)
|
||||
@ -1099,12 +1099,12 @@ static unsigned int avs_hda_stream_dpib_read(struct hdac_ext_stream *stream)
|
||||
static snd_pcm_uframes_t
|
||||
avs_component_pointer(struct snd_soc_component *component, struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct avs_dma_data *data;
|
||||
struct hdac_ext_stream *host_stream;
|
||||
unsigned int pos;
|
||||
|
||||
data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
data = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
if (!data->host_stream)
|
||||
return 0;
|
||||
|
||||
@ -1129,7 +1129,7 @@ static int avs_component_mmap(struct snd_soc_component *component,
|
||||
static int avs_component_construct(struct snd_soc_component *component,
|
||||
struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct snd_soc_dai *dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_pcm *pcm = rtd->pcm;
|
||||
|
||||
if (dai->driver->playback.channels_min)
|
||||
@ -1430,7 +1430,7 @@ static void avs_component_hda_remove(struct snd_soc_component *component)
|
||||
static int avs_component_hda_open(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct hdac_ext_stream *link_stream;
|
||||
struct hda_codec *codec;
|
||||
|
||||
@ -1464,7 +1464,7 @@ static int avs_component_hda_open(struct snd_soc_component *component,
|
||||
return snd_soc_set_runtime_hwparams(substream, &hwparams);
|
||||
}
|
||||
|
||||
codec = dev_to_hda_codec(asoc_rtd_to_codec(rtd, 0)->dev);
|
||||
codec = dev_to_hda_codec(snd_soc_rtd_to_codec(rtd, 0)->dev);
|
||||
link_stream = snd_hdac_ext_stream_assign(&codec->bus->core, substream,
|
||||
HDAC_EXT_STREAM_TYPE_LINK);
|
||||
if (!link_stream)
|
||||
@ -1477,7 +1477,7 @@ static int avs_component_hda_open(struct snd_soc_component *component,
|
||||
static int avs_component_hda_close(struct snd_soc_component *component,
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct hdac_ext_stream *link_stream;
|
||||
|
||||
/* only BE DAI links are handled here */
|
||||
|
@ -18,8 +18,8 @@
|
||||
static int a370db_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
unsigned int freq;
|
||||
|
||||
switch (params_rate(params)) {
|
||||
|
@ -20,7 +20,7 @@
|
||||
static struct kirkwood_dma_data *kirkwood_priv(struct snd_pcm_substream *subs)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *soc_runtime = subs->private_data;
|
||||
return snd_soc_dai_get_drvdata(asoc_rtd_to_cpu(soc_runtime, 0));
|
||||
return snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(soc_runtime, 0));
|
||||
}
|
||||
|
||||
static const struct snd_pcm_hardware kirkwood_dma_snd_hw = {
|
||||
|
@ -24,8 +24,8 @@ static int loongson_card_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct loongson_card_data *ls_card = snd_soc_card_get_drvdata(rtd->card);
|
||||
int ret, mclk;
|
||||
|
||||
|
@ -267,7 +267,7 @@ static int loongson_pcm_open(struct snd_soc_component *component,
|
||||
goto pos_err;
|
||||
}
|
||||
|
||||
dma_data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
|
||||
dma_data = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
|
||||
prtd->dma_data = dma_data;
|
||||
|
||||
substream->runtime->private_data = prtd;
|
||||
@ -321,7 +321,7 @@ static int loongson_pcm_new(struct snd_soc_component *component,
|
||||
if (!substream)
|
||||
continue;
|
||||
|
||||
dma_data = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0),
|
||||
dma_data = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0),
|
||||
substream);
|
||||
ret = devm_request_irq(card->dev, dma_data->irq,
|
||||
loongson_pcm_dma_irq,
|
||||
|
@ -27,7 +27,7 @@ static struct snd_soc_dai *aiu_fifo_dai(struct snd_pcm_substream *ss)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = ss->private_data;
|
||||
|
||||
return asoc_rtd_to_cpu(rtd, 0);
|
||||
return snd_soc_rtd_to_cpu(rtd, 0);
|
||||
}
|
||||
|
||||
snd_pcm_uframes_t aiu_fifo_pointer(struct snd_soc_component *component,
|
||||
|
@ -40,7 +40,7 @@ static const struct snd_soc_pcm_stream codec_params = {
|
||||
static int axg_card_tdm_be_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct meson_card *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct axg_dai_link_tdm_data *be =
|
||||
(struct axg_dai_link_tdm_data *)priv->link_data[rtd->num];
|
||||
@ -72,10 +72,10 @@ static int axg_card_tdm_dai_init(struct snd_soc_pcm_runtime *rtd)
|
||||
}
|
||||
}
|
||||
|
||||
ret = axg_tdm_set_tdm_slots(asoc_rtd_to_cpu(rtd, 0), be->tx_mask, be->rx_mask,
|
||||
ret = axg_tdm_set_tdm_slots(snd_soc_rtd_to_cpu(rtd, 0), be->tx_mask, be->rx_mask,
|
||||
be->slots, be->slot_width);
|
||||
if (ret) {
|
||||
dev_err(asoc_rtd_to_cpu(rtd, 0)->dev, "setting tdm link slots failed\n");
|
||||
dev_err(snd_soc_rtd_to_cpu(rtd, 0)->dev, "setting tdm link slots failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -90,10 +90,10 @@ static int axg_card_tdm_dai_lb_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int ret;
|
||||
|
||||
/* The loopback rx_mask is the pad tx_mask */
|
||||
ret = axg_tdm_set_tdm_slots(asoc_rtd_to_cpu(rtd, 0), NULL, be->tx_mask,
|
||||
ret = axg_tdm_set_tdm_slots(snd_soc_rtd_to_cpu(rtd, 0), NULL, be->tx_mask,
|
||||
be->slots, be->slot_width);
|
||||
if (ret) {
|
||||
dev_err(asoc_rtd_to_cpu(rtd, 0)->dev, "setting tdm link slots failed\n");
|
||||
dev_err(snd_soc_rtd_to_cpu(rtd, 0)->dev, "setting tdm link slots failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ static int axg_card_add_tdm_loopback(struct snd_soc_card *card,
|
||||
return -ENOMEM;
|
||||
|
||||
lb->cpus = dlc;
|
||||
lb->codecs = &asoc_dummy_dlc;
|
||||
lb->codecs = &snd_soc_dummy_dlc;
|
||||
lb->num_cpus = 1;
|
||||
lb->num_codecs = 1;
|
||||
|
||||
|
@ -47,7 +47,7 @@ static struct snd_soc_dai *axg_fifo_dai(struct snd_pcm_substream *ss)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = ss->private_data;
|
||||
|
||||
return asoc_rtd_to_cpu(rtd, 0);
|
||||
return snd_soc_rtd_to_cpu(rtd, 0);
|
||||
}
|
||||
|
||||
static struct axg_fifo *axg_fifo_data(struct snd_pcm_substream *ss)
|
||||
|
@ -29,7 +29,7 @@ static const struct snd_soc_pcm_stream codec_params = {
|
||||
static int gx_card_i2s_be_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct meson_card *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct gx_dai_link_i2s_data *be =
|
||||
(struct gx_dai_link_i2s_data *)priv->link_data[rtd->num];
|
||||
|
@ -13,7 +13,7 @@ int meson_card_i2s_set_sysclk(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
unsigned int mclk_fs)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
unsigned int mclk;
|
||||
int ret, i;
|
||||
@ -30,7 +30,7 @@ int meson_card_i2s_set_sysclk(struct snd_pcm_substream *substream,
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = snd_soc_dai_set_sysclk(asoc_rtd_to_cpu(rtd, 0), 0, mclk,
|
||||
ret = snd_soc_dai_set_sysclk(snd_soc_rtd_to_cpu(rtd, 0), 0, mclk,
|
||||
SND_SOC_CLOCK_OUT);
|
||||
if (ret && ret != -ENOTSUPP)
|
||||
return ret;
|
||||
@ -177,7 +177,7 @@ int meson_card_set_fe_link(struct snd_soc_card *card,
|
||||
struct device_node *node,
|
||||
bool is_playback)
|
||||
{
|
||||
link->codecs = &asoc_dummy_dlc;
|
||||
link->codecs = &snd_soc_dummy_dlc;
|
||||
link->num_codecs = 1;
|
||||
|
||||
link->dynamic = 1;
|
||||
|
@ -98,7 +98,7 @@ EXPORT_SYMBOL_GPL(meson_codec_glue_input_set_fmt);
|
||||
int meson_codec_glue_output_startup(struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget_capture(dai);
|
||||
struct meson_codec_glue_input *in_data = meson_codec_glue_output_get_input_data(w);
|
||||
|
||||
|
@ -19,9 +19,9 @@
|
||||
static int mxs_sgtl5000_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
unsigned int rate = params_rate(params);
|
||||
u32 mclk;
|
||||
int ret;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user