The WM8904 audio driver is mostly code complete and ready to begin initial testing

This commit is contained in:
Gregory Nutt 2014-07-19 18:52:58 -06:00
parent a84c776824
commit 4f6625380b
4 changed files with 589 additions and 527 deletions

View File

@ -2752,14 +2752,11 @@ Audio Support
System Type -> SSC Configuration
CONFIG_SAMA5_SSC_MAXINFLIGHT=16 : Up to 16 pending DMA transfers
CONFIG_SAMA5_SSC0_MASTER=y : Master mode
CONFIG_SAMA5_SSC0_DATALEN=16 : 16-bit data
CONFIG_SAMA5_SSC0_RX=y : Support a receiver
CONFIG_SAMA5_SSC0_RX_RKINPUT=y : Receiver gets clock from RK input
CONFIG_SAMA5_SSC0_RX=y : Support a receiver (although it is not used!)
CONFIG_SAMA5_SSC0_TX_TKINPUT=y : Receiver gets clock the RK0 input
CONFIG_SAMA5_SSC0_TX=y : Support a transmitter
CONFIG_SAMA5_SSC0_TX_MCKDIV=y : Transmitter gets clock from MCK/2
CONFIG_SAMA5_SSC0_MCKDIV_SAMPLERATE=48000 : Sampling at 48K samples/sec
CONFIG_SAMA5_SSC0_TX_TKOUTPUT_XFR=y : Outputs clock on TK when transferring data
CONFIG_SAMA5_SSC0_TX_TKINPUT=y : Transmitter gets clock the TK0 input
Audio
CONFIG_AUDIO=y : Audio support needed

File diff suppressed because it is too large Load Diff

View File

@ -60,8 +60,8 @@
*
* Description:
* Set the I2S RX sample rate. NOTE: This will have no effect if (1) the
* driver does not support an I2C receiver or if (2) the sample rate is
* driven by the I2C frame clock. This may also have unexpected side-
* driver does not support an I2S receiver or if (2) the sample rate is
* driven by the I2S frame clock. This may also have unexpected side-
* effects of the RX sample is coupled with the TX sample rate.
*
* Input Parameters:
@ -130,8 +130,8 @@
*
* Description:
* Set the I2S TX sample rate. NOTE: This will have no effect if (1) the
* driver does not support an I2C transmitter or if (2) the sample rate is
* driven by the I2C frame clock. This may also have unexpected side-
* driver does not support an I2S transmitter or if (2) the sample rate is
* driven by the I2S frame clock. This may also have unexpected side-
* effects of the TX sample is coupled with the RX sample rate.
*
* Input Parameters:
@ -176,7 +176,7 @@
* the completion of the transfer. The callback will be
* performed in the context of the worker thread.
* arg - An opaque argument that will be provided to the callback
* when the transfer complete.
* when the transfer completes.
* timeout - The timeout value to use. The transfer will be cancelled
* and an ETIMEDOUT error will be reported if this timeout
* elapsed without completion of the DMA transfer. Units

View File

@ -57,6 +57,15 @@
/* Configuration ************************************************************
*
* CONFIG_AUDIO_WM8904 - Enabled WM8904 support
* CONFIG_WM8904_INITVOLUME - The initial volume level in the range {0..1000}
* CONFIG_WM8904_INFLIGHT - Maximum number of buffers that the WM8904 driver
* will send to the I2S driver before any have completed.
* CONFIG_WM8904_MSG_PRIO - Priority of messages sent to the WM8904 worker
* thread.
* CONFIG_WM8904_BUFFER_SIZE - Preferred buffer size
* CONFIG_WM8904_NUM_BUFFERS - Preferred number of buffers
* CONFIG_WM8904_WORKER_STACKSIZE - Stack size to use when creating the the
* WM8904 worker thread.
*/
/* Pre-requisites */
@ -83,6 +92,34 @@
/* Default configuration values */
#ifndef CONFIG_WM8904_INITVOLUME
# define CONFIG_WM8904_INITVOLUME 250
#endif
#ifndef CONFIG_WM8904_INFLIGHT
# define CONFIG_WM8904_INFLIGHT 2
#endif
#if CONFIG_WM8904_INFLIGHT > 255
# error CONFIG_WM8904_INFLIGHT must fit in a uint8_t
#endif
#ifndef CONFIG_WM8904_MSG_PRIO
# define CONFIG_WM8904_MSG_PRIO 1
#endif
#ifndef CONFIG_WM8904_BUFFER_SIZE
# define CONFIG_WM8904_BUFFER_SIZE 8192
#endif
#ifndef CONFIG_WM8904_NUM_BUFFERS
# define CONFIG_WM8904_NUM_BUFFERS 4
#endif
#ifndef CONFIG_WM8904_WORKER_STACKSIZE
# define CONFIG_WM8904_WORKER_STACKSIZE 768
#endif
/* Helper macros ************************************************************/
#define WM8904_ATTACH(s,isr,arg) ((s)->attach(s,isr,arg))