blob: c1a1733f8a354dfdbfa6edced91c26b9ed160bd4 [file] [log] [blame]
Kuninori Morimotoa2911cd2013-07-03 21:15:13 -07001/*
2 * ak4554.c
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/module.h>
13#include <sound/soc.h>
14
15/*
16 * ak4554 is very simple DA/AD converter which has no setting register.
17 *
18 * CAUTION
19 *
20 * ak4554 playback format is SND_SOC_DAIFMT_RIGHT_J,
21 * and, capture format is SND_SOC_DAIFMT_LEFT_J
22 * on same bit clock, LR clock.
23 * But, this driver doesn't have snd_soc_dai_ops :: set_fmt
24 *
25 * CPU/Codec DAI image
26 *
27 * CPU-DAI1 (plaback only fmt = RIGHT_J) --+-- ak4554
28 * |
29 * CPU-DAI2 (capture only fmt = LEFT_J) ---+
30 */
31
32static struct snd_soc_dai_driver ak4554_dai = {
33 .name = "ak4554-hifi",
34 .playback = {
35 .stream_name = "Playback",
36 .channels_min = 2,
37 .channels_max = 2,
38 .rates = SNDRV_PCM_RATE_8000_48000,
39 .formats = SNDRV_PCM_FMTBIT_S16_LE,
40 },
41 .capture = {
42 .stream_name = "Capture",
43 .channels_min = 2,
44 .channels_max = 2,
45 .rates = SNDRV_PCM_RATE_8000_48000,
46 .formats = SNDRV_PCM_FMTBIT_S16_LE,
47 },
48 .symmetric_rates = 1,
49};
50
51static struct snd_soc_codec_driver soc_codec_dev_ak4554 = {
52};
53
54static int ak4554_soc_probe(struct platform_device *pdev)
55{
56 return snd_soc_register_codec(&pdev->dev,
57 &soc_codec_dev_ak4554,
58 &ak4554_dai, 1);
59}
60
61static int ak4554_soc_remove(struct platform_device *pdev)
62{
63 snd_soc_unregister_codec(&pdev->dev);
64 return 0;
65}
66
67static struct platform_driver ak4554_driver = {
68 .driver = {
69 .name = "ak4554-adc-dac",
70 .owner = THIS_MODULE,
71 },
72 .probe = ak4554_soc_probe,
73 .remove = ak4554_soc_remove,
74};
75module_platform_driver(ak4554_driver);
76
77MODULE_LICENSE("GPL");
78MODULE_DESCRIPTION("SoC AK4554 driver");
79MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");