Hi,
I'm new in this group and also pretty new with Linux, so I hope you have patience we me if I'm asking stupid questions,
I'm currently working with an Olimex A20 Lime2 board, trying to interface an 24 bit ADC (AD7768 from Analog Devices)
to the I2S interface.
So far I have done the following:
1. I have the following drivers built into the kernel:
sunxi-i2s.ko
sunxi-i2sdma.ko
sndi2s.ko
sunxi-i2s.ko
2. The I2S interface also appears as an ALSA hardware device (#sudo arecord -l)
I have briefly tested it without anything electrically connected to it, using arecord and an oscilloscope, observing how for instance
LRCLK changes frequency when i change the sampling frequency in the call to arecord.
3. AD7768 is an 8 channel 24bit ADC. It works in I2S master mode, so I have configured my A20 as slave (I have updated the fex file).
The ADC outputs data from all channels in an interleaved manner, 32bits/channel, on the same data line (I2S_DI).
Timing looks something like the following (one LRCLK data strobe per 8 channels of data):
_ _
LRCLK: _| |__________________________________________________________________| |______________
DIN: --< CH1 >< CH2 >< CH3 >< CH4 >< CH5 >< CH6 >< CH7 >< CH8 >------------------------< CH1 >< CH2 >...
6. I have written a small c code that uses the alsa/asound library to interface the ADC.
My problem is that the sunxi I2S drivers only seems to support S16_LE and S24_LE format and furthermore only up to 2 channels.
Given the timing above I think I'll need S32_LE and 8 channels.
7. My guess (please correct me I'm wrong) is that I need to update the I2S drivers to accomplish this.
Being new to Linux and especially on Linux drivers, I really don't know where to start.
I have looked into the source code of sunxi-i2s, sunxi-i2sdma, sndi2s and sunxi-i2s and at least three of them have settings regarding
bit format and number of channels, should I change them all?
8. Furthermore I have looked into the Allwinner A20 manual and in this it's stated that the I2S interface supports 16, 20 and 24 bits resolution,
so I'm not even sure that A20 supports 32 bit data words.
Grateful for any suggestions.
Regards
Per