{
struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai);
struct davinci_mcasp_context *context = &mcasp->context;
---- context->txfmtctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXFMCTL_REG);
---- context->rxfmtctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXFMCTL_REG);
---- context->txfmt = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXFMT_REG);
---- context->rxfmt = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXFMT_REG);
---- context->aclkxctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_ACLKXCTL_REG);
---- context->aclkrctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_ACLKRCTL_REG);
---- context->pdir = mcasp_get_reg(mcasp, DAVINCI_MCASP_PDIR_REG);
+ ++++ u32 reg;
+ ++++ int i;
+
- context->txfmtctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXFMCTL_REG);
- context->rxfmtctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXFMCTL_REG);
- context->txfmt = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXFMT_REG);
- context->rxfmt = mcasp_get_reg(mcasp, DAVINCI_MCASP_RXFMT_REG);
- context->aclkxctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_ACLKXCTL_REG);
- context->aclkrctl = mcasp_get_reg(mcasp, DAVINCI_MCASP_ACLKRCTL_REG);
- context->pdir = mcasp_get_reg(mcasp, DAVINCI_MCASP_PDIR_REG);
+ ++++ for (i = 0; i < ARRAY_SIZE(context_regs); i++)
+ ++++ context->config_regs[i] = mcasp_get_reg(mcasp, context_regs[i]);
+ ++++
+ ++++ if (mcasp->txnumevt) {
+ ++++ reg = mcasp->fifo_base + MCASP_WFIFOCTL_OFFSET;
+ ++++ context->afifo_regs[0] = mcasp_get_reg(mcasp, reg);
+ ++++ }
+ ++++ if (mcasp->rxnumevt) {
+ ++++ reg = mcasp->fifo_base + MCASP_RFIFOCTL_OFFSET;
+ ++++ context->afifo_regs[1] = mcasp_get_reg(mcasp, reg);
+ ++++ }
++++
+ ++++ for (i = 0; i < mcasp->num_serializer; i++)
+ ++++ context->xrsr_regs[i] = mcasp_get_reg(mcasp,
+ ++++ DAVINCI_MCASP_XRSRCTL_REG(i));
return 0;
}
}
}
--- -static int soc_probe_codec(struct snd_soc_card *card,
--- - struct snd_soc_codec *codec)
+++ +static int soc_probe_component(struct snd_soc_card *card,
+++ + struct snd_soc_component *component)
{
--- - int ret = 0;
--- - const struct snd_soc_codec_driver *driver = codec->driver;
+++ + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
- struct snd_soc_component *dai_component, *component2;
struct snd_soc_dai *dai;
+++ + int ret;
+++ +
+++ + if (component->probed)
+++ + return 0;
--- - codec->component.card = card;
--- - codec->dapm.card = card;
--- - soc_set_name_prefix(card, &codec->component);
+++ + component->card = card;
+++ + dapm->card = card;
+++ + soc_set_name_prefix(card, component);
--- - if (!try_module_get(codec->dev->driver->owner))
+++ + if (!try_module_get(component->dev->driver->owner))
return -ENODEV;
--- - soc_init_codec_debugfs(codec);
+++ + soc_init_component_debugfs(component);
--- - if (driver->dapm_widgets) {
--- - ret = snd_soc_dapm_new_controls(&codec->dapm,
--- - driver->dapm_widgets,
--- - driver->num_dapm_widgets);
+++ + if (component->dapm_widgets) {
+++ + ret = snd_soc_dapm_new_controls(dapm, component->dapm_widgets,
+++ + component->num_dapm_widgets);
if (ret != 0) {
--- - dev_err(codec->dev,
+++ + dev_err(component->dev,
"Failed to create new controls %d\n", ret);
goto err_probe;
}
}
--- - /* Create DAPM widgets for each DAI stream */
--- - list_for_each_entry(dai, &codec->component.dai_list, list) {
--- - ret = snd_soc_dapm_new_dai_widgets(&codec->dapm, dai);
- /*
- * This is rather ugly, but certain platforms expect that the DAPM
- * widgets for the DAIs for components with the same parent device are
- * created in the platforms DAPM context. Until that is fixed we need to
- * keep this.
- */
- if (component->steal_sibling_dai_widgets) {
- dai_component = NULL;
- list_for_each_entry(component2, &component_list, list) {
- if (component == component2)
- continue;
-
- if (component2->dev == component->dev &&
- !list_empty(&component2->dai_list)) {
- dai_component = component2;
- break;
- }
- }
- } else {
- dai_component = component;
- list_for_each_entry(component2, &component_list, list) {
- if (component2->dev == component->dev &&
- component2->steal_sibling_dai_widgets) {
- dai_component = NULL;
- break;
- }
- }
- }
-----
- if (dai_component) {
- list_for_each_entry(dai, &dai_component->dai_list, list) {
- snd_soc_dapm_new_dai_widgets(dapm, dai);
- if (ret != 0) {
- dev_err(component->dev,
- "Failed to create DAI widgets %d\n",
- ret);
- goto err_probe;
- }
+++++ list_for_each_entry(dai, &component->dai_list, list) {
+++++ ret = snd_soc_dapm_new_dai_widgets(dapm, dai);
+ if (ret != 0) {
--- - dev_err(codec->dev,
+++++ dev_err(component->dev,
+ "Failed to create DAI widgets %d\n", ret);
+ goto err_probe;
}
}
platform->dev = dev;
platform->driver = platform_drv;
--- - if (platform_drv->write)
--- - platform->component.write = snd_soc_platform_drv_write;
--- - if (platform_drv->read)
--- - platform->component.read = snd_soc_platform_drv_read;
- if (platform_drv->controls) {
- platform->component.controls = platform_drv->controls;
- platform->component.num_controls = platform_drv->num_controls;
- }
- if (platform_drv->dapm_widgets) {
- platform->component.dapm_widgets = platform_drv->dapm_widgets;
- platform->component.num_dapm_widgets = platform_drv->num_dapm_widgets;
- platform->component.steal_sibling_dai_widgets = true;
- }
- if (platform_drv->dapm_routes) {
- platform->component.dapm_routes = platform_drv->dapm_routes;
- platform->component.num_dapm_routes = platform_drv->num_dapm_routes;
- }
+++ +
+++ + if (platform_drv->probe)
+++ + platform->component.probe = snd_soc_platform_drv_probe;
+++ + if (platform_drv->remove)
+++ + platform->component.remove = snd_soc_platform_drv_remove;
+++ +
+++ +#ifdef CONFIG_DEBUG_FS
+++ + platform->component.debugfs_prefix = "platform";
+++ +#endif
mutex_lock(&client_mutex);
snd_soc_component_add_unlocked(&platform->component);
if (codec_drv->read)
codec->component.read = snd_soc_codec_drv_read;
codec->component.ignore_pmdown_time = codec_drv->ignore_pmdown_time;
----- codec->dapm.codec = codec;
+++ + codec->dapm.idle_bias_off = codec_drv->idle_bias_off;
++++ + codec->dapm.suspend_bias_off = codec_drv->suspend_bias_off;
if (codec_drv->seq_notifier)
codec->dapm.seq_notifier = codec_drv->seq_notifier;
if (codec_drv->set_bias_level)