|
| 1 | +/* |
| 2 | + * Driver for the PCM1794A codec |
| 3 | + * |
| 4 | + * Author: Florian Meier <[email protected]> |
| 5 | + * Copyright 2013 |
| 6 | + * |
| 7 | + * This program is free software; you can redistribute it and/or |
| 8 | + * modify it under the terms of the GNU General Public License |
| 9 | + * version 2 as published by the Free Software Foundation. |
| 10 | + * |
| 11 | + * This program is distributed in the hope that it will be useful, but |
| 12 | + * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | + * General Public License for more details. |
| 15 | + */ |
| 16 | + |
| 17 | + |
| 18 | +#include <linux/init.h> |
| 19 | +#include <linux/module.h> |
| 20 | +#include <linux/platform_device.h> |
| 21 | + |
| 22 | +#include <sound/soc.h> |
| 23 | + |
| 24 | +static struct snd_soc_dai_driver pcm1794a_dai = { |
| 25 | + .name = "pcm1794a-hifi", |
| 26 | + .playback = { |
| 27 | + .channels_min = 2, |
| 28 | + .channels_max = 2, |
| 29 | + .rates = SNDRV_PCM_RATE_8000_192000, |
| 30 | + .formats = SNDRV_PCM_FMTBIT_S16_LE | |
| 31 | + SNDRV_PCM_FMTBIT_S24_LE |
| 32 | + }, |
| 33 | +}; |
| 34 | + |
| 35 | +static struct snd_soc_component_driver soc_component_dev_pcm1794a; |
| 36 | + |
| 37 | +static int pcm1794a_probe(struct platform_device *pdev) |
| 38 | +{ |
| 39 | + return snd_soc_register_component(&pdev->dev, &soc_component_dev_pcm1794a, |
| 40 | + &pcm1794a_dai, 1); |
| 41 | +} |
| 42 | + |
| 43 | +static int pcm1794a_remove(struct platform_device *pdev) |
| 44 | +{ |
| 45 | + snd_soc_unregister_component(&pdev->dev); |
| 46 | + return 0; |
| 47 | +} |
| 48 | + |
| 49 | +static const struct of_device_id pcm1794a_of_match[] = { |
| 50 | + { .compatible = "ti,pcm1794a", }, |
| 51 | + { } |
| 52 | +}; |
| 53 | +MODULE_DEVICE_TABLE(of, pcm1794a_of_match); |
| 54 | + |
| 55 | +static struct platform_driver pcm1794a_component_driver = { |
| 56 | + .probe = pcm1794a_probe, |
| 57 | + .remove = pcm1794a_remove, |
| 58 | + .driver = { |
| 59 | + .name = "pcm1794a-codec", |
| 60 | + .owner = THIS_MODULE, |
| 61 | + .of_match_table = of_match_ptr(pcm1794a_of_match), |
| 62 | + }, |
| 63 | +}; |
| 64 | + |
| 65 | +module_platform_driver(pcm1794a_component_driver); |
| 66 | + |
| 67 | +MODULE_DESCRIPTION("ASoC PCM1794A codec driver"); |
| 68 | +MODULE_AUTHOR( "Florian Meier <[email protected]>"); |
| 69 | +MODULE_LICENSE("GPL v2"); |
0 commit comments