Skip to contentSkip to conversation

ARM: kirkwood: enable S/PDIF

PATCH In review Jean-Francois Moine 4 participants 8 messages Jul 23, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: kirkwood: enable S/PDIF

This patch enables S/PDIF.

---
 sound/soc/kirkwood/kirkwood-i2s.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/kirkwood/kirkwood-i2s.c +3 -0
index 4c9dad3..ad94c50 100644
@@ -159,6 +159,7 @@ static int kirkwood_i2s_hw_params(struct snd_pcm_substream *substream,
 	case SNDRV_PCM_FORMAT_S16_LE:
 		i2s_value |= KIRKWOOD_I2S_CTL_SIZE_16;
 		ctl_play = KIRKWOOD_PLAYCTL_SIZE_16_C |
+			   KIRKWOOD_PLAYCTL_SPDIF_EN |
 			   KIRKWOOD_PLAYCTL_I2S_EN;
 		ctl_rec = KIRKWOOD_RECCTL_SIZE_16_C |
 			  KIRKWOOD_RECCTL_I2S_EN;
@@ -169,6 +170,7 @@ static int kirkwood_i2s_hw_params(struct snd_pcm_substream *substream,
 	case SNDRV_PCM_FORMAT_S20_3LE:
 		i2s_value |= KIRKWOOD_I2S_CTL_SIZE_20;
 		ctl_play = KIRKWOOD_PLAYCTL_SIZE_20 |
+			   KIRKWOOD_PLAYCTL_SPDIF_EN |
 			   KIRKWOOD_PLAYCTL_I2S_EN;
 		ctl_rec = KIRKWOOD_RECCTL_SIZE_20 |
 			  KIRKWOOD_RECCTL_I2S_EN;
@@ -177,6 +179,7 @@ static int kirkwood_i2s_hw_params(struct snd_pcm_substream *substream,
 	case SNDRV_PCM_FORMAT_S24_LE:
 		i2s_value |= KIRKWOOD_I2S_CTL_SIZE_24;
 		ctl_play = KIRKWOOD_PLAYCTL_SIZE_24 |
+			   KIRKWOOD_PLAYCTL_SPDIF_EN |
 			   KIRKWOOD_PLAYCTL_I2S_EN;
 		ctl_rec = KIRKWOOD_RECCTL_SIZE_24 |
 			  KIRKWOOD_RECCTL_I2S_EN;
Signature · 2 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
#1 lore raw
Quoted 3 lines · Jean-Francois Moine

This patch enables S/PDIF.

I'm not submitting my patch to do this because:

(a) we don't know what effect this has on other hardware.
(b) Mark suggested that we use the slave PCM stuff to deal with this. As yet, that's something which I haven't been able to get to grips with because ASoC is soo damned complicated and undocumented.

maintainer
#2 lore raw
Quoted 8 lines · Russell King - ARM Linux
Quoted 3 lines · Jean-Francois Moine

This patch enables S/PDIF.

I'm not submitting my patch to do this because:

(a) we don't know what effect this has on other hardware.

This patch will do absolutely nothing unless it's used in a machine driver which connects a S/PDIF CODEC to it. I see no reason not to apply it, someone with hardware with more complex needs can always build on it later.

#3 lore raw
Quoted 6 lines · Mark Brown
Quoted 4 lines · Russell King - ARM Linux
Quoted 3 lines · Jean-Francois Moine

This patch enables S/PDIF.

Quoted 9 lines
Quoted 3 lines

I'm not submitting my patch to do this because:

(a) we don't know what effect this has on other hardware.

This patch will do absolutely nothing unless it's used in a machine driver which connects a S/PDIF CODEC to it. I see no reason not to apply it, someone with hardware with more complex needs can always build on it later.

Mark,

the mask that is changed in the patch is what will be written
into i2s controller's registers. So, if there is no S/PDIF in that specific controller that bit can possibly have a different meaning. Also, enabling both I2S playback and SPDIF playback can cause the
controller to behave differently.

I share Russell's concern about it and would rather like to use multiple codecs per DAI (DPCM) for that. I see Daniel Mack picked that up again, maybe he submits something soon.

Sebastian

maintainer
#4 lore raw
Quoted 5 lines · Sebastian Hesselbarth

the mask that is changed in the patch is what will be written into i2s controller's registers. So, if there is no S/PDIF in that specific controller that bit can possibly have a different meaning. Also, enabling both I2S playback and SPDIF playback can cause the controller to behave differently.

Oh, so it will - I glanced through it and misread, sorry. If it just makes the enabling of S/PDIF mode conditional on DAI format that'd cover it.

Quoted 3 lines

I share Russell's concern about it and would rather like to use multiple codecs per DAI (DPCM) for that. I see Daniel Mack picked that up again, maybe he submits something soon.

Well, that'd be ideal and is going to be needed for any hardware which has both wired up in parallel but a simpler either/or thing doesn't seem like a problem.

#5 lore raw
In reply to Sebastian Hesselbarth
Quoted 17 lines · Sebastian Hesselbarth
Quoted 6 lines · Mark Brown
Quoted 4 lines · Russell King - ARM Linux
Quoted 3 lines · Jean-Francois Moine

This patch enables S/PDIF.

Quoted 9 lines
Quoted 3 lines

I'm not submitting my patch to do this because:

(a) we don't know what effect this has on other hardware.

This patch will do absolutely nothing unless it's used in a machine driver which connects a S/PDIF CODEC to it. I see no reason not to apply it, someone with hardware with more complex needs can always build on it later.

Quoted 7 lines

Mark,

the mask that is changed in the patch is what will be written into i2s controller's registers. So, if there is no S/PDIF in that specific controller that bit can possibly have a different meaning. Also, enabling both I2S playback and SPDIF playback can cause the controller to behave differently.

Right, so the SPDIF output on Dove isn't multiplexed, so I was wrong on that _for_ _dove_, but that may not necessarily be the case for the Kirkwood SoCs - the pin may be multiplexed there.

However, Dove does have two I2S/SPDIF controllers which are otherwise identical, apart from one having SPDIF support and the other not. Setting the SPDIF enable bit on the one without is unspecified what the behaviour would be, so it should not be set.

#6 lore raw
In reply to Mark Brown
Quoted 6 lines · Mark Brown
Quoted 4 lines · Russell King - ARM Linux
Quoted 3 lines · Jean-Francois Moine

This patch enables S/PDIF.

Quoted 8 lines
Quoted 3 lines

I'm not submitting my patch to do this because:

(a) we don't know what effect this has on other hardware.

This patch will do absolutely nothing unless it's used in a machine driver which connects a S/PDIF CODEC to it. I see no reason not to apply it, someone with hardware with more complex needs can always build on it later.

So... what if setting this bit causes the SoC to start wiggling a pin with the SPDIF signal which has been used for a different purpose?

maintainer
#7 lore raw
Quoted 9 lines · Russell King - ARM Linux
Quoted 4 lines · Mark Brown

This patch will do absolutely nothing unless it's used in a machine driver which connects a S/PDIF CODEC to it. I see no reason not to apply it, someone with hardware with more complex needs can always build on it later.

So... what if setting this bit causes the SoC to start wiggling a pin with the SPDIF signal which has been used for a different purpose?

Right, yup - didn't read it fully. Like I say doing it conditional on the DAI format should be fine though.