ASoC: fix return value check in mt6351_codec_driver_probe()
[linux-2.6/btrfs-unstable.git] / sound / soc / codecs / pcm5102a.c
blob39ac2857a5545e7d437f097a878d6a7c24284b1b
1 /*
2 * Driver for the PCM5102A codec
4 * Author: Florian Meier <florian.meier@koalo.de>
5 * Copyright 2013
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.
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.
17 #include <linux/init.h>
18 #include <linux/module.h>
19 #include <linux/platform_device.h>
21 #include <sound/soc.h>
23 static struct snd_soc_dai_driver pcm5102a_dai = {
24 .name = "pcm5102a-hifi",
25 .playback = {
26 .channels_min = 2,
27 .channels_max = 2,
28 .rates = SNDRV_PCM_RATE_8000_192000,
29 .formats = SNDRV_PCM_FMTBIT_S16_LE |
30 SNDRV_PCM_FMTBIT_S24_LE |
31 SNDRV_PCM_FMTBIT_S32_LE
35 static struct snd_soc_component_driver soc_component_dev_pcm5102a = {
36 .idle_bias_on = 1,
37 .use_pmdown_time = 1,
38 .endianness = 1,
39 .non_legacy_dai_naming = 1,
42 static int pcm5102a_probe(struct platform_device *pdev)
44 return devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_pcm5102a,
45 &pcm5102a_dai, 1);
48 static const struct of_device_id pcm5102a_of_match[] = {
49 { .compatible = "ti,pcm5102a", },
50 { }
52 MODULE_DEVICE_TABLE(of, pcm5102a_of_match);
54 static struct platform_driver pcm5102a_codec_driver = {
55 .probe = pcm5102a_probe,
56 .driver = {
57 .name = "pcm5102a-codec",
58 .of_match_table = pcm5102a_of_match,
62 module_platform_driver(pcm5102a_codec_driver);
64 MODULE_DESCRIPTION("ASoC PCM5102A codec driver");
65 MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
66 MODULE_LICENSE("GPL v2");