Alsa with PCM interface from modem

走远了吗. 提交于 2019-12-10 17:56:54

问题


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 and mxs_spdif.c in particular, because the i.MX28 EVK has these two CODECs, and you can see how the drivers make them work.
  • 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 and mxs-spdif-dai.c, which are for the S/PDIF interface to the S/PDIF CODEC (output only).
  • mxs-devb.c and mxs-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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!