Commit 1450da3c authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branch 'asoc/topic/core' into asoc-next

parents 0f4019e6 15b8e94f
...@@ -252,7 +252,6 @@ struct snd_soc_dai { ...@@ -252,7 +252,6 @@ struct snd_soc_dai {
unsigned int symmetric_rates:1; unsigned int symmetric_rates:1;
unsigned int symmetric_channels:1; unsigned int symmetric_channels:1;
unsigned int symmetric_samplebits:1; unsigned int symmetric_samplebits:1;
struct snd_pcm_runtime *runtime;
unsigned int active; unsigned int active;
unsigned char probed:1; unsigned char probed:1;
...@@ -277,7 +276,6 @@ struct snd_soc_dai { ...@@ -277,7 +276,6 @@ struct snd_soc_dai {
struct snd_soc_card *card; struct snd_soc_card *card;
struct list_head list; struct list_head list;
struct list_head card_list;
}; };
static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
......
...@@ -266,6 +266,13 @@ ...@@ -266,6 +266,13 @@
{.base = xbase, .num_regs = xregs, \ {.base = xbase, .num_regs = xregs, \
.mask = xmask }) } .mask = xmask }) }
#define SND_SOC_BYTES_EXT(xname, xcount, xhandler_get, xhandler_put) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.info = snd_soc_bytes_info_ext, \
.get = xhandler_get, .put = xhandler_put, \
.private_value = (unsigned long)&(struct soc_bytes_ext) \
{.max = xcount} }
#define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \ #define SOC_SINGLE_XR_SX(xname, xregbase, xregcount, xnbits, \
xmin, xmax, xinvert) \ xmin, xmax, xinvert) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
...@@ -532,6 +539,8 @@ int snd_soc_bytes_get(struct snd_kcontrol *kcontrol, ...@@ -532,6 +539,8 @@ int snd_soc_bytes_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol); struct snd_ctl_elem_value *ucontrol);
int snd_soc_bytes_put(struct snd_kcontrol *kcontrol, int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol); struct snd_ctl_elem_value *ucontrol);
int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *ucontrol);
int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol, int snd_soc_info_xr_sx(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo); struct snd_ctl_elem_info *uinfo);
int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol, int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol,
...@@ -692,7 +701,6 @@ struct snd_soc_codec { ...@@ -692,7 +701,6 @@ struct snd_soc_codec {
struct snd_soc_card *card; struct snd_soc_card *card;
struct list_head list; struct list_head list;
struct list_head card_list; struct list_head card_list;
int num_dai;
/* runtime */ /* runtime */
struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
...@@ -949,7 +957,6 @@ struct snd_soc_card { ...@@ -949,7 +957,6 @@ struct snd_soc_card {
struct snd_card *snd_card; struct snd_card *snd_card;
struct module *owner; struct module *owner;
struct list_head list;
struct mutex mutex; struct mutex mutex;
struct mutex dapm_mutex; struct mutex dapm_mutex;
...@@ -1012,7 +1019,6 @@ struct snd_soc_card { ...@@ -1012,7 +1019,6 @@ struct snd_soc_card {
/* lists of probed devices belonging to this card */ /* lists of probed devices belonging to this card */
struct list_head codec_dev_list; struct list_head codec_dev_list;
struct list_head platform_dev_list; struct list_head platform_dev_list;
struct list_head dai_dev_list;
struct list_head widgets; struct list_head widgets;
struct list_head paths; struct list_head paths;
...@@ -1082,6 +1088,10 @@ struct soc_bytes { ...@@ -1082,6 +1088,10 @@ struct soc_bytes {
u32 mask; u32 mask;
}; };
struct soc_bytes_ext {
int max;
};
/* multi register control */ /* multi register control */
struct soc_mreg_control { struct soc_mreg_control {
long min, max; long min, max;
...@@ -1194,7 +1204,6 @@ static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd) ...@@ -1194,7 +1204,6 @@ static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
{ {
INIT_LIST_HEAD(&card->dai_dev_list);
INIT_LIST_HEAD(&card->codec_dev_list); INIT_LIST_HEAD(&card->codec_dev_list);
INIT_LIST_HEAD(&card->platform_dev_list); INIT_LIST_HEAD(&card->platform_dev_list);
INIT_LIST_HEAD(&card->widgets); INIT_LIST_HEAD(&card->widgets);
......
...@@ -76,12 +76,6 @@ struct atmel_runtime_data { ...@@ -76,12 +76,6 @@ struct atmel_runtime_data {
size_t period_size; size_t period_size;
dma_addr_t period_ptr; /* physical address of next period */ dma_addr_t period_ptr; /* physical address of next period */
/* PDC register save */
u32 pdc_xpr_save;
u32 pdc_xcr_save;
u32 pdc_xnpr_save;
u32 pdc_xncr_save;
}; };
/*--------------------------------------------------------------------------*\ /*--------------------------------------------------------------------------*\
...@@ -320,67 +314,10 @@ static struct snd_pcm_ops atmel_pcm_ops = { ...@@ -320,67 +314,10 @@ static struct snd_pcm_ops atmel_pcm_ops = {
.mmap = atmel_pcm_mmap, .mmap = atmel_pcm_mmap,
}; };
/*--------------------------------------------------------------------------*\
* ASoC platform driver
\*--------------------------------------------------------------------------*/
#ifdef CONFIG_PM
static int atmel_pcm_suspend(struct snd_soc_dai *dai)
{
struct snd_pcm_runtime *runtime = dai->runtime;
struct atmel_runtime_data *prtd;
struct atmel_pcm_dma_params *params;
if (!runtime)
return 0;
prtd = runtime->private_data;
params = prtd->params;
/* disable the PDC and save the PDC registers */
ssc_writel(params->ssc->regs, PDC_PTCR, params->mask->pdc_disable);
prtd->pdc_xpr_save = ssc_readx(params->ssc->regs, params->pdc->xpr);
prtd->pdc_xcr_save = ssc_readx(params->ssc->regs, params->pdc->xcr);
prtd->pdc_xnpr_save = ssc_readx(params->ssc->regs, params->pdc->xnpr);
prtd->pdc_xncr_save = ssc_readx(params->ssc->regs, params->pdc->xncr);
return 0;
}
static int atmel_pcm_resume(struct snd_soc_dai *dai)
{
struct snd_pcm_runtime *runtime = dai->runtime;
struct atmel_runtime_data *prtd;
struct atmel_pcm_dma_params *params;
if (!runtime)
return 0;
prtd = runtime->private_data;
params = prtd->params;
/* restore the PDC registers and enable the PDC */
ssc_writex(params->ssc->regs, params->pdc->xpr, prtd->pdc_xpr_save);
ssc_writex(params->ssc->regs, params->pdc->xcr, prtd->pdc_xcr_save);
ssc_writex(params->ssc->regs, params->pdc->xnpr, prtd->pdc_xnpr_save);
ssc_writex(params->ssc->regs, params->pdc->xncr, prtd->pdc_xncr_save);
ssc_writel(params->ssc->regs, PDC_PTCR, params->mask->pdc_enable);
return 0;
}
#else
#define atmel_pcm_suspend NULL
#define atmel_pcm_resume NULL
#endif
static struct snd_soc_platform_driver atmel_soc_platform = { static struct snd_soc_platform_driver atmel_soc_platform = {
.ops = &atmel_pcm_ops, .ops = &atmel_pcm_ops,
.pcm_new = atmel_pcm_new, .pcm_new = atmel_pcm_new,
.pcm_free = atmel_pcm_free, .pcm_free = atmel_pcm_free,
.suspend = atmel_pcm_suspend,
.resume = atmel_pcm_resume,
}; };
int atmel_pcm_pdc_platform_register(struct device *dev) int atmel_pcm_pdc_platform_register(struct device *dev)
......
...@@ -203,7 +203,6 @@ static int soc_compr_free(struct snd_compr_stream *cstream) ...@@ -203,7 +203,6 @@ static int soc_compr_free(struct snd_compr_stream *cstream)
if (platform->driver->compr_ops && platform->driver->compr_ops->free) if (platform->driver->compr_ops && platform->driver->compr_ops->free)
platform->driver->compr_ops->free(cstream); platform->driver->compr_ops->free(cstream);
cpu_dai->runtime = NULL;
if (cstream->direction == SND_COMPRESS_PLAYBACK) { if (cstream->direction == SND_COMPRESS_PLAYBACK) {
if (snd_soc_runtime_ignore_pmdown_time(rtd)) { if (snd_soc_runtime_ignore_pmdown_time(rtd)) {
...@@ -318,7 +317,8 @@ static int soc_compr_trigger_fe(struct snd_compr_stream *cstream, int cmd) ...@@ -318,7 +317,8 @@ static int soc_compr_trigger_fe(struct snd_compr_stream *cstream, int cmd)
if (platform->driver->compr_ops && if (platform->driver->compr_ops &&
platform->driver->compr_ops->trigger) platform->driver->compr_ops->trigger)
return platform->driver->compr_ops->trigger(cstream, cmd); return platform->driver->compr_ops->trigger(cstream,
cmd);
} }
if (cstream->direction == SND_COMPRESS_PLAYBACK) if (cstream->direction == SND_COMPRESS_PLAYBACK)
......
...@@ -1017,7 +1017,6 @@ static void soc_remove_codec_dai(struct snd_soc_dai *codec_dai, int order) ...@@ -1017,7 +1017,6 @@ static void soc_remove_codec_dai(struct snd_soc_dai *codec_dai, int order)
codec_dai->name, err); codec_dai->name, err);
} }
codec_dai->probed = 0; codec_dai->probed = 0;
list_del(&codec_dai->card_list);
} }
} }
...@@ -1049,7 +1048,6 @@ static void soc_remove_link_dais(struct snd_soc_card *card, int num, int order) ...@@ -1049,7 +1048,6 @@ static void soc_remove_link_dais(struct snd_soc_card *card, int num, int order)
cpu_dai->name, err); cpu_dai->name, err);
} }
cpu_dai->probed = 0; cpu_dai->probed = 0;
list_del(&cpu_dai->card_list);
if (!cpu_dai->codec) { if (!cpu_dai->codec) {
snd_soc_dapm_free(&cpu_dai->dapm); snd_soc_dapm_free(&cpu_dai->dapm);
...@@ -1405,7 +1403,6 @@ static int soc_probe_codec_dai(struct snd_soc_card *card, ...@@ -1405,7 +1403,6 @@ static int soc_probe_codec_dai(struct snd_soc_card *card,
/* mark codec_dai as probed and add to card dai list */ /* mark codec_dai as probed and add to card dai list */
codec_dai->probed = 1; codec_dai->probed = 1;
list_add(&codec_dai->card_list, &card->dai_dev_list);
} }
return 0; return 0;
...@@ -1490,8 +1487,6 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order) ...@@ -1490,8 +1487,6 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
} }
} }
cpu_dai->probed = 1; cpu_dai->probed = 1;
/* mark cpu_dai as probed and add to card dai list */
list_add(&cpu_dai->card_list, &card->dai_dev_list);
} }
/* probe the CODEC DAI */ /* probe the CODEC DAI */
...@@ -3205,6 +3200,18 @@ int snd_soc_bytes_put(struct snd_kcontrol *kcontrol, ...@@ -3205,6 +3200,18 @@ int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
} }
EXPORT_SYMBOL_GPL(snd_soc_bytes_put); EXPORT_SYMBOL_GPL(snd_soc_bytes_put);
int snd_soc_bytes_info_ext(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *ucontrol)
{
struct soc_bytes_ext *params = (void *)kcontrol->private_value;
ucontrol->type = SNDRV_CTL_ELEM_TYPE_BYTES;
ucontrol->count = params->max;
return 0;
}
EXPORT_SYMBOL_GPL(snd_soc_bytes_info_ext);
/** /**
* snd_soc_info_xr_sx - signed multi register info callback * snd_soc_info_xr_sx - signed multi register info callback
* @kcontrol: mreg control * @kcontrol: mreg control
...@@ -3738,7 +3745,6 @@ int snd_soc_register_card(struct snd_soc_card *card) ...@@ -3738,7 +3745,6 @@ int snd_soc_register_card(struct snd_soc_card *card)
for (i = 0; i < card->num_links; i++) for (i = 0; i < card->num_links; i++)
card->rtd[i].dai_link = &card->dai_link[i]; card->rtd[i].dai_link = &card->dai_link[i];
INIT_LIST_HEAD(&card->list);
INIT_LIST_HEAD(&card->dapm_dirty); INIT_LIST_HEAD(&card->dapm_dirty);
card->instantiated = 0; card->instantiated = 0;
mutex_init(&card->mutex); mutex_init(&card->mutex);
...@@ -4271,7 +4277,6 @@ int snd_soc_register_codec(struct device *dev, ...@@ -4271,7 +4277,6 @@ int snd_soc_register_codec(struct device *dev,
codec->dapm.stream_event = codec_drv->stream_event; codec->dapm.stream_event = codec_drv->stream_event;
codec->dev = dev; codec->dev = dev;
codec->driver = codec_drv; codec->driver = codec_drv;
codec->num_dai = num_dai;
codec->component.val_bytes = codec_drv->reg_word_size; codec->component.val_bytes = codec_drv->reg_word_size;
mutex_init(&codec->mutex); mutex_init(&codec->mutex);
...@@ -4697,7 +4702,7 @@ int snd_soc_of_get_dai_name(struct device_node *of_node, ...@@ -4697,7 +4702,7 @@ int snd_soc_of_get_dai_name(struct device_node *of_node,
if (id < 0 || id >= pos->num_dai) { if (id < 0 || id >= pos->num_dai) {
ret = -EINVAL; ret = -EINVAL;
break; continue;
} }
ret = 0; ret = 0;
......
...@@ -555,7 +555,6 @@ static int soc_pcm_close(struct snd_pcm_substream *substream) ...@@ -555,7 +555,6 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
if (platform->driver->ops && platform->driver->ops->close) if (platform->driver->ops && platform->driver->ops->close)
platform->driver->ops->close(substream); platform->driver->ops->close(substream);
cpu_dai->runtime = NULL;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
if (snd_soc_runtime_ignore_pmdown_time(rtd)) { if (snd_soc_runtime_ignore_pmdown_time(rtd)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment