2 * CS4270 ALSA SoC (ASoC) codec driver
4 * Author: Timur Tabi <timur@freescale.com>
6 * Copyright 2007 Freescale Semiconductor, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
11 * This is an ASoC device driver for the Cirrus Logic CS4270 codec.
13 * Current features/limitations:
15 * 1) Software mode is supported. Stand-alone mode is not supported.
16 * 2) Only I2C is supported, not SPI
17 * 3) Only Master mode is supported, not Slave.
18 * 4) The machine driver's 'startup' function must call
19 * cs4270_set_dai_sysclk() with the value of MCLK.
20 * 5) Only I2S and left-justified modes are supported
21 * 6) Power management is not supported
22 * 7) The only supported control is volume and hardware mute (if enabled)
25 #include <linux/module.h>
26 #include <linux/platform_device.h>
27 #include <sound/core.h>
28 #include <sound/soc.h>
29 #include <sound/initval.h>
30 #include <linux/i2c.h>
32 /* Private data for the CS4270 */
33 struct cs4270_private {
34 unsigned int mclk; /* Input frequency of the MCLK pin */
35 unsigned int mode; /* The mode (I2S or left-justified) */
39 * The codec isn't really big-endian or little-endian, since the I2S
40 * interface requires data to be sent serially with the MSbit first.
41 * However, to support BE and LE I2S devices, we specify both here. That
42 * way, ALSA will always match the bit patterns.
44 #define CS4270_FORMATS (SNDRV_PCM_FMTBIT_S8 | \
45 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | \
46 SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S18_3BE | \
47 SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE | \
48 SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE | \
49 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE)
51 /* CS4270 registers addresses */
52 #define CS4270_CHIPID 0x01 /* Chip ID */
53 #define CS4270_PWRCTL 0x02 /* Power Control */
54 #define CS4270_MODE 0x03 /* Mode Control */
55 #define CS4270_FORMAT 0x04 /* Serial Format, ADC/DAC Control */
56 #define CS4270_TRANS 0x05 /* Transition Control */
57 #define CS4270_MUTE 0x06 /* Mute Control */
58 #define CS4270_VOLA 0x07 /* DAC Channel A Volume Control */
59 #define CS4270_VOLB 0x08 /* DAC Channel B Volume Control */
61 #define CS4270_FIRSTREG 0x01
62 #define CS4270_LASTREG 0x08
63 #define CS4270_NUMREGS (CS4270_LASTREG - CS4270_FIRSTREG + 1)
65 /* Bit masks for the CS4270 registers */
66 #define CS4270_CHIPID_ID 0xF0
67 #define CS4270_CHIPID_REV 0x0F
68 #define CS4270_PWRCTL_FREEZE 0x80
69 #define CS4270_PWRCTL_PDN_ADC 0x20
70 #define CS4270_PWRCTL_PDN_DAC 0x02
71 #define CS4270_PWRCTL_PDN 0x01
72 #define CS4270_MODE_SPEED_MASK 0x30
73 #define CS4270_MODE_1X 0x00
74 #define CS4270_MODE_2X 0x10
75 #define CS4270_MODE_4X 0x20
76 #define CS4270_MODE_SLAVE 0x30
77 #define CS4270_MODE_DIV_MASK 0x0E
78 #define CS4270_MODE_DIV1 0x00
79 #define CS4270_MODE_DIV15 0x02
80 #define CS4270_MODE_DIV2 0x04
81 #define CS4270_MODE_DIV3 0x06
82 #define CS4270_MODE_DIV4 0x08
83 #define CS4270_MODE_POPGUARD 0x01
84 #define CS4270_FORMAT_FREEZE_A 0x80
85 #define CS4270_FORMAT_FREEZE_B 0x40
86 #define CS4270_FORMAT_LOOPBACK 0x20
87 #define CS4270_FORMAT_DAC_MASK 0x18
88 #define CS4270_FORMAT_DAC_LJ 0x00
89 #define CS4270_FORMAT_DAC_I2S 0x08
90 #define CS4270_FORMAT_DAC_RJ16 0x18
91 #define CS4270_FORMAT_DAC_RJ24 0x10
92 #define CS4270_FORMAT_ADC_MASK 0x01
93 #define CS4270_FORMAT_ADC_LJ 0x00
94 #define CS4270_FORMAT_ADC_I2S 0x01
95 #define CS4270_TRANS_ONE_VOL 0x80
96 #define CS4270_TRANS_SOFT 0x40
97 #define CS4270_TRANS_ZERO 0x20
98 #define CS4270_TRANS_INV_ADC_A 0x08
99 #define CS4270_TRANS_INV_ADC_B 0x10
100 #define CS4270_TRANS_INV_DAC_A 0x02
101 #define CS4270_TRANS_INV_DAC_B 0x04
102 #define CS4270_TRANS_DEEMPH 0x01
103 #define CS4270_MUTE_AUTO 0x20
104 #define CS4270_MUTE_ADC_A 0x08
105 #define CS4270_MUTE_ADC_B 0x10
106 #define CS4270_MUTE_POLARITY 0x04
107 #define CS4270_MUTE_DAC_A 0x01
108 #define CS4270_MUTE_DAC_B 0x02
111 * Clock Ratio Selection for Master Mode with I2C enabled
113 * The data for this chart is taken from Table 5 of the CS4270 reference
116 * This table is used to determine how to program the Mode Control register.
117 * It is also used by cs4270_set_dai_sysclk() to tell ALSA which sampling
118 * rates the CS4270 currently supports.
120 * Each element in this array corresponds to the ratios in mclk_ratios[].
121 * These two arrays need to be in sync.
123 * 'speed_mode' is the corresponding bit pattern to be written to the
124 * MODE bits of the Mode Control Register
126 * 'mclk' is the corresponding bit pattern to be wirten to the MCLK bits of
127 * the Mode Control Register.
129 * In situations where a single ratio is represented by multiple speed
130 * modes, we favor the slowest speed. E.g, for a ratio of 128, we pick
131 * double-speed instead of quad-speed. However, the CS4270 errata states
132 * that Divide-By-1.5 can cause failures, so we avoid that mode where
135 * ERRATA: There is an errata for the CS4270 where divide-by-1.5 does not
136 * work if VD = 3.3V. If this effects you, select the
137 * CONFIG_SND_SOC_CS4270_VD33_ERRATA Kconfig option, and the driver will
138 * never select any sample rates that require divide-by-1.5.
144 } cs4270_mode_ratios[] = {
145 {64, CS4270_MODE_4X, CS4270_MODE_DIV1},
146 #ifndef CONFIG_SND_SOC_CS4270_VD33_ERRATA
147 {96, CS4270_MODE_4X, CS4270_MODE_DIV15},
149 {128, CS4270_MODE_2X, CS4270_MODE_DIV1},
150 {192, CS4270_MODE_4X, CS4270_MODE_DIV3},
151 {256, CS4270_MODE_1X, CS4270_MODE_DIV1},
152 {384, CS4270_MODE_2X, CS4270_MODE_DIV3},
153 {512, CS4270_MODE_1X, CS4270_MODE_DIV2},
154 {768, CS4270_MODE_1X, CS4270_MODE_DIV3},
155 {1024, CS4270_MODE_1X, CS4270_MODE_DIV4}
158 /* The number of MCLK/LRCK ratios supported by the CS4270 */
159 #define NUM_MCLK_RATIOS ARRAY_SIZE(cs4270_mode_ratios)
162 * Determine the CS4270 samples rates.
164 * 'freq' is the input frequency to MCLK. The other parameters are ignored.
166 * The value of MCLK is used to determine which sample rates are supported
167 * by the CS4270. The ratio of MCLK / Fs must be equal to one of nine
168 * support values: 64, 96, 128, 192, 256, 384, 512, 768, and 1024.
170 * This function calculates the nine ratios and determines which ones match
171 * a standard sample rate. If there's a match, then it is added to the list
172 * of support sample rates.
174 * This function must be called by the machine driver's 'startup' function,
175 * otherwise the list of supported sample rates will not be available in
178 * Note that in stand-alone mode, the sample rate is determined by input
179 * pins M0, M1, MDIV1, and MDIV2. Also in stand-alone mode, divide-by-3
180 * is not a programmable option. However, divide-by-3 is not an available
181 * option in stand-alone mode. This cases two problems: a ratio of 768 is
182 * not available (it requires divide-by-3) and B) ratios 192 and 384 can
183 * only be selected with divide-by-1.5, but there is an errate that make
184 * this selection difficult.
186 * In addition, there is no mechanism for communicating with the machine
187 * driver what the input settings can be. This would need to be implemented
188 * for stand-alone mode to work.
190 static int cs4270_set_dai_sysclk(struct snd_soc_dai *codec_dai,
191 int clk_id, unsigned int freq, int dir)
193 struct snd_soc_codec *codec = codec_dai->codec;
194 struct cs4270_private *cs4270 = codec->private_data;
195 unsigned int rates = 0;
196 unsigned int rate_min = -1;
197 unsigned int rate_max = 0;
202 for (i = 0; i < NUM_MCLK_RATIOS; i++) {
203 unsigned int rate = freq / cs4270_mode_ratios[i].ratio;
204 rates |= snd_pcm_rate_to_rate_bit(rate);
210 /* FIXME: soc should support a rate list */
211 rates &= ~SNDRV_PCM_RATE_KNOT;
214 printk(KERN_ERR "cs4270: could not find a valid sample rate\n");
218 codec_dai->playback.rates = rates;
219 codec_dai->playback.rate_min = rate_min;
220 codec_dai->playback.rate_max = rate_max;
222 codec_dai->capture.rates = rates;
223 codec_dai->capture.rate_min = rate_min;
224 codec_dai->capture.rate_max = rate_max;
230 * Configure the codec for the selected audio format
232 * This function takes a bitmask of SND_SOC_DAIFMT_x bits and programs the
235 * Currently, this function only supports SND_SOC_DAIFMT_I2S and
236 * SND_SOC_DAIFMT_LEFT_J. The CS4270 codec also supports right-justified
237 * data for playback only, but ASoC currently does not support different
238 * formats for playback vs. record.
240 static int cs4270_set_dai_fmt(struct snd_soc_dai *codec_dai,
243 struct snd_soc_codec *codec = codec_dai->codec;
244 struct cs4270_private *cs4270 = codec->private_data;
247 switch (format & SND_SOC_DAIFMT_FORMAT_MASK) {
248 case SND_SOC_DAIFMT_I2S:
249 case SND_SOC_DAIFMT_LEFT_J:
250 cs4270->mode = format & SND_SOC_DAIFMT_FORMAT_MASK;
253 printk(KERN_ERR "cs4270: invalid DAI format\n");
261 * Pre-fill the CS4270 register cache.
263 * We use the auto-increment feature of the CS4270 to read all registers in
266 static int cs4270_fill_cache(struct snd_soc_codec *codec)
268 u8 *cache = codec->reg_cache;
269 struct i2c_client *i2c_client = codec->control_data;
272 length = i2c_smbus_read_i2c_block_data(i2c_client,
273 CS4270_FIRSTREG | 0x80, CS4270_NUMREGS, cache);
275 if (length != CS4270_NUMREGS) {
276 printk(KERN_ERR "cs4270: I2C read failure, addr=0x%x\n",
285 * Read from the CS4270 register cache.
287 * This CS4270 registers are cached to avoid excessive I2C I/O operations.
288 * After the initial read to pre-fill the cache, the CS4270 never updates
289 * the register values, so we won't have a cache coherncy problem.
291 static unsigned int cs4270_read_reg_cache(struct snd_soc_codec *codec,
294 u8 *cache = codec->reg_cache;
296 if ((reg < CS4270_FIRSTREG) || (reg > CS4270_LASTREG))
299 return cache[reg - CS4270_FIRSTREG];
303 * Write to a CS4270 register via the I2C bus.
305 * This function writes the given value to the given CS4270 register, and
306 * also updates the register cache.
308 * Note that we don't use the hw_write function pointer of snd_soc_codec.
309 * That's because it's too clunky: the hw_write_t prototype does not match
310 * i2c_smbus_write_byte_data(), and it's just another layer of overhead.
312 static int cs4270_i2c_write(struct snd_soc_codec *codec, unsigned int reg,
315 u8 *cache = codec->reg_cache;
317 if ((reg < CS4270_FIRSTREG) || (reg > CS4270_LASTREG))
320 /* Only perform an I2C operation if the new value is different */
321 if (cache[reg - CS4270_FIRSTREG] != value) {
322 struct i2c_client *client = codec->control_data;
323 if (i2c_smbus_write_byte_data(client, reg, value)) {
324 printk(KERN_ERR "cs4270: I2C write failed\n");
328 /* We've written to the hardware, so update the cache */
329 cache[reg - CS4270_FIRSTREG] = value;
336 * Program the CS4270 with the given hardware parameters.
338 * The .ops functions are used to provide board-specific data, like
339 * input frequencies, to this driver. This function takes that information,
340 * combines it with the hardware parameters provided, and programs the
341 * hardware accordingly.
343 static int cs4270_hw_params(struct snd_pcm_substream *substream,
344 struct snd_pcm_hw_params *params,
345 struct snd_soc_dai *dai)
347 struct snd_soc_pcm_runtime *rtd = substream->private_data;
348 struct snd_soc_device *socdev = rtd->socdev;
349 struct snd_soc_codec *codec = socdev->codec;
350 struct cs4270_private *cs4270 = codec->private_data;
357 /* Figure out which MCLK/LRCK ratio to use */
359 rate = params_rate(params); /* Sampling rate, in Hz */
360 ratio = cs4270->mclk / rate; /* MCLK/LRCK ratio */
362 for (i = 0; i < NUM_MCLK_RATIOS; i++) {
363 if (cs4270_mode_ratios[i].ratio == ratio)
367 if (i == NUM_MCLK_RATIOS) {
368 /* We did not find a matching ratio */
369 printk(KERN_ERR "cs4270: could not find matching ratio\n");
373 /* Freeze and power-down the codec */
375 ret = snd_soc_write(codec, CS4270_PWRCTL, CS4270_PWRCTL_FREEZE |
376 CS4270_PWRCTL_PDN_ADC | CS4270_PWRCTL_PDN_DAC |
379 printk(KERN_ERR "cs4270: I2C write failed\n");
383 /* Program the mode control register */
385 reg = snd_soc_read(codec, CS4270_MODE);
386 reg &= ~(CS4270_MODE_SPEED_MASK | CS4270_MODE_DIV_MASK);
387 reg |= cs4270_mode_ratios[i].speed_mode | cs4270_mode_ratios[i].mclk;
389 ret = snd_soc_write(codec, CS4270_MODE, reg);
391 printk(KERN_ERR "cs4270: I2C write failed\n");
395 /* Program the format register */
397 reg = snd_soc_read(codec, CS4270_FORMAT);
398 reg &= ~(CS4270_FORMAT_DAC_MASK | CS4270_FORMAT_ADC_MASK);
400 switch (cs4270->mode) {
401 case SND_SOC_DAIFMT_I2S:
402 reg |= CS4270_FORMAT_DAC_I2S | CS4270_FORMAT_ADC_I2S;
404 case SND_SOC_DAIFMT_LEFT_J:
405 reg |= CS4270_FORMAT_DAC_LJ | CS4270_FORMAT_ADC_LJ;
408 printk(KERN_ERR "cs4270: unknown format\n");
412 ret = snd_soc_write(codec, CS4270_FORMAT, reg);
414 printk(KERN_ERR "cs4270: I2C write failed\n");
418 /* Disable auto-mute. This feature appears to be buggy, because in
419 some situations, auto-mute will not deactivate when it should. */
421 reg = snd_soc_read(codec, CS4270_MUTE);
422 reg &= ~CS4270_MUTE_AUTO;
423 ret = snd_soc_write(codec, CS4270_MUTE, reg);
425 printk(KERN_ERR "cs4270: I2C write failed\n");
429 /* Disable automatic volume control. It's enabled by default, and
430 * it causes volume change commands to be delayed, sometimes until
431 * after playback has started.
434 reg = cs4270_read_reg_cache(codec, CS4270_TRANS);
435 reg &= ~(CS4270_TRANS_SOFT | CS4270_TRANS_ZERO);
436 ret = cs4270_i2c_write(codec, CS4270_TRANS, reg);
438 printk(KERN_ERR "I2C write failed\n");
442 /* Thaw and power-up the codec */
444 ret = snd_soc_write(codec, CS4270_PWRCTL, 0);
446 printk(KERN_ERR "cs4270: I2C write failed\n");
453 #ifdef CONFIG_SND_SOC_CS4270_HWMUTE
455 * Set the CS4270 external mute
457 * This function toggles the mute bits in the MUTE register. The CS4270's
458 * mute capability is intended for external muting circuitry, so if the
459 * board does not have the MUTEA or MUTEB pins connected to such circuitry,
460 * then this function will do nothing.
462 static int cs4270_mute(struct snd_soc_dai *dai, int mute)
464 struct snd_soc_codec *codec = dai->codec;
467 reg6 = snd_soc_read(codec, CS4270_MUTE);
470 reg6 |= CS4270_MUTE_ADC_A | CS4270_MUTE_ADC_B |
471 CS4270_MUTE_DAC_A | CS4270_MUTE_DAC_B;
473 reg6 &= ~(CS4270_MUTE_ADC_A | CS4270_MUTE_ADC_B |
474 CS4270_MUTE_DAC_A | CS4270_MUTE_DAC_B);
476 return snd_soc_write(codec, CS4270_MUTE, reg6);
479 #define cs4270_mute NULL
482 /* A list of non-DAPM controls that the CS4270 supports */
483 static const struct snd_kcontrol_new cs4270_snd_controls[] = {
484 SOC_DOUBLE_R("Master Playback Volume",
485 CS4270_VOLA, CS4270_VOLB, 0, 0xFF, 1)
489 * Global variable to store socdev for i2c probe function.
491 * If struct i2c_driver had a private_data field, we wouldn't need to use
492 * cs4270_socdec. This is the only way to pass the socdev structure to
493 * cs4270_i2c_probe().
495 * The real solution to cs4270_socdev is to create a mechanism
496 * that maps I2C addresses to snd_soc_device structures. Perhaps the
497 * creation of the snd_soc_device object should be moved out of
498 * cs4270_probe() and into cs4270_i2c_probe(), but that would make this
499 * driver dependent on I2C. The CS4270 supports "stand-alone" mode, whereby
500 * the chip is *not* connected to the I2C bus, but is instead configured via
503 static struct snd_soc_device *cs4270_socdev;
506 * Initialize the I2C interface of the CS4270
508 * This function is called for whenever the I2C subsystem finds a device
509 * at a particular address.
511 * Note: snd_soc_new_pcms() must be called before this function can be called,
512 * because of snd_ctl_add().
514 static int cs4270_i2c_probe(struct i2c_client *i2c_client,
515 const struct i2c_device_id *id)
517 struct snd_soc_device *socdev = cs4270_socdev;
518 struct snd_soc_codec *codec = socdev->codec;
522 /* Probing all possible addresses has one drawback: if there are
523 multiple CS4270s on the bus, then you cannot specify which
524 socdev is matched with which CS4270. For now, we just reject
525 this I2C device if the socdev already has one attached. */
526 if (codec->control_data)
529 /* Note: codec_dai->codec is NULL here */
531 codec->reg_cache = kzalloc(CS4270_NUMREGS, GFP_KERNEL);
532 if (!codec->reg_cache) {
533 printk(KERN_ERR "cs4270: could not allocate register cache\n");
538 /* Verify that we have a CS4270 */
540 ret = i2c_smbus_read_byte_data(i2c_client, CS4270_CHIPID);
542 printk(KERN_ERR "cs4270: failed to read I2C\n");
545 /* The top four bits of the chip ID should be 1100. */
546 if ((ret & 0xF0) != 0xC0) {
547 /* The device at this address is not a CS4270 codec */
552 printk(KERN_INFO "cs4270: found device at I2C address %X\n",
554 printk(KERN_INFO "cs4270: hardware revision %X\n", ret & 0xF);
556 codec->control_data = i2c_client;
557 codec->read = cs4270_read_reg_cache;
558 codec->write = cs4270_i2c_write;
559 codec->reg_cache_size = CS4270_NUMREGS;
561 /* The I2C interface is set up, so pre-fill our register cache */
563 ret = cs4270_fill_cache(codec);
565 printk(KERN_ERR "cs4270: failed to fill register cache\n");
569 /* Add the non-DAPM controls */
571 for (i = 0; i < ARRAY_SIZE(cs4270_snd_controls); i++) {
572 struct snd_kcontrol *kctrl =
573 snd_soc_cnew(&cs4270_snd_controls[i], codec, NULL);
575 ret = snd_ctl_add(codec->card, kctrl);
580 i2c_set_clientdata(i2c_client, codec);
585 codec->control_data = NULL;
587 kfree(codec->reg_cache);
588 codec->reg_cache = NULL;
589 codec->reg_cache_size = 0;
594 static const struct i2c_device_id cs4270_id[] = {
598 MODULE_DEVICE_TABLE(i2c, cs4270_id);
600 static struct i2c_driver cs4270_i2c_driver = {
603 .owner = THIS_MODULE,
605 .id_table = cs4270_id,
606 .probe = cs4270_i2c_probe,
609 struct snd_soc_dai cs4270_dai = {
612 .stream_name = "Playback",
616 .formats = CS4270_FORMATS,
619 .stream_name = "Capture",
623 .formats = CS4270_FORMATS,
626 EXPORT_SYMBOL_GPL(cs4270_dai);
629 * ASoC probe function
631 * This function is called when the machine driver calls
632 * platform_device_add().
634 static int cs4270_probe(struct platform_device *pdev)
636 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
637 struct snd_soc_codec *codec;
640 printk(KERN_INFO "CS4270 ALSA SoC Codec\n");
642 /* Allocate enough space for the snd_soc_codec structure
643 and our private data together. */
644 codec = kzalloc(ALIGN(sizeof(struct snd_soc_codec), 4) +
645 sizeof(struct cs4270_private), GFP_KERNEL);
647 printk(KERN_ERR "cs4270: Could not allocate codec structure\n");
651 mutex_init(&codec->mutex);
652 INIT_LIST_HEAD(&codec->dapm_widgets);
653 INIT_LIST_HEAD(&codec->dapm_paths);
655 codec->name = "CS4270";
656 codec->owner = THIS_MODULE;
657 codec->dai = &cs4270_dai;
659 codec->private_data = (void *) codec +
660 ALIGN(sizeof(struct snd_soc_codec), 4);
662 socdev->codec = codec;
666 ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
668 printk(KERN_ERR "cs4270: failed to create PCMs\n");
669 goto error_free_codec;
672 cs4270_socdev = socdev;
674 ret = i2c_add_driver(&cs4270_i2c_driver);
676 printk(KERN_ERR "cs4270: failed to attach driver");
677 goto error_free_pcms;
680 /* Did we find a CS4270 on the I2C bus? */
681 if (!codec->control_data) {
682 printk(KERN_ERR "cs4270: failed to attach driver");
683 goto error_del_driver;
686 /* Initialize codec ops */
687 cs4270_dai.ops.hw_params = cs4270_hw_params;
688 cs4270_dai.ops.set_sysclk = cs4270_set_dai_sysclk;
689 cs4270_dai.ops.set_fmt = cs4270_set_dai_fmt;
690 cs4270_dai.ops.digital_mute = cs4270_mute;
692 ret = snd_soc_init_card(socdev);
694 printk(KERN_ERR "cs4270: failed to register card\n");
695 goto error_del_driver;
701 i2c_del_driver(&cs4270_i2c_driver);
704 snd_soc_free_pcms(socdev);
707 kfree(socdev->codec);
708 socdev->codec = NULL;
713 static int cs4270_remove(struct platform_device *pdev)
715 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
717 snd_soc_free_pcms(socdev);
719 i2c_del_driver(&cs4270_i2c_driver);
721 kfree(socdev->codec);
722 socdev->codec = NULL;
728 * ASoC codec device structure
730 * Assign this variable to the codec_dev field of the machine driver's
731 * snd_soc_device structure.
733 struct snd_soc_codec_device soc_codec_device_cs4270 = {
734 .probe = cs4270_probe,
735 .remove = cs4270_remove
737 EXPORT_SYMBOL_GPL(soc_codec_device_cs4270);
739 static int __init cs4270_init(void)
741 return snd_soc_register_dai(&cs4270_dai);
743 module_init(cs4270_init);
745 static void __exit cs4270_exit(void)
747 snd_soc_unregister_dai(&cs4270_dai);
749 module_exit(cs4270_exit);
751 MODULE_AUTHOR("Timur Tabi <timur@freescale.com>");
752 MODULE_DESCRIPTION("Cirrus Logic CS4270 ALSA SoC Codec Driver");
753 MODULE_LICENSE("GPL");