Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Driver for the PCM5102A codec
0004  *
0005  * Author:  Florian Meier <florian.meier@koalo.de>
0006  *      Copyright 2013
0007  */
0008 
0009 #include <linux/init.h>
0010 #include <linux/module.h>
0011 #include <linux/platform_device.h>
0012 
0013 #include <sound/soc.h>
0014 
0015 static struct snd_soc_dai_driver pcm5102a_dai = {
0016     .name = "pcm5102a-hifi",
0017     .playback = {
0018         .channels_min = 2,
0019         .channels_max = 2,
0020         .rates = SNDRV_PCM_RATE_8000_384000,
0021         .formats = SNDRV_PCM_FMTBIT_S16_LE |
0022                SNDRV_PCM_FMTBIT_S24_LE |
0023                SNDRV_PCM_FMTBIT_S32_LE
0024     },
0025 };
0026 
0027 static struct snd_soc_component_driver soc_component_dev_pcm5102a = {
0028     .idle_bias_on       = 1,
0029     .use_pmdown_time    = 1,
0030     .endianness     = 1,
0031 };
0032 
0033 static int pcm5102a_probe(struct platform_device *pdev)
0034 {
0035     return devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_pcm5102a,
0036             &pcm5102a_dai, 1);
0037 }
0038 
0039 static const struct of_device_id pcm5102a_of_match[] = {
0040     { .compatible = "ti,pcm5102a", },
0041     { }
0042 };
0043 MODULE_DEVICE_TABLE(of, pcm5102a_of_match);
0044 
0045 static struct platform_driver pcm5102a_codec_driver = {
0046     .probe      = pcm5102a_probe,
0047     .driver     = {
0048         .name   = "pcm5102a-codec",
0049         .of_match_table = pcm5102a_of_match,
0050     },
0051 };
0052 
0053 module_platform_driver(pcm5102a_codec_driver);
0054 
0055 MODULE_DESCRIPTION("ASoC PCM5102A codec driver");
0056 MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
0057 MODULE_LICENSE("GPL v2");