Driver updating with linux

The necessary driver modifications are now in place.Now we can add an option to the kernel configuration so we can enable all this work we've completed.*/ #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.Should your search only reveal results for older service pack levels, it is safe to assume newer service packs already provide the drivers needed for your system.

[email protected]:~# aplay /usr/share/sounds/alsa/Front_Playing WAVE '/usr/share/sounds/alsa/Front_Left.wav' : Signed 16[20844.209594] PCM5102a hw params bit Little Endian, Rate 48000 Hz, Mono [20844.215907] sysclk=24000000 [20844.222443] bclk_freq=1536000 And that's it--you should hear sound out of your PCM5102a board.

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.

To do this, the following files must be edited: These are very simple changes that amount to looking at an existing entry, such as the PCM3008, and reproducing them to reflect PCM5102a.

Note that in sound/soc/codecs/Makefile, the changes must be reflective of the actual name of the driver we created before.


Leave a Reply