Lines Matching +full:dsp +full:- +full:aif2 +full:- +full:bclk
2 * wm8993.c -- WM8993 ALSA SoC audio driver
4 * Copyright 2009-12 Wolfson Microelectronics plc
45 { 1, 0x0000 }, /* R1 - Power Management (1) */
46 { 2, 0x6000 }, /* R2 - Power Management (2) */
47 { 3, 0x0000 }, /* R3 - Power Management (3) */
48 { 4, 0x4050 }, /* R4 - Audio Interface (1) */
49 { 5, 0x4000 }, /* R5 - Audio Interface (2) */
50 { 6, 0x01C8 }, /* R6 - Clocking 1 */
51 { 7, 0x0000 }, /* R7 - Clocking 2 */
52 { 8, 0x0000 }, /* R8 - Audio Interface (3) */
53 { 9, 0x0040 }, /* R9 - Audio Interface (4) */
54 { 10, 0x0004 }, /* R10 - DAC CTRL */
55 { 11, 0x00C0 }, /* R11 - Left DAC Digital Volume */
56 { 12, 0x00C0 }, /* R12 - Right DAC Digital Volume */
57 { 13, 0x0000 }, /* R13 - Digital Side Tone */
58 { 14, 0x0300 }, /* R14 - ADC CTRL */
59 { 15, 0x00C0 }, /* R15 - Left ADC Digital Volume */
60 { 16, 0x00C0 }, /* R16 - Right ADC Digital Volume */
61 { 18, 0x0000 }, /* R18 - GPIO CTRL 1 */
62 { 19, 0x0010 }, /* R19 - GPIO1 */
63 { 20, 0x0000 }, /* R20 - IRQ_DEBOUNCE */
64 { 21, 0x0000 }, /* R21 - Inputs Clamp */
65 { 22, 0x8000 }, /* R22 - GPIOCTRL 2 */
66 { 23, 0x0800 }, /* R23 - GPIO_POL */
67 { 24, 0x008B }, /* R24 - Left Line Input 1&2 Volume */
68 { 25, 0x008B }, /* R25 - Left Line Input 3&4 Volume */
69 { 26, 0x008B }, /* R26 - Right Line Input 1&2 Volume */
70 { 27, 0x008B }, /* R27 - Right Line Input 3&4 Volume */
71 { 28, 0x006D }, /* R28 - Left Output Volume */
72 { 29, 0x006D }, /* R29 - Right Output Volume */
73 { 30, 0x0066 }, /* R30 - Line Outputs Volume */
74 { 31, 0x0020 }, /* R31 - HPOUT2 Volume */
75 { 32, 0x0079 }, /* R32 - Left OPGA Volume */
76 { 33, 0x0079 }, /* R33 - Right OPGA Volume */
77 { 34, 0x0003 }, /* R34 - SPKMIXL Attenuation */
78 { 35, 0x0003 }, /* R35 - SPKMIXR Attenuation */
79 { 36, 0x0011 }, /* R36 - SPKOUT Mixers */
80 { 37, 0x0100 }, /* R37 - SPKOUT Boost */
81 { 38, 0x0079 }, /* R38 - Speaker Volume Left */
82 { 39, 0x0079 }, /* R39 - Speaker Volume Right */
83 { 40, 0x0000 }, /* R40 - Input Mixer2 */
84 { 41, 0x0000 }, /* R41 - Input Mixer3 */
85 { 42, 0x0000 }, /* R42 - Input Mixer4 */
86 { 43, 0x0000 }, /* R43 - Input Mixer5 */
87 { 44, 0x0000 }, /* R44 - Input Mixer6 */
88 { 45, 0x0000 }, /* R45 - Output Mixer1 */
89 { 46, 0x0000 }, /* R46 - Output Mixer2 */
90 { 47, 0x0000 }, /* R47 - Output Mixer3 */
91 { 48, 0x0000 }, /* R48 - Output Mixer4 */
92 { 49, 0x0000 }, /* R49 - Output Mixer5 */
93 { 50, 0x0000 }, /* R50 - Output Mixer6 */
94 { 51, 0x0000 }, /* R51 - HPOUT2 Mixer */
95 { 52, 0x0000 }, /* R52 - Line Mixer1 */
96 { 53, 0x0000 }, /* R53 - Line Mixer2 */
97 { 54, 0x0000 }, /* R54 - Speaker Mixer */
98 { 55, 0x0000 }, /* R55 - Additional Control */
99 { 56, 0x0000 }, /* R56 - AntiPOP1 */
100 { 57, 0x0000 }, /* R57 - AntiPOP2 */
101 { 58, 0x0000 }, /* R58 - MICBIAS */
102 { 60, 0x0000 }, /* R60 - FLL Control 1 */
103 { 61, 0x0000 }, /* R61 - FLL Control 2 */
104 { 62, 0x0000 }, /* R62 - FLL Control 3 */
105 { 63, 0x2EE0 }, /* R63 - FLL Control 4 */
106 { 64, 0x0002 }, /* R64 - FLL Control 5 */
107 { 65, 0x2287 }, /* R65 - Clocking 3 */
108 { 66, 0x025F }, /* R66 - Clocking 4 */
109 { 67, 0x0000 }, /* R67 - MW Slave Control */
110 { 69, 0x0002 }, /* R69 - Bus Control 1 */
111 { 70, 0x0000 }, /* R70 - Write Sequencer 0 */
112 { 71, 0x0000 }, /* R71 - Write Sequencer 1 */
113 { 72, 0x0000 }, /* R72 - Write Sequencer 2 */
114 { 73, 0x0000 }, /* R73 - Write Sequencer 3 */
115 { 74, 0x0000 }, /* R74 - Write Sequencer 4 */
116 { 75, 0x0000 }, /* R75 - Write Sequencer 5 */
117 { 76, 0x1F25 }, /* R76 - Charge Pump 1 */
118 { 81, 0x0000 }, /* R81 - Class W 0 */
119 { 85, 0x054A }, /* R85 - DC Servo 1 */
120 { 87, 0x0000 }, /* R87 - DC Servo 3 */
121 { 96, 0x0100 }, /* R96 - Analogue HP 0 */
122 { 98, 0x0000 }, /* R98 - EQ1 */
123 { 99, 0x000C }, /* R99 - EQ2 */
124 { 100, 0x000C }, /* R100 - EQ3 */
125 { 101, 0x000C }, /* R101 - EQ4 */
126 { 102, 0x000C }, /* R102 - EQ5 */
127 { 103, 0x000C }, /* R103 - EQ6 */
128 { 104, 0x0FCA }, /* R104 - EQ7 */
129 { 105, 0x0400 }, /* R105 - EQ8 */
130 { 106, 0x00D8 }, /* R106 - EQ9 */
131 { 107, 0x1EB5 }, /* R107 - EQ10 */
132 { 108, 0xF145 }, /* R108 - EQ11 */
133 { 109, 0x0B75 }, /* R109 - EQ12 */
134 { 110, 0x01C5 }, /* R110 - EQ13 */
135 { 111, 0x1C58 }, /* R111 - EQ14 */
136 { 112, 0xF373 }, /* R112 - EQ15 */
137 { 113, 0x0A54 }, /* R113 - EQ16 */
138 { 114, 0x0558 }, /* R114 - EQ17 */
139 { 115, 0x168E }, /* R115 - EQ18 */
140 { 116, 0xF829 }, /* R116 - EQ19 */
141 { 117, 0x07AD }, /* R117 - EQ20 */
142 { 118, 0x1103 }, /* R118 - EQ21 */
143 { 119, 0x0564 }, /* R119 - EQ22 */
144 { 120, 0x0559 }, /* R120 - EQ23 */
145 { 121, 0x4000 }, /* R121 - EQ24 */
146 { 122, 0x0000 }, /* R122 - Digital Pulls */
147 { 123, 0x0F08 }, /* R123 - DRC Control 1 */
148 { 124, 0x0000 }, /* R124 - DRC Control 2 */
149 { 125, 0x0080 }, /* R125 - DRC Control 3 */
150 { 126, 0x0000 }, /* R126 - DRC Control 4 */
220 unsigned int bclk; member
395 fll_div->fll_clk_ref_div = 0; in fll_factors()
398 fll_div->fll_clk_ref_div++; in fll_factors()
403 return -EINVAL; in fll_factors()
412 /* Fvco should be 90-100MHz; don't check the upper bound */ in fll_factors()
421 return -EINVAL; in fll_factors()
424 fll_div->fll_outdiv = div; in fll_factors()
431 fll_div->fll_fratio = fll_fratios[i].fll_fratio; in fll_factors()
438 return -EINVAL; in fll_factors()
444 fll_div->n = Ndiv; in fll_factors()
448 /* Calculate fractional part - scale up so we can round. */ in fll_factors()
459 fll_div->k = K / 10; in fll_factors()
462 fll_div->n, fll_div->k, in fll_factors()
463 fll_div->fll_fratio, fll_div->fll_outdiv, in fll_factors()
464 fll_div->fll_clk_ref_div); in fll_factors()
473 struct i2c_client *i2c = to_i2c_client(component->dev); in _wm8993_set_fll()
480 if (Fref == wm8993->fll_fref && Fout == wm8993->fll_fout) in _wm8993_set_fll()
485 dev_dbg(component->dev, "FLL disabled\n"); in _wm8993_set_fll()
486 wm8993->fll_fref = 0; in _wm8993_set_fll()
487 wm8993->fll_fout = 0; in _wm8993_set_fll()
516 dev_err(component->dev, "Unknown FLL ID %d\n", fll_id); in _wm8993_set_fll()
517 return -EINVAL; in _wm8993_set_fll()
548 if (i2c->irq) in _wm8993_set_fll()
555 try_wait_for_completion(&wm8993->fll_lock); in _wm8993_set_fll()
560 timeout = wait_for_completion_timeout(&wm8993->fll_lock, timeout); in _wm8993_set_fll()
561 if (i2c->irq && !timeout) in _wm8993_set_fll()
562 dev_warn(component->dev, "Timed out waiting for FLL\n"); in _wm8993_set_fll()
564 dev_dbg(component->dev, "FLL enabled at %dHz->%dHz\n", Fref, Fout); in _wm8993_set_fll()
566 wm8993->fll_fref = Fref; in _wm8993_set_fll()
567 wm8993->fll_fout = Fout; in _wm8993_set_fll()
568 wm8993->fll_src = source; in _wm8993_set_fll()
576 return _wm8993_set_fll(dai->component, fll_id, source, Fref, Fout); in wm8993_set_fll()
585 switch (wm8993->sysclk_source) { in configure_clock()
587 dev_dbg(component->dev, "Using %dHz MCLK\n", wm8993->mclk_rate); in configure_clock()
591 if (wm8993->mclk_rate > 13500000) { in configure_clock()
593 wm8993->sysclk_rate = wm8993->mclk_rate / 2; in configure_clock()
596 wm8993->sysclk_rate = wm8993->mclk_rate; in configure_clock()
602 dev_dbg(component->dev, "Using %dHz FLL clock\n", in configure_clock()
603 wm8993->fll_fout); in configure_clock()
607 if (wm8993->fll_fout > 13500000) { in configure_clock()
609 wm8993->sysclk_rate = wm8993->fll_fout / 2; in configure_clock()
612 wm8993->sysclk_rate = wm8993->fll_fout; in configure_clock()
618 dev_err(component->dev, "System clock not configured\n"); in configure_clock()
619 return -EINVAL; in configure_clock()
622 dev_dbg(component->dev, "CLK_SYS is %dHz\n", wm8993->sysclk_rate); in configure_clock()
627 static const DECLARE_TLV_DB_SCALE(sidetone_tlv, -3600, 300, 0);
628 static const DECLARE_TLV_DB_SCALE(drc_comp_threash, -4500, 75, 0);
629 static const DECLARE_TLV_DB_SCALE(drc_comp_amp, -2250, 75, 0);
630 static const DECLARE_TLV_DB_SCALE(drc_min_tlv, -1800, 600, 0);
636 static const DECLARE_TLV_DB_SCALE(drc_startup_tlv, -1800, 300, 0);
637 static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
638 static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1);
652 "Hi-Fi",
770 SOC_SINGLE("DRC Anti-clip Switch", WM8993_DRC_CONTROL_1, 9, 1, 0),
812 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in clk_sys_event()
995 ret = regulator_bulk_enable(ARRAY_SIZE(wm8993->supplies), in wm8993_set_bias_level()
996 wm8993->supplies); in wm8993_set_bias_level()
1000 regcache_cache_only(wm8993->regmap, false); in wm8993_set_bias_level()
1001 regcache_sync(wm8993->regmap); in wm8993_set_bias_level()
1018 if (!wm8993->pdata.lineout1_diff || in wm8993_set_bias_level()
1019 !wm8993->pdata.lineout2_diff) in wm8993_set_bias_level()
1059 regcache_cache_only(wm8993->regmap, true); in wm8993_set_bias_level()
1060 regcache_mark_dirty(wm8993->regmap); in wm8993_set_bias_level()
1062 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), in wm8993_set_bias_level()
1063 wm8993->supplies); in wm8993_set_bias_level()
1073 struct snd_soc_component *component = codec_dai->component; in wm8993_set_sysclk()
1078 wm8993->mclk_rate = freq; in wm8993_set_sysclk()
1081 wm8993->sysclk_source = clk_id; in wm8993_set_sysclk()
1085 return -EINVAL; in wm8993_set_sysclk()
1094 struct snd_soc_component *component = dai->component; in wm8993_set_dai_fmt()
1105 wm8993->master = 0; in wm8993_set_dai_fmt()
1109 wm8993->master = 1; in wm8993_set_dai_fmt()
1113 wm8993->master = 1; in wm8993_set_dai_fmt()
1118 wm8993->master = 1; in wm8993_set_dai_fmt()
1121 return -EINVAL; in wm8993_set_dai_fmt()
1140 return -EINVAL; in wm8993_set_dai_fmt()
1146 /* frame inversion not valid for DSP modes */ in wm8993_set_dai_fmt()
1154 return -EINVAL; in wm8993_set_dai_fmt()
1174 return -EINVAL; in wm8993_set_dai_fmt()
1178 return -EINVAL; in wm8993_set_dai_fmt()
1191 struct snd_soc_component *component = dai->component; in wm8993_hw_params()
1208 /* What BCLK do we need? */ in wm8993_hw_params()
1209 wm8993->fs = params_rate(params); in wm8993_hw_params()
1210 wm8993->bclk = 2 * wm8993->fs; in wm8993_hw_params()
1211 if (wm8993->tdm_slots) { in wm8993_hw_params()
1212 dev_dbg(component->dev, "Configuring for %d %d bit TDM slots\n", in wm8993_hw_params()
1213 wm8993->tdm_slots, wm8993->tdm_width); in wm8993_hw_params()
1214 wm8993->bclk *= wm8993->tdm_width * wm8993->tdm_slots; in wm8993_hw_params()
1218 wm8993->bclk *= 16; in wm8993_hw_params()
1221 wm8993->bclk *= 20; in wm8993_hw_params()
1225 wm8993->bclk *= 24; in wm8993_hw_params()
1229 wm8993->bclk *= 32; in wm8993_hw_params()
1233 return -EINVAL; in wm8993_hw_params()
1237 dev_dbg(component->dev, "Target BCLK is %dHz\n", wm8993->bclk); in wm8993_hw_params()
1245 best_val = abs((wm8993->sysclk_rate / clk_sys_rates[0].ratio) in wm8993_hw_params()
1246 - wm8993->fs); in wm8993_hw_params()
1248 cur_val = abs((wm8993->sysclk_rate / in wm8993_hw_params()
1249 clk_sys_rates[i].ratio) - wm8993->fs); in wm8993_hw_params()
1255 dev_dbg(component->dev, "Selected CLK_SYS_RATIO of %d\n", in wm8993_hw_params()
1262 best_val = abs(wm8993->fs - sample_rates[0].rate); in wm8993_hw_params()
1265 cur_val = abs(wm8993->fs - sample_rates[i].rate); in wm8993_hw_params()
1271 dev_dbg(component->dev, "Selected SAMPLE_RATE of %dHz\n", in wm8993_hw_params()
1280 cur_val = ((wm8993->sysclk_rate * 10) / bclk_divs[i].div) in wm8993_hw_params()
1281 - wm8993->bclk; in wm8993_hw_params()
1289 wm8993->bclk = (wm8993->sysclk_rate * 10) / bclk_divs[best].div; in wm8993_hw_params()
1290 dev_dbg(component->dev, "Selected BCLK_DIV of %d for %dHz BCLK\n", in wm8993_hw_params()
1291 bclk_divs[best].div, wm8993->bclk); in wm8993_hw_params()
1294 /* LRCLK is a simple fraction of BCLK */ in wm8993_hw_params()
1295 dev_dbg(component->dev, "LRCLK_RATE is %d\n", wm8993->bclk / wm8993->fs); in wm8993_hw_params()
1296 aif4 |= wm8993->bclk / wm8993->fs; in wm8993_hw_params()
1304 if (wm8993->pdata.num_retune_configs) { in wm8993_hw_params()
1309 best_val = abs(wm8993->pdata.retune_configs[0].rate in wm8993_hw_params()
1310 - wm8993->fs); in wm8993_hw_params()
1311 for (i = 0; i < wm8993->pdata.num_retune_configs; i++) { in wm8993_hw_params()
1312 cur_val = abs(wm8993->pdata.retune_configs[i].rate in wm8993_hw_params()
1313 - wm8993->fs); in wm8993_hw_params()
1319 s = &wm8993->pdata.retune_configs[best]; in wm8993_hw_params()
1321 dev_dbg(component->dev, "ReTune Mobile %s tuned for %dHz\n", in wm8993_hw_params()
1322 s->name, s->rate); in wm8993_hw_params()
1327 for (i = 1; i < ARRAY_SIZE(s->config); i++) in wm8993_hw_params()
1328 snd_soc_component_write(component, WM8993_EQ1 + i, s->config[i]); in wm8993_hw_params()
1338 struct snd_soc_component *component = codec_dai->component; in wm8993_digital_mute()
1356 struct snd_soc_component *component = dai->component; in wm8993_set_tdm_slot()
1359 int aif2 = 0; in wm8993_set_tdm_slot() local
1363 wm8993->tdm_slots = 0; in wm8993_set_tdm_slot()
1367 /* Note that we allow configurations we can't handle ourselves - in wm8993_set_tdm_slot()
1372 aif2 |= WM8993_AIFDAC_TDM; in wm8993_set_tdm_slot()
1381 return -EINVAL; in wm8993_set_tdm_slot()
1389 aif2 |= WM8993_AIFDAC_TDM_CHAN; in wm8993_set_tdm_slot()
1392 return -EINVAL; in wm8993_set_tdm_slot()
1396 wm8993->tdm_width = slot_width; in wm8993_set_tdm_slot()
1397 wm8993->tdm_slots = slots / 2; in wm8993_set_tdm_slot()
1402 WM8993_AIFDAC_TDM | WM8993_AIFDAC_TDM_CHAN, aif2); in wm8993_set_tdm_slot()
1412 ret = regmap_read(wm8993->regmap, WM8993_GPIO_CTRL_1, &val); in wm8993_irq()
1414 dev_err(wm8993->dev, "Failed to read interrupt status: %d\n", in wm8993_irq()
1419 ret = regmap_read(wm8993->regmap, WM8993_GPIOCTRL_2, &mask); in wm8993_irq()
1421 dev_err(wm8993->dev, "Failed to read interrupt mask: %d\n", in wm8993_irq()
1432 dev_crit(wm8993->dev, "Thermal warning\n"); in wm8993_irq()
1435 dev_dbg(wm8993->dev, "FLL locked\n"); in wm8993_irq()
1436 complete(&wm8993->fll_lock); in wm8993_irq()
1439 ret = regmap_write(wm8993->regmap, WM8993_GPIO_CTRL_1, val); in wm8993_irq()
1441 dev_err(wm8993->dev, "Failed to ack interrupt: %d\n", ret); in wm8993_irq()
1463 .name = "wm8993-hifi",
1489 wm8993->hubs_data.hp_startup_mode = 1; in wm8993_probe()
1490 wm8993->hubs_data.dcs_codes_l = -2; in wm8993_probe()
1491 wm8993->hubs_data.dcs_codes_r = -2; in wm8993_probe()
1492 wm8993->hubs_data.series_startup = 1; in wm8993_probe()
1508 wm_hubs_handle_analogue_pdata(component, wm8993->pdata.lineout1_diff, in wm8993_probe()
1509 wm8993->pdata.lineout2_diff, in wm8993_probe()
1510 wm8993->pdata.lineout1fb, in wm8993_probe()
1511 wm8993->pdata.lineout2fb, in wm8993_probe()
1512 wm8993->pdata.jd_scthr, in wm8993_probe()
1513 wm8993->pdata.jd_thr, in wm8993_probe()
1514 wm8993->pdata.micbias1_delay, in wm8993_probe()
1515 wm8993->pdata.micbias2_delay, in wm8993_probe()
1516 wm8993->pdata.micbias1_lvl, in wm8993_probe()
1517 wm8993->pdata.micbias2_lvl); in wm8993_probe()
1521 if (wm8993->pdata.num_retune_configs != 0) { in wm8993_probe()
1522 dev_dbg(component->dev, "Using ReTune Mobile\n"); in wm8993_probe()
1524 dev_dbg(component->dev, "No ReTune Mobile, using normal EQ\n"); in wm8993_probe()
1534 wm_hubs_add_analogue_routes(component, wm8993->pdata.lineout1_diff, in wm8993_probe()
1535 wm8993->pdata.lineout2_diff); in wm8993_probe()
1540 if (wm8993->pdata.lineout1_diff && wm8993->pdata.lineout2_diff) in wm8993_probe()
1541 dapm->idle_bias_off = 1; in wm8993_probe()
1551 int fll_fout = wm8993->fll_fout; in wm8993_suspend()
1552 int fll_fref = wm8993->fll_fref; in wm8993_suspend()
1558 dev_err(component->dev, "Failed to stop FLL\n"); in wm8993_suspend()
1562 wm8993->fll_fout = fll_fout; in wm8993_suspend()
1563 wm8993->fll_fref = fll_fref; in wm8993_suspend()
1578 if (wm8993->fll_fout) { in wm8993_resume()
1579 int fll_fout = wm8993->fll_fout; in wm8993_resume()
1580 int fll_fref = wm8993->fll_fref; in wm8993_resume()
1582 wm8993->fll_fref = 0; in wm8993_resume()
1583 wm8993->fll_fout = 0; in wm8993_resume()
1585 ret = _wm8993_set_fll(component, 0, wm8993->fll_src, in wm8993_resume()
1588 dev_err(component->dev, "Failed to restart FLL\n"); in wm8993_resume()
1636 wm8993 = devm_kzalloc(&i2c->dev, sizeof(struct wm8993_priv), in wm8993_i2c_probe()
1639 return -ENOMEM; in wm8993_i2c_probe()
1641 wm8993->dev = &i2c->dev; in wm8993_i2c_probe()
1642 init_completion(&wm8993->fll_lock); in wm8993_i2c_probe()
1644 wm8993->regmap = devm_regmap_init_i2c(i2c, &wm8993_regmap); in wm8993_i2c_probe()
1645 if (IS_ERR(wm8993->regmap)) { in wm8993_i2c_probe()
1646 ret = PTR_ERR(wm8993->regmap); in wm8993_i2c_probe()
1647 dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret); in wm8993_i2c_probe()
1653 for (i = 0; i < ARRAY_SIZE(wm8993->supplies); i++) in wm8993_i2c_probe()
1654 wm8993->supplies[i].supply = wm8993_supply_names[i]; in wm8993_i2c_probe()
1656 ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8993->supplies), in wm8993_i2c_probe()
1657 wm8993->supplies); in wm8993_i2c_probe()
1659 dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret); in wm8993_i2c_probe()
1663 ret = regulator_bulk_enable(ARRAY_SIZE(wm8993->supplies), in wm8993_i2c_probe()
1664 wm8993->supplies); in wm8993_i2c_probe()
1666 dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret); in wm8993_i2c_probe()
1670 ret = regmap_read(wm8993->regmap, WM8993_SOFTWARE_RESET, ®); in wm8993_i2c_probe()
1672 dev_err(&i2c->dev, "Failed to read chip ID: %d\n", ret); in wm8993_i2c_probe()
1677 dev_err(&i2c->dev, "Invalid ID register value %x\n", reg); in wm8993_i2c_probe()
1678 ret = -EINVAL; in wm8993_i2c_probe()
1682 ret = regmap_write(wm8993->regmap, WM8993_SOFTWARE_RESET, 0xffff); in wm8993_i2c_probe()
1686 ret = regmap_register_patch(wm8993->regmap, wm8993_regmap_patch, in wm8993_i2c_probe()
1689 dev_warn(wm8993->dev, "Failed to apply regmap patch: %d\n", in wm8993_i2c_probe()
1692 if (i2c->irq) { in wm8993_i2c_probe()
1694 ret = regmap_update_bits(wm8993->regmap, WM8993_GPIO1, in wm8993_i2c_probe()
1700 ret = request_threaded_irq(i2c->irq, NULL, wm8993_irq, in wm8993_i2c_probe()
1708 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); in wm8993_i2c_probe()
1710 regcache_cache_only(wm8993->regmap, true); in wm8993_i2c_probe()
1712 ret = devm_snd_soc_register_component(&i2c->dev, in wm8993_i2c_probe()
1715 dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); in wm8993_i2c_probe()
1722 if (i2c->irq) in wm8993_i2c_probe()
1723 free_irq(i2c->irq, wm8993); in wm8993_i2c_probe()
1725 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); in wm8993_i2c_probe()
1733 if (i2c->irq) in wm8993_i2c_remove()
1734 free_irq(i2c->irq, wm8993); in wm8993_i2c_remove()
1735 regulator_bulk_disable(ARRAY_SIZE(wm8993->supplies), wm8993->supplies); in wm8993_i2c_remove()