things about it which I was unable to find out by asking.
I put it to you that DPCM in mainline is incomplete and nonfunctional
as it currently stands. Moreover, it requires either those who know
that code to continue to develop it, or someone else who understands
the direction that this code is supposed to go picks up to complete it.
Add to that that you say that this was being developed with TI and
the TI situation happened, it seems unlikely to me that there's any
significant chance of movement on that.
So, insisting that DPCM is used for this driver is grossly unfair.
What I have implemented so far in these patches is not _that_ far from
apparantly what is required for a DPCM solution, if only it would work.
Therefore, there is no reason for you to refuse this patch based on your
original assertion.
The main thing is that it _works_ and, as far as is currently known,
it should not cause a regression for existing mainline kernel users.
Hopefully the t5325 folk will be able to test on their platform.
If DPCM moves forward to a state where it becomes usable, or if Liam can
provide some input on what's wrong and how it can be addressed, we can
then look at converting the driver over to use it. Given everything I've
discovered about DPCM thus far should be a trivial matter of something
like the diff below (without the debug hacks) - provided of course that
the structure in Liam's driver was correct.
Let's not forget: Liam may be working on this stuff, and may have his own
set of patches to sort out DPCM, so having patches from me messing around
with the DPCM code apparantly "fixing" problems with it may very well be
counter-productive. Again - Liam needs to provide some input on this.
@@ -36,7 +36,7 @@ static const struct snd_soc_dapm_widget dit_widgets[] = {
};
static const const struct snd_soc_dapm_route dit_routes[] = {
- { "spdif-out", NULL, "Playback" },
+ { "spdif-out", NULL, "spdif-Playback" },
};
static struct snd_soc_codec_driver soc_codec_spdif_dit = {
@@ -49,7 +49,7 @@ static struct snd_soc_codec_driver soc_codec_spdif_dit = {
static struct snd_soc_dai_driver dit_stub_dai = {
.name = "dit-hifi",
.playback = {
- .stream_name = "Playback",
+ .stream_name = "spdif-Playback",
.channels_min = 1,
.channels_max = 384,
.rates = STUB_RATES,
@@ -372,7 +372,7 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
dev_notice(dai->dev, "timed out waiting for busy to deassert: %08x\n",
ctl);
}
-
+printk("%s: %02x %02x\n", __func__, priv->ctl_play, priv->ctl_play_mask);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
/* configure */
@@ -57,7 +57,7 @@ static struct snd_soc_ops kirkwood_spdif_ops = {
};
static const struct snd_soc_dapm_route routes[] = {
- { "Playback", NULL, "spdifdo" },
+ { "spdif-Playback", NULL, "spdifdo" },
};
static struct snd_soc_dai_link kirkwood_spdif_dai0[] = {
@@ -78,6 +78,14 @@ static struct snd_soc_dai_link kirkwood_spdif_dai1[] = {
.stream_name = "IEC958 Playback",
.platform_name = "mvebu-audio.1",
.cpu_dai_name = "mvebu-audio.1",
+ .codec_name = "snd-soc-dummy",
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .dynamic = 1,
+ }, {
+ .name = "Codec",
+ .cpu_dai_name = "snd-soc-dummy-dai",
+ .platform_name = "snd-soc-dummy",
+ .no_pcm = 1,
.codec_dai_name = "dit-hifi",
.codec_name = "spdif-dit",
.ops = &kirkwood_spdif_ops,
@@ -108,7 +116,7 @@ static int kirkwood_spdif_probe(struct platform_device *pdev)
card->dai_link = kirkwood_spdif_dai0;
else
card->dai_link = kirkwood_spdif_dai1;
- card->num_links = 1;
+ card->num_links = 2;
card->dapm_routes = routes;
card->num_dapm_routes = ARRAY_SIZE(routes);
card->dev = &pdev->dev;
@@ -1163,7 +1163,7 @@ static int soc_probe_platform(struct snd_soc_card *card,
if (dai->dev != platform->dev)
continue;
- snd_soc_dapm_new_dai_widgets(&platform->dapm, dai);
+// snd_soc_dapm_new_dai_widgets(&platform->dapm, dai);
}
platform->dapm.idle_bias_off = 1;
@@ -1362,7 +1362,7 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
return -ENODEV;
list_add(&cpu_dai->dapm.list, &card->dapm_list);
-// snd_soc_dapm_new_dai_widgets(&cpu_dai->dapm, cpu_dai);
+ snd_soc_dapm_new_dai_widgets(&cpu_dai->dapm, cpu_dai);
}
if (cpu_dai->driver->probe) {
@@ -22,7 +22,7 @@
* device reopen.
*
*/
-
+#define DEBUG
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
@@ -305,6 +305,7 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
int ret = 0;
trace_snd_soc_bias_level_start(card, level);
+ printk("%s(%p,%u)\n", __func__, card, level);
if (card && card->set_bias_level)
ret = card->set_bias_level(card, dapm, level);
@@ -1110,6 +1111,7 @@ EXPORT_SYMBOL_GPL(dapm_clock_event);
static int dapm_widget_power_check(struct snd_soc_dapm_widget *w)
{
+printk("%s(%p): %s %u %u %u\n", __func__, w, w->name, w->power_checked, w->new_power, w->force);
if (w->power_checked)
return w->new_power;
@@ -1119,6 +1121,7 @@ static int dapm_widget_power_check(struct snd_soc_dapm_widget *w)
w->new_power = w->power_check(w);
w->power_checked = true;
+printk("%s: %s %u %u %u\n", __func__, w->name, w->power_checked, w->new_power, w->force);
return w->new_power;
}
@@ -1135,6 +1138,7 @@ static int dapm_generic_check_power(struct snd_soc_dapm_widget *w)
dapm_clear_walk_input(w->dapm, &w->sources);
out = is_connected_output_ep(w, NULL);
dapm_clear_walk_output(w->dapm, &w->sinks);
+printk("%s(%p): %u %u\n", __func__, w, out, in);
return out != 0 && in != 0;
}
@@ -1163,6 +1167,7 @@ static int dapm_dac_check_power(struct snd_soc_dapm_widget *w)
if (w->active) {
out = is_connected_output_ep(w, NULL);
+ printk("%s(%p): %u\n", __func__, w, out);
dapm_clear_walk_output(w->dapm, &w->sinks);
return out != 0;
} else {
@@ -1576,6 +1581,7 @@ static void dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power,
return;
trace_snd_soc_dapm_widget_power(w, power);
+ printk("%s(%p,%u): %s\n", __func__, w, power, w->name);
/* If we changed our power state perhaps our neigbours changed
* also.
@@ -1652,6 +1658,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
enum snd_soc_bias_level bias;
trace_snd_soc_dapm_start(card);
+ printk("%s(%p,%u)\n", __func__, dapm, event);
list_for_each_entry(d, &card->dapm_list, list) {
if (d->idle_bias_off)
@@ -1669,6 +1676,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
* iterate.
*/
list_for_each_entry(w, &card->dapm_dirty, dirty) {
+printk("%s: dirty %s power %u active %u\n", __func__, w->name, w->power, w->active);
dapm_power_one_widget(w, &up_list, &down_list);
}
@@ -1682,7 +1690,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
list_del_init(&w->dirty);
break;
}
-
+printk("%s: widget %s power %u active %u\n", __func__, w->name, w->power, w->active);
if (w->power) {
d = w->dapm;
@@ -2256,7 +2264,7 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm,
route->sink);
return -ENODEV;
}
-
+printk("%s: adding a route from %s to %s (%p->%p)\n", __func__, wsource->name, wsink->name, wsource, wsink);
path = kzalloc(sizeof(struct snd_soc_dapm_path), GFP_KERNEL);
if (!path)
return -ENOMEM;
@@ -2562,6 +2570,7 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm)
{
struct snd_soc_dapm_widget *w;
unsigned int val;
+printk("%s(%p)\n", __func__, dapm);
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
@@ -3060,6 +3069,7 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
if ((w = dapm_cnew_widget(widget)) == NULL)
return NULL;
+printk("%s(%p, %p): %s => %p\n", __func__, dapm, widget, widget->name, w);
switch (w->id) {
case snd_soc_dapm_regulator_supply:
@@ -3184,6 +3194,7 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
struct snd_soc_dapm_widget *w;
int i;
int ret = 0;
+printk("%s(%p)\n", __func__, dapm);
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
for (i = 0; i < num; i++) {
@@ -3326,6 +3337,8 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
return -ENOMEM;
snprintf(link_name, len, "%s-%s", source->name, sink->name);
+ printk("%s: linking %s to %s via %s\n", __func__, source->name, sink->name, link_name);
+
memset(&template, 0, sizeof(template));
template.reg = SND_SOC_NOPM;
template.id = snd_soc_dapm_dai_link;
@@ -3376,6 +3389,8 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
template.name);
w = snd_soc_dapm_new_control(dapm, &template);
+printk("%s: creating playback widget %s:%s for dai %p dapm %p (playback_widget was %p, new %p)\n",
+ __func__, template.name, template.sname, dai, dapm, dai->playback_widget, w);
if (!w) {
dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
dai->driver->playback.stream_name);
@@ -3394,6 +3409,8 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
template.name);
w = snd_soc_dapm_new_control(dapm, &template);
+printk("%s: creating capture widget %s:%s for dai %p dapm %p (capture_widget was %p, new %p)\n",
+ __func__, template.name, template.sname, dai, dapm, dai->capture_widget, w);
if (!w) {
dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
dai->driver->capture.stream_name);
@@ -3423,7 +3440,7 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
default:
continue;
}
-
+printk("%s: found dai widget %s:%s (%p)\n", __func__, dai_w->name, dai_w->sname, dai_w);
dai = dai_w->priv;
/* ...find all widgets with the same stream and link them */
@@ -3441,6 +3458,7 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
if (!w->sname || !strstr(w->sname, dai_w->name))
continue;
+printk("%s: found widget %s:%s (%p)\n", __func__, w->name, w->sname, w);
if (dai->driver->playback.stream_name &&
strstr(w->sname,
@@ -3484,7 +3502,7 @@ static void soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
w_cpu = cpu_dai->capture_widget;
w_codec = codec_dai->capture_widget;
}
-
+printk("%s: w_cpu %p w_codec %p event %u\n", __func__, w_cpu, w_codec, event);
if (w_cpu) {
dapm_mark_dirty(w_cpu, "stream event");
@@ -15,7 +15,7 @@
* option) any later version.
*
*/
-
+#define DEBUG
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>