ASoC: rt5640: Allow snd_soc_component_set_jack() to override the codec IRQ
[linux-2.6-block.git] / sound / soc / codecs / pcm5102a.c
CommitLineData
1802d0be 1// SPDX-License-Identifier: GPL-2.0-only
97d3ddd7
FM
2/*
3 * Driver for the PCM5102A codec
4 *
5 * Author: Florian Meier <florian.meier@koalo.de>
6 * Copyright 2013
97d3ddd7
FM
7 */
8
9#include <linux/init.h>
10#include <linux/module.h>
11#include <linux/platform_device.h>
12
13#include <sound/soc.h>
14
15static struct snd_soc_dai_driver pcm5102a_dai = {
16 .name = "pcm5102a-hifi",
17 .playback = {
18 .channels_min = 2,
19 .channels_max = 2,
0beeb330 20 .rates = SNDRV_PCM_RATE_8000_384000,
97d3ddd7
FM
21 .formats = SNDRV_PCM_FMTBIT_S16_LE |
22 SNDRV_PCM_FMTBIT_S24_LE |
23 SNDRV_PCM_FMTBIT_S32_LE
24 },
25};
26
d5e90bad
KM
27static struct snd_soc_component_driver soc_component_dev_pcm5102a = {
28 .idle_bias_on = 1,
29 .use_pmdown_time = 1,
30 .endianness = 1,
31 .non_legacy_dai_naming = 1,
32};
97d3ddd7
FM
33
34static int pcm5102a_probe(struct platform_device *pdev)
35{
d5e90bad 36 return devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_pcm5102a,
97d3ddd7
FM
37 &pcm5102a_dai, 1);
38}
39
97d3ddd7
FM
40static const struct of_device_id pcm5102a_of_match[] = {
41 { .compatible = "ti,pcm5102a", },
42 { }
43};
44MODULE_DEVICE_TABLE(of, pcm5102a_of_match);
45
46static struct platform_driver pcm5102a_codec_driver = {
47 .probe = pcm5102a_probe,
97d3ddd7
FM
48 .driver = {
49 .name = "pcm5102a-codec",
97d3ddd7
FM
50 .of_match_table = pcm5102a_of_match,
51 },
52};
53
54module_platform_driver(pcm5102a_codec_driver);
55
56MODULE_DESCRIPTION("ASoC PCM5102A codec driver");
57MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
58MODULE_LICENSE("GPL v2");