Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-29 Thread Max Filippov
On Thu, Oct 30, 2014 at 12:02 AM, Mark Brown wrote: > On Wed, Oct 29, 2014 at 05:23:15PM +0300, Max Filippov wrote: >> On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown wrote: >> > On Tue, Oct 28, 2014 at 08:00:45PM +0300, Max Filippov wrote: > >> >> > It's also about ensuring that the code is cleanly

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-29 Thread Mark Brown
On Thu, Oct 30, 2014 at 12:10:56AM +0300, Max Filippov wrote: > On Thu, Oct 30, 2014 at 12:02 AM, Mark Brown wrote: > > Just keep the code physically separate so the DMA bits are hanging off > > the DMA operations and the interface setup bits are hanging off the DAI > > operations rather than

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-29 Thread Mark Brown
On Wed, Oct 29, 2014 at 05:23:15PM +0300, Max Filippov wrote: > On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown wrote: > > On Tue, Oct 28, 2014 at 08:00:45PM +0300, Max Filippov wrote: > >> > It's also about ensuring that the code is cleanly split up so that > >> > someone can actually go in and add

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-29 Thread Max Filippov
On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown wrote: > On Tue, Oct 28, 2014 at 08:00:45PM +0300, Max Filippov wrote: >> On Tue, Oct 28, 2014 at 6:42 PM, Mark Brown wrote: >> >> > I would also expect to see the data transfer and I2S bits more split >> >> > out, presumably this IP can actually be

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-29 Thread Max Filippov
On Wed, Oct 29, 2014 at 12:34 AM, Mark Brown wrote: > On Tue, Oct 28, 2014 at 09:11:34PM +0300, Max Filippov wrote: >> On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown wrote: > >> > You *really* need to explain how it's supposed to work - right now it's >> > not at all obvious, like I say the fact

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-29 Thread Max Filippov
On Wed, Oct 29, 2014 at 12:34 AM, Mark Brown broo...@kernel.org wrote: On Tue, Oct 28, 2014 at 09:11:34PM +0300, Max Filippov wrote: On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown broo...@kernel.org wrote: You *really* need to explain how it's supposed to work - right now it's not at all

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-29 Thread Max Filippov
On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown broo...@kernel.org wrote: On Tue, Oct 28, 2014 at 08:00:45PM +0300, Max Filippov wrote: On Tue, Oct 28, 2014 at 6:42 PM, Mark Brown broo...@kernel.org wrote: I would also expect to see the data transfer and I2S bits more split out, presumably

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-29 Thread Mark Brown
On Wed, Oct 29, 2014 at 05:23:15PM +0300, Max Filippov wrote: On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown broo...@kernel.org wrote: On Tue, Oct 28, 2014 at 08:00:45PM +0300, Max Filippov wrote: It's also about ensuring that the code is cleanly split up so that someone can actually go in

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-29 Thread Mark Brown
On Thu, Oct 30, 2014 at 12:10:56AM +0300, Max Filippov wrote: On Thu, Oct 30, 2014 at 12:02 AM, Mark Brown broo...@kernel.org wrote: Just keep the code physically separate so the DMA bits are hanging off the DMA operations and the interface setup bits are hanging off the DAI operations

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-29 Thread Max Filippov
On Thu, Oct 30, 2014 at 12:02 AM, Mark Brown broo...@kernel.org wrote: On Wed, Oct 29, 2014 at 05:23:15PM +0300, Max Filippov wrote: On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown broo...@kernel.org wrote: On Tue, Oct 28, 2014 at 08:00:45PM +0300, Max Filippov wrote: It's also about ensuring

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Mark Brown
On Tue, Oct 28, 2014 at 09:11:34PM +0300, Max Filippov wrote: > On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown wrote: > > You *really* need to explain how it's supposed to work - right now it's > > not at all obvious, like I say the fact that this is a rarely used idiom > > is not helping. For

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Max Filippov
On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown wrote: > On Tue, Oct 28, 2014 at 08:00:45PM +0300, Max Filippov wrote: >> On Tue, Oct 28, 2014 at 6:42 PM, Mark Brown wrote: >> > So atomics don't work? Simple flags are one of the few cases where they >> > might cover it... again, the fact that this

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Mark Brown
On Tue, Oct 28, 2014 at 08:00:45PM +0300, Max Filippov wrote: > On Tue, Oct 28, 2014 at 6:42 PM, Mark Brown wrote: > > Then this just shouldn't exist at all, adding Kconfig entries for all > > the simple-card devices would defeat the point of having simple-card > > which is why we don't do it

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Max Filippov
Hi Lars-Peter, On Tue, Oct 28, 2014 at 6:58 PM, Lars-Peter Clausen wrote: > On 10/27/2014 08:07 PM, Max Filippov wrote: > > A few minor things. > > [...] > >> +static irqreturn_t xtfpga_i2s_interrupt(int irq, void *dev_id) >> + if (tx_active) { >> + if (i2s->tx_fifo_high <

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Mark Brown
On Tue, Oct 28, 2014 at 05:39:13PM +0100, Lars-Peter Clausen wrote: > On 10/28/2014 05:04 PM, Mark Brown wrote: > >Is that going to play nicely with the fact that the interrupt can be > >shared and the desire to (AFAICT) do NAPI style stuff with the interrupt > >disabled for long periods? >

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Max Filippov
On Tue, Oct 28, 2014 at 6:42 PM, Mark Brown wrote: > On Mon, Oct 27, 2014 at 11:38:53PM +0300, Max Filippov wrote: >> On Mon, Oct 27, 2014 at 10:32 PM, Mark Brown wrote: >> > On Mon, Oct 27, 2014 at 10:07:05PM +0300, Max Filippov wrote: > >> >> +config SND_SOC_XTENSA_XTFPGA >> >> + tristate

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Takashi Iwai
At Tue, 28 Oct 2014 17:39:13 +0100, Lars-Peter Clausen wrote: > > On 10/28/2014 05:04 PM, Mark Brown wrote: > > On Tue, Oct 28, 2014 at 04:58:24PM +0100, Lars-Peter Clausen wrote: > >> On 10/27/2014 08:07 PM, Max Filippov wrote: > > > >>> + if (tx_active) { > >>> + if (i2s->tx_fifo_high <

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Lars-Peter Clausen
On 10/28/2014 05:04 PM, Mark Brown wrote: On Tue, Oct 28, 2014 at 04:58:24PM +0100, Lars-Peter Clausen wrote: On 10/27/2014 08:07 PM, Max Filippov wrote: + if (tx_active) { + if (i2s->tx_fifo_high < 256) + xtfpga_i2s_refill_fifo(i2s); +

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Mark Brown
On Tue, Oct 28, 2014 at 04:58:24PM +0100, Lars-Peter Clausen wrote: > On 10/27/2014 08:07 PM, Max Filippov wrote: > >+if (tx_active) { > >+if (i2s->tx_fifo_high < 256) > >+xtfpga_i2s_refill_fifo(i2s); > >+else > >+

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Lars-Peter Clausen
On 10/27/2014 08:07 PM, Max Filippov wrote: A few minor things. [...] +static irqreturn_t xtfpga_i2s_interrupt(int irq, void *dev_id) +{ + struct xtfpga_i2s *i2s = dev_id; + struct snd_pcm_substream *tx_substream; + int tx_active; + unsigned int_status; + +

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Mark Brown
On Mon, Oct 27, 2014 at 11:38:53PM +0300, Max Filippov wrote: > On Mon, Oct 27, 2014 at 10:32 PM, Mark Brown wrote: > > On Mon, Oct 27, 2014 at 10:07:05PM +0300, Max Filippov wrote: > >> +config SND_SOC_XTENSA_XTFPGA > >> + tristate "SoC Audio for xtensa xtfpga" > >> + depends on

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Mark Brown
On Mon, Oct 27, 2014 at 11:38:53PM +0300, Max Filippov wrote: On Mon, Oct 27, 2014 at 10:32 PM, Mark Brown broo...@kernel.org wrote: On Mon, Oct 27, 2014 at 10:07:05PM +0300, Max Filippov wrote: +config SND_SOC_XTENSA_XTFPGA + tristate SoC Audio for xtensa xtfpga + depends on

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Lars-Peter Clausen
On 10/27/2014 08:07 PM, Max Filippov wrote: A few minor things. [...] +static irqreturn_t xtfpga_i2s_interrupt(int irq, void *dev_id) +{ + struct xtfpga_i2s *i2s = dev_id; + struct snd_pcm_substream *tx_substream; + int tx_active; + unsigned int_status; + +

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Mark Brown
On Tue, Oct 28, 2014 at 04:58:24PM +0100, Lars-Peter Clausen wrote: On 10/27/2014 08:07 PM, Max Filippov wrote: +if (tx_active) { +if (i2s-tx_fifo_high 256) +xtfpga_i2s_refill_fifo(i2s); +else +

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Lars-Peter Clausen
On 10/28/2014 05:04 PM, Mark Brown wrote: On Tue, Oct 28, 2014 at 04:58:24PM +0100, Lars-Peter Clausen wrote: On 10/27/2014 08:07 PM, Max Filippov wrote: + if (tx_active) { + if (i2s-tx_fifo_high 256) + xtfpga_i2s_refill_fifo(i2s); +

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Takashi Iwai
At Tue, 28 Oct 2014 17:39:13 +0100, Lars-Peter Clausen wrote: On 10/28/2014 05:04 PM, Mark Brown wrote: On Tue, Oct 28, 2014 at 04:58:24PM +0100, Lars-Peter Clausen wrote: On 10/27/2014 08:07 PM, Max Filippov wrote: + if (tx_active) { + if (i2s-tx_fifo_high 256) +

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Max Filippov
On Tue, Oct 28, 2014 at 6:42 PM, Mark Brown broo...@kernel.org wrote: On Mon, Oct 27, 2014 at 11:38:53PM +0300, Max Filippov wrote: On Mon, Oct 27, 2014 at 10:32 PM, Mark Brown broo...@kernel.org wrote: On Mon, Oct 27, 2014 at 10:07:05PM +0300, Max Filippov wrote: +config

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Mark Brown
On Tue, Oct 28, 2014 at 05:39:13PM +0100, Lars-Peter Clausen wrote: On 10/28/2014 05:04 PM, Mark Brown wrote: Is that going to play nicely with the fact that the interrupt can be shared and the desire to (AFAICT) do NAPI style stuff with the interrupt disabled for long periods? Threaded

Re: [alsa-devel] [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Max Filippov
Hi Lars-Peter, On Tue, Oct 28, 2014 at 6:58 PM, Lars-Peter Clausen l...@metafoo.de wrote: On 10/27/2014 08:07 PM, Max Filippov wrote: A few minor things. [...] +static irqreturn_t xtfpga_i2s_interrupt(int irq, void *dev_id) + if (tx_active) { + if (i2s-tx_fifo_high

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Mark Brown
On Tue, Oct 28, 2014 at 08:00:45PM +0300, Max Filippov wrote: On Tue, Oct 28, 2014 at 6:42 PM, Mark Brown broo...@kernel.org wrote: Then this just shouldn't exist at all, adding Kconfig entries for all the simple-card devices would defeat the point of having simple-card which is why we

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Max Filippov
On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown broo...@kernel.org wrote: On Tue, Oct 28, 2014 at 08:00:45PM +0300, Max Filippov wrote: On Tue, Oct 28, 2014 at 6:42 PM, Mark Brown broo...@kernel.org wrote: So atomics don't work? Simple flags are one of the few cases where they might cover it...

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-28 Thread Mark Brown
On Tue, Oct 28, 2014 at 09:11:34PM +0300, Max Filippov wrote: On Tue, Oct 28, 2014 at 8:38 PM, Mark Brown broo...@kernel.org wrote: You *really* need to explain how it's supposed to work - right now it's not at all obvious, like I say the fact that this is a rarely used idiom is not

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-27 Thread Max Filippov
On Mon, Oct 27, 2014 at 10:32 PM, Mark Brown wrote: > On Mon, Oct 27, 2014 at 10:07:05PM +0300, Max Filippov wrote: > >> +config SND_SOC_XTENSA_XTFPGA >> + tristate "SoC Audio for xtensa xtfpga" >> + depends on XTENSA_PLATFORM_XTFPGA >> + select SND_SOC_XTFPGA_I2S >> + select

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-27 Thread Mark Brown
On Mon, Oct 27, 2014 at 10:07:05PM +0300, Max Filippov wrote: > +config SND_SOC_XTENSA_XTFPGA > + tristate "SoC Audio for xtensa xtfpga" > + depends on XTENSA_PLATFORM_XTFPGA > + select SND_SOC_XTFPGA_I2S > + select SND_SOC_TLV320AIC23_SPI > + select SND_SIMPLE_CARD I've only

[PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-27 Thread Max Filippov
XTFPGA boards providean audio subsystem that consists of TI CDCE706 clock synthesizer, I2S transmitter and TLV320AIC23 audio codec. I2S transmitter has MMIO-based interface that resembles that of the OpenCores I2S transmitter. I2S transmitter is always a master on I2S bus. There's no specialized

[PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-27 Thread Max Filippov
XTFPGA boards providean audio subsystem that consists of TI CDCE706 clock synthesizer, I2S transmitter and TLV320AIC23 audio codec. I2S transmitter has MMIO-based interface that resembles that of the OpenCores I2S transmitter. I2S transmitter is always a master on I2S bus. There's no specialized

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-27 Thread Mark Brown
On Mon, Oct 27, 2014 at 10:07:05PM +0300, Max Filippov wrote: +config SND_SOC_XTENSA_XTFPGA + tristate SoC Audio for xtensa xtfpga + depends on XTENSA_PLATFORM_XTFPGA + select SND_SOC_XTFPGA_I2S + select SND_SOC_TLV320AIC23_SPI + select SND_SIMPLE_CARD I've only got

Re: [PATCH] ASoC: add xtensa xtfpga I2S interface and platform

2014-10-27 Thread Max Filippov
On Mon, Oct 27, 2014 at 10:32 PM, Mark Brown broo...@kernel.org wrote: On Mon, Oct 27, 2014 at 10:07:05PM +0300, Max Filippov wrote: +config SND_SOC_XTENSA_XTFPGA + tristate SoC Audio for xtensa xtfpga + depends on XTENSA_PLATFORM_XTFPGA + select SND_SOC_XTFPGA_I2S + select