Lines Matching +full:dsp +full:- +full:aif2 +full:- +full:bclk
2 * wm8903.c -- WM8903 ALSA SoC Audio driver
4 * Copyright 2008-12 Wolfson Microelectronics
5 * Copyright 2011-2012 NVIDIA, Inc.
14 * - TDM mode configuration.
15 * - Digital microphone support.
45 { 4, 0x0018 }, /* R4 - Bias Control 0 */
46 { 5, 0x0000 }, /* R5 - VMID Control 0 */
47 { 6, 0x0000 }, /* R6 - Mic Bias Control 0 */
48 { 8, 0x0001 }, /* R8 - Analogue DAC 0 */
49 { 10, 0x0001 }, /* R10 - Analogue ADC 0 */
50 { 12, 0x0000 }, /* R12 - Power Management 0 */
51 { 13, 0x0000 }, /* R13 - Power Management 1 */
52 { 14, 0x0000 }, /* R14 - Power Management 2 */
53 { 15, 0x0000 }, /* R15 - Power Management 3 */
54 { 16, 0x0000 }, /* R16 - Power Management 4 */
55 { 17, 0x0000 }, /* R17 - Power Management 5 */
56 { 18, 0x0000 }, /* R18 - Power Management 6 */
57 { 20, 0x0400 }, /* R20 - Clock Rates 0 */
58 { 21, 0x0D07 }, /* R21 - Clock Rates 1 */
59 { 22, 0x0000 }, /* R22 - Clock Rates 2 */
60 { 24, 0x0050 }, /* R24 - Audio Interface 0 */
61 { 25, 0x0242 }, /* R25 - Audio Interface 1 */
62 { 26, 0x0008 }, /* R26 - Audio Interface 2 */
63 { 27, 0x0022 }, /* R27 - Audio Interface 3 */
64 { 30, 0x00C0 }, /* R30 - DAC Digital Volume Left */
65 { 31, 0x00C0 }, /* R31 - DAC Digital Volume Right */
66 { 32, 0x0000 }, /* R32 - DAC Digital 0 */
67 { 33, 0x0000 }, /* R33 - DAC Digital 1 */
68 { 36, 0x00C0 }, /* R36 - ADC Digital Volume Left */
69 { 37, 0x00C0 }, /* R37 - ADC Digital Volume Right */
70 { 38, 0x0000 }, /* R38 - ADC Digital 0 */
71 { 39, 0x0073 }, /* R39 - Digital Microphone 0 */
72 { 40, 0x09BF }, /* R40 - DRC 0 */
73 { 41, 0x3241 }, /* R41 - DRC 1 */
74 { 42, 0x0020 }, /* R42 - DRC 2 */
75 { 43, 0x0000 }, /* R43 - DRC 3 */
76 { 44, 0x0085 }, /* R44 - Analogue Left Input 0 */
77 { 45, 0x0085 }, /* R45 - Analogue Right Input 0 */
78 { 46, 0x0044 }, /* R46 - Analogue Left Input 1 */
79 { 47, 0x0044 }, /* R47 - Analogue Right Input 1 */
80 { 50, 0x0008 }, /* R50 - Analogue Left Mix 0 */
81 { 51, 0x0004 }, /* R51 - Analogue Right Mix 0 */
82 { 52, 0x0000 }, /* R52 - Analogue Spk Mix Left 0 */
83 { 53, 0x0000 }, /* R53 - Analogue Spk Mix Left 1 */
84 { 54, 0x0000 }, /* R54 - Analogue Spk Mix Right 0 */
85 { 55, 0x0000 }, /* R55 - Analogue Spk Mix Right 1 */
86 { 57, 0x002D }, /* R57 - Analogue OUT1 Left */
87 { 58, 0x002D }, /* R58 - Analogue OUT1 Right */
88 { 59, 0x0039 }, /* R59 - Analogue OUT2 Left */
89 { 60, 0x0039 }, /* R60 - Analogue OUT2 Right */
90 { 62, 0x0139 }, /* R62 - Analogue OUT3 Left */
91 { 63, 0x0139 }, /* R63 - Analogue OUT3 Right */
92 { 64, 0x0000 }, /* R65 - Analogue SPK Output Control 0 */
93 { 67, 0x0010 }, /* R67 - DC Servo 0 */
94 { 69, 0x00A4 }, /* R69 - DC Servo 2 */
95 { 90, 0x0000 }, /* R90 - Analogue HP 0 */
96 { 94, 0x0000 }, /* R94 - Analogue Lineout 0 */
97 { 98, 0x0000 }, /* R98 - Charge Pump 0 */
98 { 104, 0x0000 }, /* R104 - Class W 0 */
99 { 108, 0x0000 }, /* R108 - Write Sequencer 0 */
100 { 109, 0x0000 }, /* R109 - Write Sequencer 1 */
101 { 110, 0x0000 }, /* R110 - Write Sequencer 2 */
102 { 111, 0x0000 }, /* R111 - Write Sequencer 3 */
103 { 112, 0x0000 }, /* R112 - Write Sequencer 4 */
104 { 114, 0x0000 }, /* R114 - Control Interface */
105 { 116, 0x00A8 }, /* R116 - GPIO Control 1 */
106 { 117, 0x00A8 }, /* R117 - GPIO Control 2 */
107 { 118, 0x00A8 }, /* R118 - GPIO Control 3 */
108 { 119, 0x0220 }, /* R119 - GPIO Control 4 */
109 { 120, 0x01A0 }, /* R120 - GPIO Control 5 */
110 { 122, 0xFFFF }, /* R122 - Interrupt Status 1 Mask */
111 { 123, 0x0000 }, /* R123 - Interrupt Polarity 1 */
112 { 126, 0x0000 }, /* R126 - Interrupt Control */
113 { 129, 0x0000 }, /* R129 - Control Interface Test 1 */
114 { 149, 0x6810 }, /* R149 - Charge Pump Test 1 */
115 { 164, 0x0028 }, /* R164 - Clock Rate Test 4 */
116 { 172, 0x0000 }, /* R172 - Analogue Output Bias 0 */
273 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm8903_dcs_event()
278 wm8903->dcs_pending |= 1 << w->shift; in wm8903_dcs_event()
282 1 << w->shift, 0); in wm8903_dcs_event()
300 if (wm8903->dcs_pending) { in wm8903_seq_notifier()
301 dev_dbg(component->dev, "Starting DC servo for %x\n", in wm8903_seq_notifier()
302 wm8903->dcs_pending); in wm8903_seq_notifier()
305 for (i = 0; i < ARRAY_SIZE(wm8903->dcs_cache); i++) { in wm8903_seq_notifier()
306 if (!(wm8903->dcs_pending & (1 << i))) in wm8903_seq_notifier()
309 if (wm8903->dcs_cache[i]) { in wm8903_seq_notifier()
310 dev_dbg(component->dev, in wm8903_seq_notifier()
312 3 - i, wm8903->dcs_cache[i]); in wm8903_seq_notifier()
315 wm8903->dcs_cache[i] & 0xff); in wm8903_seq_notifier()
317 dev_dbg(component->dev, in wm8903_seq_notifier()
318 "Calibrate DC servo %d\n", 3 - i); in wm8903_seq_notifier()
324 if (wm8903->class_w_users) in wm8903_seq_notifier()
331 WM8903_DCS_ENA_MASK, wm8903->dcs_pending); in wm8903_seq_notifier()
341 if (wm8903->class_w_users) in wm8903_seq_notifier()
344 for (i = 0; i < ARRAY_SIZE(wm8903->dcs_cache); i++) { in wm8903_seq_notifier()
345 if (!(wm8903->dcs_pending & (1 << i))) in wm8903_seq_notifier()
350 dev_dbg(component->dev, "DC servo %d: %x\n", in wm8903_seq_notifier()
351 3 - i, val); in wm8903_seq_notifier()
352 wm8903->dcs_cache[i] = val; in wm8903_seq_notifier()
361 wm8903->dcs_pending = 0; in wm8903_seq_notifier()
384 if (ucontrol->value.integer.value[0]) { in wm8903_class_w_put()
385 if (wm8903->class_w_users == 0) { in wm8903_class_w_put()
386 dev_dbg(component->dev, "Disabling Class W\n"); in wm8903_class_w_put()
390 wm8903->class_w_users++; in wm8903_class_w_put()
397 if (!ucontrol->value.integer.value[0]) { in wm8903_class_w_put()
398 if (wm8903->class_w_users == 1) { in wm8903_class_w_put()
399 dev_dbg(component->dev, "Enabling Class W\n"); in wm8903_class_w_put()
403 wm8903->class_w_users--; in wm8903_class_w_put()
406 dev_dbg(component->dev, "Bypass use count now %d\n", in wm8903_class_w_put()
407 wm8903->class_w_users); in wm8903_class_w_put()
427 if (wm8903->deemph) { in wm8903_set_deemph()
430 if (abs(wm8903_deemph[i] - wm8903->fs) < in wm8903_set_deemph()
431 abs(wm8903_deemph[best] - wm8903->fs)) in wm8903_set_deemph()
441 dev_dbg(component->dev, "Set deemphasis %d (%dHz)\n", in wm8903_set_deemph()
454 ucontrol->value.integer.value[0] = wm8903->deemph; in wm8903_get_deemph()
464 unsigned int deemph = ucontrol->value.integer.value[0]; in wm8903_put_deemph()
468 return -EINVAL; in wm8903_put_deemph()
470 mutex_lock(&wm8903->lock); in wm8903_put_deemph()
471 if (wm8903->deemph != deemph) { in wm8903_put_deemph()
472 wm8903->deemph = deemph; in wm8903_put_deemph()
478 mutex_unlock(&wm8903->lock); in wm8903_put_deemph()
484 static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1);
488 static const DECLARE_TLV_DB_SCALE(digital_sidetone_tlv, -3600, 300, 0);
489 static const DECLARE_TLV_DB_SCALE(out_tlv, -5700, 100, 0);
492 static const DECLARE_TLV_DB_SCALE(drc_tlv_amp, -2250, 75, 0);
495 static const DECLARE_TLV_DB_SCALE(drc_tlv_startup, -300, 50, 0);
498 "Hi-fi", "Voice 1", "Voice 2", "Voice 3"
587 "Single-Ended", "Differential Line", "Differential Mic"
652 /* Input PGAs - No TLV since the scale depends on PGA mode */
964 { "Left Input Mode Mux", "Single-Ended", "Left Input Inverting Mux" },
974 { "Right Input Mode Mux", "Single-Ended",
1175 dev_dbg(component->dev, "Enabling Class W\n"); in wm8903_set_bias_level()
1218 struct snd_soc_component *component = codec_dai->component; in wm8903_set_dai_sysclk()
1221 wm8903->sysclk = freq; in wm8903_set_dai_sysclk()
1229 struct snd_soc_component *component = codec_dai->component; in wm8903_set_dai_fmt()
1248 return -EINVAL; in wm8903_set_dai_fmt()
1267 return -EINVAL; in wm8903_set_dai_fmt()
1274 /* frame inversion not valid for DSP modes */ in wm8903_set_dai_fmt()
1282 return -EINVAL; in wm8903_set_dai_fmt()
1301 return -EINVAL; in wm8903_set_dai_fmt()
1305 return -EINVAL; in wm8903_set_dai_fmt()
1315 struct snd_soc_component *component = codec_dai->component; in wm8903_digital_mute()
1398 /* CLK_SYS/BCLK ratios - multiplied by 10 due to .5s */
1422 /* Sample rates for DSP */
1445 struct snd_soc_component *component = dai->component; in wm8903_hw_params()
1448 int bclk; in wm8903_hw_params() local
1458 u16 aif2 = snd_soc_component_read32(component, WM8903_AUDIO_INTERFACE_2); in wm8903_hw_params() local
1470 /* Configure sample rate logic for DSP - choose nearest rate */ in wm8903_hw_params()
1472 best_val = abs(sample_rates[dsp_config].rate - fs); in wm8903_hw_params()
1474 cur_val = abs(sample_rates[i].rate - fs); in wm8903_hw_params()
1481 dev_dbg(component->dev, "DSP fs = %dHz\n", sample_rates[dsp_config].rate); in wm8903_hw_params()
1486 bclk = 2 * fs; in wm8903_hw_params()
1489 bclk *= 16; in wm8903_hw_params()
1492 bclk *= 20; in wm8903_hw_params()
1496 bclk *= 24; in wm8903_hw_params()
1500 bclk *= 32; in wm8903_hw_params()
1504 return -EINVAL; in wm8903_hw_params()
1507 dev_dbg(component->dev, "MCLK = %dHz, target sample rate = %dHz\n", in wm8903_hw_params()
1508 wm8903->sysclk, fs); in wm8903_hw_params()
1515 best_val = abs((wm8903->sysclk / in wm8903_hw_params()
1517 clk_sys_ratios[0].div)) - fs); in wm8903_hw_params()
1519 cur_val = abs((wm8903->sysclk / in wm8903_hw_params()
1521 clk_sys_ratios[i].div)) - fs); in wm8903_hw_params()
1531 clk_sys = wm8903->sysclk / 2; in wm8903_hw_params()
1534 clk_sys = wm8903->sysclk; in wm8903_hw_params()
1542 dev_dbg(component->dev, "CLK_SYS_RATE=%x, CLK_SYS_MODE=%x div=%d\n", in wm8903_hw_params()
1547 dev_dbg(component->dev, "Actual CLK_SYS = %dHz\n", clk_sys); in wm8903_hw_params()
1555 best_val = ((clk_sys * 10) / bclk_divs[0].ratio) - bclk; in wm8903_hw_params()
1558 cur_val = ((clk_sys * 10) / bclk_divs[i].ratio) - bclk; in wm8903_hw_params()
1559 if (cur_val < 0) /* BCLK table is sorted */ in wm8903_hw_params()
1566 aif2 &= ~WM8903_BCLK_DIV_MASK; in wm8903_hw_params()
1569 dev_dbg(component->dev, "BCLK ratio %d for %dHz - actual BCLK = %dHz\n", in wm8903_hw_params()
1570 bclk_divs[bclk_div].ratio / 10, bclk, in wm8903_hw_params()
1573 aif2 |= bclk_divs[bclk_div].div; in wm8903_hw_params()
1574 aif3 |= bclk / fs; in wm8903_hw_params()
1576 wm8903->fs = params_rate(params); in wm8903_hw_params()
1582 snd_soc_component_write(component, WM8903_AUDIO_INTERFACE_2, aif2); in wm8903_hw_params()
1590 * wm8903_mic_detect - Enable microphone detection via the WM8903 IRQ
1612 dev_dbg(component->dev, "Enabling microphone detection: %x %x\n", in wm8903_mic_detect()
1616 wm8903->mic_jack = jack; in wm8903_mic_detect()
1617 wm8903->mic_det = det; in wm8903_mic_detect()
1618 wm8903->mic_short = shrt; in wm8903_mic_detect()
1652 ret = regmap_read(wm8903->regmap, WM8903_INTERRUPT_STATUS_1_MASK, in wm8903_irq()
1655 dev_err(wm8903->dev, "Failed to read IRQ mask: %d\n", ret); in wm8903_irq()
1659 ret = regmap_read(wm8903->regmap, WM8903_INTERRUPT_STATUS_1, &int_val); in wm8903_irq()
1661 dev_err(wm8903->dev, "Failed to read IRQ status: %d\n", ret); in wm8903_irq()
1668 dev_warn(wm8903->dev, "Write sequencer done\n"); in wm8903_irq()
1673 * invert the polarity of the interrupt after each event - to in wm8903_irq()
1678 mic_report = wm8903->mic_last_report; in wm8903_irq()
1679 ret = regmap_read(wm8903->regmap, WM8903_INTERRUPT_POLARITY_1, in wm8903_irq()
1682 dev_err(wm8903->dev, "Failed to read interrupt polarity: %d\n", in wm8903_irq()
1689 trace_snd_soc_jack_irq(dev_name(wm8903->dev)); in wm8903_irq()
1693 dev_dbg(wm8903->dev, "Microphone short (pol=%x)\n", int_pol); in wm8903_irq()
1695 mic_report ^= wm8903->mic_short; in wm8903_irq()
1700 dev_dbg(wm8903->dev, "Microphone detect (pol=%x)\n", int_pol); in wm8903_irq()
1702 mic_report ^= wm8903->mic_det; in wm8903_irq()
1705 msleep(wm8903->mic_delay); in wm8903_irq()
1708 regmap_update_bits(wm8903->regmap, WM8903_INTERRUPT_POLARITY_1, in wm8903_irq()
1711 snd_soc_jack_report(wm8903->mic_jack, mic_report, in wm8903_irq()
1712 wm8903->mic_short | wm8903->mic_det); in wm8903_irq()
1714 wm8903->mic_last_report = mic_report; in wm8903_irq()
1749 .name = "wm8903-hifi",
1772 regcache_sync(wm8903->regmap); in wm8903_resume()
1781 return -EINVAL; in wm8903_gpio_request()
1796 ret = regmap_update_bits(wm8903->regmap, in wm8903_gpio_direction_in()
1809 regmap_read(wm8903->regmap, WM8903_GPIO_CONTROL_1 + offset, ®); in wm8903_gpio_get()
1825 ret = regmap_update_bits(wm8903->regmap, in wm8903_gpio_direction_out()
1837 regmap_update_bits(wm8903->regmap, WM8903_GPIO_CONTROL_1 + offset, in wm8903_gpio_set()
1855 struct wm8903_platform_data *pdata = wm8903->pdata; in wm8903_init_gpio()
1858 wm8903->gpio_chip = wm8903_template_chip; in wm8903_init_gpio()
1859 wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO; in wm8903_init_gpio()
1860 wm8903->gpio_chip.parent = wm8903->dev; in wm8903_init_gpio()
1862 if (pdata->gpio_base) in wm8903_init_gpio()
1863 wm8903->gpio_chip.base = pdata->gpio_base; in wm8903_init_gpio()
1865 wm8903->gpio_chip.base = -1; in wm8903_init_gpio()
1867 ret = gpiochip_add_data(&wm8903->gpio_chip, wm8903); in wm8903_init_gpio()
1869 dev_err(wm8903->dev, "Failed to add GPIOs: %d\n", ret); in wm8903_init_gpio()
1874 gpiochip_remove(&wm8903->gpio_chip); in wm8903_free_gpio()
1919 struct irq_data *irq_data = irq_get_irq_data(i2c->irq); in wm8903_set_pdata_irq_trigger()
1921 dev_err(&i2c->dev, "Invalid IRQ: %d\n", in wm8903_set_pdata_irq_trigger()
1922 i2c->irq); in wm8903_set_pdata_irq_trigger()
1923 return -EINVAL; in wm8903_set_pdata_irq_trigger()
1931 * so we are able to select active-high in wm8903_set_pdata_irq_trigger()
1933 /* Fall-through */ in wm8903_set_pdata_irq_trigger()
1935 pdata->irq_active_low = false; in wm8903_set_pdata_irq_trigger()
1938 pdata->irq_active_low = true; in wm8903_set_pdata_irq_trigger()
1948 const struct device_node *np = i2c->dev.of_node; in wm8903_set_pdata_from_of()
1952 if (of_property_read_u32(np, "micdet-cfg", &val32) >= 0) in wm8903_set_pdata_from_of()
1953 pdata->micdet_cfg = val32; in wm8903_set_pdata_from_of()
1955 if (of_property_read_u32(np, "micdet-delay", &val32) >= 0) in wm8903_set_pdata_from_of()
1956 pdata->micdet_delay = val32; in wm8903_set_pdata_from_of()
1958 if (of_property_read_u32_array(np, "gpio-cfg", pdata->gpio_cfg, in wm8903_set_pdata_from_of()
1959 ARRAY_SIZE(pdata->gpio_cfg)) >= 0) { in wm8903_set_pdata_from_of()
1972 for (i = 0; i < ARRAY_SIZE(pdata->gpio_cfg); i++) { in wm8903_set_pdata_from_of()
1973 if (pdata->gpio_cfg[i] == 0) { in wm8903_set_pdata_from_of()
1974 pdata->gpio_cfg[i] = WM8903_GPIO_CONFIG_ZERO; in wm8903_set_pdata_from_of()
1975 } else if (pdata->gpio_cfg[i] == 0xffffffff) { in wm8903_set_pdata_from_of()
1976 pdata->gpio_cfg[i] = 0; in wm8903_set_pdata_from_of()
1977 } else if (pdata->gpio_cfg[i] > 0x7fff) { in wm8903_set_pdata_from_of()
1978 dev_err(&i2c->dev, "Invalid gpio-cfg[%d] %x\n", in wm8903_set_pdata_from_of()
1979 i, pdata->gpio_cfg[i]); in wm8903_set_pdata_from_of()
1980 return -EINVAL; in wm8903_set_pdata_from_of()
1991 struct wm8903_platform_data *pdata = dev_get_platdata(&i2c->dev); in wm8903_i2c_probe()
1998 wm8903 = devm_kzalloc(&i2c->dev, sizeof(*wm8903), GFP_KERNEL); in wm8903_i2c_probe()
2000 return -ENOMEM; in wm8903_i2c_probe()
2002 mutex_init(&wm8903->lock); in wm8903_i2c_probe()
2003 wm8903->dev = &i2c->dev; in wm8903_i2c_probe()
2005 wm8903->regmap = devm_regmap_init_i2c(i2c, &wm8903_regmap); in wm8903_i2c_probe()
2006 if (IS_ERR(wm8903->regmap)) { in wm8903_i2c_probe()
2007 ret = PTR_ERR(wm8903->regmap); in wm8903_i2c_probe()
2008 dev_err(&i2c->dev, "Failed to allocate register map: %d\n", in wm8903_i2c_probe()
2017 wm8903->pdata = pdata; in wm8903_i2c_probe()
2019 wm8903->pdata = devm_kzalloc(&i2c->dev, sizeof(*wm8903->pdata), in wm8903_i2c_probe()
2021 if (!wm8903->pdata) in wm8903_i2c_probe()
2022 return -ENOMEM; in wm8903_i2c_probe()
2024 if (i2c->irq) { in wm8903_i2c_probe()
2025 ret = wm8903_set_pdata_irq_trigger(i2c, wm8903->pdata); in wm8903_i2c_probe()
2030 if (i2c->dev.of_node) { in wm8903_i2c_probe()
2031 ret = wm8903_set_pdata_from_of(i2c, wm8903->pdata); in wm8903_i2c_probe()
2037 pdata = wm8903->pdata; in wm8903_i2c_probe()
2039 for (i = 0; i < ARRAY_SIZE(wm8903->supplies); i++) in wm8903_i2c_probe()
2040 wm8903->supplies[i].supply = wm8903_supply_names[i]; in wm8903_i2c_probe()
2042 ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(wm8903->supplies), in wm8903_i2c_probe()
2043 wm8903->supplies); in wm8903_i2c_probe()
2045 dev_err(&i2c->dev, "Failed to request supplies: %d\n", ret); in wm8903_i2c_probe()
2049 ret = regulator_bulk_enable(ARRAY_SIZE(wm8903->supplies), in wm8903_i2c_probe()
2050 wm8903->supplies); in wm8903_i2c_probe()
2052 dev_err(&i2c->dev, "Failed to enable supplies: %d\n", ret); in wm8903_i2c_probe()
2056 ret = regmap_read(wm8903->regmap, WM8903_SW_RESET_AND_ID, &val); in wm8903_i2c_probe()
2058 dev_err(&i2c->dev, "Failed to read chip ID: %d\n", ret); in wm8903_i2c_probe()
2062 dev_err(&i2c->dev, "Device with ID %x is not a WM8903\n", val); in wm8903_i2c_probe()
2063 ret = -ENODEV; in wm8903_i2c_probe()
2067 ret = regmap_read(wm8903->regmap, WM8903_REVISION_NUMBER, &val); in wm8903_i2c_probe()
2069 dev_err(&i2c->dev, "Failed to read chip revision: %d\n", ret); in wm8903_i2c_probe()
2072 dev_info(&i2c->dev, "WM8903 revision %c\n", in wm8903_i2c_probe()
2076 regmap_write(wm8903->regmap, WM8903_SW_RESET_AND_ID, 0x8903); in wm8903_i2c_probe()
2081 for (i = 0; i < ARRAY_SIZE(pdata->gpio_cfg); i++) { in wm8903_i2c_probe()
2082 if ((!pdata->gpio_cfg[i]) || in wm8903_i2c_probe()
2083 (pdata->gpio_cfg[i] > WM8903_GPIO_CONFIG_ZERO)) in wm8903_i2c_probe()
2086 regmap_write(wm8903->regmap, WM8903_GPIO_CONTROL_1 + i, in wm8903_i2c_probe()
2087 pdata->gpio_cfg[i] & 0x7fff); in wm8903_i2c_probe()
2089 val = (pdata->gpio_cfg[i] & WM8903_GP1_FN_MASK) in wm8903_i2c_probe()
2103 regmap_write(wm8903->regmap, WM8903_MIC_BIAS_CONTROL_0, in wm8903_i2c_probe()
2104 pdata->micdet_cfg); in wm8903_i2c_probe()
2107 if (pdata->micdet_cfg) in wm8903_i2c_probe()
2108 regmap_update_bits(wm8903->regmap, WM8903_WRITE_SEQUENCER_0, in wm8903_i2c_probe()
2117 WARN_ON(!mic_gpio && (pdata->micdet_cfg & WM8903_MICDET_ENA)); in wm8903_i2c_probe()
2119 wm8903->mic_delay = pdata->micdet_delay; in wm8903_i2c_probe()
2121 if (i2c->irq) { in wm8903_i2c_probe()
2122 if (pdata->irq_active_low) { in wm8903_i2c_probe()
2130 regmap_update_bits(wm8903->regmap, WM8903_INTERRUPT_CONTROL, in wm8903_i2c_probe()
2133 ret = request_threaded_irq(i2c->irq, NULL, wm8903_irq, in wm8903_i2c_probe()
2137 dev_err(wm8903->dev, "Failed to request IRQ: %d\n", in wm8903_i2c_probe()
2143 regmap_update_bits(wm8903->regmap, in wm8903_i2c_probe()
2149 regmap_update_bits(wm8903->regmap, WM8903_ADC_DIGITAL_VOLUME_LEFT, in wm8903_i2c_probe()
2151 regmap_update_bits(wm8903->regmap, WM8903_ADC_DIGITAL_VOLUME_RIGHT, in wm8903_i2c_probe()
2154 regmap_update_bits(wm8903->regmap, WM8903_DAC_DIGITAL_VOLUME_LEFT, in wm8903_i2c_probe()
2156 regmap_update_bits(wm8903->regmap, WM8903_DAC_DIGITAL_VOLUME_RIGHT, in wm8903_i2c_probe()
2159 regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT1_LEFT, in wm8903_i2c_probe()
2161 regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT1_RIGHT, in wm8903_i2c_probe()
2164 regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT2_LEFT, in wm8903_i2c_probe()
2166 regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT2_RIGHT, in wm8903_i2c_probe()
2169 regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT3_LEFT, in wm8903_i2c_probe()
2171 regmap_update_bits(wm8903->regmap, WM8903_ANALOGUE_OUT3_RIGHT, in wm8903_i2c_probe()
2175 regmap_update_bits(wm8903->regmap, WM8903_DAC_DIGITAL_1, in wm8903_i2c_probe()
2179 ret = devm_snd_soc_register_component(&i2c->dev, in wm8903_i2c_probe()
2186 regulator_bulk_disable(ARRAY_SIZE(wm8903->supplies), in wm8903_i2c_probe()
2187 wm8903->supplies); in wm8903_i2c_probe()
2195 regulator_bulk_disable(ARRAY_SIZE(wm8903->supplies), in wm8903_i2c_remove()
2196 wm8903->supplies); in wm8903_i2c_remove()
2197 if (client->irq) in wm8903_i2c_remove()
2198 free_irq(client->irq, wm8903); in wm8903_i2c_remove()