2 * File: sound/soc/codecs/ssm2602.c
3 * Author: Cliff Cai <Cliff.Cai@analog.com>
5 * Created: Tue June 06 2008
6 * Description: Driver for ssm2602 sound chip
9 * Copyright 2008 Analog Devices Inc.
11 * Bugs: Enter bugs at http://blackfin.uclinux.org/
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.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, see the file COPYING, or write
25 * to the Free Software Foundation, Inc.,
26 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 #include <linux/delay.h>
30 #include <linux/module.h>
31 #include <linux/regmap.h>
32 #include <linux/slab.h>
34 #include <sound/pcm.h>
35 #include <sound/pcm_params.h>
36 #include <sound/soc.h>
37 #include <sound/tlv.h>
41 /* codec private data */
44 const struct snd_pcm_hw_constraint_list *sysclk_constraints;
46 struct regmap *regmap;
48 enum ssm2602_type type;
49 unsigned int clk_out_pwr;
53 * ssm2602 register cache
54 * We can't read the ssm2602 register space when we are
55 * using 2 wire for device control, so we cache them instead.
56 * There is no point in caching the reset register
58 static const struct reg_default ssm2602_reg[SSM2602_CACHEREGNUM] = {
59 { .reg = 0x00, .def = 0x0097 },
60 { .reg = 0x01, .def = 0x0097 },
61 { .reg = 0x02, .def = 0x0079 },
62 { .reg = 0x03, .def = 0x0079 },
63 { .reg = 0x04, .def = 0x000a },
64 { .reg = 0x05, .def = 0x0008 },
65 { .reg = 0x06, .def = 0x009f },
66 { .reg = 0x07, .def = 0x000a },
67 { .reg = 0x08, .def = 0x0000 },
68 { .reg = 0x09, .def = 0x0000 }
72 /*Appending several "None"s just for OSS mixer use*/
73 static const char *ssm2602_input_select[] = {
77 static const char *ssm2602_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"};
79 static const struct soc_enum ssm2602_enum[] = {
80 SOC_ENUM_SINGLE(SSM2602_APANA, 2, ARRAY_SIZE(ssm2602_input_select),
81 ssm2602_input_select),
82 SOC_ENUM_SINGLE(SSM2602_APDIGI, 1, ARRAY_SIZE(ssm2602_deemph),
86 static const DECLARE_TLV_DB_RANGE(ssm260x_outmix_tlv,
87 0, 47, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 0),
88 48, 127, TLV_DB_SCALE_ITEM(-7400, 100, 0)
91 static const DECLARE_TLV_DB_SCALE(ssm260x_inpga_tlv, -3450, 150, 0);
92 static const DECLARE_TLV_DB_SCALE(ssm260x_sidetone_tlv, -1500, 300, 0);
94 static const struct snd_kcontrol_new ssm260x_snd_controls[] = {
95 SOC_DOUBLE_R_TLV("Capture Volume", SSM2602_LINVOL, SSM2602_RINVOL, 0, 45, 0,
97 SOC_DOUBLE_R("Capture Switch", SSM2602_LINVOL, SSM2602_RINVOL, 7, 1, 1),
99 SOC_SINGLE("ADC High Pass Filter Switch", SSM2602_APDIGI, 0, 1, 1),
100 SOC_SINGLE("Store DC Offset Switch", SSM2602_APDIGI, 4, 1, 0),
102 SOC_ENUM("Playback De-emphasis", ssm2602_enum[1]),
105 static const struct snd_kcontrol_new ssm2602_snd_controls[] = {
106 SOC_DOUBLE_R_TLV("Master Playback Volume", SSM2602_LOUT1V, SSM2602_ROUT1V,
107 0, 127, 0, ssm260x_outmix_tlv),
108 SOC_DOUBLE_R("Master Playback ZC Switch", SSM2602_LOUT1V, SSM2602_ROUT1V,
110 SOC_SINGLE_TLV("Sidetone Playback Volume", SSM2602_APANA, 6, 3, 1,
111 ssm260x_sidetone_tlv),
113 SOC_SINGLE("Mic Boost (+20dB)", SSM2602_APANA, 0, 1, 0),
114 SOC_SINGLE("Mic Boost2 (+20dB)", SSM2602_APANA, 8, 1, 0),
118 static const struct snd_kcontrol_new ssm260x_output_mixer_controls[] = {
119 SOC_DAPM_SINGLE("Line Bypass Switch", SSM2602_APANA, 3, 1, 0),
120 SOC_DAPM_SINGLE("HiFi Playback Switch", SSM2602_APANA, 4, 1, 0),
121 SOC_DAPM_SINGLE("Mic Sidetone Switch", SSM2602_APANA, 5, 1, 0),
124 static const struct snd_kcontrol_new mic_ctl =
125 SOC_DAPM_SINGLE("Switch", SSM2602_APANA, 1, 1, 1);
128 static const struct snd_kcontrol_new ssm2602_input_mux_controls =
129 SOC_DAPM_ENUM("Input Select", ssm2602_enum[0]);
131 static int ssm2602_mic_switch_event(struct snd_soc_dapm_widget *w,
132 struct snd_kcontrol *kcontrol, int event)
135 * According to the ssm2603 data sheet (control register sequencing),
136 * the digital core should be activated only after all necessary bits
137 * in the power register are enabled, and a delay determined by the
138 * decoupling capacitor on the VMID pin has passed. If the digital core
139 * is activated too early, or even before the ADC is powered up, audible
140 * artifacts appear at the beginning and end of the recorded signal.
142 * In practice, audible artifacts disappear well over 500 ms.
149 static const struct snd_soc_dapm_widget ssm260x_dapm_widgets[] = {
150 SND_SOC_DAPM_DAC("DAC", "HiFi Playback", SSM2602_PWR, 3, 1),
151 SND_SOC_DAPM_ADC("ADC", "HiFi Capture", SSM2602_PWR, 2, 1),
152 SND_SOC_DAPM_PGA("Line Input", SSM2602_PWR, 0, 1, NULL, 0),
154 SND_SOC_DAPM_SUPPLY("Digital Core Power", SSM2602_ACTIVE, 0, 0, NULL, 0),
156 SND_SOC_DAPM_OUTPUT("LOUT"),
157 SND_SOC_DAPM_OUTPUT("ROUT"),
158 SND_SOC_DAPM_INPUT("RLINEIN"),
159 SND_SOC_DAPM_INPUT("LLINEIN"),
162 static const struct snd_soc_dapm_widget ssm2602_dapm_widgets[] = {
163 SND_SOC_DAPM_MIXER("Output Mixer", SSM2602_PWR, 4, 1,
164 ssm260x_output_mixer_controls,
165 ARRAY_SIZE(ssm260x_output_mixer_controls)),
167 SND_SOC_DAPM_MUX("Input Mux", SND_SOC_NOPM, 0, 0, &ssm2602_input_mux_controls),
168 SND_SOC_DAPM_MICBIAS("Mic Bias", SSM2602_PWR, 1, 1),
170 SND_SOC_DAPM_SWITCH_E("Mic Switch", SSM2602_APANA, 1, 1, &mic_ctl,
171 ssm2602_mic_switch_event, SND_SOC_DAPM_PRE_PMU),
173 SND_SOC_DAPM_OUTPUT("LHPOUT"),
174 SND_SOC_DAPM_OUTPUT("RHPOUT"),
175 SND_SOC_DAPM_INPUT("MICIN"),
178 static const struct snd_soc_dapm_widget ssm2604_dapm_widgets[] = {
179 SND_SOC_DAPM_MIXER("Output Mixer", SND_SOC_NOPM, 0, 0,
180 ssm260x_output_mixer_controls,
181 ARRAY_SIZE(ssm260x_output_mixer_controls) - 1), /* Last element is the mic */
184 static const struct snd_soc_dapm_route ssm260x_routes[] = {
185 {"DAC", NULL, "Digital Core Power"},
186 {"ADC", NULL, "Digital Core Power"},
188 {"Output Mixer", "Line Bypass Switch", "Line Input"},
189 {"Output Mixer", "HiFi Playback Switch", "DAC"},
191 {"ROUT", NULL, "Output Mixer"},
192 {"LOUT", NULL, "Output Mixer"},
194 {"Line Input", NULL, "LLINEIN"},
195 {"Line Input", NULL, "RLINEIN"},
198 static const struct snd_soc_dapm_route ssm2602_routes[] = {
199 {"Output Mixer", "Mic Sidetone Switch", "Mic Bias"},
201 {"RHPOUT", NULL, "Output Mixer"},
202 {"LHPOUT", NULL, "Output Mixer"},
204 {"Input Mux", "Line", "Line Input"},
205 {"Input Mux", "Mic", "Mic Switch"},
206 {"ADC", NULL, "Input Mux"},
208 {"Mic Switch", NULL, "Mic Bias"},
210 {"Mic Bias", NULL, "MICIN"},
213 static const struct snd_soc_dapm_route ssm2604_routes[] = {
214 {"ADC", NULL, "Line Input"},
217 static const unsigned int ssm2602_rates_12288000[] = {
218 8000, 16000, 32000, 48000, 96000,
221 static const struct snd_pcm_hw_constraint_list ssm2602_constraints_12288000 = {
222 .list = ssm2602_rates_12288000,
223 .count = ARRAY_SIZE(ssm2602_rates_12288000),
226 static const unsigned int ssm2602_rates_11289600[] = {
227 8000, 11025, 22050, 44100, 88200,
230 static const struct snd_pcm_hw_constraint_list ssm2602_constraints_11289600 = {
231 .list = ssm2602_rates_11289600,
232 .count = ARRAY_SIZE(ssm2602_rates_11289600),
235 struct ssm2602_coeff {
241 #define SSM2602_COEFF_SRATE(sr, bosr, usb) (((sr) << 2) | ((bosr) << 1) | (usb))
243 /* codec mclk clock coefficients */
244 static const struct ssm2602_coeff ssm2602_coeff_table[] = {
246 {12288000, 48000, SSM2602_COEFF_SRATE(0x0, 0x0, 0x0)},
247 {18432000, 48000, SSM2602_COEFF_SRATE(0x0, 0x1, 0x0)},
248 {12000000, 48000, SSM2602_COEFF_SRATE(0x0, 0x0, 0x1)},
251 {12288000, 32000, SSM2602_COEFF_SRATE(0x6, 0x0, 0x0)},
252 {18432000, 32000, SSM2602_COEFF_SRATE(0x6, 0x1, 0x0)},
253 {12000000, 32000, SSM2602_COEFF_SRATE(0x6, 0x0, 0x1)},
256 {12288000, 16000, SSM2602_COEFF_SRATE(0x5, 0x0, 0x0)},
257 {18432000, 16000, SSM2602_COEFF_SRATE(0x5, 0x1, 0x0)},
258 {12000000, 16000, SSM2602_COEFF_SRATE(0xa, 0x0, 0x1)},
261 {12288000, 8000, SSM2602_COEFF_SRATE(0x3, 0x0, 0x0)},
262 {18432000, 8000, SSM2602_COEFF_SRATE(0x3, 0x1, 0x0)},
263 {11289600, 8000, SSM2602_COEFF_SRATE(0xb, 0x0, 0x0)},
264 {16934400, 8000, SSM2602_COEFF_SRATE(0xb, 0x1, 0x0)},
265 {12000000, 8000, SSM2602_COEFF_SRATE(0x3, 0x0, 0x1)},
268 {12288000, 96000, SSM2602_COEFF_SRATE(0x7, 0x0, 0x0)},
269 {18432000, 96000, SSM2602_COEFF_SRATE(0x7, 0x1, 0x0)},
270 {12000000, 96000, SSM2602_COEFF_SRATE(0x7, 0x0, 0x1)},
273 {11289600, 11025, SSM2602_COEFF_SRATE(0xc, 0x0, 0x0)},
274 {16934400, 11025, SSM2602_COEFF_SRATE(0xc, 0x1, 0x0)},
275 {12000000, 11025, SSM2602_COEFF_SRATE(0xc, 0x1, 0x1)},
278 {11289600, 22050, SSM2602_COEFF_SRATE(0xd, 0x0, 0x0)},
279 {16934400, 22050, SSM2602_COEFF_SRATE(0xd, 0x1, 0x0)},
280 {12000000, 22050, SSM2602_COEFF_SRATE(0xd, 0x1, 0x1)},
283 {11289600, 44100, SSM2602_COEFF_SRATE(0x8, 0x0, 0x0)},
284 {16934400, 44100, SSM2602_COEFF_SRATE(0x8, 0x1, 0x0)},
285 {12000000, 44100, SSM2602_COEFF_SRATE(0x8, 0x1, 0x1)},
288 {11289600, 88200, SSM2602_COEFF_SRATE(0xf, 0x0, 0x0)},
289 {16934400, 88200, SSM2602_COEFF_SRATE(0xf, 0x1, 0x0)},
290 {12000000, 88200, SSM2602_COEFF_SRATE(0xf, 0x1, 0x1)},
293 static inline int ssm2602_get_coeff(int mclk, int rate)
297 for (i = 0; i < ARRAY_SIZE(ssm2602_coeff_table); i++) {
298 if (ssm2602_coeff_table[i].rate == rate &&
299 ssm2602_coeff_table[i].mclk == mclk)
300 return ssm2602_coeff_table[i].srate;
305 static int ssm2602_hw_params(struct snd_pcm_substream *substream,
306 struct snd_pcm_hw_params *params,
307 struct snd_soc_dai *dai)
309 struct snd_soc_component *component = dai->component;
310 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
311 int srate = ssm2602_get_coeff(ssm2602->sysclk, params_rate(params));
317 regmap_write(ssm2602->regmap, SSM2602_SRATE, srate);
320 switch (params_width(params)) {
336 regmap_update_bits(ssm2602->regmap, SSM2602_IFACE,
337 IFACE_AUDIO_DATA_LEN, iface);
341 static int ssm2602_startup(struct snd_pcm_substream *substream,
342 struct snd_soc_dai *dai)
344 struct snd_soc_component *component = dai->component;
345 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
347 if (ssm2602->sysclk_constraints) {
348 snd_pcm_hw_constraint_list(substream->runtime, 0,
349 SNDRV_PCM_HW_PARAM_RATE,
350 ssm2602->sysclk_constraints);
356 static int ssm2602_mute(struct snd_soc_dai *dai, int mute)
358 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(dai->component);
361 regmap_update_bits(ssm2602->regmap, SSM2602_APDIGI,
362 APDIGI_ENABLE_DAC_MUTE,
363 APDIGI_ENABLE_DAC_MUTE);
365 regmap_update_bits(ssm2602->regmap, SSM2602_APDIGI,
366 APDIGI_ENABLE_DAC_MUTE, 0);
370 static int ssm2602_set_dai_sysclk(struct snd_soc_dai *codec_dai,
371 int clk_id, unsigned int freq, int dir)
373 struct snd_soc_component *component = codec_dai->component;
374 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
376 if (dir == SND_SOC_CLOCK_IN) {
377 if (clk_id != SSM2602_SYSCLK)
383 ssm2602->sysclk_constraints = &ssm2602_constraints_12288000;
387 ssm2602->sysclk_constraints = &ssm2602_constraints_11289600;
390 ssm2602->sysclk_constraints = NULL;
395 ssm2602->sysclk = freq;
400 case SSM2602_CLK_CLKOUT:
401 mask = PWR_CLK_OUT_PDN;
403 case SSM2602_CLK_XTO:
411 ssm2602->clk_out_pwr |= mask;
413 ssm2602->clk_out_pwr &= ~mask;
415 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
416 PWR_CLK_OUT_PDN | PWR_OSC_PDN, ssm2602->clk_out_pwr);
422 static int ssm2602_set_dai_fmt(struct snd_soc_dai *codec_dai,
425 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(codec_dai->component);
426 unsigned int iface = 0;
428 /* set master/slave audio interface */
429 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
430 case SND_SOC_DAIFMT_CBM_CFM:
433 case SND_SOC_DAIFMT_CBS_CFS:
439 /* interface format */
440 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
441 case SND_SOC_DAIFMT_I2S:
444 case SND_SOC_DAIFMT_RIGHT_J:
446 case SND_SOC_DAIFMT_LEFT_J:
449 case SND_SOC_DAIFMT_DSP_A:
452 case SND_SOC_DAIFMT_DSP_B:
459 /* clock inversion */
460 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
461 case SND_SOC_DAIFMT_NB_NF:
463 case SND_SOC_DAIFMT_IB_IF:
466 case SND_SOC_DAIFMT_IB_NF:
469 case SND_SOC_DAIFMT_NB_IF:
477 regmap_write(ssm2602->regmap, SSM2602_IFACE, iface);
481 static int ssm2602_set_bias_level(struct snd_soc_component *component,
482 enum snd_soc_bias_level level)
484 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
487 case SND_SOC_BIAS_ON:
488 /* vref/mid on, osc and clkout on if enabled */
489 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
490 PWR_POWER_OFF | PWR_CLK_OUT_PDN | PWR_OSC_PDN,
491 ssm2602->clk_out_pwr);
493 case SND_SOC_BIAS_PREPARE:
495 case SND_SOC_BIAS_STANDBY:
496 /* everything off except vref/vmid, */
497 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
498 PWR_POWER_OFF | PWR_CLK_OUT_PDN | PWR_OSC_PDN,
499 PWR_CLK_OUT_PDN | PWR_OSC_PDN);
501 case SND_SOC_BIAS_OFF:
503 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
504 PWR_POWER_OFF, PWR_POWER_OFF);
511 #define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
512 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
513 SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
514 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
515 SNDRV_PCM_RATE_96000)
517 #define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
518 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
520 static const struct snd_soc_dai_ops ssm2602_dai_ops = {
521 .startup = ssm2602_startup,
522 .hw_params = ssm2602_hw_params,
523 .digital_mute = ssm2602_mute,
524 .set_sysclk = ssm2602_set_dai_sysclk,
525 .set_fmt = ssm2602_set_dai_fmt,
528 static struct snd_soc_dai_driver ssm2602_dai = {
529 .name = "ssm2602-hifi",
531 .stream_name = "Playback",
534 .rates = SSM2602_RATES,
535 .formats = SSM2602_FORMATS,},
537 .stream_name = "Capture",
540 .rates = SSM2602_RATES,
541 .formats = SSM2602_FORMATS,},
542 .ops = &ssm2602_dai_ops,
543 .symmetric_rates = 1,
544 .symmetric_samplebits = 1,
547 static int ssm2602_resume(struct snd_soc_component *component)
549 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
551 regcache_sync(ssm2602->regmap);
556 static int ssm2602_component_probe(struct snd_soc_component *component)
558 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
559 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
562 regmap_update_bits(ssm2602->regmap, SSM2602_LOUT1V,
563 LOUT1V_LRHP_BOTH, LOUT1V_LRHP_BOTH);
564 regmap_update_bits(ssm2602->regmap, SSM2602_ROUT1V,
565 ROUT1V_RLHP_BOTH, ROUT1V_RLHP_BOTH);
567 ret = snd_soc_add_component_controls(component, ssm2602_snd_controls,
568 ARRAY_SIZE(ssm2602_snd_controls));
572 ret = snd_soc_dapm_new_controls(dapm, ssm2602_dapm_widgets,
573 ARRAY_SIZE(ssm2602_dapm_widgets));
577 return snd_soc_dapm_add_routes(dapm, ssm2602_routes,
578 ARRAY_SIZE(ssm2602_routes));
581 static int ssm2604_component_probe(struct snd_soc_component *component)
583 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
586 ret = snd_soc_dapm_new_controls(dapm, ssm2604_dapm_widgets,
587 ARRAY_SIZE(ssm2604_dapm_widgets));
591 return snd_soc_dapm_add_routes(dapm, ssm2604_routes,
592 ARRAY_SIZE(ssm2604_routes));
595 static int ssm260x_component_probe(struct snd_soc_component *component)
597 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
600 ret = regmap_write(ssm2602->regmap, SSM2602_RESET, 0);
602 dev_err(component->dev, "Failed to issue reset: %d\n", ret);
606 /* set the update bits */
607 regmap_update_bits(ssm2602->regmap, SSM2602_LINVOL,
608 LINVOL_LRIN_BOTH, LINVOL_LRIN_BOTH);
609 regmap_update_bits(ssm2602->regmap, SSM2602_RINVOL,
610 RINVOL_RLIN_BOTH, RINVOL_RLIN_BOTH);
611 /*select Line in as default input*/
612 regmap_write(ssm2602->regmap, SSM2602_APANA, APANA_SELECT_DAC |
613 APANA_ENABLE_MIC_BOOST);
615 switch (ssm2602->type) {
617 ret = ssm2602_component_probe(component);
620 ret = ssm2604_component_probe(component);
627 static const struct snd_soc_component_driver soc_component_dev_ssm2602 = {
628 .probe = ssm260x_component_probe,
629 .resume = ssm2602_resume,
630 .set_bias_level = ssm2602_set_bias_level,
631 .controls = ssm260x_snd_controls,
632 .num_controls = ARRAY_SIZE(ssm260x_snd_controls),
633 .dapm_widgets = ssm260x_dapm_widgets,
634 .num_dapm_widgets = ARRAY_SIZE(ssm260x_dapm_widgets),
635 .dapm_routes = ssm260x_routes,
636 .num_dapm_routes = ARRAY_SIZE(ssm260x_routes),
637 .suspend_bias_off = 1,
639 .use_pmdown_time = 1,
641 .non_legacy_dai_naming = 1,
644 static bool ssm2602_register_volatile(struct device *dev, unsigned int reg)
646 return reg == SSM2602_RESET;
649 const struct regmap_config ssm2602_regmap_config = {
653 .max_register = SSM2602_RESET,
654 .volatile_reg = ssm2602_register_volatile,
656 .cache_type = REGCACHE_RBTREE,
657 .reg_defaults = ssm2602_reg,
658 .num_reg_defaults = ARRAY_SIZE(ssm2602_reg),
660 EXPORT_SYMBOL_GPL(ssm2602_regmap_config);
662 int ssm2602_probe(struct device *dev, enum ssm2602_type type,
663 struct regmap *regmap)
665 struct ssm2602_priv *ssm2602;
668 return PTR_ERR(regmap);
670 ssm2602 = devm_kzalloc(dev, sizeof(*ssm2602), GFP_KERNEL);
674 dev_set_drvdata(dev, ssm2602);
675 ssm2602->type = type;
676 ssm2602->regmap = regmap;
678 return devm_snd_soc_register_component(dev, &soc_component_dev_ssm2602,
681 EXPORT_SYMBOL_GPL(ssm2602_probe);
683 MODULE_DESCRIPTION("ASoC SSM2602/SSM2603/SSM2604 driver");
684 MODULE_AUTHOR("Cliff Cai");
685 MODULE_LICENSE("GPL");