I2S driver
Angelo
s104259 at yahoo.it
Wed Mar 5 03:38:53 EST 2008
Pedro wrote:
Ok, here down is the code I told you.
A few considerations before:
- As I told you, it is very bad commented, sorry. I'm still working on it.
- It's is not an alsa driver, but it copies data to the PSC working as SPI mode (it is not I2S but you only need to change the PSC configuration).
- Its purpose is to establish a dma task to copy the data from a buffer to the PSC, where I had attached a Digital to Analog Converter that into sound through a speaker.
- Data alignment is imposed by DAC requirements.
- Clock configuration is fixed to 44.1 Khz, so audio data must be sampled using that frequency. Data must be also mono (only one converter attached).
- This module is part of a mayor project to stream audio data through ethernet, so it provides a function to copy audio data to audio buffers. If there's no data to copy, it copies a null buffer to keep silence.
- What can you find useful in this code? Configuration steps to establish DMA Tasks and PSC configuration.
- After the module I send you also the code from another module that establishes PSC as I2S configuration. Clocks where adjusted to send the audio data also at 44.1 Khz as fine tunned as possible due to communication requirements of the attached DAC in that hardware.
And finally, here is the code:
#define SPI_DBG
#ifdef SPI_DBG
#define DBG(x...) printk("(debug) " x)
#else
#define DBG(x...)
#endif
#include
#include
#include
#include
#include
#include
.....
Thanks for code.
But why i can't see library?
>After the module I send you also the code from another module that >establishes PSC as I2S configuration. Clocks where adjusted to send >the audio data also at 44.1 Khz as fine tunned as possible due to >communication requirements of the attached DAC in that hardware.
You'll send me another code?
And what about my file lite5200b.dts?
I must enable some like this?
// PSC3 in CODEC mode example
//i2s at 2400 { // PSC3
// device_type = "sound";
// compatible = "mpc5200b-psc-i2s";//not 5200 compatible
// cell-index = <2>;
// reg = <2400 100>;
// interrupts = <2 3 0>;
// interrupt-parent = <&mpc5200_pic>;
//};
---------------------------------
L'email della prossima generazione? Puoi averla con la Nuova Yahoo! Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20080304/f93ee2eb/attachment.htm
More information about the Linuxppc-embedded
mailing list