On Mon, 30 Jun 2014 17:20:51 +0100 Russell King - ARM Linux linux@arm.linux.org.uk wrote:
Add DPCM support to kirkwood-i2s to support the I2S and SPDIF streams. This consists of:
- a single front end DAI called "kirkwood-fe" with "dma-tx" and "dma-rx" streams.
- one backend DAI called "kirkwood-i2s" for I2S with streams named "i2s-tx" and "i2s-rx"
- one backend DAI called "kirkwood-spdif" for SPDIF with a single stream named "spdif-tx".
In the Cubox, you may have kirkwood S/PDIF with both HDMI and S/PDIF outputs and this avoids to activate both kirkwood I2S and S/PDIF in most cases.
.rates = SNDRV_PCM_RATE_CONTINUOUS,
.rate_min = 5512,
.rate_max = 192000,
.formats = KIRKWOOD_I2S_FORMATS,
.rates = SNDRV_PCM_RATE_8000_192000 |
SNDRV_PCM_RATE_CONTINUOUS |
SNDRV_PCM_RATE_KNOT,
.formats = KIRKWOOD_FE_FORMATS,
This does not work: SNDRV_PCM_RATE_CONTINUOUS asks for rate_min and rate_max. SNDRV_PCM_RATE_KNOT is of no interest here.
diff --git a/sound/soc/kirkwood/kirkwood-openrd.c b/sound/soc/kirkwood/kirkwood-openrd.c index 65f2a5b9ec3b..78fb05ff44a8 100644 --- a/sound/soc/kirkwood/kirkwood-openrd.c +++ b/sound/soc/kirkwood/kirkwood-openrd.c @@ -49,24 +49,34 @@ static struct snd_soc_ops openrd_client_ops = {
static struct snd_soc_dai_link openrd_client_dai[] = {
- KIRKWOOD_FE_DAI_LINK(".0", 1, 1),
{ .name = "CS42L51", .stream_name = "CS42L51 HiFi",
- .cpu_dai_name = "i2s",
- .platform_name = "mvebu-audio",
- .cpu_name = "mvebu-audio.0",
- .cpu_dai_name = "kirkwood-i2s",
- .platform_name = "snd-soc-dummy", .codec_dai_name = "cs42l51-hifi", .codec_name = "cs42l51-codec.0-004a", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS, .ops = &openrd_client_ops,
- .dpcm_playback = 1,
- .dpcm_capture = 1,
}, };
There is no need to change the openrd and t5325 drivers: they may use the kirkwood DAI's in a non-DPCM way.
diff --git a/sound/soc/kirkwood/kirkwood-spdif.c b/sound/soc/kirkwood/kirkwood-spdif.c index 9d49bc53f07d..6098dde85fc9 100644 --- a/sound/soc/kirkwood/kirkwood-spdif.c +++ b/sound/soc/kirkwood/kirkwood-spdif.c
What is that file?
Eventually, your code is close to the one I tested end 2013. But, once again, this does not work because DPCM does not handle the format and rate constraints of the backends. This is critical for the device which is connected to HDMI.