Lines Matching +full:bias +full:- +full:ctrl +full:- +full:value
2 * wm8983.c -- WM8983 ALSA SoC Audio driver
32 { 0x01, 0x0000 }, /* R1 - Power management 1 */
33 { 0x02, 0x0000 }, /* R2 - Power management 2 */
34 { 0x03, 0x0000 }, /* R3 - Power management 3 */
35 { 0x04, 0x0050 }, /* R4 - Audio Interface */
36 { 0x05, 0x0000 }, /* R5 - Companding control */
37 { 0x06, 0x0140 }, /* R6 - Clock Gen control */
38 { 0x07, 0x0000 }, /* R7 - Additional control */
39 { 0x08, 0x0000 }, /* R8 - GPIO Control */
40 { 0x09, 0x0000 }, /* R9 - Jack Detect Control 1 */
41 { 0x0A, 0x0000 }, /* R10 - DAC Control */
42 { 0x0B, 0x00FF }, /* R11 - Left DAC digital Vol */
43 { 0x0C, 0x00FF }, /* R12 - Right DAC digital vol */
44 { 0x0D, 0x0000 }, /* R13 - Jack Detect Control 2 */
45 { 0x0E, 0x0100 }, /* R14 - ADC Control */
46 { 0x0F, 0x00FF }, /* R15 - Left ADC Digital Vol */
47 { 0x10, 0x00FF }, /* R16 - Right ADC Digital Vol */
48 { 0x12, 0x012C }, /* R18 - EQ1 - low shelf */
49 { 0x13, 0x002C }, /* R19 - EQ2 - peak 1 */
50 { 0x14, 0x002C }, /* R20 - EQ3 - peak 2 */
51 { 0x15, 0x002C }, /* R21 - EQ4 - peak 3 */
52 { 0x16, 0x002C }, /* R22 - EQ5 - high shelf */
53 { 0x18, 0x0032 }, /* R24 - DAC Limiter 1 */
54 { 0x19, 0x0000 }, /* R25 - DAC Limiter 2 */
55 { 0x1B, 0x0000 }, /* R27 - Notch Filter 1 */
56 { 0x1C, 0x0000 }, /* R28 - Notch Filter 2 */
57 { 0x1D, 0x0000 }, /* R29 - Notch Filter 3 */
58 { 0x1E, 0x0000 }, /* R30 - Notch Filter 4 */
59 { 0x20, 0x0038 }, /* R32 - ALC control 1 */
60 { 0x21, 0x000B }, /* R33 - ALC control 2 */
61 { 0x22, 0x0032 }, /* R34 - ALC control 3 */
62 { 0x23, 0x0000 }, /* R35 - Noise Gate */
63 { 0x24, 0x0008 }, /* R36 - PLL N */
64 { 0x25, 0x000C }, /* R37 - PLL K 1 */
65 { 0x26, 0x0093 }, /* R38 - PLL K 2 */
66 { 0x27, 0x00E9 }, /* R39 - PLL K 3 */
67 { 0x29, 0x0000 }, /* R41 - 3D control */
68 { 0x2A, 0x0000 }, /* R42 - OUT4 to ADC */
69 { 0x2B, 0x0000 }, /* R43 - Beep control */
70 { 0x2C, 0x0033 }, /* R44 - Input ctrl */
71 { 0x2D, 0x0010 }, /* R45 - Left INP PGA gain ctrl */
72 { 0x2E, 0x0010 }, /* R46 - Right INP PGA gain ctrl */
73 { 0x2F, 0x0100 }, /* R47 - Left ADC BOOST ctrl */
74 { 0x30, 0x0100 }, /* R48 - Right ADC BOOST ctrl */
75 { 0x31, 0x0002 }, /* R49 - Output ctrl */
76 { 0x32, 0x0001 }, /* R50 - Left mixer ctrl */
77 { 0x33, 0x0001 }, /* R51 - Right mixer ctrl */
78 { 0x34, 0x0039 }, /* R52 - LOUT1 (HP) volume ctrl */
79 { 0x35, 0x0039 }, /* R53 - ROUT1 (HP) volume ctrl */
80 { 0x36, 0x0039 }, /* R54 - LOUT2 (SPK) volume ctrl */
81 { 0x37, 0x0039 }, /* R55 - ROUT2 (SPK) volume ctrl */
82 { 0x38, 0x0001 }, /* R56 - OUT3 mixer ctrl */
83 { 0x39, 0x0001 }, /* R57 - OUT4 (MONO) mix ctrl */
84 { 0x3D, 0x0000 }, /* R61 - BIAS CTRL */
132 static const DECLARE_TLV_DB_SCALE(dac_tlv, -12700, 50, 1);
133 static const DECLARE_TLV_DB_SCALE(adc_tlv, -12700, 50, 1);
134 static const DECLARE_TLV_DB_SCALE(out_tlv, -5700, 100, 0);
135 static const DECLARE_TLV_DB_SCALE(lim_thresh_tlv, -600, 100, 0);
137 static const DECLARE_TLV_DB_SCALE(alc_min_tlv, -1200, 600, 0);
138 static const DECLARE_TLV_DB_SCALE(alc_max_tlv, -675, 600, 0);
139 static const DECLARE_TLV_DB_SCALE(alc_tar_tlv, -2250, 150, 0);
140 static const DECLARE_TLV_DB_SCALE(pga_vol_tlv, -1200, 75, 0);
141 static const DECLARE_TLV_DB_SCALE(boost_tlv, -1200, 300, 1);
142 static const DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
143 static const DECLARE_TLV_DB_SCALE(aux_tlv, -1500, 300, 0);
144 static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0);
414 SND_SOC_DAPM_SUPPLY("Mic Bias", WM8983_POWER_MANAGEMENT_1, 4, 0,
500 ucontrol->value.enumerated.item[0] = 1; in eqmode_get()
502 ucontrol->value.enumerated.item[0] = 0; in eqmode_get()
514 if (ucontrol->value.enumerated.item[0] != 0 in eqmode_put()
515 && ucontrol->value.enumerated.item[0] != 1) in eqmode_put()
516 return -EINVAL; in eqmode_put()
521 if (!ucontrol->value.enumerated.item[0]) in eqmode_put()
525 if (ucontrol->value.enumerated.item[0]) in eqmode_put()
540 ucontrol->value.enumerated.item[0] in eqmode_put()
565 struct snd_soc_component *component = dai->component; in wm8983_dac_mute()
574 struct snd_soc_component *component = dai->component; in wm8983_set_fmt()
592 dev_err(dai->dev, "Unknown dai format\n"); in wm8983_set_fmt()
593 return -EINVAL; in wm8983_set_fmt()
607 dev_err(dai->dev, "Unknown master/slave configuration\n"); in wm8983_set_fmt()
608 return -EINVAL; in wm8983_set_fmt()
618 dev_err(dai->dev, "DSP A/B modes are not supported\n"); in wm8983_set_fmt()
619 return -EINVAL; in wm8983_set_fmt()
638 dev_err(dai->dev, "Unknown polarity configuration\n"); in wm8983_set_fmt()
639 return -EINVAL; in wm8983_set_fmt()
654 struct snd_soc_component *component = dai->component; in wm8983_hw_params()
663 dev_err(component->dev, "Failed to convert params to bclk: %d\n", ret); in wm8983_hw_params()
667 wm8983->bclk = ret; in wm8983_hw_params()
683 dev_err(dai->dev, "Unsupported word length %u\n", in wm8983_hw_params()
685 return -EINVAL; in wm8983_hw_params()
696 srate_best = abs(srates[0] - params_rate(params)); in wm8983_hw_params()
698 if (abs(srates[i] - params_rate(params)) >= srate_best) in wm8983_hw_params()
701 srate_best = abs(srates[i] - params_rate(params)); in wm8983_hw_params()
704 dev_dbg(dai->dev, "Selected SRATE = %d\n", srates[srate_idx]); in wm8983_hw_params()
708 dev_dbg(dai->dev, "Target BCLK = %uHz\n", wm8983->bclk); in wm8983_hw_params()
709 dev_dbg(dai->dev, "SYSCLK = %uHz\n", wm8983->sysclk); in wm8983_hw_params()
712 if (wm8983->sysclk / params_rate(params) in wm8983_hw_params()
718 dev_err(dai->dev, "Unable to configure MCLK ratio %u/%u\n", in wm8983_hw_params()
719 wm8983->sysclk, params_rate(params)); in wm8983_hw_params()
720 return -EINVAL; in wm8983_hw_params()
723 dev_dbg(dai->dev, "MCLK ratio = %dfs\n", fs_ratios[i].ratio); in wm8983_hw_params()
728 tmp = (wm8983->sysclk / fs_ratios[i].div) * 10; in wm8983_hw_params()
730 if (wm8983->bclk == tmp / bclk_divs[i]) in wm8983_hw_params()
735 dev_err(dai->dev, "No matching BCLK divider found\n"); in wm8983_hw_params()
736 return -EINVAL; in wm8983_hw_params()
739 dev_dbg(dai->dev, "BCLK div = %d\n", i); in wm8983_hw_params()
759 pll_div->div2 = 0; in pll_factors()
763 pll_div->div2 = 1; in pll_factors()
768 printk(KERN_ERR "%s: WM8983 N value is not within" in pll_factors()
770 return -EINVAL; in pll_factors()
772 pll_div->n = Ndiv; in pll_factors()
783 pll_div->k = K; in pll_factors()
795 component = dai->component; in wm8983_set_pll()
806 /* disable the PLL before re-programming it */ in wm8983_set_pll()
829 struct snd_soc_component *component = dai->component; in wm8983_set_sysclk()
842 dev_err(dai->dev, "Unknown clock source: %d\n", clk_id); in wm8983_set_sysclk()
843 return -EINVAL; in wm8983_set_sysclk()
846 wm8983->sysclk = freq; in wm8983_set_sysclk()
866 ret = regcache_sync(wm8983->regmap); in wm8983_set_bias_level()
868 dev_err(component->dev, "Failed to sync cache: %d\n", ret); in wm8983_set_bias_level()
871 /* enable anti-pop features */ in wm8983_set_bias_level()
886 /* disable anti-pop features */ in wm8983_set_bias_level()
923 dev_err(component->dev, "Failed to issue reset: %d\n", ret); in wm8983_probe()
960 .name = "wm8983-hifi",
1013 wm8983 = devm_kzalloc(&spi->dev, sizeof *wm8983, GFP_KERNEL); in wm8983_spi_probe()
1015 return -ENOMEM; in wm8983_spi_probe()
1017 wm8983->regmap = devm_regmap_init_spi(spi, &wm8983_regmap); in wm8983_spi_probe()
1018 if (IS_ERR(wm8983->regmap)) { in wm8983_spi_probe()
1019 ret = PTR_ERR(wm8983->regmap); in wm8983_spi_probe()
1020 dev_err(&spi->dev, "Failed to init regmap: %d\n", ret); in wm8983_spi_probe()
1026 ret = devm_snd_soc_register_component(&spi->dev, in wm8983_spi_probe()
1046 wm8983 = devm_kzalloc(&i2c->dev, sizeof *wm8983, GFP_KERNEL); in wm8983_i2c_probe()
1048 return -ENOMEM; in wm8983_i2c_probe()
1050 wm8983->regmap = devm_regmap_init_i2c(i2c, &wm8983_regmap); in wm8983_i2c_probe()
1051 if (IS_ERR(wm8983->regmap)) { in wm8983_i2c_probe()
1052 ret = PTR_ERR(wm8983->regmap); in wm8983_i2c_probe()
1053 dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret); in wm8983_i2c_probe()
1059 ret = devm_snd_soc_register_component(&i2c->dev, in wm8983_i2c_probe()