Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 1 | /* |
| 2 | * File: sound/soc/codecs/ad1836.c |
| 3 | * Author: Barry Song <Barry.Song@analog.com> |
| 4 | * |
| 5 | * Created: Aug 04 2009 |
| 6 | * Description: Driver for AD1836 sound chip |
| 7 | * |
| 8 | * Modified: |
| 9 | * Copyright 2009 Analog Devices Inc. |
| 10 | * |
| 11 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
| 12 | * |
| 13 | * This program is free software; you can redistribute it and/or modify |
| 14 | * it under the terms of the GNU General Public License as published by |
| 15 | * the Free Software Foundation; either version 2 of the License, or |
| 16 | * (at your option) any later version. |
| 17 | */ |
| 18 | |
| 19 | #include <linux/init.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 20 | #include <linux/slab.h> |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 21 | #include <linux/module.h> |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 22 | #include <linux/kernel.h> |
| 23 | #include <linux/device.h> |
| 24 | #include <sound/core.h> |
| 25 | #include <sound/pcm.h> |
| 26 | #include <sound/pcm_params.h> |
| 27 | #include <sound/initval.h> |
| 28 | #include <sound/soc.h> |
| 29 | #include <sound/tlv.h> |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 30 | #include <linux/spi/spi.h> |
| 31 | #include "ad1836.h" |
| 32 | |
| 33 | /* codec private data */ |
| 34 | struct ad1836_priv { |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 35 | enum snd_soc_control_type control_type; |
| 36 | void *control_data; |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 37 | }; |
| 38 | |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 39 | /* |
| 40 | * AD1836 volume/mute/de-emphasis etc. controls |
| 41 | */ |
| 42 | static const char *ad1836_deemp[] = {"None", "44.1kHz", "32kHz", "48kHz"}; |
| 43 | |
| 44 | static const struct soc_enum ad1836_deemp_enum = |
| 45 | SOC_ENUM_SINGLE(AD1836_DAC_CTRL1, 8, 4, ad1836_deemp); |
| 46 | |
Lars-Peter Clausen | 90bc11d | 2011-06-06 13:38:36 +0200 | [diff] [blame^] | 47 | #define AD1836_DAC_VOLUME(x) \ |
| 48 | SOC_DOUBLE_R("DAC" #x " Playback Volume", AD1836_DAC_L_VOL(x), \ |
| 49 | AD1836_DAC_R_VOL(x), 0, 0x3FF, 0) |
| 50 | |
| 51 | #define AD1836_DAC_SWITCH(x) \ |
| 52 | SOC_DOUBLE("DAC" #x " Playback Switch", AD1836_DAC_CTRL2, \ |
| 53 | AD1836_MUTE_LEFT(x), AD1836_MUTE_RIGHT(x), 1, 1) |
| 54 | |
| 55 | #define AD1836_ADC_SWITCH(x) \ |
| 56 | SOC_DOUBLE("ADC" #x " Capture Switch", AD1836_ADC_CTRL2, \ |
| 57 | AD1836_MUTE_LEFT(x), AD1836_MUTE_RIGHT(x), 1, 1) |
| 58 | |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 59 | static const struct snd_kcontrol_new ad1836_snd_controls[] = { |
| 60 | /* DAC volume control */ |
Lars-Peter Clausen | 90bc11d | 2011-06-06 13:38:36 +0200 | [diff] [blame^] | 61 | AD1836_DAC_VOLUME(1), |
| 62 | AD1836_DAC_VOLUME(2), |
| 63 | AD1836_DAC_VOLUME(3), |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 64 | |
| 65 | /* ADC switch control */ |
Lars-Peter Clausen | 90bc11d | 2011-06-06 13:38:36 +0200 | [diff] [blame^] | 66 | AD1836_ADC_SWITCH(1), |
| 67 | AD1836_ADC_SWITCH(2), |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 68 | |
| 69 | /* DAC switch control */ |
Lars-Peter Clausen | 90bc11d | 2011-06-06 13:38:36 +0200 | [diff] [blame^] | 70 | AD1836_DAC_SWITCH(1), |
| 71 | AD1836_DAC_SWITCH(2), |
| 72 | AD1836_DAC_SWITCH(3), |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 73 | |
| 74 | /* ADC high-pass filter */ |
| 75 | SOC_SINGLE("ADC High Pass Filter Switch", AD1836_ADC_CTRL1, |
| 76 | AD1836_ADC_HIGHPASS_FILTER, 1, 0), |
| 77 | |
| 78 | /* DAC de-emphasis */ |
| 79 | SOC_ENUM("Playback Deemphasis", ad1836_deemp_enum), |
| 80 | }; |
| 81 | |
| 82 | static const struct snd_soc_dapm_widget ad1836_dapm_widgets[] = { |
| 83 | SND_SOC_DAPM_DAC("DAC", "Playback", AD1836_DAC_CTRL1, |
| 84 | AD1836_DAC_POWERDOWN, 1), |
| 85 | SND_SOC_DAPM_ADC("ADC", "Capture", SND_SOC_NOPM, 0, 0), |
| 86 | SND_SOC_DAPM_SUPPLY("ADC_PWR", AD1836_ADC_CTRL1, |
| 87 | AD1836_ADC_POWERDOWN, 1, NULL, 0), |
| 88 | SND_SOC_DAPM_OUTPUT("DAC1OUT"), |
| 89 | SND_SOC_DAPM_OUTPUT("DAC2OUT"), |
| 90 | SND_SOC_DAPM_OUTPUT("DAC3OUT"), |
| 91 | SND_SOC_DAPM_INPUT("ADC1IN"), |
| 92 | SND_SOC_DAPM_INPUT("ADC2IN"), |
| 93 | }; |
| 94 | |
| 95 | static const struct snd_soc_dapm_route audio_paths[] = { |
| 96 | { "DAC", NULL, "ADC_PWR" }, |
| 97 | { "ADC", NULL, "ADC_PWR" }, |
| 98 | { "DAC1OUT", "DAC1 Switch", "DAC" }, |
| 99 | { "DAC2OUT", "DAC2 Switch", "DAC" }, |
| 100 | { "DAC3OUT", "DAC3 Switch", "DAC" }, |
| 101 | { "ADC", "ADC1 Switch", "ADC1IN" }, |
| 102 | { "ADC", "ADC2 Switch", "ADC2IN" }, |
| 103 | }; |
| 104 | |
| 105 | /* |
| 106 | * DAI ops entries |
| 107 | */ |
| 108 | |
| 109 | static int ad1836_set_dai_fmt(struct snd_soc_dai *codec_dai, |
| 110 | unsigned int fmt) |
| 111 | { |
| 112 | switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { |
| 113 | /* at present, we support adc aux mode to interface with |
| 114 | * blackfin sport tdm mode |
| 115 | */ |
| 116 | case SND_SOC_DAIFMT_DSP_A: |
| 117 | break; |
| 118 | default: |
| 119 | return -EINVAL; |
| 120 | } |
| 121 | |
| 122 | switch (fmt & SND_SOC_DAIFMT_INV_MASK) { |
| 123 | case SND_SOC_DAIFMT_IB_IF: |
| 124 | break; |
| 125 | default: |
| 126 | return -EINVAL; |
| 127 | } |
| 128 | |
| 129 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
| 130 | /* ALCLK,ABCLK are both output, AD1836 can only be master */ |
| 131 | case SND_SOC_DAIFMT_CBM_CFM: |
| 132 | break; |
| 133 | default: |
| 134 | return -EINVAL; |
| 135 | } |
| 136 | |
| 137 | return 0; |
| 138 | } |
| 139 | |
| 140 | static int ad1836_hw_params(struct snd_pcm_substream *substream, |
| 141 | struct snd_pcm_hw_params *params, |
| 142 | struct snd_soc_dai *dai) |
| 143 | { |
| 144 | int word_len = 0; |
| 145 | |
| 146 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 147 | struct snd_soc_codec *codec = rtd->codec; |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 148 | |
| 149 | /* bit size */ |
| 150 | switch (params_format(params)) { |
| 151 | case SNDRV_PCM_FORMAT_S16_LE: |
| 152 | word_len = 3; |
| 153 | break; |
| 154 | case SNDRV_PCM_FORMAT_S20_3LE: |
| 155 | word_len = 1; |
| 156 | break; |
| 157 | case SNDRV_PCM_FORMAT_S24_LE: |
| 158 | case SNDRV_PCM_FORMAT_S32_LE: |
| 159 | word_len = 0; |
| 160 | break; |
| 161 | } |
| 162 | |
| 163 | snd_soc_update_bits(codec, AD1836_DAC_CTRL1, |
| 164 | AD1836_DAC_WORD_LEN_MASK, word_len); |
| 165 | |
| 166 | snd_soc_update_bits(codec, AD1836_ADC_CTRL2, |
| 167 | AD1836_ADC_WORD_LEN_MASK, word_len); |
| 168 | |
| 169 | return 0; |
| 170 | } |
| 171 | |
Barry Song | 84549d2 | 2010-01-25 16:42:25 +0800 | [diff] [blame] | 172 | #ifdef CONFIG_PM |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 173 | static int ad1836_soc_suspend(struct snd_soc_codec *codec, |
Barry Song | 84549d2 | 2010-01-25 16:42:25 +0800 | [diff] [blame] | 174 | pm_message_t state) |
| 175 | { |
Barry Song | 84549d2 | 2010-01-25 16:42:25 +0800 | [diff] [blame] | 176 | /* reset clock control mode */ |
Barry Song | 63b62ab | 2010-01-27 11:46:17 +0800 | [diff] [blame] | 177 | u16 adc_ctrl2 = snd_soc_read(codec, AD1836_ADC_CTRL2); |
Barry Song | 84549d2 | 2010-01-25 16:42:25 +0800 | [diff] [blame] | 178 | adc_ctrl2 &= ~AD1836_ADC_SERFMT_MASK; |
| 179 | |
Barry Song | 63b62ab | 2010-01-27 11:46:17 +0800 | [diff] [blame] | 180 | return snd_soc_write(codec, AD1836_ADC_CTRL2, adc_ctrl2); |
Barry Song | 84549d2 | 2010-01-25 16:42:25 +0800 | [diff] [blame] | 181 | } |
| 182 | |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 183 | static int ad1836_soc_resume(struct snd_soc_codec *codec) |
Barry Song | 84549d2 | 2010-01-25 16:42:25 +0800 | [diff] [blame] | 184 | { |
Barry Song | 84549d2 | 2010-01-25 16:42:25 +0800 | [diff] [blame] | 185 | /* restore clock control mode */ |
Barry Song | 63b62ab | 2010-01-27 11:46:17 +0800 | [diff] [blame] | 186 | u16 adc_ctrl2 = snd_soc_read(codec, AD1836_ADC_CTRL2); |
Barry Song | 84549d2 | 2010-01-25 16:42:25 +0800 | [diff] [blame] | 187 | adc_ctrl2 |= AD1836_ADC_AUX; |
| 188 | |
Barry Song | 63b62ab | 2010-01-27 11:46:17 +0800 | [diff] [blame] | 189 | return snd_soc_write(codec, AD1836_ADC_CTRL2, adc_ctrl2); |
Barry Song | 84549d2 | 2010-01-25 16:42:25 +0800 | [diff] [blame] | 190 | } |
| 191 | #else |
| 192 | #define ad1836_soc_suspend NULL |
| 193 | #define ad1836_soc_resume NULL |
| 194 | #endif |
| 195 | |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 196 | static struct snd_soc_dai_ops ad1836_dai_ops = { |
| 197 | .hw_params = ad1836_hw_params, |
| 198 | .set_fmt = ad1836_set_dai_fmt, |
| 199 | }; |
| 200 | |
| 201 | /* codec DAI instance */ |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 202 | static struct snd_soc_dai_driver ad1836_dai = { |
| 203 | .name = "ad1836-hifi", |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 204 | .playback = { |
| 205 | .stream_name = "Playback", |
| 206 | .channels_min = 2, |
| 207 | .channels_max = 6, |
| 208 | .rates = SNDRV_PCM_RATE_48000, |
| 209 | .formats = SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S16_LE | |
| 210 | SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE, |
| 211 | }, |
| 212 | .capture = { |
| 213 | .stream_name = "Capture", |
| 214 | .channels_min = 2, |
| 215 | .channels_max = 4, |
| 216 | .rates = SNDRV_PCM_RATE_48000, |
| 217 | .formats = SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S16_LE | |
| 218 | SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE, |
| 219 | }, |
| 220 | .ops = &ad1836_dai_ops, |
| 221 | }; |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 222 | |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 223 | static int ad1836_probe(struct snd_soc_codec *codec) |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 224 | { |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 225 | struct ad1836_priv *ad1836 = snd_soc_codec_get_drvdata(codec); |
Liam Girdwood | ce6120c | 2010-11-05 15:53:46 +0200 | [diff] [blame] | 226 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 227 | int ret = 0; |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 228 | |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 229 | codec->control_data = ad1836->control_data; |
Barry Song | 63b62ab | 2010-01-27 11:46:17 +0800 | [diff] [blame] | 230 | ret = snd_soc_codec_set_cache_io(codec, 4, 12, SND_SOC_SPI); |
| 231 | if (ret < 0) { |
| 232 | dev_err(codec->dev, "failed to set cache I/O: %d\n", |
| 233 | ret); |
Barry Song | 63b62ab | 2010-01-27 11:46:17 +0800 | [diff] [blame] | 234 | return ret; |
| 235 | } |
| 236 | |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 237 | /* default setting for ad1836 */ |
| 238 | /* de-emphasis: 48kHz, power-on dac */ |
Barry Song | 63b62ab | 2010-01-27 11:46:17 +0800 | [diff] [blame] | 239 | snd_soc_write(codec, AD1836_DAC_CTRL1, 0x300); |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 240 | /* unmute dac channels */ |
Barry Song | 63b62ab | 2010-01-27 11:46:17 +0800 | [diff] [blame] | 241 | snd_soc_write(codec, AD1836_DAC_CTRL2, 0x0); |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 242 | /* high-pass filter enable, power-on adc */ |
Barry Song | 63b62ab | 2010-01-27 11:46:17 +0800 | [diff] [blame] | 243 | snd_soc_write(codec, AD1836_ADC_CTRL1, 0x100); |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 244 | /* unmute adc channles, adc aux mode */ |
Barry Song | 63b62ab | 2010-01-27 11:46:17 +0800 | [diff] [blame] | 245 | snd_soc_write(codec, AD1836_ADC_CTRL2, 0x180); |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 246 | /* left/right diff:PGA/MUX */ |
Barry Song | 63b62ab | 2010-01-27 11:46:17 +0800 | [diff] [blame] | 247 | snd_soc_write(codec, AD1836_ADC_CTRL3, 0x3A); |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 248 | /* volume */ |
Lars-Peter Clausen | 90bc11d | 2011-06-06 13:38:36 +0200 | [diff] [blame^] | 249 | snd_soc_write(codec, AD1836_DAC_L_VOL(1), 0x3FF); |
| 250 | snd_soc_write(codec, AD1836_DAC_R_VOL(1), 0x3FF); |
| 251 | snd_soc_write(codec, AD1836_DAC_L_VOL(2), 0x3FF); |
| 252 | snd_soc_write(codec, AD1836_DAC_R_VOL(2), 0x3FF); |
| 253 | snd_soc_write(codec, AD1836_DAC_L_VOL(3), 0x3FF); |
| 254 | snd_soc_write(codec, AD1836_DAC_R_VOL(3), 0x3FF); |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 255 | |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 256 | snd_soc_add_controls(codec, ad1836_snd_controls, |
| 257 | ARRAY_SIZE(ad1836_snd_controls)); |
Liam Girdwood | ce6120c | 2010-11-05 15:53:46 +0200 | [diff] [blame] | 258 | snd_soc_dapm_new_controls(dapm, ad1836_dapm_widgets, |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 259 | ARRAY_SIZE(ad1836_dapm_widgets)); |
Liam Girdwood | ce6120c | 2010-11-05 15:53:46 +0200 | [diff] [blame] | 260 | snd_soc_dapm_add_routes(dapm, audio_paths, ARRAY_SIZE(audio_paths)); |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 261 | |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 262 | return ret; |
| 263 | } |
| 264 | |
| 265 | /* power down chip */ |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 266 | static int ad1836_remove(struct snd_soc_codec *codec) |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 267 | { |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 268 | /* reset clock control mode */ |
| 269 | u16 adc_ctrl2 = snd_soc_read(codec, AD1836_ADC_CTRL2); |
| 270 | adc_ctrl2 &= ~AD1836_ADC_SERFMT_MASK; |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 271 | |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 272 | return snd_soc_write(codec, AD1836_ADC_CTRL2, adc_ctrl2); |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 273 | } |
| 274 | |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 275 | static struct snd_soc_codec_driver soc_codec_dev_ad1836 = { |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 276 | .probe = ad1836_probe, |
| 277 | .remove = ad1836_remove, |
Barry Song | 84549d2 | 2010-01-25 16:42:25 +0800 | [diff] [blame] | 278 | .suspend = ad1836_soc_suspend, |
| 279 | .resume = ad1836_soc_resume, |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 280 | .reg_cache_size = AD1836_NUM_REGS, |
| 281 | .reg_word_size = sizeof(u16), |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 282 | }; |
Liam Girdwood | f0fba2a | 2010-03-17 20:15:21 +0000 | [diff] [blame] | 283 | |
| 284 | static int __devinit ad1836_spi_probe(struct spi_device *spi) |
| 285 | { |
| 286 | struct ad1836_priv *ad1836; |
| 287 | int ret; |
| 288 | |
| 289 | ad1836 = kzalloc(sizeof(struct ad1836_priv), GFP_KERNEL); |
| 290 | if (ad1836 == NULL) |
| 291 | return -ENOMEM; |
| 292 | |
| 293 | spi_set_drvdata(spi, ad1836); |
| 294 | ad1836->control_data = spi; |
| 295 | ad1836->control_type = SND_SOC_SPI; |
| 296 | |
| 297 | ret = snd_soc_register_codec(&spi->dev, |
| 298 | &soc_codec_dev_ad1836, &ad1836_dai, 1); |
| 299 | if (ret < 0) |
| 300 | kfree(ad1836); |
| 301 | return ret; |
| 302 | } |
| 303 | |
| 304 | static int __devexit ad1836_spi_remove(struct spi_device *spi) |
| 305 | { |
| 306 | snd_soc_unregister_codec(&spi->dev); |
| 307 | kfree(spi_get_drvdata(spi)); |
| 308 | return 0; |
| 309 | } |
| 310 | |
| 311 | static struct spi_driver ad1836_spi_driver = { |
| 312 | .driver = { |
| 313 | .name = "ad1836-codec", |
| 314 | .owner = THIS_MODULE, |
| 315 | }, |
| 316 | .probe = ad1836_spi_probe, |
| 317 | .remove = __devexit_p(ad1836_spi_remove), |
| 318 | }; |
Barry Song | 7eaae41 | 2009-08-13 11:59:32 +0800 | [diff] [blame] | 319 | |
| 320 | static int __init ad1836_init(void) |
| 321 | { |
| 322 | int ret; |
| 323 | |
| 324 | ret = spi_register_driver(&ad1836_spi_driver); |
| 325 | if (ret != 0) { |
| 326 | printk(KERN_ERR "Failed to register ad1836 SPI driver: %d\n", |
| 327 | ret); |
| 328 | } |
| 329 | |
| 330 | return ret; |
| 331 | } |
| 332 | module_init(ad1836_init); |
| 333 | |
| 334 | static void __exit ad1836_exit(void) |
| 335 | { |
| 336 | spi_unregister_driver(&ad1836_spi_driver); |
| 337 | } |
| 338 | module_exit(ad1836_exit); |
| 339 | |
| 340 | MODULE_DESCRIPTION("ASoC ad1836 driver"); |
| 341 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
| 342 | MODULE_LICENSE("GPL"); |