Compare commits
9 commits
v6.6-order
...
v6.7
Author | SHA1 | Date | |
---|---|---|---|
|
899fdb1e5b | ||
|
8448ced150 | ||
|
afeaee0500 | ||
|
560b0e02a1 | ||
|
205fd0198d | ||
|
1ae8b116b0 | ||
|
651f208785 | ||
|
cc75decb61 | ||
|
073ad5d467 |
3 changed files with 70 additions and 69 deletions
2
ac101.c
2
ac101.c
|
@ -1280,13 +1280,11 @@ int ac101_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||||
ret = ret || ac101_update_bits(codec, MOD_RST_CTRL, (0x1<<MOD_RESET_AIF1), (0x1<<MOD_RESET_AIF1));
|
ret = ret || ac101_update_bits(codec, MOD_RST_CTRL, (0x1<<MOD_RESET_AIF1), (0x1<<MOD_RESET_AIF1));
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&ac10x->lock, flags);
|
spin_unlock_irqrestore(&ac10x->lock, flags);
|
||||||
ac101_set_clock(1, substream, cmd, dai);
|
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case SNDRV_PCM_TRIGGER_STOP:
|
case SNDRV_PCM_TRIGGER_STOP:
|
||||||
case SNDRV_PCM_TRIGGER_SUSPEND:
|
case SNDRV_PCM_TRIGGER_SUSPEND:
|
||||||
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
||||||
ac101_set_clock(0, NULL, 0, NULL);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
|
|
9
ac108.c
9
ac108.c
|
@ -999,7 +999,7 @@ static int ac108_set_clock(int y_start_n_stop, struct snd_pcm_substream *substre
|
||||||
|
|
||||||
/* spin_lock move to machine trigger */
|
/* spin_lock move to machine trigger */
|
||||||
|
|
||||||
if (ac10x->i2c101 && _MASTER_MULTI_CODEC == _MASTER_AC101) {
|
if (y_start_n_stop && ac10x->i2c101 && _MASTER_MULTI_CODEC == _MASTER_AC101) {
|
||||||
ac101_trigger(substream, cmd, dai);
|
ac101_trigger(substream, cmd, dai);
|
||||||
}
|
}
|
||||||
if (y_start_n_stop && ac10x->sysclk_en == 0) {
|
if (y_start_n_stop && ac10x->sysclk_en == 0) {
|
||||||
|
@ -1073,12 +1073,15 @@ static int ac108_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||||
ac108_multi_update_bits(I2S_CTRL, 0x1 << TXEN | 0x1 << GEN, 0x0 << TXEN | 0x0 << GEN, ac10x);
|
ac108_multi_update_bits(I2S_CTRL, 0x1 << TXEN | 0x1 << GEN, 0x0 << TXEN | 0x0 << GEN, ac10x);
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&ac10x->lock, flags);
|
spin_unlock_irqrestore(&ac10x->lock, flags);
|
||||||
ac108_set_clock(1, substream, cmd, dai);
|
|
||||||
|
/* delayed clock starting, move to machine trigger() */
|
||||||
break;
|
break;
|
||||||
case SNDRV_PCM_TRIGGER_STOP:
|
case SNDRV_PCM_TRIGGER_STOP:
|
||||||
case SNDRV_PCM_TRIGGER_SUSPEND:
|
case SNDRV_PCM_TRIGGER_SUSPEND:
|
||||||
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
||||||
ac108_set_clock(0, substream, cmd, dai);
|
if (ac10x->i2c101 && _MASTER_MULTI_CODEC == _MASTER_AC101) {
|
||||||
|
ac101_trigger(substream, cmd, dai);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
|
|
|
@ -32,16 +32,16 @@
|
||||||
|
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)
|
||||||
#define asoc_simple_parse_clk_cpu(dev, node, dai_link, simple_dai) \
|
#define simple_util_parse_clk_cpu(dev, node, dai_link, simple_dai) \
|
||||||
asoc_simple_parse_clk(dev, node, simple_dai, dai_link->cpus)
|
simple_util_parse_clk(dev, node, simple_dai, dai_link->cpus)
|
||||||
#define asoc_simple_parse_clk_codec(dev, node, dai_link, simple_dai) \
|
#define simple_util_parse_clk_codec(dev, node, dai_link, simple_dai) \
|
||||||
asoc_simple_parse_clk(dev, node, simple_dai, dai_link->codecs)
|
simple_util_parse_clk(dev, node, simple_dai, dai_link->codecs)
|
||||||
#define asoc_simple_parse_cpu(node, dai_link, is_single_link) \
|
#define simple_util_parse_cpu(node, dai_link, is_single_link) \
|
||||||
asoc_simple_parse_dai(node, dai_link->cpus, is_single_link)
|
simple_util_parse_dai(node, dai_link->cpus, is_single_link)
|
||||||
#define asoc_simple_parse_codec(node, dai_link) \
|
#define simple_util_parse_codec(node, dai_link) \
|
||||||
asoc_simple_parse_dai(node, dai_link->codecs, NULL)
|
simple_util_parse_dai(node, dai_link->codecs, NULL)
|
||||||
#define asoc_simple_parse_platform(node, dai_link) \
|
#define simple_util_parse_platform(node, dai_link) \
|
||||||
asoc_simple_parse_dai(node, dai_link->platforms, NULL)
|
simple_util_parse_dai(node, dai_link->platforms, NULL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -54,8 +54,8 @@
|
||||||
struct seeed_card_data {
|
struct seeed_card_data {
|
||||||
struct snd_soc_card snd_card;
|
struct snd_soc_card snd_card;
|
||||||
struct seeed_dai_props {
|
struct seeed_dai_props {
|
||||||
struct asoc_simple_dai cpu_dai;
|
struct simple_util_dai cpu_dai;
|
||||||
struct asoc_simple_dai codec_dai;
|
struct simple_util_dai codec_dai;
|
||||||
struct snd_soc_dai_link_component cpus; /* single cpu */
|
struct snd_soc_dai_link_component cpus; /* single cpu */
|
||||||
struct snd_soc_dai_link_component codecs; /* single codec */
|
struct snd_soc_dai_link_component codecs; /* single codec */
|
||||||
struct snd_soc_dai_link_component platforms;
|
struct snd_soc_dai_link_component platforms;
|
||||||
|
@ -82,8 +82,8 @@ struct seeed_card_info {
|
||||||
const char *platform;
|
const char *platform;
|
||||||
|
|
||||||
unsigned int daifmt;
|
unsigned int daifmt;
|
||||||
struct asoc_simple_dai cpu_dai;
|
struct simple_util_dai cpu_dai;
|
||||||
struct asoc_simple_dai codec_dai;
|
struct simple_util_dai codec_dai;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define seeed_priv_to_card(priv) (&(priv)->snd_card)
|
#define seeed_priv_to_card(priv) (&(priv)->snd_card)
|
||||||
|
@ -111,16 +111,16 @@ static int seeed_voice_card_startup(struct snd_pcm_substream *substream)
|
||||||
if (ret)
|
if (ret)
|
||||||
clk_disable_unprepare(dai_props->cpu_dai.clk);
|
clk_disable_unprepare(dai_props->cpu_dai.clk);
|
||||||
|
|
||||||
if (asoc_rtd_to_cpu(rtd, 0)->driver->playback.channels_min) {
|
if (snd_soc_rtd_to_cpu(rtd, 0)->driver->playback.channels_min) {
|
||||||
priv->channels_playback_default = asoc_rtd_to_cpu(rtd, 0)->driver->playback.channels_min;
|
priv->channels_playback_default = snd_soc_rtd_to_cpu(rtd, 0)->driver->playback.channels_min;
|
||||||
}
|
}
|
||||||
if (asoc_rtd_to_cpu(rtd, 0)->driver->capture.channels_min) {
|
if (snd_soc_rtd_to_cpu(rtd, 0)->driver->capture.channels_min) {
|
||||||
priv->channels_capture_default = asoc_rtd_to_cpu(rtd, 0)->driver->capture.channels_min;
|
priv->channels_capture_default = snd_soc_rtd_to_cpu(rtd, 0)->driver->capture.channels_min;
|
||||||
}
|
}
|
||||||
asoc_rtd_to_cpu(rtd, 0)->driver->playback.channels_min = priv->channels_playback_override;
|
snd_soc_rtd_to_cpu(rtd, 0)->driver->playback.channels_min = priv->channels_playback_override;
|
||||||
asoc_rtd_to_cpu(rtd, 0)->driver->playback.channels_max = priv->channels_playback_override;
|
snd_soc_rtd_to_cpu(rtd, 0)->driver->playback.channels_max = priv->channels_playback_override;
|
||||||
asoc_rtd_to_cpu(rtd, 0)->driver->capture.channels_min = priv->channels_capture_override;
|
snd_soc_rtd_to_cpu(rtd, 0)->driver->capture.channels_min = priv->channels_capture_override;
|
||||||
asoc_rtd_to_cpu(rtd, 0)->driver->capture.channels_max = priv->channels_capture_override;
|
snd_soc_rtd_to_cpu(rtd, 0)->driver->capture.channels_max = priv->channels_capture_override;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -132,10 +132,10 @@ static void seeed_voice_card_shutdown(struct snd_pcm_substream *substream)
|
||||||
struct seeed_dai_props *dai_props =
|
struct seeed_dai_props *dai_props =
|
||||||
seeed_priv_to_props(priv, rtd->num);
|
seeed_priv_to_props(priv, rtd->num);
|
||||||
|
|
||||||
asoc_rtd_to_cpu(rtd, 0)->driver->playback.channels_min = priv->channels_playback_default;
|
snd_soc_rtd_to_cpu(rtd, 0)->driver->playback.channels_min = priv->channels_playback_default;
|
||||||
asoc_rtd_to_cpu(rtd, 0)->driver->playback.channels_max = priv->channels_playback_default;
|
snd_soc_rtd_to_cpu(rtd, 0)->driver->playback.channels_max = priv->channels_playback_default;
|
||||||
asoc_rtd_to_cpu(rtd, 0)->driver->capture.channels_min = priv->channels_capture_default;
|
snd_soc_rtd_to_cpu(rtd, 0)->driver->capture.channels_min = priv->channels_capture_default;
|
||||||
asoc_rtd_to_cpu(rtd, 0)->driver->capture.channels_max = priv->channels_capture_default;
|
snd_soc_rtd_to_cpu(rtd, 0)->driver->capture.channels_max = priv->channels_capture_default;
|
||||||
|
|
||||||
clk_disable_unprepare(dai_props->cpu_dai.clk);
|
clk_disable_unprepare(dai_props->cpu_dai.clk);
|
||||||
|
|
||||||
|
@ -146,8 +146,8 @@ static int seeed_voice_card_hw_params(struct snd_pcm_substream *substream,
|
||||||
struct snd_pcm_hw_params *params)
|
struct snd_pcm_hw_params *params)
|
||||||
{
|
{
|
||||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||||
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_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||||
struct seeed_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
|
struct seeed_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||||
struct seeed_dai_props *dai_props =
|
struct seeed_dai_props *dai_props =
|
||||||
seeed_priv_to_props(priv, rtd->num);
|
seeed_priv_to_props(priv, rtd->num);
|
||||||
|
@ -211,7 +211,7 @@ static void work_cb_codec_clk(struct work_struct *work)
|
||||||
static int seeed_voice_card_trigger(struct snd_pcm_substream *substream, int cmd)
|
static int seeed_voice_card_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||||
{
|
{
|
||||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||||
struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0);
|
struct snd_soc_dai *dai = snd_soc_rtd_to_codec(rtd, 0);
|
||||||
struct seeed_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
|
struct seeed_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||||
#if CONFIG_AC10X_TRIG_LOCK
|
#if CONFIG_AC10X_TRIG_LOCK
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
@ -231,8 +231,8 @@ static int seeed_voice_card_trigger(struct snd_pcm_substream *substream, int cmd
|
||||||
/* I know it will degrades performance, but I have no choice */
|
/* I know it will degrades performance, but I have no choice */
|
||||||
spin_lock_irqsave(&priv->lock, flags);
|
spin_lock_irqsave(&priv->lock, flags);
|
||||||
#endif
|
#endif
|
||||||
// if (_set_clock[SNDRV_PCM_STREAM_CAPTURE]) _set_clock[SNDRV_PCM_STREAM_CAPTURE](1, substream, cmd, dai);
|
if (_set_clock[SNDRV_PCM_STREAM_CAPTURE]) _set_clock[SNDRV_PCM_STREAM_CAPTURE](1, substream, cmd, dai);
|
||||||
// if (_set_clock[SNDRV_PCM_STREAM_PLAYBACK]) _set_clock[SNDRV_PCM_STREAM_PLAYBACK](1, substream, cmd, dai);
|
if (_set_clock[SNDRV_PCM_STREAM_PLAYBACK]) _set_clock[SNDRV_PCM_STREAM_PLAYBACK](1, substream, cmd, dai);
|
||||||
#if CONFIG_AC10X_TRIG_LOCK
|
#if CONFIG_AC10X_TRIG_LOCK
|
||||||
spin_unlock_irqrestore(&priv->lock, flags);
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
#endif
|
#endif
|
||||||
|
@ -252,8 +252,8 @@ static int seeed_voice_card_trigger(struct snd_pcm_substream *substream, int cmd
|
||||||
if (0 != schedule_work(&priv->work_codec_clk)) {
|
if (0 != schedule_work(&priv->work_codec_clk)) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// if (_set_clock[SNDRV_PCM_STREAM_CAPTURE]) _set_clock[SNDRV_PCM_STREAM_CAPTURE](0, NULL, 0, NULL); /* not using 2nd to 4th arg if 1st == 0 */
|
if (_set_clock[SNDRV_PCM_STREAM_CAPTURE]) _set_clock[SNDRV_PCM_STREAM_CAPTURE](0, NULL, 0, NULL); /* not using 2nd to 4th arg if 1st == 0 */
|
||||||
// if (_set_clock[SNDRV_PCM_STREAM_PLAYBACK]) _set_clock[SNDRV_PCM_STREAM_PLAYBACK](0, NULL, 0, NULL); /* not using 2nd to 4th arg if 1st == 0 */
|
if (_set_clock[SNDRV_PCM_STREAM_PLAYBACK]) _set_clock[SNDRV_PCM_STREAM_PLAYBACK](0, NULL, 0, NULL); /* not using 2nd to 4th arg if 1st == 0 */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -274,7 +274,7 @@ static struct snd_soc_ops seeed_voice_card_ops = {
|
||||||
.trigger = seeed_voice_card_trigger,
|
.trigger = seeed_voice_card_trigger,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int asoc_simple_parse_dai(struct device_node *node,
|
static int simple_util_parse_dai(struct device_node *node,
|
||||||
struct snd_soc_dai_link_component *dlc,
|
struct snd_soc_dai_link_component *dlc,
|
||||||
int *is_single_link)
|
int *is_single_link)
|
||||||
{
|
{
|
||||||
|
@ -323,8 +323,8 @@ static int asoc_simple_parse_dai(struct device_node *node,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int asoc_simple_init_dai(struct snd_soc_dai *dai,
|
static int simple_util_init_dai(struct snd_soc_dai *dai,
|
||||||
struct asoc_simple_dai *simple_dai)
|
struct simple_util_dai *simple_dai)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -354,12 +354,12 @@ static int asoc_simple_init_dai(struct snd_soc_dai *dai,
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)
|
||||||
static inline int asoc_simple_component_is_codec(struct snd_soc_component *component)
|
static inline int simple_util_component_is_codec(struct snd_soc_component *component)
|
||||||
{
|
{
|
||||||
return component->driver->endianness;
|
return component->driver->endianness;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int asoc_simple_init_dai_link_params(struct snd_soc_pcm_runtime *rtd)
|
static int simple_util_init_dai_link_params(struct snd_soc_pcm_runtime *rtd)
|
||||||
{
|
{
|
||||||
struct snd_soc_dai_link *dai_link = rtd->dai_link;
|
struct snd_soc_dai_link *dai_link = rtd->dai_link;
|
||||||
struct snd_soc_component *component;
|
struct snd_soc_component *component;
|
||||||
|
@ -369,7 +369,7 @@ static int asoc_simple_init_dai_link_params(struct snd_soc_pcm_runtime *rtd)
|
||||||
|
|
||||||
/* Only Codecs */
|
/* Only Codecs */
|
||||||
for_each_rtd_components(rtd, i, component) {
|
for_each_rtd_components(rtd, i, component) {
|
||||||
if (!asoc_simple_component_is_codec(component))
|
if (!simple_util_component_is_codec(component))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,22 +412,22 @@ static int asoc_simple_init_dai_link_params(struct snd_soc_pcm_runtime *rtd)
|
||||||
static int seeed_voice_card_dai_init(struct snd_soc_pcm_runtime *rtd)
|
static int seeed_voice_card_dai_init(struct snd_soc_pcm_runtime *rtd)
|
||||||
{
|
{
|
||||||
struct seeed_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
|
struct seeed_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
|
||||||
struct snd_soc_dai *codec = asoc_rtd_to_codec(rtd, 0);
|
struct snd_soc_dai *codec = snd_soc_rtd_to_codec(rtd, 0);
|
||||||
struct snd_soc_dai *cpu = asoc_rtd_to_cpu(rtd, 0);
|
struct snd_soc_dai *cpu = snd_soc_rtd_to_cpu(rtd, 0);
|
||||||
struct seeed_dai_props *dai_props =
|
struct seeed_dai_props *dai_props =
|
||||||
seeed_priv_to_props(priv, rtd->num);
|
seeed_priv_to_props(priv, rtd->num);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = asoc_simple_init_dai(codec, &dai_props->codec_dai);
|
ret = simple_util_init_dai(codec, &dai_props->codec_dai);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = asoc_simple_init_dai(cpu, &dai_props->cpu_dai);
|
ret = simple_util_init_dai(cpu, &dai_props->cpu_dai);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)
|
||||||
ret = asoc_simple_init_dai_link_params(rtd);
|
ret = simple_util_init_dai_link_params(rtd);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
|
@ -444,8 +444,8 @@ static int seeed_voice_card_dai_link_of(struct device_node *node,
|
||||||
struct device *dev = seeed_priv_to_dev(priv);
|
struct device *dev = seeed_priv_to_dev(priv);
|
||||||
struct snd_soc_dai_link *dai_link = seeed_priv_to_link(priv, idx);
|
struct snd_soc_dai_link *dai_link = seeed_priv_to_link(priv, idx);
|
||||||
struct seeed_dai_props *dai_props = seeed_priv_to_props(priv, idx);
|
struct seeed_dai_props *dai_props = seeed_priv_to_props(priv, idx);
|
||||||
struct asoc_simple_dai *cpu_dai = &dai_props->cpu_dai;
|
struct simple_util_dai *cpu_dai = &dai_props->cpu_dai;
|
||||||
struct asoc_simple_dai *codec_dai = &dai_props->codec_dai;
|
struct simple_util_dai *codec_dai = &dai_props->codec_dai;
|
||||||
struct device_node *cpu = NULL;
|
struct device_node *cpu = NULL;
|
||||||
struct device_node *plat = NULL;
|
struct device_node *plat = NULL;
|
||||||
struct device_node *codec = NULL;
|
struct device_node *codec = NULL;
|
||||||
|
@ -478,19 +478,19 @@ static int seeed_voice_card_dai_link_of(struct device_node *node,
|
||||||
goto dai_link_of_err;
|
goto dai_link_of_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = asoc_simple_parse_daifmt(dev, node, codec,
|
ret = simple_util_parse_daifmt(dev, node, codec,
|
||||||
prefix, &dai_link->dai_fmt);
|
prefix, &dai_link->dai_fmt);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto dai_link_of_err;
|
goto dai_link_of_err;
|
||||||
|
|
||||||
of_property_read_u32(node, "mclk-fs", &dai_props->mclk_fs);
|
of_property_read_u32(node, "mclk-fs", &dai_props->mclk_fs);
|
||||||
|
|
||||||
ret = asoc_simple_parse_cpu(cpu, dai_link, &single_cpu);
|
ret = simple_util_parse_cpu(cpu, dai_link, &single_cpu);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto dai_link_of_err;
|
goto dai_link_of_err;
|
||||||
|
|
||||||
#if _SINGLE_CODEC
|
#if _SINGLE_CODEC
|
||||||
ret = asoc_simple_parse_codec(codec, dai_link);
|
ret = simple_util_parse_codec(codec, dai_link);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto dai_link_of_err;
|
goto dai_link_of_err;
|
||||||
#else
|
#else
|
||||||
|
@ -502,7 +502,7 @@ static int seeed_voice_card_dai_link_of(struct device_node *node,
|
||||||
dev_dbg(dev, "dai_link num_codecs = %d\n", dai_link->num_codecs);
|
dev_dbg(dev, "dai_link num_codecs = %d\n", dai_link->num_codecs);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret = asoc_simple_parse_platform(plat, dai_link);
|
ret = simple_util_parse_platform(plat, dai_link);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto dai_link_of_err;
|
goto dai_link_of_err;
|
||||||
|
|
||||||
|
@ -525,22 +525,22 @@ static int seeed_voice_card_dai_link_of(struct device_node *node,
|
||||||
goto dai_link_of_err;
|
goto dai_link_of_err;
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,10,0)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,10,0)
|
||||||
ret = asoc_simple_card_parse_clk_cpu(cpu, dai_link, cpu_dai);
|
ret = simple_util_card_parse_clk_cpu(cpu, dai_link, cpu_dai);
|
||||||
#else
|
#else
|
||||||
ret = asoc_simple_parse_clk_cpu(dev, cpu, dai_link, cpu_dai);
|
ret = simple_util_parse_clk_cpu(dev, cpu, dai_link, cpu_dai);
|
||||||
#endif
|
#endif
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto dai_link_of_err;
|
goto dai_link_of_err;
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,10,0)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,10,0)
|
||||||
ret = asoc_simple_card_parse_clk_codec(codec, dai_link, codec_dai);
|
ret = simple_util_card_parse_clk_codec(codec, dai_link, codec_dai);
|
||||||
#else
|
#else
|
||||||
ret = asoc_simple_parse_clk_codec(dev, codec, dai_link, codec_dai);
|
ret = simple_util_parse_clk_codec(dev, codec, dai_link, codec_dai);
|
||||||
#endif
|
#endif
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto dai_link_of_err;
|
goto dai_link_of_err;
|
||||||
|
|
||||||
ret = asoc_simple_set_dailink_name(dev, dai_link,
|
ret = simple_util_set_dailink_name(dev, dai_link,
|
||||||
"%s-%s",
|
"%s-%s",
|
||||||
dai_link->cpus->dai_name,
|
dai_link->cpus->dai_name,
|
||||||
#if _SINGLE_CODEC
|
#if _SINGLE_CODEC
|
||||||
|
@ -569,14 +569,14 @@ static int seeed_voice_card_dai_link_of(struct device_node *node,
|
||||||
dai_props->codec_dai.sysclk);
|
dai_props->codec_dai.sysclk);
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,13,0)
|
||||||
asoc_simple_canonicalize_cpu(dai_link->cpus, single_cpu);
|
simple_util_canonicalize_cpu(dai_link->cpus, single_cpu);
|
||||||
#if _SINGLE_CODEC
|
#if _SINGLE_CODEC
|
||||||
asoc_simple_canonicalize_platform(dai_link->platforms, dai_link->cpus);
|
simple_util_canonicalize_platform(dai_link->platforms, dai_link->cpus);
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
asoc_simple_canonicalize_cpu(dai_link, single_cpu);
|
simple_util_canonicalize_cpu(dai_link, single_cpu);
|
||||||
#if _SINGLE_CODEC
|
#if _SINGLE_CODEC
|
||||||
asoc_simple_canonicalize_platform(dai_link);
|
simple_util_canonicalize_platform(dai_link);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -670,7 +670,7 @@ static int seeed_voice_card_parse_of(struct device_node *node,
|
||||||
goto card_parse_end;
|
goto card_parse_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = asoc_simple_parse_card_name(&priv->snd_card, PREFIX);
|
ret = simple_util_parse_card_name(&priv->snd_card, PREFIX);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto card_parse_end;
|
goto card_parse_end;
|
||||||
|
|
||||||
|
@ -698,7 +698,7 @@ card_parse_end:
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
inline void seeed_debug_dai(struct seeed_card_data *priv,
|
inline void seeed_debug_dai(struct seeed_card_data *priv,
|
||||||
char *name,
|
char *name,
|
||||||
struct asoc_simple_dai *dai)
|
struct simple_util_dai *dai)
|
||||||
{
|
{
|
||||||
struct device *dev = seeed_priv_to_dev(priv);
|
struct device *dev = seeed_priv_to_dev(priv);
|
||||||
|
|
||||||
|
@ -801,7 +801,7 @@ static int seeed_voice_card_probe(struct platform_device *pdev)
|
||||||
*
|
*
|
||||||
* "platform" might be removed
|
* "platform" might be removed
|
||||||
* see
|
* see
|
||||||
* simple-card-utils.c :: asoc_simple_canonicalize_platform()
|
* simple-card-utils.c :: simple_util_canonicalize_platform()
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
dai_link[i].cpus = &dai_props[i].cpus;
|
dai_link[i].cpus = &dai_props[i].cpus;
|
||||||
|
@ -885,7 +885,7 @@ static int seeed_voice_card_probe(struct platform_device *pdev)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
asoc_simple_clean_reference(&priv->snd_card);
|
simple_util_clean_reference(&priv->snd_card);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -897,7 +897,7 @@ static int seeed_voice_card_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
if (cancel_work_sync(&priv->work_codec_clk) != 0) {
|
if (cancel_work_sync(&priv->work_codec_clk) != 0) {
|
||||||
}
|
}
|
||||||
asoc_simple_clean_reference(card);
|
simple_util_clean_reference(card);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue