[alsa-devel] [PATCH 1/4] ASoC: pxa-ssp: enhance I2S and add Left_J support

Eric Miao eric.y.miao at gmail.com
Thu Jun 11 15:34:03 CEST 2009

2009/6/11 Daniel Ribeiro <drwyrm at gmail.com>:
> Hi Eric,
> Em Ter, 2009-06-09 às 17:39 +0800, Eric Miao escreveu:
>> frame_width = sample_width * channel ( = LRCLK for I2S )
>> is no longer (and ever) correct.
>> E.g. the frame width could be 64fs, meaning a whole frame is
>> consisting
>> of 64 bitclks - that's saying, sample width from 1 - 64 are possible,
>> For typical 16-bit sample width I2S format, the envelope for each
>> sample
>> is 32 bitclks, and offseting by 1 bitclk starts the 16-bit sample.
> I'm working on supporting I2S right now, and I found some issues with
> this enveloping thing.
> First, it doesn't work on pxa2xx. DMYSTOP on pxa2xx is only 0-3.

Well, there is a dedicated I2S controller on pxa{25x,27x}, so I'd expect
if it's required for DMYSTOP > 3, the HW engineer would just resort to
the I2S controller.

> Second, is enveloping needed at all? The patch you sent supports 32bits
> frames for 2*16bits samples or 64bits frames for 2*32bits samples using

There are some codecs requiring this.

> We already use FSRT for DSP_A, and if this works on littleton I2S we
> should just stick with FSRT (and frame_width = sample_width * channels)
> to keep the code simple.

I hope so, but the assumption of frame_width == sample_width * 2 should
hold true first.

>> And the TDM mode is actually special for PXA-SSP to emulate the I2S
>> protocol, it's no way generic TDM in a common sense. So talking about
>> set_tdm_slots(), I'd really like to hide into the format setting code
>> of I2S/Left_J to avoid further confusion.
> TDM is needed for frames larger than 32 bits on any dai format. Its not
> something specific to I2S.

Well, emulating I2S with SSP has to use TDM mode so that a single
frame can include two samples.

More information about the Alsa-devel mailing list