1 // SPDX-License-Identifier: GPL-2.0-or-later
3 // File: sound/soc/codecs/ssm2602.c
4 // Author: Cliff Cai <Cliff.Cai@analog.com>
6 // Created: Tue June 06 2008
7 // Description: Driver for ssm2602 sound chip
10 // Copyright 2008 Analog Devices Inc.
12 // Bugs: Enter bugs at http://blackfin.uclinux.org/
14 #include <linux/delay.h>
15 #include <linux/module.h>
16 #include <linux/regmap.h>
17 #include <linux/slab.h>
19 #include <sound/pcm.h>
20 #include <sound/pcm_params.h>
21 #include <sound/soc.h>
22 #include <sound/tlv.h>
26 /* codec private data */
29 const struct snd_pcm_hw_constraint_list *sysclk_constraints;
31 struct regmap *regmap;
33 enum ssm2602_type type;
34 unsigned int clk_out_pwr;
38 * ssm2602 register cache
39 * We can't read the ssm2602 register space when we are
40 * using 2 wire for device control, so we cache them instead.
41 * There is no point in caching the reset register
43 static const struct reg_default ssm2602_reg[SSM2602_CACHEREGNUM] = {
44 { .reg = 0x00, .def = 0x0097 },
45 { .reg = 0x01, .def = 0x0097 },
46 { .reg = 0x02, .def = 0x0079 },
47 { .reg = 0x03, .def = 0x0079 },
48 { .reg = 0x04, .def = 0x000a },
49 { .reg = 0x05, .def = 0x0008 },
50 { .reg = 0x06, .def = 0x009f },
51 { .reg = 0x07, .def = 0x000a },
52 { .reg = 0x08, .def = 0x0000 },
53 { .reg = 0x09, .def = 0x0000 }
57 * ssm2602 register patch
58 * Workaround for playback distortions after power up: activates digital
59 * core, and then powers on output, DAC, and whole chip at the same time
62 static const struct reg_sequence ssm2602_patch[] = {
63 { SSM2602_ACTIVE, 0x01 },
64 { SSM2602_PWR, 0x07 },
65 { SSM2602_RESET, 0x00 },
69 /*Appending several "None"s just for OSS mixer use*/
70 static const char *ssm2602_input_select[] = {
74 static const char *ssm2602_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"};
76 static const struct soc_enum ssm2602_enum[] = {
77 SOC_ENUM_SINGLE(SSM2602_APANA, 2, ARRAY_SIZE(ssm2602_input_select),
78 ssm2602_input_select),
79 SOC_ENUM_SINGLE(SSM2602_APDIGI, 1, ARRAY_SIZE(ssm2602_deemph),
83 static const DECLARE_TLV_DB_RANGE(ssm260x_outmix_tlv,
84 0, 47, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 0),
85 48, 127, TLV_DB_SCALE_ITEM(-7400, 100, 0)
88 static const DECLARE_TLV_DB_SCALE(ssm260x_inpga_tlv, -3450, 150, 0);
89 static const DECLARE_TLV_DB_SCALE(ssm260x_sidetone_tlv, -1500, 300, 0);
91 static const struct snd_kcontrol_new ssm260x_snd_controls[] = {
92 SOC_DOUBLE_R_TLV("Capture Volume", SSM2602_LINVOL, SSM2602_RINVOL, 0, 45, 0,
94 SOC_DOUBLE_R("Capture Switch", SSM2602_LINVOL, SSM2602_RINVOL, 7, 1, 1),
96 SOC_SINGLE("ADC High Pass Filter Switch", SSM2602_APDIGI, 0, 1, 1),
97 SOC_SINGLE("Store DC Offset Switch", SSM2602_APDIGI, 4, 1, 0),
99 SOC_ENUM("Playback De-emphasis", ssm2602_enum[1]),
102 static const struct snd_kcontrol_new ssm2602_snd_controls[] = {
103 SOC_DOUBLE_R_TLV("Master Playback Volume", SSM2602_LOUT1V, SSM2602_ROUT1V,
104 0, 127, 0, ssm260x_outmix_tlv),
105 SOC_DOUBLE_R("Master Playback ZC Switch", SSM2602_LOUT1V, SSM2602_ROUT1V,
107 SOC_SINGLE_TLV("Sidetone Playback Volume", SSM2602_APANA, 6, 3, 1,
108 ssm260x_sidetone_tlv),
110 SOC_SINGLE("Mic Boost (+20dB)", SSM2602_APANA, 0, 1, 0),
111 SOC_SINGLE("Mic Boost2 (+20dB)", SSM2602_APANA, 8, 1, 0),
115 static const struct snd_kcontrol_new ssm260x_output_mixer_controls[] = {
116 SOC_DAPM_SINGLE("Line Bypass Switch", SSM2602_APANA, 3, 1, 0),
117 SOC_DAPM_SINGLE("HiFi Playback Switch", SSM2602_APANA, 4, 1, 0),
118 SOC_DAPM_SINGLE("Mic Sidetone Switch", SSM2602_APANA, 5, 1, 0),
121 static const struct snd_kcontrol_new mic_ctl =
122 SOC_DAPM_SINGLE("Switch", SSM2602_APANA, 1, 1, 1);
125 static const struct snd_kcontrol_new ssm2602_input_mux_controls =
126 SOC_DAPM_ENUM("Input Select", ssm2602_enum[0]);
128 static int ssm2602_mic_switch_event(struct snd_soc_dapm_widget *w,
129 struct snd_kcontrol *kcontrol, int event)
132 * According to the ssm2603 data sheet (control register sequencing),
133 * the digital core should be activated only after all necessary bits
134 * in the power register are enabled, and a delay determined by the
135 * decoupling capacitor on the VMID pin has passed. If the digital core
136 * is activated too early, or even before the ADC is powered up, audible
137 * artifacts appear at the beginning and end of the recorded signal.
139 * In practice, audible artifacts disappear well over 500 ms.
146 static const struct snd_soc_dapm_widget ssm260x_dapm_widgets[] = {
147 SND_SOC_DAPM_DAC("DAC", "HiFi Playback", SSM2602_PWR, 3, 1),
148 SND_SOC_DAPM_ADC("ADC", "HiFi Capture", SSM2602_PWR, 2, 1),
149 SND_SOC_DAPM_PGA("Line Input", SSM2602_PWR, 0, 1, NULL, 0),
151 SND_SOC_DAPM_SUPPLY("Digital Core Power", SSM2602_ACTIVE, 0, 0, NULL, 0),
153 SND_SOC_DAPM_OUTPUT("LOUT"),
154 SND_SOC_DAPM_OUTPUT("ROUT"),
155 SND_SOC_DAPM_INPUT("RLINEIN"),
156 SND_SOC_DAPM_INPUT("LLINEIN"),
159 static const struct snd_soc_dapm_widget ssm2602_dapm_widgets[] = {
160 SND_SOC_DAPM_MIXER("Output Mixer", SSM2602_PWR, 4, 1,
161 ssm260x_output_mixer_controls,
162 ARRAY_SIZE(ssm260x_output_mixer_controls)),
164 SND_SOC_DAPM_MUX("Input Mux", SND_SOC_NOPM, 0, 0, &ssm2602_input_mux_controls),
165 SND_SOC_DAPM_MICBIAS("Mic Bias", SSM2602_PWR, 1, 1),
167 SND_SOC_DAPM_SWITCH_E("Mic Switch", SSM2602_APANA, 1, 1, &mic_ctl,
168 ssm2602_mic_switch_event, SND_SOC_DAPM_PRE_PMU),
170 SND_SOC_DAPM_OUTPUT("LHPOUT"),
171 SND_SOC_DAPM_OUTPUT("RHPOUT"),
172 SND_SOC_DAPM_INPUT("MICIN"),
175 static const struct snd_soc_dapm_widget ssm2604_dapm_widgets[] = {
176 SND_SOC_DAPM_MIXER("Output Mixer", SND_SOC_NOPM, 0, 0,
177 ssm260x_output_mixer_controls,
178 ARRAY_SIZE(ssm260x_output_mixer_controls) - 1), /* Last element is the mic */
181 static const struct snd_soc_dapm_route ssm260x_routes[] = {
182 {"DAC", NULL, "Digital Core Power"},
183 {"ADC", NULL, "Digital Core Power"},
185 {"Output Mixer", "Line Bypass Switch", "Line Input"},
186 {"Output Mixer", "HiFi Playback Switch", "DAC"},
188 {"ROUT", NULL, "Output Mixer"},
189 {"LOUT", NULL, "Output Mixer"},
191 {"Line Input", NULL, "LLINEIN"},
192 {"Line Input", NULL, "RLINEIN"},
195 static const struct snd_soc_dapm_route ssm2602_routes[] = {
196 {"Output Mixer", "Mic Sidetone Switch", "Mic Bias"},
198 {"RHPOUT", NULL, "Output Mixer"},
199 {"LHPOUT", NULL, "Output Mixer"},
201 {"Input Mux", "Line", "Line Input"},
202 {"Input Mux", "Mic", "Mic Switch"},
203 {"ADC", NULL, "Input Mux"},
205 {"Mic Switch", NULL, "Mic Bias"},
207 {"Mic Bias", NULL, "MICIN"},
210 static const struct snd_soc_dapm_route ssm2604_routes[] = {
211 {"ADC", NULL, "Line Input"},
214 static const unsigned int ssm2602_rates_12288000[] = {
215 8000, 16000, 32000, 48000, 96000,
218 static const struct snd_pcm_hw_constraint_list ssm2602_constraints_12288000 = {
219 .list = ssm2602_rates_12288000,
220 .count = ARRAY_SIZE(ssm2602_rates_12288000),
223 static const unsigned int ssm2602_rates_11289600[] = {
224 8000, 11025, 22050, 44100, 88200,
227 static const struct snd_pcm_hw_constraint_list ssm2602_constraints_11289600 = {
228 .list = ssm2602_rates_11289600,
229 .count = ARRAY_SIZE(ssm2602_rates_11289600),
232 struct ssm2602_coeff {
238 #define SSM2602_COEFF_SRATE(sr, bosr, usb) (((sr) << 2) | ((bosr) << 1) | (usb))
240 /* codec mclk clock coefficients */
241 static const struct ssm2602_coeff ssm2602_coeff_table[] = {
243 {12288000, 48000, SSM2602_COEFF_SRATE(0x0, 0x0, 0x0)},
244 {18432000, 48000, SSM2602_COEFF_SRATE(0x0, 0x1, 0x0)},
245 {12000000, 48000, SSM2602_COEFF_SRATE(0x0, 0x0, 0x1)},
248 {12288000, 32000, SSM2602_COEFF_SRATE(0x6, 0x0, 0x0)},
249 {18432000, 32000, SSM2602_COEFF_SRATE(0x6, 0x1, 0x0)},
250 {12000000, 32000, SSM2602_COEFF_SRATE(0x6, 0x0, 0x1)},
253 {12288000, 16000, SSM2602_COEFF_SRATE(0x5, 0x0, 0x0)},
254 {18432000, 16000, SSM2602_COEFF_SRATE(0x5, 0x1, 0x0)},
255 {12000000, 16000, SSM2602_COEFF_SRATE(0xa, 0x0, 0x1)},
258 {12288000, 8000, SSM2602_COEFF_SRATE(0x3, 0x0, 0x0)},
259 {18432000, 8000, SSM2602_COEFF_SRATE(0x3, 0x1, 0x0)},
260 {11289600, 8000, SSM2602_COEFF_SRATE(0xb, 0x0, 0x0)},
261 {16934400, 8000, SSM2602_COEFF_SRATE(0xb, 0x1, 0x0)},
262 {12000000, 8000, SSM2602_COEFF_SRATE(0x3, 0x0, 0x1)},
265 {12288000, 96000, SSM2602_COEFF_SRATE(0x7, 0x0, 0x0)},
266 {18432000, 96000, SSM2602_COEFF_SRATE(0x7, 0x1, 0x0)},
267 {12000000, 96000, SSM2602_COEFF_SRATE(0x7, 0x0, 0x1)},
270 {11289600, 11025, SSM2602_COEFF_SRATE(0xc, 0x0, 0x0)},
271 {16934400, 11025, SSM2602_COEFF_SRATE(0xc, 0x1, 0x0)},
272 {12000000, 11025, SSM2602_COEFF_SRATE(0xc, 0x1, 0x1)},
275 {11289600, 22050, SSM2602_COEFF_SRATE(0xd, 0x0, 0x0)},
276 {16934400, 22050, SSM2602_COEFF_SRATE(0xd, 0x1, 0x0)},
277 {12000000, 22050, SSM2602_COEFF_SRATE(0xd, 0x1, 0x1)},
280 {11289600, 44100, SSM2602_COEFF_SRATE(0x8, 0x0, 0x0)},
281 {16934400, 44100, SSM2602_COEFF_SRATE(0x8, 0x1, 0x0)},
282 {12000000, 44100, SSM2602_COEFF_SRATE(0x8, 0x1, 0x1)},
285 {11289600, 88200, SSM2602_COEFF_SRATE(0xf, 0x0, 0x0)},
286 {16934400, 88200, SSM2602_COEFF_SRATE(0xf, 0x1, 0x0)},
287 {12000000, 88200, SSM2602_COEFF_SRATE(0xf, 0x1, 0x1)},
290 static inline int ssm2602_get_coeff(int mclk, int rate)
294 for (i = 0; i < ARRAY_SIZE(ssm2602_coeff_table); i++) {
295 if (ssm2602_coeff_table[i].rate == rate &&
296 ssm2602_coeff_table[i].mclk == mclk)
297 return ssm2602_coeff_table[i].srate;
302 static int ssm2602_hw_params(struct snd_pcm_substream *substream,
303 struct snd_pcm_hw_params *params,
304 struct snd_soc_dai *dai)
306 struct snd_soc_component *component = dai->component;
307 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
308 int srate = ssm2602_get_coeff(ssm2602->sysclk, params_rate(params));
314 regmap_write(ssm2602->regmap, SSM2602_SRATE, srate);
317 switch (params_width(params)) {
333 regmap_update_bits(ssm2602->regmap, SSM2602_IFACE,
334 IFACE_AUDIO_DATA_LEN, iface);
338 static int ssm2602_startup(struct snd_pcm_substream *substream,
339 struct snd_soc_dai *dai)
341 struct snd_soc_component *component = dai->component;
342 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
344 if (ssm2602->sysclk_constraints) {
345 snd_pcm_hw_constraint_list(substream->runtime, 0,
346 SNDRV_PCM_HW_PARAM_RATE,
347 ssm2602->sysclk_constraints);
353 static int ssm2602_mute(struct snd_soc_dai *dai, int mute, int direction)
355 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(dai->component);
358 regmap_update_bits(ssm2602->regmap, SSM2602_APDIGI,
359 APDIGI_ENABLE_DAC_MUTE,
360 APDIGI_ENABLE_DAC_MUTE);
362 regmap_update_bits(ssm2602->regmap, SSM2602_APDIGI,
363 APDIGI_ENABLE_DAC_MUTE, 0);
367 static int ssm2602_set_dai_sysclk(struct snd_soc_dai *codec_dai,
368 int clk_id, unsigned int freq, int dir)
370 struct snd_soc_component *component = codec_dai->component;
371 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
373 if (dir == SND_SOC_CLOCK_IN) {
374 if (clk_id != SSM2602_SYSCLK)
380 ssm2602->sysclk_constraints = &ssm2602_constraints_12288000;
384 ssm2602->sysclk_constraints = &ssm2602_constraints_11289600;
387 ssm2602->sysclk_constraints = NULL;
392 ssm2602->sysclk = freq;
397 case SSM2602_CLK_CLKOUT:
398 mask = PWR_CLK_OUT_PDN;
400 case SSM2602_CLK_XTO:
408 ssm2602->clk_out_pwr |= mask;
410 ssm2602->clk_out_pwr &= ~mask;
412 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
413 PWR_CLK_OUT_PDN | PWR_OSC_PDN, ssm2602->clk_out_pwr);
419 static int ssm2602_set_dai_fmt(struct snd_soc_dai *codec_dai,
422 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(codec_dai->component);
423 unsigned int iface = 0;
425 /* set master/slave audio interface */
426 switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
427 case SND_SOC_DAIFMT_CBP_CFP:
430 case SND_SOC_DAIFMT_CBC_CFC:
436 /* interface format */
437 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
438 case SND_SOC_DAIFMT_I2S:
441 case SND_SOC_DAIFMT_RIGHT_J:
443 case SND_SOC_DAIFMT_LEFT_J:
446 case SND_SOC_DAIFMT_DSP_A:
449 case SND_SOC_DAIFMT_DSP_B:
456 /* clock inversion */
457 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
458 case SND_SOC_DAIFMT_NB_NF:
460 case SND_SOC_DAIFMT_IB_IF:
463 case SND_SOC_DAIFMT_IB_NF:
466 case SND_SOC_DAIFMT_NB_IF:
474 regmap_write(ssm2602->regmap, SSM2602_IFACE, iface);
478 static int ssm2602_set_bias_level(struct snd_soc_component *component,
479 enum snd_soc_bias_level level)
481 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
484 case SND_SOC_BIAS_ON:
485 /* vref/mid on, osc and clkout on if enabled */
486 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
487 PWR_POWER_OFF | PWR_CLK_OUT_PDN | PWR_OSC_PDN,
488 ssm2602->clk_out_pwr);
490 case SND_SOC_BIAS_PREPARE:
492 case SND_SOC_BIAS_STANDBY:
493 /* everything off except vref/vmid, */
494 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
495 PWR_POWER_OFF | PWR_CLK_OUT_PDN | PWR_OSC_PDN,
496 PWR_CLK_OUT_PDN | PWR_OSC_PDN);
498 case SND_SOC_BIAS_OFF:
500 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
501 PWR_POWER_OFF, PWR_POWER_OFF);
508 #define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
509 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
510 SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
511 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
512 SNDRV_PCM_RATE_96000)
514 #define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
515 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
517 static const struct snd_soc_dai_ops ssm2602_dai_ops = {
518 .startup = ssm2602_startup,
519 .hw_params = ssm2602_hw_params,
520 .mute_stream = ssm2602_mute,
521 .set_sysclk = ssm2602_set_dai_sysclk,
522 .set_fmt = ssm2602_set_dai_fmt,
523 .no_capture_mute = 1,
526 static struct snd_soc_dai_driver ssm2602_dai = {
527 .name = "ssm2602-hifi",
529 .stream_name = "Playback",
532 .rates = SSM2602_RATES,
533 .formats = SSM2602_FORMATS,},
535 .stream_name = "Capture",
538 .rates = SSM2602_RATES,
539 .formats = SSM2602_FORMATS,},
540 .ops = &ssm2602_dai_ops,
542 .symmetric_sample_bits = 1,
545 static int ssm2602_resume(struct snd_soc_component *component)
547 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
549 regcache_sync(ssm2602->regmap);
554 static int ssm2602_component_probe(struct snd_soc_component *component)
556 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
557 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
560 regmap_update_bits(ssm2602->regmap, SSM2602_LOUT1V,
561 LOUT1V_LRHP_BOTH, LOUT1V_LRHP_BOTH);
562 regmap_update_bits(ssm2602->regmap, SSM2602_ROUT1V,
563 ROUT1V_RLHP_BOTH, ROUT1V_RLHP_BOTH);
565 ret = snd_soc_add_component_controls(component, ssm2602_snd_controls,
566 ARRAY_SIZE(ssm2602_snd_controls));
570 ret = snd_soc_dapm_new_controls(dapm, ssm2602_dapm_widgets,
571 ARRAY_SIZE(ssm2602_dapm_widgets));
575 return snd_soc_dapm_add_routes(dapm, ssm2602_routes,
576 ARRAY_SIZE(ssm2602_routes));
579 static int ssm2604_component_probe(struct snd_soc_component *component)
581 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
584 ret = snd_soc_dapm_new_controls(dapm, ssm2604_dapm_widgets,
585 ARRAY_SIZE(ssm2604_dapm_widgets));
589 return snd_soc_dapm_add_routes(dapm, ssm2604_routes,
590 ARRAY_SIZE(ssm2604_routes));
593 static int ssm260x_component_probe(struct snd_soc_component *component)
595 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
598 ret = regmap_write(ssm2602->regmap, SSM2602_RESET, 0);
600 dev_err(component->dev, "Failed to issue reset: %d\n", ret);
604 regmap_register_patch(ssm2602->regmap, ssm2602_patch,
605 ARRAY_SIZE(ssm2602_patch));
607 /* set the update bits */
608 regmap_update_bits(ssm2602->regmap, SSM2602_LINVOL,
609 LINVOL_LRIN_BOTH, LINVOL_LRIN_BOTH);
610 regmap_update_bits(ssm2602->regmap, SSM2602_RINVOL,
611 RINVOL_RLIN_BOTH, RINVOL_RLIN_BOTH);
612 /*select Line in as default input*/
613 regmap_write(ssm2602->regmap, SSM2602_APANA, APANA_SELECT_DAC |
614 APANA_ENABLE_MIC_BOOST);
616 switch (ssm2602->type) {
618 ret = ssm2602_component_probe(component);
621 ret = ssm2604_component_probe(component);
628 static const struct snd_soc_component_driver soc_component_dev_ssm2602 = {
629 .probe = ssm260x_component_probe,
630 .resume = ssm2602_resume,
631 .set_bias_level = ssm2602_set_bias_level,
632 .controls = ssm260x_snd_controls,
633 .num_controls = ARRAY_SIZE(ssm260x_snd_controls),
634 .dapm_widgets = ssm260x_dapm_widgets,
635 .num_dapm_widgets = ARRAY_SIZE(ssm260x_dapm_widgets),
636 .dapm_routes = ssm260x_routes,
637 .num_dapm_routes = ARRAY_SIZE(ssm260x_routes),
638 .suspend_bias_off = 1,
640 .use_pmdown_time = 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");