问题
I have a custom board based on the imx28 CPU. The Serial port of the CPU is connected to the PCM output of a modem. I have to develop a driver for the modem's PCM interface to be a part of ALSA SoC. Can you point out some drivers in the kernel tree that reasembles with my setup?
回答1:
See the Documentation/sound/alsa/soc
directory in the Linux source. It explains how ASoC drivers are divided into three categories:
- Codec driver: These define the audio controls, interface capabilities, DAPM definition and codec I/O functions. It is your modem which is considered the "CODEC" in this case. In that situation, your CODEC driver is probably going to be very minimal, just defining the PCM sample rate (assuming it's fixed, e.g. 8000 samples/s) and data format (e.g. 16 bit linear).
- Look at source code in
sound/soc/codecs
- If you have an i.MX28 EVK (evaluation kit), look at
sgtl5000.c
andmxs_spdif.c
in particular, because the i.MX28 EVK has these two CODECs, and you can see how the drivers make them work.
- If you have an i.MX28 EVK (evaluation kit), look at
- Look at source code in
- Platform driver: audio DMA engine and audio interface driver (specifically, PCM for your case) for the platform, the platform being the Freescale MXS chip family.
- Machine driver: any machine specific controls and audio events.
For platform and machine drivers, see the following files in sound/soc/mxs
. I'm not quite clear as to which are considered "platform drivers" and which are "machine drivers", since they don't clearly state it.
mxs-spdif.c
andmxs-spdif-dai.c
, which are for the S/PDIF interface to the S/PDIF CODEC (output only).mxs-devb.c
andmxs-dai.c
, which are for the SAIF interface to the SGTL5000 CODEC.mxs-pcm.c
which I think handles the DMA stuff.
But I don't know if there's example code for the synchronous serial port (SSP) peripherals on the i.MX28, which is what you are interested in.
来源:https://stackoverflow.com/questions/11740507/alsa-with-pcm-interface-from-modem