mtd: add ECC info for nand_flash_dev{}
[linux/fpc-iii.git] / sound / soc / codecs / ads117x.c
blob506d474c4d2227372b6b8e4a6743ca8f67ef7da3
1 /*
2 * ads117x.c -- Driver for ads1174/8 ADC chips
4 * Copyright 2009 ShotSpotter Inc.
5 * Author: Graeme Gregory <gg@slimlogic.co.uk>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
13 #include <linux/kernel.h>
14 #include <linux/slab.h>
15 #include <linux/init.h>
16 #include <linux/device.h>
17 #include <linux/module.h>
18 #include <sound/core.h>
19 #include <sound/pcm.h>
20 #include <sound/initval.h>
21 #include <sound/soc.h>
23 #define ADS117X_RATES (SNDRV_PCM_RATE_8000_48000)
24 #define ADS117X_FORMATS (SNDRV_PCM_FMTBIT_S16_LE)
26 static struct snd_soc_dai_driver ads117x_dai = {
27 /* ADC */
28 .name = "ads117x-hifi",
29 .capture = {
30 .stream_name = "Capture",
31 .channels_min = 1,
32 .channels_max = 32,
33 .rates = ADS117X_RATES,
34 .formats = ADS117X_FORMATS,},
37 static struct snd_soc_codec_driver soc_codec_dev_ads117x;
39 static int ads117x_probe(struct platform_device *pdev)
41 return snd_soc_register_codec(&pdev->dev,
42 &soc_codec_dev_ads117x, &ads117x_dai, 1);
45 static int ads117x_remove(struct platform_device *pdev)
47 snd_soc_unregister_codec(&pdev->dev);
48 return 0;
51 static struct platform_driver ads117x_codec_driver = {
52 .driver = {
53 .name = "ads117x-codec",
54 .owner = THIS_MODULE,
57 .probe = ads117x_probe,
58 .remove = ads117x_remove,
61 module_platform_driver(ads117x_codec_driver);
63 MODULE_DESCRIPTION("ASoC ads117x driver");
64 MODULE_AUTHOR("Graeme Gregory");
65 MODULE_LICENSE("GPL");