1 // SPDX-License-Identifier: GPL-2.0-or-later
3 // File: sound/soc/codecs/ssm2602.c
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 if (ssm2602_coeff_table[i].mclk == mclk)
297 return ssm2602_coeff_table[i].srate;
298 if (ssm2602_coeff_table[i].mclk == mclk / 2)
299 return ssm2602_coeff_table[i].srate | SRATE_CORECLK_DIV2;
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, int direction)
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)
385 ssm2602->sysclk_constraints = &ssm2602_constraints_12288000;
391 ssm2602->sysclk_constraints = &ssm2602_constraints_11289600;
395 ssm2602->sysclk_constraints = NULL;
401 ssm2602->sysclk = freq;
406 case SSM2602_CLK_CLKOUT:
407 mask = PWR_CLK_OUT_PDN;
409 case SSM2602_CLK_XTO:
417 ssm2602->clk_out_pwr |= mask;
419 ssm2602->clk_out_pwr &= ~mask;
421 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
422 PWR_CLK_OUT_PDN | PWR_OSC_PDN, ssm2602->clk_out_pwr);
428 static int ssm2602_set_dai_fmt(struct snd_soc_dai *codec_dai,
431 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(codec_dai->component);
432 unsigned int iface = 0;
434 /* set master/slave audio interface */
435 switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
436 case SND_SOC_DAIFMT_CBP_CFP:
439 case SND_SOC_DAIFMT_CBC_CFC:
445 /* interface format */
446 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
447 case SND_SOC_DAIFMT_I2S:
450 case SND_SOC_DAIFMT_RIGHT_J:
452 case SND_SOC_DAIFMT_LEFT_J:
455 case SND_SOC_DAIFMT_DSP_A:
458 case SND_SOC_DAIFMT_DSP_B:
465 /* clock inversion */
466 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
467 case SND_SOC_DAIFMT_NB_NF:
469 case SND_SOC_DAIFMT_IB_IF:
472 case SND_SOC_DAIFMT_IB_NF:
475 case SND_SOC_DAIFMT_NB_IF:
483 regmap_write(ssm2602->regmap, SSM2602_IFACE, iface);
487 static int ssm2602_set_bias_level(struct snd_soc_component *component,
488 enum snd_soc_bias_level level)
490 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
493 case SND_SOC_BIAS_ON:
494 /* vref/mid on, osc and clkout on if enabled */
495 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
496 PWR_POWER_OFF | PWR_CLK_OUT_PDN | PWR_OSC_PDN,
497 ssm2602->clk_out_pwr);
499 case SND_SOC_BIAS_PREPARE:
501 case SND_SOC_BIAS_STANDBY:
502 /* everything off except vref/vmid, */
503 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
504 PWR_POWER_OFF | PWR_CLK_OUT_PDN | PWR_OSC_PDN,
505 PWR_CLK_OUT_PDN | PWR_OSC_PDN);
507 case SND_SOC_BIAS_OFF:
509 regmap_update_bits(ssm2602->regmap, SSM2602_PWR,
510 PWR_POWER_OFF, PWR_POWER_OFF);
517 #define SSM2602_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
518 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
519 SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
520 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
521 SNDRV_PCM_RATE_96000)
523 #define SSM2602_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
524 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
526 static const struct snd_soc_dai_ops ssm2602_dai_ops = {
527 .startup = ssm2602_startup,
528 .hw_params = ssm2602_hw_params,
529 .mute_stream = ssm2602_mute,
530 .set_sysclk = ssm2602_set_dai_sysclk,
531 .set_fmt = ssm2602_set_dai_fmt,
532 .no_capture_mute = 1,
535 static struct snd_soc_dai_driver ssm2602_dai = {
536 .name = "ssm2602-hifi",
538 .stream_name = "Playback",
541 .rates = SSM2602_RATES,
542 .formats = SSM2602_FORMATS,},
544 .stream_name = "Capture",
547 .rates = SSM2602_RATES,
548 .formats = SSM2602_FORMATS,},
549 .ops = &ssm2602_dai_ops,
551 .symmetric_sample_bits = 1,
554 static int ssm2602_resume(struct snd_soc_component *component)
556 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
558 regcache_sync(ssm2602->regmap);
563 static int ssm2602_component_probe(struct snd_soc_component *component)
565 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
566 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
569 regmap_update_bits(ssm2602->regmap, SSM2602_LOUT1V,
570 LOUT1V_LRHP_BOTH, LOUT1V_LRHP_BOTH);
571 regmap_update_bits(ssm2602->regmap, SSM2602_ROUT1V,
572 ROUT1V_RLHP_BOTH, ROUT1V_RLHP_BOTH);
574 ret = snd_soc_add_component_controls(component, ssm2602_snd_controls,
575 ARRAY_SIZE(ssm2602_snd_controls));
579 ret = snd_soc_dapm_new_controls(dapm, ssm2602_dapm_widgets,
580 ARRAY_SIZE(ssm2602_dapm_widgets));
584 return snd_soc_dapm_add_routes(dapm, ssm2602_routes,
585 ARRAY_SIZE(ssm2602_routes));
588 static int ssm2604_component_probe(struct snd_soc_component *component)
590 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
593 ret = snd_soc_dapm_new_controls(dapm, ssm2604_dapm_widgets,
594 ARRAY_SIZE(ssm2604_dapm_widgets));
598 return snd_soc_dapm_add_routes(dapm, ssm2604_routes,
599 ARRAY_SIZE(ssm2604_routes));
602 static int ssm260x_component_probe(struct snd_soc_component *component)
604 struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
607 ret = regmap_write(ssm2602->regmap, SSM2602_RESET, 0);
609 dev_err(component->dev, "Failed to issue reset: %d\n", ret);
613 regmap_register_patch(ssm2602->regmap, ssm2602_patch,
614 ARRAY_SIZE(ssm2602_patch));
616 /* set the update bits */
617 regmap_update_bits(ssm2602->regmap, SSM2602_LINVOL,
618 LINVOL_LRIN_BOTH, LINVOL_LRIN_BOTH);
619 regmap_update_bits(ssm2602->regmap, SSM2602_RINVOL,
620 RINVOL_RLIN_BOTH, RINVOL_RLIN_BOTH);
621 /*select Line in as default input*/
622 regmap_write(ssm2602->regmap, SSM2602_APANA, APANA_SELECT_DAC |
623 APANA_ENABLE_MIC_BOOST);
625 switch (ssm2602->type) {
627 ret = ssm2602_component_probe(component);
630 ret = ssm2604_component_probe(component);
637 static const struct snd_soc_component_driver soc_component_dev_ssm2602 = {
638 .probe = ssm260x_component_probe,
639 .resume = ssm2602_resume,
640 .set_bias_level = ssm2602_set_bias_level,
641 .controls = ssm260x_snd_controls,
642 .num_controls = ARRAY_SIZE(ssm260x_snd_controls),
643 .dapm_widgets = ssm260x_dapm_widgets,
644 .num_dapm_widgets = ARRAY_SIZE(ssm260x_dapm_widgets),
645 .dapm_routes = ssm260x_routes,
646 .num_dapm_routes = ARRAY_SIZE(ssm260x_routes),
647 .suspend_bias_off = 1,
649 .use_pmdown_time = 1,
653 static bool ssm2602_register_volatile(struct device *dev, unsigned int reg)
655 return reg == SSM2602_RESET;
658 const struct regmap_config ssm2602_regmap_config = {
662 .max_register = SSM2602_RESET,
663 .volatile_reg = ssm2602_register_volatile,
665 .cache_type = REGCACHE_RBTREE,
666 .reg_defaults = ssm2602_reg,
667 .num_reg_defaults = ARRAY_SIZE(ssm2602_reg),
669 EXPORT_SYMBOL_GPL(ssm2602_regmap_config);
671 int ssm2602_probe(struct device *dev, enum ssm2602_type type,
672 struct regmap *regmap)
674 struct ssm2602_priv *ssm2602;
677 return PTR_ERR(regmap);
679 ssm2602 = devm_kzalloc(dev, sizeof(*ssm2602), GFP_KERNEL);
683 dev_set_drvdata(dev, ssm2602);
684 ssm2602->type = type;
685 ssm2602->regmap = regmap;
687 return devm_snd_soc_register_component(dev, &soc_component_dev_ssm2602,
690 EXPORT_SYMBOL_GPL(ssm2602_probe);
692 MODULE_DESCRIPTION("ASoC SSM2602/SSM2603/SSM2604 driver");
693 MODULE_AUTHOR("Cliff Cai");
694 MODULE_LICENSE("GPL");