1
2
3
4
5
6
7
8
9
10
11
12#include <linux/module.h>
13#include <sound/soc.h>
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32static const struct snd_soc_dapm_widget ak4554_dapm_widgets[] = {
33SND_SOC_DAPM_INPUT("AINL"),
34SND_SOC_DAPM_INPUT("AINR"),
35
36SND_SOC_DAPM_OUTPUT("AOUTL"),
37SND_SOC_DAPM_OUTPUT("AOUTR"),
38};
39
40static const struct snd_soc_dapm_route ak4554_dapm_routes[] = {
41 { "Capture", NULL, "AINL" },
42 { "Capture", NULL, "AINR" },
43
44 { "AOUTL", NULL, "Playback" },
45 { "AOUTR", NULL, "Playback" },
46};
47
48static struct snd_soc_dai_driver ak4554_dai = {
49 .name = "ak4554-hifi",
50 .playback = {
51 .stream_name = "Playback",
52 .channels_min = 2,
53 .channels_max = 2,
54 .rates = SNDRV_PCM_RATE_8000_48000,
55 .formats = SNDRV_PCM_FMTBIT_S16_LE,
56 },
57 .capture = {
58 .stream_name = "Capture",
59 .channels_min = 2,
60 .channels_max = 2,
61 .rates = SNDRV_PCM_RATE_8000_48000,
62 .formats = SNDRV_PCM_FMTBIT_S16_LE,
63 },
64 .symmetric_rates = 1,
65};
66
67static struct snd_soc_codec_driver soc_codec_dev_ak4554 = {
68 .dapm_widgets = ak4554_dapm_widgets,
69 .num_dapm_widgets = ARRAY_SIZE(ak4554_dapm_widgets),
70 .dapm_routes = ak4554_dapm_routes,
71 .num_dapm_routes = ARRAY_SIZE(ak4554_dapm_routes),
72};
73
74static int ak4554_soc_probe(struct platform_device *pdev)
75{
76 return snd_soc_register_codec(&pdev->dev,
77 &soc_codec_dev_ak4554,
78 &ak4554_dai, 1);
79}
80
81static int ak4554_soc_remove(struct platform_device *pdev)
82{
83 snd_soc_unregister_codec(&pdev->dev);
84 return 0;
85}
86
87static struct of_device_id ak4554_of_match[] = {
88 { .compatible = "asahi-kasei,ak4554" },
89 {},
90};
91MODULE_DEVICE_TABLE(of, ak4554_of_match);
92
93static struct platform_driver ak4554_driver = {
94 .driver = {
95 .name = "ak4554-adc-dac",
96 .owner = THIS_MODULE,
97 .of_match_table = ak4554_of_match,
98 },
99 .probe = ak4554_soc_probe,
100 .remove = ak4554_soc_remove,
101};
102module_platform_driver(ak4554_driver);
103
104MODULE_LICENSE("GPL");
105MODULE_DESCRIPTION("SoC AK4554 driver");
106MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
107