Lines Matching refs:amp

266 static void awacs_amp_set_tone(struct awacs_amp *amp, int bass, int treble)  in awacs_amp_set_tone()  argument
268 amp->amp_tone[0] = bass; in awacs_amp_set_tone()
269 amp->amp_tone[1] = treble; in awacs_amp_set_tone()
280 static int awacs_amp_set_vol(struct awacs_amp *amp, int index, in awacs_amp_set_vol() argument
283 if (do_check && amp->amp_vol[index][0] == lvol && in awacs_amp_set_vol()
284 amp->amp_vol[index][1] == rvol) in awacs_amp_set_vol()
288 amp->amp_vol[index][0] = lvol; in awacs_amp_set_vol()
289 amp->amp_vol[index][1] = rvol; in awacs_amp_set_vol()
296 static void awacs_amp_set_master(struct awacs_amp *amp, int vol) in awacs_amp_set_master() argument
298 amp->amp_master = vol; in awacs_amp_set_master()
308 struct awacs_amp *amp = chip->mixer_data; in awacs_amp_free() local
309 if (!amp) in awacs_amp_free()
311 kfree(amp); in awacs_amp_free()
335 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_get_volume_amp() local
337 ucontrol->value.integer.value[0] = 31 - (amp->amp_vol[index][0] & 31); in snd_pmac_awacs_get_volume_amp()
338 ucontrol->value.integer.value[1] = 31 - (amp->amp_vol[index][1] & 31); in snd_pmac_awacs_get_volume_amp()
348 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_put_volume_amp() local
351 | (amp->amp_vol[index][0] & 32); in snd_pmac_awacs_put_volume_amp()
353 | (amp->amp_vol[index][1] & 32); in snd_pmac_awacs_put_volume_amp()
354 return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1); in snd_pmac_awacs_put_volume_amp()
362 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_get_switch_amp() local
364 ucontrol->value.integer.value[0] = (amp->amp_vol[index][0] & 32) in snd_pmac_awacs_get_switch_amp()
366 ucontrol->value.integer.value[1] = (amp->amp_vol[index][1] & 32) in snd_pmac_awacs_get_switch_amp()
377 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_put_switch_amp() local
380 | (amp->amp_vol[index][0] & 31); in snd_pmac_awacs_put_switch_amp()
382 | (amp->amp_vol[index][1] & 31); in snd_pmac_awacs_put_switch_amp()
383 return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1); in snd_pmac_awacs_put_switch_amp()
401 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_get_tone_amp() local
403 ucontrol->value.integer.value[0] = amp->amp_tone[index]; in snd_pmac_awacs_get_tone_amp()
412 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_put_tone_amp() local
418 if (val != amp->amp_tone[index]) { in snd_pmac_awacs_put_tone_amp()
419 amp->amp_tone[index] = val; in snd_pmac_awacs_put_tone_amp()
420 awacs_amp_set_tone(amp, amp->amp_tone[0], amp->amp_tone[1]); in snd_pmac_awacs_put_tone_amp()
440 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_get_master_amp() local
442 ucontrol->value.integer.value[0] = amp->amp_master; in snd_pmac_awacs_get_master_amp()
450 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_put_master_amp() local
456 if (val != amp->amp_master) { in snd_pmac_awacs_put_master_amp()
457 amp->amp_master = val; in snd_pmac_awacs_put_master_amp()
458 awacs_amp_set_master(amp, amp->amp_master); in snd_pmac_awacs_put_master_amp()
758 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_resume() local
759 awacs_amp_set_vol(amp, 0, in snd_pmac_awacs_resume()
760 amp->amp_vol[0][0], amp->amp_vol[0][1], 0); in snd_pmac_awacs_resume()
761 awacs_amp_set_vol(amp, 1, in snd_pmac_awacs_resume()
762 amp->amp_vol[1][0], amp->amp_vol[1][1], 0); in snd_pmac_awacs_resume()
763 awacs_amp_set_tone(amp, amp->amp_tone[0], amp->amp_tone[1]); in snd_pmac_awacs_resume()
764 awacs_amp_set_master(amp, amp->amp_master); in snd_pmac_awacs_resume()
793 static int toggle_amp_mute(struct awacs_amp *amp, int index, int mute) in toggle_amp_mute() argument
796 vol[0] = amp->amp_vol[index][0] & 31; in toggle_amp_mute()
797 vol[1] = amp->amp_vol[index][1] & 31; in toggle_amp_mute()
802 return awacs_amp_set_vol(amp, index, vol[0], vol[1], 1); in toggle_amp_mute()
811 struct awacs_amp *amp = chip->mixer_data; in snd_pmac_awacs_update_automute() local
814 changed = toggle_amp_mute(amp, AMP_CH_HD, 0); in snd_pmac_awacs_update_automute()
815 changed |= toggle_amp_mute(amp, AMP_CH_SPK, 1); in snd_pmac_awacs_update_automute()
817 changed = toggle_amp_mute(amp, AMP_CH_HD, 1); in snd_pmac_awacs_update_automute()
818 changed |= toggle_amp_mute(amp, AMP_CH_SPK, 0); in snd_pmac_awacs_update_automute()
910 struct awacs_amp *amp = kzalloc(sizeof(*amp), GFP_KERNEL); in snd_pmac_awacs_init() local
911 if (! amp) in snd_pmac_awacs_init()
913 chip->mixer_data = amp; in snd_pmac_awacs_init()
916 awacs_amp_set_vol(amp, 0, 63, 63, 0); in snd_pmac_awacs_init()
917 awacs_amp_set_vol(amp, 1, 63, 63, 0); in snd_pmac_awacs_init()
918 awacs_amp_set_tone(amp, 7, 7); /* 0 dB */ in snd_pmac_awacs_init()
919 awacs_amp_set_master(amp, 79); /* 0 dB */ in snd_pmac_awacs_init()