Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASoC Drivers: Which files are platform, machine, and codec drivers? [closed]

When navigating the Linux ASoC files, which ones pertain to the following categories:

  • Platform Driver: ? (somewhere in sound/soc/ ?)
  • Machine Driver: ? (somewhere in sound/soc/ ?)
  • Codec Driver: sound/soc/codecs/partname.c

From kernel documentation: https://www.kernel.org/doc/Documentation/sound/alsa/soc/overview.txt

To achieve all this, ASoC basically splits an embedded audio system into 3 components :-

  • Codec driver: The codec driver is platform independent and contains audio controls, audio interface capabilities, codec DAPM definition and codec IO functions.

  • Platform driver: The platform driver contains the audio DMA engine and audio interface drivers (e.g. I2S, AC97, PCM) for that platform.

  • Machine driver: The machine driver handles any machine specific controls and audio events (e.g. turning on an amp at start of playback).

Also, where are the launching points for each of these pieces? (May be self explanatory when I find which files they are in)

like image 608
SwimBikeRun Avatar asked Jan 11 '23 20:01

SwimBikeRun


2 Answers

The codec drivers are in sound/soc/codecs/.

The platform drivers typcially are in sound/soc/platform/.

Machine drivers can be in some arch-specific directory; those for development boards typically are in the same directory; for example, this is sound/soc/atmel/Makefile:

# AT91 Platform Support
snd-soc-atmel-pcm-objs := atmel-pcm.o
snd-soc-atmel-pcm-pdc-objs := atmel-pcm-pdc.o
snd-soc-atmel-pcm-dma-objs := atmel-pcm-dma.o
snd-soc-atmel_ssc_dai-objs := atmel_ssc_dai.o

obj-$(CONFIG_SND_ATMEL_SOC) += snd-soc-atmel-pcm.o
obj-$(CONFIG_SND_ATMEL_SOC_PDC) += snd-soc-atmel-pcm-pdc.o
obj-$(CONFIG_SND_ATMEL_SOC_DMA) += snd-soc-atmel-pcm-dma.o
obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel_ssc_dai.o

# AT91 Machine Support
snd-soc-sam9g20-wm8731-objs := sam9g20_wm8731.o
snd-atmel-soc-wm8904-objs := atmel_wm8904.o
snd-soc-sam9x5-wm8731-objs := sam9x5_wm8731.o

obj-$(CONFIG_SND_AT91_SOC_SAM9G20_WM8731) += snd-soc-sam9g20-wm8731.o
obj-$(CONFIG_SND_ATMEL_SOC_WM8904) += snd-atmel-soc-wm8904.o
obj-$(CONFIG_SND_AT91_SOC_SAM9X5_WM8731) += snd-soc-sam9x5-wm8731.o
obj-$(CONFIG_SND_AT91_SOC_AFEB9260) += snd-soc-afeb9260.o

Machine driver files typcially implement a platform driver.

like image 108
CL. Avatar answered Jan 16 '23 02:01

CL.


Refer this link https://01.org/linuxgraphics/gfx-docs/drm/sound/soc/index.html, it has very good explanation on ASOC

Codec class drivers: The codec class driver is platform independent and contains audio controls, audio interface capabilities, codec DAPM definition and codec IO functions. This class extends to BT, FM and MODEM ICs if required. Codec class drivers should be generic code that can run on any architecture and machine.

Platform class drivers: The platform class driver includes the audio DMA engine driver, digital audio interface (DAI) drivers (e.g. I2S, AC97, PCM) and any audio DSP drivers for that platform.

Machine class driver: The machine driver class acts as the glue that describes and binds the other component drivers together to form an ALSA “sound card device”. It handles any machine specific controls and machine level audio events (e.g. turning on an amp at start of playback).

You can match this information with source code to find your corresponding Codec,Platform and Machine drivers.

Example

Codec Driver: https://elixir.bootlin.com/linux/latest/source/sound/soc/codecs/max98927.c

Platform Driver: https://elixir.bootlin.com/linux/latest/source/sound/soc/qcom/lpass-platform.c

Machine Driver: https://elixir.bootlin.com/linux/latest/source/sound/soc/qcom/sdm845.c

like image 39
Vijeth PO Avatar answered Jan 16 '23 00:01

Vijeth PO