blob: 557ac16d43e2881377c82b0bbe0a48b308c96737 [file] [log] [blame]
Kuninori Morimotob0757062015-09-15 08:26:36 +00001/*
2 * ak4613.c -- Asahi Kasei ALSA Soc Audio driver
3 *
4 * Copyright (C) 2015 Renesas Electronics Corporation
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * Based on ak4642.c by Kuninori Morimoto
8 * Based on wm8731.c by Richard Purdie
9 * Based on ak4535.c by Richard Purdie
10 * Based on wm8753.c by Liam Girdwood
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <linux/clk.h>
18#include <linux/i2c.h>
19#include <linux/slab.h>
20#include <linux/of_device.h>
21#include <linux/module.h>
22#include <linux/regmap.h>
23#include <sound/soc.h>
24#include <sound/pcm_params.h>
Kuninori Morimotoe3a4d952015-09-18 00:52:44 +000025#include <sound/tlv.h>
Kuninori Morimotob0757062015-09-15 08:26:36 +000026
27#define PW_MGMT1 0x00 /* Power Management 1 */
28#define PW_MGMT2 0x01 /* Power Management 2 */
29#define PW_MGMT3 0x02 /* Power Management 3 */
30#define CTRL1 0x03 /* Control 1 */
31#define CTRL2 0x04 /* Control 2 */
32#define DEMP1 0x05 /* De-emphasis1 */
33#define DEMP2 0x06 /* De-emphasis2 */
34#define OFD 0x07 /* Overflow Detect */
35#define ZRD 0x08 /* Zero Detect */
36#define ICTRL 0x09 /* Input Control */
37#define OCTRL 0x0a /* Output Control */
38#define LOUT1 0x0b /* LOUT1 Volume Control */
39#define ROUT1 0x0c /* ROUT1 Volume Control */
40#define LOUT2 0x0d /* LOUT2 Volume Control */
41#define ROUT2 0x0e /* ROUT2 Volume Control */
42#define LOUT3 0x0f /* LOUT3 Volume Control */
43#define ROUT3 0x10 /* ROUT3 Volume Control */
44#define LOUT4 0x11 /* LOUT4 Volume Control */
45#define ROUT4 0x12 /* ROUT4 Volume Control */
46#define LOUT5 0x13 /* LOUT5 Volume Control */
47#define ROUT5 0x14 /* ROUT5 Volume Control */
48#define LOUT6 0x15 /* LOUT6 Volume Control */
49#define ROUT6 0x16 /* ROUT6 Volume Control */
50
51/* PW_MGMT1 */
52#define RSTN BIT(0)
53#define PMDAC BIT(1)
54#define PMADC BIT(2)
55#define PMVR BIT(3)
56
57/* PW_MGMT2 */
58#define PMAD_ALL 0x7
59
60/* PW_MGMT3 */
61#define PMDA_ALL 0x3f
62
63/* CTRL1 */
64#define DIF0 BIT(3)
65#define DIF1 BIT(4)
66#define DIF2 BIT(5)
67#define TDM0 BIT(6)
68#define TDM1 BIT(7)
69#define NO_FMT (0xff)
70#define FMT_MASK (0xf8)
71
72/* CTRL2 */
Kuninori Morimotob323dd32015-11-17 08:28:56 +000073#define DFS_MASK (3 << 2)
Kuninori Morimotob0757062015-09-15 08:26:36 +000074#define DFS_NORMAL_SPEED (0 << 2)
75#define DFS_DOUBLE_SPEED (1 << 2)
76#define DFS_QUAD_SPEED (2 << 2)
77
Kuninori Morimoto4898b612017-04-19 00:40:38 +000078/* ICTRL */
79#define ICTRL_MASK (0x3)
80
81/* OCTRL */
82#define OCTRL_MASK (0x3F)
83
Kuninori Morimotob0757062015-09-15 08:26:36 +000084struct ak4613_formats {
85 unsigned int width;
86 unsigned int fmt;
87};
88
89struct ak4613_interface {
90 struct ak4613_formats capture;
91 struct ak4613_formats playback;
92};
93
Kuninori Morimoto35299f12015-11-16 06:01:29 +000094struct ak4613_priv {
95 struct mutex lock;
96 const struct ak4613_interface *iface;
97
98 unsigned int fmt;
99 u8 oc;
100 u8 ic;
101 int cnt;
102};
103
Kuninori Morimotoe3a4d952015-09-18 00:52:44 +0000104/*
105 * Playback Volume
106 *
107 * max : 0x00 : 0 dB
108 * ( 0.5 dB step )
109 * min : 0xFE : -127.0 dB
110 * mute: 0xFF
111 */
112static const DECLARE_TLV_DB_SCALE(out_tlv, -12750, 50, 1);
113
114static const struct snd_kcontrol_new ak4613_snd_controls[] = {
115 SOC_DOUBLE_R_TLV("Digital Playback Volume1", LOUT1, ROUT1,
116 0, 0xFF, 1, out_tlv),
117 SOC_DOUBLE_R_TLV("Digital Playback Volume2", LOUT2, ROUT2,
118 0, 0xFF, 1, out_tlv),
119 SOC_DOUBLE_R_TLV("Digital Playback Volume3", LOUT3, ROUT3,
120 0, 0xFF, 1, out_tlv),
121 SOC_DOUBLE_R_TLV("Digital Playback Volume4", LOUT4, ROUT4,
122 0, 0xFF, 1, out_tlv),
123 SOC_DOUBLE_R_TLV("Digital Playback Volume5", LOUT5, ROUT5,
124 0, 0xFF, 1, out_tlv),
125 SOC_DOUBLE_R_TLV("Digital Playback Volume6", LOUT6, ROUT6,
126 0, 0xFF, 1, out_tlv),
127};
128
Kuninori Morimotob0757062015-09-15 08:26:36 +0000129static const struct reg_default ak4613_reg[] = {
130 { 0x0, 0x0f }, { 0x1, 0x07 }, { 0x2, 0x3f }, { 0x3, 0x20 },
131 { 0x4, 0x20 }, { 0x5, 0x55 }, { 0x6, 0x05 }, { 0x7, 0x07 },
132 { 0x8, 0x0f }, { 0x9, 0x07 }, { 0xa, 0x3f }, { 0xb, 0x00 },
133 { 0xc, 0x00 }, { 0xd, 0x00 }, { 0xe, 0x00 }, { 0xf, 0x00 },
134 { 0x10, 0x00 }, { 0x11, 0x00 }, { 0x12, 0x00 }, { 0x13, 0x00 },
135 { 0x14, 0x00 }, { 0x15, 0x00 }, { 0x16, 0x00 },
136};
137
Kuninori Morimoto35299f12015-11-16 06:01:29 +0000138#define AUDIO_IFACE_TO_VAL(fmts) ((fmts - ak4613_iface) << 3)
Kuninori Morimotob0757062015-09-15 08:26:36 +0000139#define AUDIO_IFACE(b, fmt) { b, SND_SOC_DAIFMT_##fmt }
140static const struct ak4613_interface ak4613_iface[] = {
141 /* capture */ /* playback */
Kuninori Morimotoec185f92017-05-08 02:28:13 +0000142 /* [0] - [2] are not supported */
Kuninori Morimotob0757062015-09-15 08:26:36 +0000143 [3] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(24, LEFT_J) },
144 [4] = { AUDIO_IFACE(24, I2S), AUDIO_IFACE(24, I2S) },
145};
146
147static const struct regmap_config ak4613_regmap_cfg = {
148 .reg_bits = 8,
149 .val_bits = 8,
150 .max_register = 0x16,
151 .reg_defaults = ak4613_reg,
152 .num_reg_defaults = ARRAY_SIZE(ak4613_reg),
Geert Uytterhoevendcd2d1f2016-06-16 14:34:30 +0200153 .cache_type = REGCACHE_RBTREE,
Kuninori Morimotob0757062015-09-15 08:26:36 +0000154};
155
156static const struct of_device_id ak4613_of_match[] = {
157 { .compatible = "asahi-kasei,ak4613", .data = &ak4613_regmap_cfg },
158 {},
159};
160MODULE_DEVICE_TABLE(of, ak4613_of_match);
161
162static const struct i2c_device_id ak4613_i2c_id[] = {
163 { "ak4613", (kernel_ulong_t)&ak4613_regmap_cfg },
164 { }
165};
166MODULE_DEVICE_TABLE(i2c, ak4613_i2c_id);
167
168static const struct snd_soc_dapm_widget ak4613_dapm_widgets[] = {
169
170 /* Outputs */
171 SND_SOC_DAPM_OUTPUT("LOUT1"),
172 SND_SOC_DAPM_OUTPUT("LOUT2"),
173 SND_SOC_DAPM_OUTPUT("LOUT3"),
174 SND_SOC_DAPM_OUTPUT("LOUT4"),
175 SND_SOC_DAPM_OUTPUT("LOUT5"),
176 SND_SOC_DAPM_OUTPUT("LOUT6"),
177
178 SND_SOC_DAPM_OUTPUT("ROUT1"),
179 SND_SOC_DAPM_OUTPUT("ROUT2"),
180 SND_SOC_DAPM_OUTPUT("ROUT3"),
181 SND_SOC_DAPM_OUTPUT("ROUT4"),
182 SND_SOC_DAPM_OUTPUT("ROUT5"),
183 SND_SOC_DAPM_OUTPUT("ROUT6"),
184
185 /* Inputs */
186 SND_SOC_DAPM_INPUT("LIN1"),
187 SND_SOC_DAPM_INPUT("LIN2"),
188
189 SND_SOC_DAPM_INPUT("RIN1"),
190 SND_SOC_DAPM_INPUT("RIN2"),
191
192 /* DAC */
193 SND_SOC_DAPM_DAC("DAC1", NULL, PW_MGMT3, 0, 0),
194 SND_SOC_DAPM_DAC("DAC2", NULL, PW_MGMT3, 1, 0),
195 SND_SOC_DAPM_DAC("DAC3", NULL, PW_MGMT3, 2, 0),
196 SND_SOC_DAPM_DAC("DAC4", NULL, PW_MGMT3, 3, 0),
197 SND_SOC_DAPM_DAC("DAC5", NULL, PW_MGMT3, 4, 0),
198 SND_SOC_DAPM_DAC("DAC6", NULL, PW_MGMT3, 5, 0),
199
200 /* ADC */
201 SND_SOC_DAPM_ADC("ADC1", NULL, PW_MGMT2, 0, 0),
202 SND_SOC_DAPM_ADC("ADC2", NULL, PW_MGMT2, 1, 0),
203};
204
205static const struct snd_soc_dapm_route ak4613_intercon[] = {
206 {"LOUT1", NULL, "DAC1"},
207 {"LOUT2", NULL, "DAC2"},
208 {"LOUT3", NULL, "DAC3"},
209 {"LOUT4", NULL, "DAC4"},
210 {"LOUT5", NULL, "DAC5"},
211 {"LOUT6", NULL, "DAC6"},
212
213 {"ROUT1", NULL, "DAC1"},
214 {"ROUT2", NULL, "DAC2"},
215 {"ROUT3", NULL, "DAC3"},
216 {"ROUT4", NULL, "DAC4"},
217 {"ROUT5", NULL, "DAC5"},
218 {"ROUT6", NULL, "DAC6"},
219
220 {"DAC1", NULL, "Playback"},
221 {"DAC2", NULL, "Playback"},
222 {"DAC3", NULL, "Playback"},
223 {"DAC4", NULL, "Playback"},
224 {"DAC5", NULL, "Playback"},
225 {"DAC6", NULL, "Playback"},
226
227 {"Capture", NULL, "ADC1"},
228 {"Capture", NULL, "ADC2"},
229
230 {"ADC1", NULL, "LIN1"},
231 {"ADC2", NULL, "LIN2"},
232
233 {"ADC1", NULL, "RIN1"},
234 {"ADC2", NULL, "RIN2"},
235};
236
237static void ak4613_dai_shutdown(struct snd_pcm_substream *substream,
238 struct snd_soc_dai *dai)
239{
240 struct snd_soc_codec *codec = dai->codec;
241 struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec);
242 struct device *dev = codec->dev;
243
244 mutex_lock(&priv->lock);
245 priv->cnt--;
246 if (priv->cnt < 0) {
247 dev_err(dev, "unexpected counter error\n");
248 priv->cnt = 0;
249 }
250 if (!priv->cnt)
Kuninori Morimoto35299f12015-11-16 06:01:29 +0000251 priv->iface = NULL;
Kuninori Morimotob0757062015-09-15 08:26:36 +0000252 mutex_unlock(&priv->lock);
253}
254
255static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
256{
257 struct snd_soc_codec *codec = dai->codec;
258 struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec);
259
260 fmt &= SND_SOC_DAIFMT_FORMAT_MASK;
261
262 switch (fmt) {
Kuninori Morimotob0757062015-09-15 08:26:36 +0000263 case SND_SOC_DAIFMT_LEFT_J:
264 case SND_SOC_DAIFMT_I2S:
265 priv->fmt = fmt;
Kuninori Morimotob0757062015-09-15 08:26:36 +0000266 break;
267 default:
268 return -EINVAL;
269 }
270
271 return 0;
272}
273
Kuninori Morimoto35299f12015-11-16 06:01:29 +0000274static bool ak4613_dai_fmt_matching(const struct ak4613_interface *iface,
275 int is_play,
276 unsigned int fmt, unsigned int width)
277{
278 const struct ak4613_formats *fmts;
279
280 fmts = (is_play) ? &iface->playback : &iface->capture;
281
282 if (fmts->fmt != fmt)
283 return false;
284
Kuninori Morimotoec185f92017-05-08 02:28:13 +0000285 if (fmts->width != width)
286 return false;
Kuninori Morimoto35299f12015-11-16 06:01:29 +0000287
288 return true;
289}
290
Kuninori Morimotob0757062015-09-15 08:26:36 +0000291static int ak4613_dai_hw_params(struct snd_pcm_substream *substream,
292 struct snd_pcm_hw_params *params,
293 struct snd_soc_dai *dai)
294{
295 struct snd_soc_codec *codec = dai->codec;
296 struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec);
Kuninori Morimoto35299f12015-11-16 06:01:29 +0000297 const struct ak4613_interface *iface;
Kuninori Morimotob0757062015-09-15 08:26:36 +0000298 struct device *dev = codec->dev;
299 unsigned int width = params_width(params);
300 unsigned int fmt = priv->fmt;
301 unsigned int rate;
302 int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
303 int i, ret;
304 u8 fmt_ctrl, ctrl2;
305
306 rate = params_rate(params);
307 switch (rate) {
308 case 32000:
309 case 44100:
310 case 48000:
311 ctrl2 = DFS_NORMAL_SPEED;
312 break;
313 case 88200:
314 case 96000:
315 ctrl2 = DFS_DOUBLE_SPEED;
316 break;
317 case 176400:
318 case 192000:
319 ctrl2 = DFS_QUAD_SPEED;
320 break;
321 default:
322 return -EINVAL;
323 }
324
325 /*
326 * FIXME
327 *
328 * It doesn't support TDM at this point
329 */
330 fmt_ctrl = NO_FMT;
Kuninori Morimotob0757062015-09-15 08:26:36 +0000331 ret = -EINVAL;
Kuninori Morimoto35299f12015-11-16 06:01:29 +0000332 iface = NULL;
Kuninori Morimotob0757062015-09-15 08:26:36 +0000333
334 mutex_lock(&priv->lock);
Kuninori Morimoto35299f12015-11-16 06:01:29 +0000335 if (priv->iface) {
336 if (ak4613_dai_fmt_matching(priv->iface, is_play, fmt, width))
337 iface = priv->iface;
338 } else {
339 for (i = ARRAY_SIZE(ak4613_iface); i >= 0; i--) {
340 if (!ak4613_dai_fmt_matching(ak4613_iface + i,
341 is_play,
342 fmt, width))
343 continue;
344 iface = ak4613_iface + i;
345 break;
346 }
347 }
348
349 if ((priv->iface == NULL) ||
350 (priv->iface == iface)) {
351 priv->iface = iface;
Kuninori Morimotob0757062015-09-15 08:26:36 +0000352 priv->cnt++;
353 ret = 0;
354 }
355 mutex_unlock(&priv->lock);
356
357 if (ret < 0)
358 goto hw_params_end;
359
Kuninori Morimoto35299f12015-11-16 06:01:29 +0000360 fmt_ctrl = AUDIO_IFACE_TO_VAL(iface);
361
Kuninori Morimotob0757062015-09-15 08:26:36 +0000362 snd_soc_update_bits(codec, CTRL1, FMT_MASK, fmt_ctrl);
Kuninori Morimotob323dd32015-11-17 08:28:56 +0000363 snd_soc_update_bits(codec, CTRL2, DFS_MASK, ctrl2);
Kuninori Morimotob0757062015-09-15 08:26:36 +0000364
Kuninori Morimoto4898b612017-04-19 00:40:38 +0000365 snd_soc_update_bits(codec, ICTRL, ICTRL_MASK, priv->ic);
366 snd_soc_update_bits(codec, OCTRL, OCTRL_MASK, priv->oc);
Kuninori Morimotoa3af0c62015-11-16 04:51:21 +0000367
Kuninori Morimotob0757062015-09-15 08:26:36 +0000368hw_params_end:
369 if (ret < 0)
370 dev_warn(dev, "unsupported data width/format combination\n");
371
372 return ret;
373}
374
375static int ak4613_set_bias_level(struct snd_soc_codec *codec,
376 enum snd_soc_bias_level level)
377{
378 u8 mgmt1 = 0;
379
380 switch (level) {
381 case SND_SOC_BIAS_ON:
382 mgmt1 |= RSTN;
383 /* fall through */
384 case SND_SOC_BIAS_PREPARE:
385 mgmt1 |= PMADC | PMDAC;
386 /* fall through */
387 case SND_SOC_BIAS_STANDBY:
388 mgmt1 |= PMVR;
389 /* fall through */
390 case SND_SOC_BIAS_OFF:
391 default:
392 break;
393 }
394
395 snd_soc_write(codec, PW_MGMT1, mgmt1);
396
397 return 0;
398}
399
400static const struct snd_soc_dai_ops ak4613_dai_ops = {
401 .shutdown = ak4613_dai_shutdown,
402 .set_fmt = ak4613_dai_set_fmt,
403 .hw_params = ak4613_dai_hw_params,
404};
405
406#define AK4613_PCM_RATE (SNDRV_PCM_RATE_32000 |\
407 SNDRV_PCM_RATE_44100 |\
408 SNDRV_PCM_RATE_48000 |\
409 SNDRV_PCM_RATE_64000 |\
410 SNDRV_PCM_RATE_88200 |\
411 SNDRV_PCM_RATE_96000 |\
412 SNDRV_PCM_RATE_176400 |\
413 SNDRV_PCM_RATE_192000)
Kuninori Morimotoec185f92017-05-08 02:28:13 +0000414#define AK4613_PCM_FMTBIT (SNDRV_PCM_FMTBIT_S24_LE)
Kuninori Morimotob0757062015-09-15 08:26:36 +0000415
416static struct snd_soc_dai_driver ak4613_dai = {
417 .name = "ak4613-hifi",
418 .playback = {
419 .stream_name = "Playback",
420 .channels_min = 2,
421 .channels_max = 2,
422 .rates = AK4613_PCM_RATE,
423 .formats = AK4613_PCM_FMTBIT,
424 },
425 .capture = {
426 .stream_name = "Capture",
427 .channels_min = 2,
428 .channels_max = 2,
429 .rates = AK4613_PCM_RATE,
430 .formats = AK4613_PCM_FMTBIT,
431 },
432 .ops = &ak4613_dai_ops,
433 .symmetric_rates = 1,
434};
435
Geert Uytterhoevenf9ae17b2016-06-16 14:34:31 +0200436static int ak4613_suspend(struct snd_soc_codec *codec)
437{
438 struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
439
440 regcache_cache_only(regmap, true);
441 regcache_mark_dirty(regmap);
442 return 0;
443}
444
Kuninori Morimotob0757062015-09-15 08:26:36 +0000445static int ak4613_resume(struct snd_soc_codec *codec)
446{
447 struct regmap *regmap = dev_get_regmap(codec->dev, NULL);
448
Geert Uytterhoevenf9ae17b2016-06-16 14:34:31 +0200449 regcache_cache_only(regmap, false);
Kuninori Morimotob0757062015-09-15 08:26:36 +0000450 return regcache_sync(regmap);
451}
452
453static struct snd_soc_codec_driver soc_codec_dev_ak4613 = {
Geert Uytterhoevenf9ae17b2016-06-16 14:34:31 +0200454 .suspend = ak4613_suspend,
Kuninori Morimotob0757062015-09-15 08:26:36 +0000455 .resume = ak4613_resume,
456 .set_bias_level = ak4613_set_bias_level,
Kuninori Morimotobeb84f72016-08-08 09:06:34 +0000457 .component_driver = {
458 .controls = ak4613_snd_controls,
459 .num_controls = ARRAY_SIZE(ak4613_snd_controls),
460 .dapm_widgets = ak4613_dapm_widgets,
461 .num_dapm_widgets = ARRAY_SIZE(ak4613_dapm_widgets),
462 .dapm_routes = ak4613_intercon,
463 .num_dapm_routes = ARRAY_SIZE(ak4613_intercon),
464 },
Kuninori Morimotob0757062015-09-15 08:26:36 +0000465};
466
Kuninori Morimotoa3af0c62015-11-16 04:51:21 +0000467static void ak4613_parse_of(struct ak4613_priv *priv,
468 struct device *dev)
469{
470 struct device_node *np = dev->of_node;
471 char prop[32];
472 int i;
473
474 /* Input 1 - 2 */
475 for (i = 0; i < 2; i++) {
Kuninori Morimoto5547ba62015-11-19 04:22:14 +0000476 snprintf(prop, sizeof(prop), "asahi-kasei,in%d-single-end", i + 1);
Kuninori Morimotoa3af0c62015-11-16 04:51:21 +0000477 if (!of_get_property(np, prop, NULL))
478 priv->ic |= 1 << i;
479 }
480
481 /* Output 1 - 6 */
482 for (i = 0; i < 6; i++) {
Kuninori Morimoto5547ba62015-11-19 04:22:14 +0000483 snprintf(prop, sizeof(prop), "asahi-kasei,out%d-single-end", i + 1);
Kuninori Morimotoa3af0c62015-11-16 04:51:21 +0000484 if (!of_get_property(np, prop, NULL))
485 priv->oc |= 1 << i;
486 }
487}
488
Kuninori Morimotob0757062015-09-15 08:26:36 +0000489static int ak4613_i2c_probe(struct i2c_client *i2c,
490 const struct i2c_device_id *id)
491{
492 struct device *dev = &i2c->dev;
493 struct device_node *np = dev->of_node;
494 const struct regmap_config *regmap_cfg;
495 struct regmap *regmap;
496 struct ak4613_priv *priv;
497
498 regmap_cfg = NULL;
499 if (np) {
500 const struct of_device_id *of_id;
501
502 of_id = of_match_device(ak4613_of_match, dev);
503 if (of_id)
504 regmap_cfg = of_id->data;
505 } else {
506 regmap_cfg = (const struct regmap_config *)id->driver_data;
507 }
508
509 if (!regmap_cfg)
510 return -EINVAL;
511
512 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
513 if (!priv)
514 return -ENOMEM;
515
Kuninori Morimotoa3af0c62015-11-16 04:51:21 +0000516 ak4613_parse_of(priv, dev);
517
Kuninori Morimoto35299f12015-11-16 06:01:29 +0000518 priv->iface = NULL;
Kuninori Morimotob0757062015-09-15 08:26:36 +0000519 priv->cnt = 0;
520
521 mutex_init(&priv->lock);
522
523 i2c_set_clientdata(i2c, priv);
524
525 regmap = devm_regmap_init_i2c(i2c, regmap_cfg);
526 if (IS_ERR(regmap))
527 return PTR_ERR(regmap);
528
529 return snd_soc_register_codec(dev, &soc_codec_dev_ak4613,
530 &ak4613_dai, 1);
531}
532
533static int ak4613_i2c_remove(struct i2c_client *client)
534{
535 snd_soc_unregister_codec(&client->dev);
536 return 0;
537}
538
539static struct i2c_driver ak4613_i2c_driver = {
540 .driver = {
541 .name = "ak4613-codec",
Kuninori Morimotob0757062015-09-15 08:26:36 +0000542 .of_match_table = ak4613_of_match,
543 },
544 .probe = ak4613_i2c_probe,
545 .remove = ak4613_i2c_remove,
546 .id_table = ak4613_i2c_id,
547};
548
549module_i2c_driver(ak4613_i2c_driver);
550
551MODULE_DESCRIPTION("Soc AK4613 driver");
552MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
553MODULE_LICENSE("GPL v2");