Lines Matching refs:amp

267 static void awacs_amp_set_tone(struct awacs_amp *amp, int bass, int treble)  in awacs_amp_set_tone()  argument
269 amp->amp_tone[0] = bass; in awacs_amp_set_tone()
270 amp->amp_tone[1] = treble; in awacs_amp_set_tone()
281 static int awacs_amp_set_vol(struct awacs_amp *amp, int index, in awacs_amp_set_vol() argument
284 if (do_check && amp->amp_vol[index][0] == lvol && in awacs_amp_set_vol()
285 amp->amp_vol[index][1] == rvol) in awacs_amp_set_vol()
289 amp->amp_vol[index][0] = lvol; in awacs_amp_set_vol()
290 amp->amp_vol[index][1] = rvol; in awacs_amp_set_vol()
297 static void awacs_amp_set_master(struct awacs_amp *amp, int vol) in awacs_amp_set_master() argument
299 amp->amp_master = vol; in awacs_amp_set_master()
309 struct awacs_amp *amp = chip->mixer_data; in awacs_amp_free() local
310 if (!amp) in awacs_amp_free()
312 kfree(amp); in awacs_amp_free()
336 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_get_volume_amp() local
338 ucontrol->value.integer.value[0] = 31 - (amp->amp_vol[index][0] & 31); in snd_pmac_awacs_get_volume_amp()
339 ucontrol->value.integer.value[1] = 31 - (amp->amp_vol[index][1] & 31); in snd_pmac_awacs_get_volume_amp()
349 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_put_volume_amp() local
352 | (amp->amp_vol[index][0] & 32); in snd_pmac_awacs_put_volume_amp()
354 | (amp->amp_vol[index][1] & 32); in snd_pmac_awacs_put_volume_amp()
355 return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1); in snd_pmac_awacs_put_volume_amp()
363 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_get_switch_amp() local
365 ucontrol->value.integer.value[0] = (amp->amp_vol[index][0] & 32) in snd_pmac_awacs_get_switch_amp()
367 ucontrol->value.integer.value[1] = (amp->amp_vol[index][1] & 32) in snd_pmac_awacs_get_switch_amp()
378 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_put_switch_amp() local
381 | (amp->amp_vol[index][0] & 31); in snd_pmac_awacs_put_switch_amp()
383 | (amp->amp_vol[index][1] & 31); in snd_pmac_awacs_put_switch_amp()
384 return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1); in snd_pmac_awacs_put_switch_amp()
402 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_get_tone_amp() local
404 ucontrol->value.integer.value[0] = amp->amp_tone[index]; in snd_pmac_awacs_get_tone_amp()
413 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_put_tone_amp() local
419 if (val != amp->amp_tone[index]) { in snd_pmac_awacs_put_tone_amp()
420 amp->amp_tone[index] = val; in snd_pmac_awacs_put_tone_amp()
421 awacs_amp_set_tone(amp, amp->amp_tone[0], amp->amp_tone[1]); in snd_pmac_awacs_put_tone_amp()
441 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_get_master_amp() local
443 ucontrol->value.integer.value[0] = amp->amp_master; in snd_pmac_awacs_get_master_amp()
451 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_put_master_amp() local
457 if (val != amp->amp_master) { in snd_pmac_awacs_put_master_amp()
458 amp->amp_master = val; in snd_pmac_awacs_put_master_amp()
459 awacs_amp_set_master(amp, amp->amp_master); in snd_pmac_awacs_put_master_amp()
759 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_resume() local
760 awacs_amp_set_vol(amp, 0, in snd_pmac_awacs_resume()
761 amp->amp_vol[0][0], amp->amp_vol[0][1], 0); in snd_pmac_awacs_resume()
762 awacs_amp_set_vol(amp, 1, in snd_pmac_awacs_resume()
763 amp->amp_vol[1][0], amp->amp_vol[1][1], 0); in snd_pmac_awacs_resume()
764 awacs_amp_set_tone(amp, amp->amp_tone[0], amp->amp_tone[1]); in snd_pmac_awacs_resume()
765 awacs_amp_set_master(amp, amp->amp_master); in snd_pmac_awacs_resume()
794 static int toggle_amp_mute(struct awacs_amp *amp, int index, int mute) in toggle_amp_mute() argument
797 vol[0] = amp->amp_vol[index][0] & 31; in toggle_amp_mute()
798 vol[1] = amp->amp_vol[index][1] & 31; in toggle_amp_mute()
803 return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1); in toggle_amp_mute()
812 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_update_automute() local
815 changed = toggle_amp_mute(amp, AMP_CH_HD, 0); in snd_pmac_awacs_update_automute()
816 changed |= toggle_amp_mute(amp, AMP_CH_SPK, 1); in snd_pmac_awacs_update_automute()
818 changed = toggle_amp_mute(amp, AMP_CH_HD, 1); in snd_pmac_awacs_update_automute()
819 changed |= toggle_amp_mute(amp, AMP_CH_SPK, 0); in snd_pmac_awacs_update_automute()
911 struct awacs_amp *amp = kzalloc(sizeof(*amp), GFP_KERNEL); in snd_pmac_awacs_init() local
912 if (! amp) in snd_pmac_awacs_init()
914 chip->mixer_data = amp; in snd_pmac_awacs_init()
917 awacs_amp_set_vol(amp, 0, 63, 63, 0); in snd_pmac_awacs_init()
918 awacs_amp_set_vol(amp, 1, 63, 63, 0); in snd_pmac_awacs_init()
919 awacs_amp_set_tone(amp, 7, 7); /* 0 dB */ in snd_pmac_awacs_init()
920 awacs_amp_set_master(amp, 79); /* 0 dB */ in snd_pmac_awacs_init()