All of lore.kernel.org
 help / color / mirror / Atom feed
* ASoC: codec: SPDIF only works with Tx/Rx seperate codec drivers?
@ 2013-07-12  8:30 Nicolin Chen
  2013-07-12 11:33 ` Mark Brown
  2013-07-12 14:26 ` Lars-Peter Clausen
  0 siblings, 2 replies; 6+ messages in thread
From: Nicolin Chen @ 2013-07-12  8:30 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel

Hi Mark,

I've a little question about SPDIF codec drivers.

I found there're spdif_receiver.c and spdif_transmitter.c, two files,
in sound/soc/codecs directory. So it looks like SPDIF module would work
separately as one IN device and one OUT device, for example:
dts/spear1340.dtsi:		spdif-in@d0100000 {
dts/spear1340.dtsi:			compatible = "st,spdif-in";
dts/spear1340.dtsi:		spdif-out@d0000000 {
dts/spear1340.dtsi:			compatible = "st,spdif-out";

But the question is what if a SPDIF module have both Tx and Rx function
in one simple CPU DAI. Is that okay to add a new codec driver for this
situation?

Actually I'm gonna prepare some patches to add Freescale SPDIF drivers.
But this needs to create a brand new dummy SPDIF codec driver, which's
some kinda same as spdif_receiver/transmitter.c but quite different
in the supports of SAMPLE_RATE/FORMAT and IN/OUT-in-one integration.

So I just want to make sure if this'll be okay.

Thank you. And looking forward to your reply.
Nicolin Chen

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ASoC: codec: SPDIF only works with Tx/Rx seperate codec drivers?
  2013-07-12  8:30 ASoC: codec: SPDIF only works with Tx/Rx seperate codec drivers? Nicolin Chen
@ 2013-07-12 11:33 ` Mark Brown
  2013-07-12 11:57   ` Nicolin Chen
  2013-07-12 14:26 ` Lars-Peter Clausen
  1 sibling, 1 reply; 6+ messages in thread
From: Mark Brown @ 2013-07-12 11:33 UTC (permalink / raw)
  To: Nicolin Chen; +Cc: alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 413 bytes --]

On Fri, Jul 12, 2013 at 04:30:31PM +0800, Nicolin Chen wrote:

> Actually I'm gonna prepare some patches to add Freescale SPDIF drivers.
> But this needs to create a brand new dummy SPDIF codec driver, which's
> some kinda same as spdif_receiver/transmitter.c but quite different
> in the supports of SAMPLE_RATE/FORMAT and IN/OUT-in-one integration.

We could just merge them into a single driver easily enough.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ASoC: codec: SPDIF only works with Tx/Rx seperate codec drivers?
  2013-07-12 11:33 ` Mark Brown
@ 2013-07-12 11:57   ` Nicolin Chen
  2013-07-12 14:29     ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolin Chen @ 2013-07-12 11:57 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel

Thank you for the reply.

On Fri, Jul 12, 2013 at 12:33:53PM +0100, Mark Brown wrote:
> We could just merge them into a single driver easily enough.

Merge spdif_receiver.c and spdif_transmitter.c?
But each of them is being individually used by several drivers:
davinci/davinci-evm.c
samsung/smdk_spdif.c
spear/spdif_in.c
spear/spdif_out.c

If we merge these two files, it would break their functions.
Especially for spear's platform, seems they are using SPDIF
IN and OUT separately.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ASoC: codec: SPDIF only works with Tx/Rx seperate codec drivers?
  2013-07-12  8:30 ASoC: codec: SPDIF only works with Tx/Rx seperate codec drivers? Nicolin Chen
  2013-07-12 11:33 ` Mark Brown
@ 2013-07-12 14:26 ` Lars-Peter Clausen
  2013-07-15  2:11   ` Nicolin Chen
  1 sibling, 1 reply; 6+ messages in thread
From: Lars-Peter Clausen @ 2013-07-12 14:26 UTC (permalink / raw)
  To: Nicolin Chen; +Cc: alsa-devel, broonie

On 07/12/2013 10:30 AM, Nicolin Chen wrote:
> Hi Mark,
> 
> I've a little question about SPDIF codec drivers.
> 
> I found there're spdif_receiver.c and spdif_transmitter.c, two files,
> in sound/soc/codecs directory. So it looks like SPDIF module would work
> separately as one IN device and one OUT device, for example:
> dts/spear1340.dtsi:		spdif-in@d0100000 {
> dts/spear1340.dtsi:			compatible = "st,spdif-in";
> dts/spear1340.dtsi:		spdif-out@d0000000 {
> dts/spear1340.dtsi:			compatible = "st,spdif-out";
> 
> But the question is what if a SPDIF module have both Tx and Rx function
> in one simple CPU DAI. Is that okay to add a new codec driver for this
> situation?
> 
> Actually I'm gonna prepare some patches to add Freescale SPDIF drivers.
> But this needs to create a brand new dummy SPDIF codec driver, which's
> some kinda same as spdif_receiver/transmitter.c but quite different
> in the supports of SAMPLE_RATE/FORMAT and IN/OUT-in-one integration.
> 
> So I just want to make sure if this'll be okay.

The current drivers should work fine with this. You can create a card with
two DAI links

static struct snd_soc_dai_link dai_links[] = {
	{
		.name = "S/PDIF TX",
		.stream_name = "S/PDIF PCM Playback",
		.platform_name = "your-platform",
		.cpu_dai_name = "your-cpu-dai",
		.codec_dai_name = "dit-hifi",
		.codec_name = "spdif-dit",
	}, {
		.name = "S/PDIF RX",
		.stream_name = "S/PDIF PCM Playback",
		.platform_name = "your-platform",
		.cpu_dai_name = "your-cpu-dai",
		.codec_dai_name = "dir-hifi",
		.codec_name = "spdif-dir",
	},
};

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ASoC: codec: SPDIF only works with Tx/Rx seperate codec drivers?
  2013-07-12 11:57   ` Nicolin Chen
@ 2013-07-12 14:29     ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2013-07-12 14:29 UTC (permalink / raw)
  To: Nicolin Chen; +Cc: alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 609 bytes --]

On Fri, Jul 12, 2013 at 07:57:13PM +0800, Nicolin Chen wrote:
> On Fri, Jul 12, 2013 at 12:33:53PM +0100, Mark Brown wrote:
> > We could just merge them into a single driver easily enough.

> Merge spdif_receiver.c and spdif_transmitter.c?
> But each of them is being individually used by several drivers:
> davinci/davinci-evm.c
> samsung/smdk_spdif.c
> spear/spdif_in.c
> spear/spdif_out.c

> If we merge these two files, it would break their functions.
> Especially for spear's platform, seems they are using SPDIF
> IN and OUT separately.

Why would it break them?  You can always instantiate two copies.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ASoC: codec: SPDIF only works with Tx/Rx seperate codec drivers?
  2013-07-12 14:26 ` Lars-Peter Clausen
@ 2013-07-15  2:11   ` Nicolin Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolin Chen @ 2013-07-15  2:11 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: alsa-devel, broonie

Hi,

On Fri, Jul 12, 2013 at 04:26:17PM +0200, Lars-Peter Clausen wrote:
> The current drivers should work fine with this. You can create a card with
> two DAI links

I'll try it. Thank you so much!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-07-15  2:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-12  8:30 ASoC: codec: SPDIF only works with Tx/Rx seperate codec drivers? Nicolin Chen
2013-07-12 11:33 ` Mark Brown
2013-07-12 11:57   ` Nicolin Chen
2013-07-12 14:29     ` Mark Brown
2013-07-12 14:26 ` Lars-Peter Clausen
2013-07-15  2:11   ` Nicolin Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.