Lines Matching refs:mixer

98 	vfree(chip->mixer.array_saved);  in lola_free_mixer()
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()
123 chip->mixer.array_saved = vmalloc(sizeof(struct lola_mixer_array)); in lola_init_mixer_widget()
124 if (!chip->mixer.array_saved) in lola_init_mixer_widget()
128 chip->mixer.src_stream_outs = chip->pcm[PLAY].num_streams; in lola_init_mixer_widget()
129 chip->mixer.src_phys_ins = chip->pin[CAPT].num_pins; in lola_init_mixer_widget()
132 chip->mixer.dest_stream_ins = chip->pcm[CAPT].num_streams; in lola_init_mixer_widget()
133 chip->mixer.dest_phys_outs = chip->pin[PLAY].num_pins; in lola_init_mixer_widget()
138 chip->mixer.src_stream_out_ofs = chip->mixer.src_phys_ins + in lola_init_mixer_widget()
140 chip->mixer.dest_phys_out_ofs = chip->mixer.dest_stream_ins + in lola_init_mixer_widget()
191 if (chip->mixer.src_stream_out_ofs > MAX_AUDIO_INOUT_COUNT || in lola_init_mixer_widget()
192 chip->mixer.dest_phys_out_ofs > MAX_STREAM_IN_COUNT) { in lola_init_mixer_widget()
197 chip->mixer.src_mask = ((1U << chip->mixer.src_phys_ins) - 1) | in lola_init_mixer_widget()
198 (((1U << chip->mixer.src_stream_outs) - 1) in lola_init_mixer_widget()
199 << chip->mixer.src_stream_out_ofs); in lola_init_mixer_widget()
200 chip->mixer.dest_mask = ((1U << chip->mixer.dest_stream_ins) - 1) | in lola_init_mixer_widget()
201 (((1U << chip->mixer.dest_phys_outs) - 1) in lola_init_mixer_widget()
202 << chip->mixer.dest_phys_out_ofs); in lola_init_mixer_widget()
205 chip->mixer.src_mask, chip->mixer.dest_mask); in lola_init_mixer_widget()
215 if (!(chip->mixer.src_mask & (1 << id))) in lola_mixer_set_src_gain()
217 oldval = val = readl(&chip->mixer.array->src_gain_enable); in lola_mixer_set_src_gain()
224 (gain == readw(&chip->mixer.array->src_gain[id]))) in lola_mixer_set_src_gain()
230 writew(gain, &chip->mixer.array->src_gain[id]); in lola_mixer_set_src_gain()
231 writel(val, &chip->mixer.array->src_gain_enable); in lola_mixer_set_src_gain()
234 return lola_codec_write(chip, chip->mixer.nid, in lola_mixer_set_src_gain()
244 if ((chip->mixer.src_mask & mask) != mask)
248 writew(*gains, &chip->mixer.array->src_gain[i]);
252 writel(mask, &chip->mixer.array->src_gain_enable);
254 if (chip->mixer.caps & LOLA_PEAK_METER_CAN_AGC_MASK) {
256 return lola_codec_write(chip, chip->mixer.nid,
262 lola_codec_write(chip, chip->mixer.nid,
276 if (!(chip->mixer.src_mask & (1 << src)) || in lola_mixer_set_mapping_gain()
277 !(chip->mixer.dest_mask & (1 << dest))) in lola_mixer_set_mapping_gain()
280 writew(gain, &chip->mixer.array->dest_mix_gain[dest][src]); in lola_mixer_set_mapping_gain()
281 val = readl(&chip->mixer.array->dest_mix_gain_enable[dest]); in lola_mixer_set_mapping_gain()
286 writel(val, &chip->mixer.array->dest_mix_gain_enable[dest]); in lola_mixer_set_mapping_gain()
288 return lola_codec_write(chip, chip->mixer.nid, LOLA_VERB_SET_MIX_GAIN, in lola_mixer_set_mapping_gain()
298 if (!(chip->mixer.dest_mask & (1 << id)) ||
299 (chip->mixer.src_mask & mask) != mask)
303 writew(*gains, &chip->mixer.array->dest_mix_gain[id][i]);
307 writel(mask, &chip->mixer.array->dest_mix_gain_enable[id]);
310 return lola_codec_write(chip, chip->mixer.nid,
342 if (chip->mixer.array_saved) { in lola_save_mixer()
344 memcpy_fromio(chip->mixer.array_saved, chip->mixer.array, in lola_save_mixer()
345 sizeof(*chip->mixer.array)); in lola_save_mixer()
355 if (chip->mixer.array_saved) { in lola_restore_mixer()
357 memcpy_toio(chip->mixer.array, chip->mixer.array_saved, in lola_restore_mixer()
358 sizeof(*chip->mixer.array)); in lola_restore_mixer()
362 for (i = 0; i < chip->mixer.src_phys_ins; i++) in lola_restore_mixer()
363 lola_codec_write(chip, chip->mixer.nid, in lola_restore_mixer()
366 for (i = 0; i < chip->mixer.src_stream_outs; i++) in lola_restore_mixer()
367 lola_codec_write(chip, chip->mixer.nid, in lola_restore_mixer()
369 chip->mixer.src_stream_out_ofs + i, 0); in lola_restore_mixer()
370 for (i = 0; i < chip->mixer.dest_stream_ins; i++) in lola_restore_mixer()
371 lola_codec_write(chip, chip->mixer.nid, in lola_restore_mixer()
374 for (i = 0; i < chip->mixer.dest_phys_outs; i++) in lola_restore_mixer()
375 lola_codec_write(chip, chip->mixer.nid, in lola_restore_mixer()
377 chip->mixer.dest_phys_out_ofs + i, 0); in lola_restore_mixer()
459 memset_io(chip->mixer.array, 0, sizeof(*chip->mixer.array)); in init_mixer_values()
461 for (i = 0; i < chip->mixer.dest_stream_ins; i++) in init_mixer_values()
462 lola_codec_write(chip, chip->mixer.nid, in init_mixer_values()
466 for (i = 0; i < chip->mixer.dest_phys_outs; i++) in init_mixer_values()
467 lola_codec_write(chip, chip->mixer.nid, in init_mixer_values()
469 chip->mixer.dest_phys_out_ofs + i, 0); in init_mixer_values()
472 for (i = 0; i < chip->mixer.src_phys_ins; i++) in init_mixer_values()
476 for (i = 0; i < chip->mixer.src_stream_outs; i++) in init_mixer_values()
478 i + chip->mixer.src_stream_out_ofs, in init_mixer_values()
481 for (i = 0; i < chip->mixer.dest_stream_ins; i++) { in init_mixer_values()
482 int src = i % chip->mixer.src_phys_ins; in init_mixer_values()
489 for (i = 0; i < chip->mixer.src_stream_outs; i++) { in init_mixer_values()
490 int src = chip->mixer.src_stream_out_ofs + i; in init_mixer_values()
491 int dst = chip->mixer.dest_phys_out_ofs + in init_mixer_values()
492 i % chip->mixer.dest_phys_outs; in init_mixer_values()
681 mask = readl(&chip->mixer.array->src_gain_enable); in lola_src_gain_get()
685 if (!(chip->mixer.src_mask & (1 << idx))) in lola_src_gain_get()
688 val = readw(&chip->mixer.array->src_gain[idx]) + 1; in lola_src_gain_get()
764 mask = readl(&chip->mixer.array->dest_mix_gain_enable[dst]);
768 if (!(chip->mixer.src_mask & (1 << src)))
771 val = readw(&chip->mixer.array->dest_mix_gain[dst][src]) + 1;
844 err = create_src_gain_mixer(chip, chip->mixer.src_phys_ins, 0, in lola_create_mixer()
848 err = create_src_gain_mixer(chip, chip->mixer.src_stream_outs, in lola_create_mixer()
849 chip->mixer.src_stream_out_ofs, in lola_create_mixer()
856 chip->mixer.src_phys_ins, 0, in lola_create_mixer()
857 chip->mixer.dest_stream_ins, 0, in lola_create_mixer()
862 chip->mixer.src_stream_outs, in lola_create_mixer()
863 chip->mixer.src_stream_out_ofs, in lola_create_mixer()
864 chip->mixer.dest_stream_ins, 0, in lola_create_mixer()
869 chip->mixer.src_phys_ins, 0, in lola_create_mixer()
870 chip->mixer.dest_phys_outs, in lola_create_mixer()
871 chip->mixer.dest_phys_out_ofs, in lola_create_mixer()
876 chip->mixer.src_stream_outs, in lola_create_mixer()
877 chip->mixer.src_stream_out_ofs, in lola_create_mixer()
878 chip->mixer.dest_phys_outs, in lola_create_mixer()
879 chip->mixer.dest_phys_out_ofs, in lola_create_mixer()