*/ #include #define DRV_NAME "pcm5102a" #define RATES SNDRV_PCM_RATE_8000_96000 #define FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S32_LE) static struct snd_soc_codec_driver soc_codec_pcm5102a = ; static struct snd_soc_dai_driver pcm5102a_dai = ; static int pcm5102a_probe(struct platform_device *pdev) static int pcm5102a_remove(struct platform_device *pdev) #ifdef CONFIG_OF static const struct of_device_id pcm5102a_dt_ids = ; MODULE_DEVICE_TABLE(of, pcm5102a_dt_ids); #endif static struct platform_driver pcm5102a_driver = ; module_platform_driver(pcm5102a_driver); MODULE_AUTHOR("Josh Elliott "); MODULE_DESCRIPTION("PCM5102A dummy codec driver"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:" DRV_NAME); diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig index c2153cf..3e11da5 100644 --- a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig @@ -26,6 26,14 @@ config SND_AM33XX_SOC_EVM AM335X-EVMSK, AM43XX-GP-EVM, and Beagel Bone with Audio Cape boards have this setup.
config SND_AM33XX_SOC_PCM5102A tristate "So C Audio support for PCM5102A on Beagle Bone Black" depends on SND_DAVINCI_SOC && SOC_AM33XX select SND_SOC_PCM5102A help Say Y or M if you want to add support for So C audio on AM33XX Beagle Bone Black board using Mc ASP and PCM5102A.
It is meant to give an overview of the basic tasks required to configure an audio device to work with linux.
The following topics will be covered: NOTEYou don't actually need to have the PCM5102a board to follow this guide; the drivers that will be created will work just fine without it connected.
This template could easily be repurposed as the basis for a custom driver for another audio device.
To create our customer PCM5102a driver, we will borrow heavily from another simple driver called the ALSA So C SPDIF DIT driver.
Within the ALSA So C layer, it is grouped within the codec directory: This makes the driver Device Tree compatible, and it will allow us to reference this driver in the DTS file later on.
Now we can add an option to the kernel configuration so we can enable all this work we've completed.
Feel free to apply it to the SDK 7.0 kernel and follow along with the details below. In terms of configuration, it does not require a control interface as is the case with many audio codecs; instead, it internally determines the sampling rate and format of the I2S data with which it is fed.
For more information on the PCM5102a, refer to the datasheet: There is no existing linux driver written for this device (nor is there really a need for one), but for the purposes of this project, we will create a dummy template driver.
For Sitara Mc ASP, this machine layer driver is found here: Let's take a closer look at the .dai_fmt member of this structure.
We may have copied it directly from the tda998x, but it turns out it to be exactly the configuration that is needed for the PCM5102a.