User`s guide
i.MX53 System Development User’s Guide, Rev. 1
Freescale Semiconductor 21-1
Chapter 21
Porting Audio Codecs to a Custom Board
This chapter explains how to port audio drivers from the Freescale reference BSP to a custom board. This
procedure varies depending on whether the audio codec on the custom board is the same as or different
than the audio codec on the Freescale reference design. This chapter first explains the common porting
task and then the different porting tasks.
21.1 Common Porting Task
The mxc_audio_platform_data structure must be defined and filled appropriately for the custom board
before doing any other porting tasks. An example of a filled structure can be found in the file located at
linux/arch/arm/mach-mx5/mx53_<board name>.c
static struct mxc_audio_platform_data sgtl5000_data = {
.ssi_num = 1,
.src_port = 2,
.ext_port = 5,
.hp_irq = IOMUX_TO_IRQ(MX53_PIN_ATA_DATA5),
.hp_status = headphone_det_status,
.amp_enable = mxc_sgtl5000_amp_enable,
.init = mxc_sgtl5000_init,
};
Customize the structure according to the following definitions:
ssi_num The ssi used for this codec
src_port The digital audio mux (DAM) port used for the internal SSI interface
(for details about the internal functionality of the DAM please refer to the
AUDMUX chapter of the i.MX53 Applications Processor Reference Manual)
ext_port The digital audio mux (DAM) port used for the external device audio interface
(for details about the internal functionality of the DAM please refer to the
AUDMUX chapter of the i.MX53 Applications Processor Reference Manual)
hp_irq The IRQ line used for headphone detection
hp_status A pointer to a function that returns the current headphone detect status. If a
different mechanism or GPIO is used for headphone detect in the custom board,
this function must be modified to accurately reflect the headphone presence.
amp_enable A pointer to a function that enables/disables the audio codec. For example, this
function can be used to turn on or turn off the regulator supplying the audio codec.
init The initialization routine for the audio codec. Any setup necessary for the audio
codec should be implemented in this function.