Lines Matching full:component

60 static void wait_for_dc_servo(struct snd_soc_component *component, unsigned int op)  in wait_for_dc_servo()  argument
62 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in wait_for_dc_servo()
71 snd_soc_component_write(component, WM8993_DC_SERVO_0, val); in wait_for_dc_servo()
73 dev_dbg(component->dev, "Waiting for DC servo...\n"); in wait_for_dc_servo()
89 reg = snd_soc_component_read(component, WM8993_DC_SERVO_0); in wait_for_dc_servo()
90 dev_dbg(component->dev, "DC servo: %x\n", reg); in wait_for_dc_servo()
94 dev_err(component->dev, "Timed out waiting for DC Servo %x\n", in wait_for_dc_servo()
108 static bool wm_hubs_dac_hp_direct(struct snd_soc_component *component) in wm_hubs_dac_hp_direct() argument
113 reg = snd_soc_component_read(component, WM8993_OUTPUT_MIXER1); in wm_hubs_dac_hp_direct()
116 dev_vdbg(component->dev, "Analogue paths connected: %x\n", in wm_hubs_dac_hp_direct()
120 dev_vdbg(component->dev, "HPL connected to mixer\n"); in wm_hubs_dac_hp_direct()
123 dev_vdbg(component->dev, "HPL connected to DAC\n"); in wm_hubs_dac_hp_direct()
126 reg = snd_soc_component_read(component, WM8993_OUTPUT_MIXER2); in wm_hubs_dac_hp_direct()
129 dev_vdbg(component->dev, "Analogue paths connected: %x\n", in wm_hubs_dac_hp_direct()
133 dev_vdbg(component->dev, "HPR connected to mixer\n"); in wm_hubs_dac_hp_direct()
136 dev_vdbg(component->dev, "HPR connected to DAC\n"); in wm_hubs_dac_hp_direct()
149 static bool wm_hubs_dcs_cache_get(struct snd_soc_component *component, in wm_hubs_dcs_cache_get() argument
152 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in wm_hubs_dcs_cache_get()
156 left = snd_soc_component_read(component, WM8993_LEFT_OUTPUT_VOLUME); in wm_hubs_dcs_cache_get()
159 right = snd_soc_component_read(component, WM8993_RIGHT_OUTPUT_VOLUME); in wm_hubs_dcs_cache_get()
173 static void wm_hubs_dcs_cache_set(struct snd_soc_component *component, u16 dcs_cfg) in wm_hubs_dcs_cache_set() argument
175 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in wm_hubs_dcs_cache_set()
181 cache = devm_kzalloc(component->dev, sizeof(*cache), GFP_KERNEL); in wm_hubs_dcs_cache_set()
185 cache->left = snd_soc_component_read(component, WM8993_LEFT_OUTPUT_VOLUME); in wm_hubs_dcs_cache_set()
188 cache->right = snd_soc_component_read(component, WM8993_RIGHT_OUTPUT_VOLUME); in wm_hubs_dcs_cache_set()
196 static int wm_hubs_read_dc_servo(struct snd_soc_component *component, in wm_hubs_read_dc_servo() argument
199 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in wm_hubs_read_dc_servo()
220 *reg_l = snd_soc_component_read(component, WM8993_DC_SERVO_READBACK_1) in wm_hubs_read_dc_servo()
222 *reg_r = snd_soc_component_read(component, WM8993_DC_SERVO_READBACK_2) in wm_hubs_read_dc_servo()
227 reg = snd_soc_component_read(component, dcs_reg); in wm_hubs_read_dc_servo()
242 static void enable_dc_servo(struct snd_soc_component *component) in enable_dc_servo() argument
244 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in enable_dc_servo()
260 if (wm_hubs_dac_hp_direct(component) && in enable_dc_servo()
261 wm_hubs_dcs_cache_get(component, &cache)) { in enable_dc_servo()
262 dev_dbg(component->dev, "Using cached DCS offset %x for %d,%d\n", in enable_dc_servo()
264 snd_soc_component_write(component, dcs_reg, cache->dcs_cfg); in enable_dc_servo()
265 wait_for_dc_servo(component, in enable_dc_servo()
273 snd_soc_component_update_bits(component, WM8993_DC_SERVO_1, in enable_dc_servo()
276 wait_for_dc_servo(component, in enable_dc_servo()
280 wait_for_dc_servo(component, in enable_dc_servo()
285 if (wm_hubs_read_dc_servo(component, &reg_l, &reg_r) < 0) in enable_dc_servo()
288 dev_dbg(component->dev, "DCS input: %x %x\n", reg_l, reg_r); in enable_dc_servo()
292 dev_dbg(component->dev, in enable_dc_servo()
298 dev_dbg(component->dev, "DCS right %d->%d\n", offset, in enable_dc_servo()
305 dev_dbg(component->dev, "DCS left %d->%d\n", offset, in enable_dc_servo()
310 dev_dbg(component->dev, "DCS result: %x\n", dcs_cfg); in enable_dc_servo()
313 snd_soc_component_write(component, dcs_reg, dcs_cfg); in enable_dc_servo()
314 wait_for_dc_servo(component, in enable_dc_servo()
324 if (wm_hubs_dac_hp_direct(component)) in enable_dc_servo()
325 wm_hubs_dcs_cache_set(component, dcs_cfg); in enable_dc_servo()
334 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8993_put_dc_servo() local
335 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in wm8993_put_dc_servo()
346 if (snd_soc_component_read(component, WM8993_POWER_MANAGEMENT_1) in wm8993_put_dc_servo()
348 snd_soc_component_update_bits(component, in wm8993_put_dc_servo()
499 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in hp_supply_event() local
500 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in hp_supply_event()
509 snd_soc_component_update_bits(component, WM8993_POWER_MANAGEMENT_1, in hp_supply_event()
516 snd_soc_component_update_bits(component, WM8993_ANALOGUE_HP_0, in hp_supply_event()
523 dev_err(component->dev, "Unknown HP startup mode %d\n", in hp_supply_event()
530 snd_soc_component_update_bits(component, WM8993_CHARGE_PUMP_1, in hp_supply_event()
541 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in hp_event() local
542 unsigned int reg = snd_soc_component_read(component, WM8993_ANALOGUE_HP_0); in hp_event()
546 snd_soc_component_update_bits(component, WM8993_CHARGE_PUMP_1, in hp_event()
551 snd_soc_component_update_bits(component, WM8993_POWER_MANAGEMENT_1, in hp_event()
556 snd_soc_component_write(component, WM8993_ANALOGUE_HP_0, reg); in hp_event()
558 snd_soc_component_update_bits(component, WM8993_DC_SERVO_1, in hp_event()
561 enable_dc_servo(component); in hp_event()
565 snd_soc_component_write(component, WM8993_ANALOGUE_HP_0, reg); in hp_event()
569 snd_soc_component_update_bits(component, WM8993_ANALOGUE_HP_0, in hp_event()
575 snd_soc_component_update_bits(component, WM8993_ANALOGUE_HP_0, in hp_event()
579 snd_soc_component_write(component, WM8993_DC_SERVO_0, 0); in hp_event()
581 snd_soc_component_update_bits(component, WM8993_POWER_MANAGEMENT_1, in hp_event()
593 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in earpiece_event() local
594 u16 reg = snd_soc_component_read(component, WM8993_ANTIPOP1) & ~WM8993_HPOUT2_IN_ENA; in earpiece_event()
599 snd_soc_component_write(component, WM8993_ANTIPOP1, reg); in earpiece_event()
604 snd_soc_component_write(component, WM8993_ANTIPOP1, reg); in earpiece_event()
618 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in lineout_event() local
619 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in lineout_event()
648 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in micbias_event() local
649 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in micbias_event()
667 void wm_hubs_update_class_w(struct snd_soc_component *component) in wm_hubs_update_class_w() argument
669 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in wm_hubs_update_class_w()
672 if (!wm_hubs_dac_hp_direct(component)) in wm_hubs_update_class_w()
675 if (hubs->check_class_w_digital && !hubs->check_class_w_digital(component)) in wm_hubs_update_class_w()
678 dev_vdbg(component->dev, "Class W %s\n", str_enabled_disabled(enable)); in wm_hubs_update_class_w()
680 snd_soc_component_update_bits(component, WM8993_CLASS_W_0, in wm_hubs_update_class_w()
683 snd_soc_component_write(component, WM8993_LEFT_OUTPUT_VOLUME, in wm_hubs_update_class_w()
684 snd_soc_component_read(component, WM8993_LEFT_OUTPUT_VOLUME)); in wm_hubs_update_class_w()
685 snd_soc_component_write(component, WM8993_RIGHT_OUTPUT_VOLUME, in wm_hubs_update_class_w()
686 snd_soc_component_read(component, WM8993_RIGHT_OUTPUT_VOLUME)); in wm_hubs_update_class_w()
697 struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); in class_w_put_volsw() local
702 wm_hubs_update_class_w(component); in class_w_put_volsw()
717 struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); in class_w_put_double() local
722 wm_hubs_update_class_w(component); in class_w_put_double()
1113 int wm_hubs_add_analogue_controls(struct snd_soc_component *component) in wm_hubs_add_analogue_controls() argument
1115 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm_hubs_add_analogue_controls()
1118 snd_soc_component_update_bits(component, WM8993_LEFT_LINE_INPUT_1_2_VOLUME, in wm_hubs_add_analogue_controls()
1120 snd_soc_component_update_bits(component, WM8993_RIGHT_LINE_INPUT_1_2_VOLUME, in wm_hubs_add_analogue_controls()
1122 snd_soc_component_update_bits(component, WM8993_LEFT_LINE_INPUT_3_4_VOLUME, in wm_hubs_add_analogue_controls()
1124 snd_soc_component_update_bits(component, WM8993_RIGHT_LINE_INPUT_3_4_VOLUME, in wm_hubs_add_analogue_controls()
1127 snd_soc_component_update_bits(component, WM8993_SPEAKER_VOLUME_LEFT, in wm_hubs_add_analogue_controls()
1129 snd_soc_component_update_bits(component, WM8993_SPEAKER_VOLUME_RIGHT, in wm_hubs_add_analogue_controls()
1132 snd_soc_component_update_bits(component, WM8993_LEFT_OUTPUT_VOLUME, in wm_hubs_add_analogue_controls()
1135 snd_soc_component_update_bits(component, WM8993_RIGHT_OUTPUT_VOLUME, in wm_hubs_add_analogue_controls()
1139 snd_soc_component_update_bits(component, WM8993_LEFT_OPGA_VOLUME, in wm_hubs_add_analogue_controls()
1142 snd_soc_component_update_bits(component, WM8993_RIGHT_OPGA_VOLUME, in wm_hubs_add_analogue_controls()
1146 snd_soc_add_component_controls(component, analogue_snd_controls, in wm_hubs_add_analogue_controls()
1155 int wm_hubs_add_analogue_routes(struct snd_soc_component *component, in wm_hubs_add_analogue_routes() argument
1158 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in wm_hubs_add_analogue_routes()
1159 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm_hubs_add_analogue_routes()
1161 hubs->component = component; in wm_hubs_add_analogue_routes()
1191 int wm_hubs_handle_analogue_pdata(struct snd_soc_component *component, in wm_hubs_handle_analogue_pdata() argument
1198 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in wm_hubs_handle_analogue_pdata()
1206 snd_soc_component_update_bits(component, WM8993_LINE_MIXER1, in wm_hubs_handle_analogue_pdata()
1210 snd_soc_component_update_bits(component, WM8993_LINE_MIXER2, in wm_hubs_handle_analogue_pdata()
1215 snd_soc_component_update_bits(component, WM8993_ANTIPOP1, in wm_hubs_handle_analogue_pdata()
1220 snd_soc_component_update_bits(component, WM8993_ADDITIONAL_CONTROL, in wm_hubs_handle_analogue_pdata()
1224 snd_soc_component_update_bits(component, WM8993_ADDITIONAL_CONTROL, in wm_hubs_handle_analogue_pdata()
1230 snd_soc_component_update_bits(component, WM8993_MICBIAS, in wm_hubs_handle_analogue_pdata()
1242 void wm_hubs_vmid_ena(struct snd_soc_component *component) in wm_hubs_vmid_ena() argument
1244 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in wm_hubs_vmid_ena()
1254 snd_soc_component_update_bits(component, WM8993_POWER_MANAGEMENT_3, val, val); in wm_hubs_vmid_ena()
1258 void wm_hubs_set_bias_level(struct snd_soc_component *component, in wm_hubs_set_bias_level() argument
1261 struct wm_hubs_data *hubs = snd_soc_component_get_drvdata(component); in wm_hubs_set_bias_level()
1267 snd_soc_component_update_bits(component, WM8993_INPUTS_CLAMP_REG, in wm_hubs_set_bias_level()
1294 snd_soc_component_update_bits(component, WM8993_POWER_MANAGEMENT_3, in wm_hubs_set_bias_level()
1298 snd_soc_component_update_bits(component, WM8993_INPUTS_CLAMP_REG, in wm_hubs_set_bias_level()