Lines Matching full:mixer
98 vfree(chip->mixer.array_saved); in lola_free_mixer()
113 dev_dbg(chip->card->dev, "No valid mixer widget\n"); in lola_init_mixer_widget()
117 chip->mixer.nid = nid; in lola_init_mixer_widget()
118 chip->mixer.caps = val; in lola_init_mixer_widget()
119 chip->mixer.array = (struct lola_mixer_array __iomem *) in lola_init_mixer_widget()
122 /* reserve memory to copy mixer data for sleep mode transitions */ in lola_init_mixer_widget()
123 chip->mixer.array_saved = vmalloc(sizeof(struct lola_mixer_array)); in lola_init_mixer_widget()
125 /* mixer matrix sources are physical input data and play streams */ in lola_init_mixer_widget()
126 chip->mixer.src_stream_outs = chip->pcm[PLAY].num_streams; in lola_init_mixer_widget()
127 chip->mixer.src_phys_ins = chip->pin[CAPT].num_pins; in lola_init_mixer_widget()
129 /* mixer matrix destinations are record streams and physical output */ in lola_init_mixer_widget()
130 chip->mixer.dest_stream_ins = chip->pcm[CAPT].num_streams; in lola_init_mixer_widget()
131 chip->mixer.dest_phys_outs = chip->pin[PLAY].num_pins; in lola_init_mixer_widget()
133 /* mixer matrix may have unused areas between PhysIn and in lola_init_mixer_widget()
136 chip->mixer.src_stream_out_ofs = chip->mixer.src_phys_ins + in lola_init_mixer_widget()
138 chip->mixer.dest_phys_out_ofs = chip->mixer.dest_stream_ins + in lola_init_mixer_widget()
189 if (chip->mixer.src_stream_out_ofs > MAX_AUDIO_INOUT_COUNT || in lola_init_mixer_widget()
190 chip->mixer.dest_phys_out_ofs > MAX_STREAM_IN_COUNT) { in lola_init_mixer_widget()
191 dev_err(chip->card->dev, "Invalid mixer widget size\n"); in lola_init_mixer_widget()
195 chip->mixer.src_mask = ((1U << chip->mixer.src_phys_ins) - 1) | in lola_init_mixer_widget()
196 (((1U << chip->mixer.src_stream_outs) - 1) in lola_init_mixer_widget()
197 << chip->mixer.src_stream_out_ofs); in lola_init_mixer_widget()
198 chip->mixer.dest_mask = ((1U << chip->mixer.dest_stream_ins) - 1) | in lola_init_mixer_widget()
199 (((1U << chip->mixer.dest_phys_outs) - 1) in lola_init_mixer_widget()
200 << chip->mixer.dest_phys_out_ofs); in lola_init_mixer_widget()
202 dev_dbg(chip->card->dev, "Mixer src_mask=%x, dest_mask=%x\n", in lola_init_mixer_widget()
203 chip->mixer.src_mask, chip->mixer.dest_mask); in lola_init_mixer_widget()
213 if (!(chip->mixer.src_mask & (1 << id))) in lola_mixer_set_src_gain()
215 oldval = val = readl(&chip->mixer.array->src_gain_enable); in lola_mixer_set_src_gain()
222 (gain == readw(&chip->mixer.array->src_gain[id]))) in lola_mixer_set_src_gain()
228 writew(gain, &chip->mixer.array->src_gain[id]); in lola_mixer_set_src_gain()
229 writel(val, &chip->mixer.array->src_gain_enable); in lola_mixer_set_src_gain()
232 return lola_codec_write(chip, chip->mixer.nid, in lola_mixer_set_src_gain()
242 if ((chip->mixer.src_mask & mask) != mask)
246 writew(*gains, &chip->mixer.array->src_gain[i]);
250 writel(mask, &chip->mixer.array->src_gain_enable);
252 if (chip->mixer.caps & LOLA_PEAK_METER_CAN_AGC_MASK) {
254 return lola_codec_write(chip, chip->mixer.nid,
260 lola_codec_write(chip, chip->mixer.nid,
274 if (!(chip->mixer.src_mask & (1 << src)) || in lola_mixer_set_mapping_gain()
275 !(chip->mixer.dest_mask & (1 << dest))) in lola_mixer_set_mapping_gain()
278 writew(gain, &chip->mixer.array->dest_mix_gain[dest][src]); in lola_mixer_set_mapping_gain()
279 val = readl(&chip->mixer.array->dest_mix_gain_enable[dest]); in lola_mixer_set_mapping_gain()
284 writel(val, &chip->mixer.array->dest_mix_gain_enable[dest]); in lola_mixer_set_mapping_gain()
286 return lola_codec_write(chip, chip->mixer.nid, LOLA_VERB_SET_MIX_GAIN, in lola_mixer_set_mapping_gain()
296 if (!(chip->mixer.dest_mask & (1 << id)) ||
297 (chip->mixer.src_mask & mask) != mask)
301 writew(*gains, &chip->mixer.array->dest_mix_gain[id][i]);
305 writel(mask, &chip->mixer.array->dest_mix_gain_enable[id]);
308 return lola_codec_write(chip, chip->mixer.nid,
340 if (chip->mixer.array_saved) { in lola_save_mixer()
341 /* store contents of mixer array */ in lola_save_mixer()
342 memcpy_fromio(chip->mixer.array_saved, chip->mixer.array, in lola_save_mixer()
343 sizeof(*chip->mixer.array)); in lola_save_mixer()
353 if (chip->mixer.array_saved) { in lola_restore_mixer()
354 /* restore contents of mixer array */ in lola_restore_mixer()
355 memcpy_toio(chip->mixer.array, chip->mixer.array_saved, in lola_restore_mixer()
356 sizeof(*chip->mixer.array)); in lola_restore_mixer()
360 for (i = 0; i < chip->mixer.src_phys_ins; i++) in lola_restore_mixer()
361 lola_codec_write(chip, chip->mixer.nid, in lola_restore_mixer()
364 for (i = 0; i < chip->mixer.src_stream_outs; i++) in lola_restore_mixer()
365 lola_codec_write(chip, chip->mixer.nid, in lola_restore_mixer()
367 chip->mixer.src_stream_out_ofs + i, 0); in lola_restore_mixer()
368 for (i = 0; i < chip->mixer.dest_stream_ins; i++) in lola_restore_mixer()
369 lola_codec_write(chip, chip->mixer.nid, in lola_restore_mixer()
372 for (i = 0; i < chip->mixer.dest_phys_outs; i++) in lola_restore_mixer()
373 lola_codec_write(chip, chip->mixer.nid, in lola_restore_mixer()
375 chip->mixer.dest_phys_out_ofs + i, 0); in lola_restore_mixer()
456 /* clear all mixer matrix settings */ in init_mixer_values()
457 memset_io(chip->mixer.array, 0, sizeof(*chip->mixer.array)); in init_mixer_values()
459 for (i = 0; i < chip->mixer.dest_stream_ins; i++) in init_mixer_values()
460 lola_codec_write(chip, chip->mixer.nid, in init_mixer_values()
464 for (i = 0; i < chip->mixer.dest_phys_outs; i++) in init_mixer_values()
465 lola_codec_write(chip, chip->mixer.nid, in init_mixer_values()
467 chip->mixer.dest_phys_out_ofs + i, 0); in init_mixer_values()
470 for (i = 0; i < chip->mixer.src_phys_ins; i++) in init_mixer_values()
474 for (i = 0; i < chip->mixer.src_stream_outs; i++) in init_mixer_values()
476 i + chip->mixer.src_stream_out_ofs, in init_mixer_values()
479 for (i = 0; i < chip->mixer.dest_stream_ins; i++) { in init_mixer_values()
480 int src = i % chip->mixer.src_phys_ins; in init_mixer_values()
487 for (i = 0; i < chip->mixer.src_stream_outs; i++) { in init_mixer_values()
488 int src = chip->mixer.src_stream_out_ofs + i; in init_mixer_values()
489 int dst = chip->mixer.dest_phys_out_ofs + in init_mixer_values()
490 i % chip->mixer.dest_phys_outs; in init_mixer_values()
497 * analog mixer control element
657 * src gain mixer
679 mask = readl(&chip->mixer.array->src_gain_enable); in lola_src_gain_get()
683 if (!(chip->mixer.src_mask & (1 << idx))) in lola_src_gain_get()
686 val = readw(&chip->mixer.array->src_gain[idx]) + 1; in lola_src_gain_get()
738 * destination gain (matrix-like) mixer
762 mask = readl(&chip->mixer.array->dest_mix_gain_enable[dst]);
766 if (!(chip->mixer.src_mask & (1 << src)))
769 val = readw(&chip->mixer.array->dest_mix_gain[dst][src]) + 1;
842 err = create_src_gain_mixer(chip, chip->mixer.src_phys_ins, 0, in lola_create_mixer()
846 err = create_src_gain_mixer(chip, chip->mixer.src_stream_outs, in lola_create_mixer()
847 chip->mixer.src_stream_out_ofs, in lola_create_mixer()
852 /* FIXME: buggy mixer matrix handling */ in lola_create_mixer()
854 chip->mixer.src_phys_ins, 0, in lola_create_mixer()
855 chip->mixer.dest_stream_ins, 0, in lola_create_mixer()
860 chip->mixer.src_stream_outs, in lola_create_mixer()
861 chip->mixer.src_stream_out_ofs, in lola_create_mixer()
862 chip->mixer.dest_stream_ins, 0, in lola_create_mixer()
867 chip->mixer.src_phys_ins, 0, in lola_create_mixer()
868 chip->mixer.dest_phys_outs, in lola_create_mixer()
869 chip->mixer.dest_phys_out_ofs, in lola_create_mixer()
874 chip->mixer.src_stream_outs, in lola_create_mixer()
875 chip->mixer.src_stream_out_ofs, in lola_create_mixer()
876 chip->mixer.dest_phys_outs, in lola_create_mixer()
877 chip->mixer.dest_phys_out_ofs, in lola_create_mixer()