Lines Matching +full:4 +full:- +full:switch
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright 2009-12 Wolfson Microelectronics
25 { 1, 0x0006 }, /* R1 - Power Management (1) */
26 { 2, 0x6000 }, /* R2 - Power Management (2) */
27 { 3, 0x0000 }, /* R3 - Power Management (3) */
28 { 6, 0x01C0 }, /* R6 - Clocking 1 */
29 { 22, 0x0003 }, /* R22 - IN1 Line Control */
30 { 23, 0x0003 }, /* R23 - IN2 Line Control */
31 { 24, 0x0083 }, /* R24 - IN1 Line Input A Volume */
32 { 25, 0x0083 }, /* R25 - IN1 Line Input B Volume */
33 { 26, 0x0083 }, /* R26 - IN2 Line Input A Volume */
34 { 27, 0x0083 }, /* R27 - IN2 Line Input B Volume */
35 { 28, 0x002D }, /* R28 - Left Output Volume */
36 { 29, 0x002D }, /* R29 - Right Output Volume */
37 { 34, 0x0100 }, /* R34 - SPKMIXL Attenuation */
38 { 35, 0x0010 }, /* R36 - SPKOUT Mixers */
39 { 37, 0x0140 }, /* R37 - ClassD3 */
40 { 38, 0x0039 }, /* R38 - Speaker Volume Left */
41 { 45, 0x0000 }, /* R45 - Output Mixer1 */
42 { 46, 0x0000 }, /* R46 - Output Mixer2 */
43 { 47, 0x0100 }, /* R47 - Output Mixer3 */
44 { 48, 0x0100 }, /* R48 - Output Mixer4 */
45 { 54, 0x0000 }, /* R54 - Speaker Mixer */
46 { 57, 0x000D }, /* R57 - AntiPOP2 */
47 { 70, 0x0000 }, /* R70 - Write Sequencer 0 */
48 { 71, 0x0000 }, /* R71 - Write Sequencer 1 */
49 { 72, 0x0000 }, /* R72 - Write Sequencer 2 */
50 { 73, 0x0000 }, /* R73 - Write Sequencer 3 */
51 { 74, 0x0000 }, /* R74 - Write Sequencer 4 */
52 { 75, 0x0000 }, /* R75 - Write Sequencer 5 */
53 { 76, 0x1F25 }, /* R76 - Charge Pump 1 */
54 { 85, 0x054A }, /* R85 - DC Servo 1 */
55 { 87, 0x0000 }, /* R87 - DC Servo 3 */
56 { 96, 0x0100 }, /* R96 - Analogue HP 0 */
57 { 98, 0x8640 }, /* R98 - AGC Control 0 */
58 { 99, 0xC000 }, /* R99 - AGC Control 1 */
59 { 100, 0x0200 }, /* R100 - AGC Control 2 */
70 switch (reg) { in wm9090_volatile()
85 switch (reg) { in wm9090_readable()
138 dev_dbg(component->dev, "Waiting for DC servo...\n"); in wait_for_dc_servo()
143 dev_dbg(component->dev, "DC servo status: %x\n", reg); in wait_for_dc_servo()
149 dev_err(component->dev, "Timed out waiting for DC Servo\n"); in wait_for_dc_servo()
153 0, 0, TLV_DB_SCALE_ITEM(-600, 0, 0),
154 1, 3, TLV_DB_SCALE_ITEM(-350, 350, 0),
155 4, 6, TLV_DB_SCALE_ITEM(600, 600, 0)
158 0, 2, TLV_DB_SCALE_ITEM(-1200, 300, 0),
161 static const DECLARE_TLV_DB_SCALE(out_tlv, -5700, 100, 0);
170 SOC_SINGLE("IN1A Switch", WM9090_IN1_LINE_INPUT_A_VOLUME, 7, 1, 1),
171 SOC_SINGLE("IN1A ZC Switch", WM9090_IN1_LINE_INPUT_A_VOLUME, 6, 1, 0),
175 SOC_SINGLE("IN2A Switch", WM9090_IN2_LINE_INPUT_A_VOLUME, 7, 1, 1),
176 SOC_SINGLE("IN2A ZC Switch", WM9090_IN2_LINE_INPUT_A_VOLUME, 6, 1, 0),
178 SOC_SINGLE("MIXOUTL Switch", WM9090_OUTPUT_MIXER3, 8, 1, 1),
184 SOC_SINGLE("MIXOUTR Switch", WM9090_OUTPUT_MIXER4, 8, 1, 1),
190 SOC_SINGLE("SPKMIX Switch", WM9090_SPKMIXL_ATTENUATION, 8, 1, 1),
198 SOC_DOUBLE_R("Headphone Switch", WM9090_LEFT_OUTPUT_VOLUME,
200 SOC_DOUBLE_R("Headphone ZC Switch", WM9090_LEFT_OUTPUT_VOLUME,
205 SOC_SINGLE("Speaker Switch", WM9090_SPEAKER_VOLUME_LEFT, 6, 1, 1),
206 SOC_SINGLE("Speaker ZC Switch", WM9090_SPEAKER_VOLUME_LEFT, 7, 1, 0),
213 SOC_SINGLE("IN1B Switch", WM9090_IN1_LINE_INPUT_B_VOLUME, 7, 1, 1),
214 SOC_SINGLE("IN1B ZC Switch", WM9090_IN1_LINE_INPUT_B_VOLUME, 6, 1, 0),
216 SOC_SINGLE_TLV("SPKMIX IN1B Volume", WM9090_SPKMIXL_ATTENUATION, 4, 3, 1,
218 SOC_SINGLE_TLV("MIXOUTL IN1B Volume", WM9090_OUTPUT_MIXER3, 4, 3, 1,
220 SOC_SINGLE_TLV("MIXOUTR IN1B Volume", WM9090_OUTPUT_MIXER4, 4, 3, 1,
227 SOC_SINGLE("IN2B Switch", WM9090_IN2_LINE_INPUT_B_VOLUME, 7, 1, 1),
228 SOC_SINGLE("IN2B ZC Switch", WM9090_IN2_LINE_INPUT_B_VOLUME, 6, 1, 0),
241 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in hp_ev()
244 switch (event) { in hp_ev()
301 SOC_DAPM_SINGLE("IN1A Switch", WM9090_SPEAKER_MIXER, 6, 1, 0),
302 SOC_DAPM_SINGLE("IN1B Switch", WM9090_SPEAKER_MIXER, 4, 1, 0),
303 SOC_DAPM_SINGLE("IN2A Switch", WM9090_SPEAKER_MIXER, 2, 1, 0),
304 SOC_DAPM_SINGLE("IN2B Switch", WM9090_SPEAKER_MIXER, 0, 1, 0),
308 SOC_DAPM_SINGLE("Mixer Switch", WM9090_SPKOUT_MIXERS, 4, 1, 0),
312 SOC_DAPM_SINGLE("IN1A Switch", WM9090_OUTPUT_MIXER1, 6, 1, 0),
313 SOC_DAPM_SINGLE("IN1B Switch", WM9090_OUTPUT_MIXER1, 4, 1, 0),
314 SOC_DAPM_SINGLE("IN2A Switch", WM9090_OUTPUT_MIXER1, 2, 1, 0),
315 SOC_DAPM_SINGLE("IN2B Switch", WM9090_OUTPUT_MIXER1, 0, 1, 0),
319 SOC_DAPM_SINGLE("IN1A Switch", WM9090_OUTPUT_MIXER2, 6, 1, 0),
320 SOC_DAPM_SINGLE("IN1B Switch", WM9090_OUTPUT_MIXER2, 4, 1, 0),
321 SOC_DAPM_SINGLE("IN2A Switch", WM9090_OUTPUT_MIXER2, 2, 1, 0),
322 SOC_DAPM_SINGLE("IN2B Switch", WM9090_OUTPUT_MIXER2, 0, 1, 0),
327 SND_SOC_DAPM_INPUT("IN1-"),
329 SND_SOC_DAPM_INPUT("IN2-"),
336 SND_SOC_DAPM_PGA("IN2B PGA", WM9090_POWER_MANAGEMENT_2, 4, 0, NULL, 0),
342 SND_SOC_DAPM_MIXER("MIXOUTR", WM9090_POWER_MANAGEMENT_3, 4, 0,
361 { "SPKMIX", "IN1A Switch", "IN1A PGA" },
362 { "SPKMIX", "IN2A Switch", "IN2A PGA" },
364 { "MIXOUTL", "IN1A Switch", "IN1A PGA" },
365 { "MIXOUTL", "IN2A Switch", "IN2A PGA" },
367 { "MIXOUTR", "IN1A Switch", "IN1A PGA" },
368 { "MIXOUTR", "IN2A Switch", "IN2A PGA" },
380 { "SPKOUT", "Mixer Switch", "SPKPGA" },
386 { "IN1B PGA", NULL, "IN1-" },
388 { "SPKMIX", "IN1B Switch", "IN1B PGA" },
389 { "MIXOUTL", "IN1B Switch", "IN1B PGA" },
390 { "MIXOUTR", "IN1B Switch", "IN1B PGA" },
394 { "IN1A PGA", NULL, "IN1-" },
398 { "IN2B PGA", NULL, "IN2-" },
400 { "SPKMIX", "IN2B Switch", "IN2B PGA" },
401 { "MIXOUTL", "IN2B Switch", "IN2B PGA" },
402 { "MIXOUTR", "IN2B Switch", "IN2B PGA" },
406 { "IN2A PGA", NULL, "IN2-" },
423 if (wm9090->pdata.lin1_diff) { in wm9090_add_controls()
433 if (wm9090->pdata.lin2_diff) { in wm9090_add_controls()
443 if (wm9090->pdata.agc_ena) { in wm9090_add_controls()
444 for (i = 0; i < ARRAY_SIZE(wm9090->pdata.agc); i++) in wm9090_add_controls()
446 wm9090->pdata.agc[i]); in wm9090_add_controls()
467 switch (level) { in wm9090_set_bias_level()
485 regcache_sync(wm9090->regmap); in wm9090_set_bias_level()
568 wm9090 = devm_kzalloc(&i2c->dev, sizeof(*wm9090), GFP_KERNEL); in wm9090_i2c_probe()
570 return -ENOMEM; in wm9090_i2c_probe()
572 wm9090->regmap = devm_regmap_init_i2c(i2c, &wm9090_regmap); in wm9090_i2c_probe()
573 if (IS_ERR(wm9090->regmap)) { in wm9090_i2c_probe()
574 ret = PTR_ERR(wm9090->regmap); in wm9090_i2c_probe()
575 dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret); in wm9090_i2c_probe()
579 ret = regmap_read(wm9090->regmap, WM9090_SOFTWARE_RESET, ®); in wm9090_i2c_probe()
584 dev_err(&i2c->dev, "Device is not a WM9090, ID=%x\n", reg); in wm9090_i2c_probe()
585 return -ENODEV; in wm9090_i2c_probe()
588 ret = regmap_write(wm9090->regmap, WM9090_SOFTWARE_RESET, 0); in wm9090_i2c_probe()
592 if (i2c->dev.platform_data) in wm9090_i2c_probe()
593 memcpy(&wm9090->pdata, i2c->dev.platform_data, in wm9090_i2c_probe()
594 sizeof(wm9090->pdata)); in wm9090_i2c_probe()
598 ret = devm_snd_soc_register_component(&i2c->dev, in wm9090_i2c_probe()
601 dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); in wm9090_i2c_probe()