beep.c (c1f3ee120bb61045b1c0a3ead620d1d65af47130) | beep.c (5e246b850df563224be26f1d409cf66fd6c968df) |
---|---|
1/* 2 * Beep using pcm 3 * 4 * Copyright (c) by Takashi Iwai <tiwai@suse.de> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 171 unchanged lines hidden (view full) --- 180 uinfo->value.integer.max = 100; 181 return 0; 182} 183 184static int snd_pmac_get_beep(struct snd_kcontrol *kcontrol, 185 struct snd_ctl_elem_value *ucontrol) 186{ 187 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); | 1/* 2 * Beep using pcm 3 * 4 * Copyright (c) by Takashi Iwai <tiwai@suse.de> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 171 unchanged lines hidden (view full) --- 180 uinfo->value.integer.max = 100; 181 return 0; 182} 183 184static int snd_pmac_get_beep(struct snd_kcontrol *kcontrol, 185 struct snd_ctl_elem_value *ucontrol) 186{ 187 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); |
188 snd_assert(chip->beep, return -ENXIO); | 188 if (snd_BUG_ON(!chip->beep)) 189 return -ENXIO; |
189 ucontrol->value.integer.value[0] = chip->beep->volume; 190 return 0; 191} 192 193static int snd_pmac_put_beep(struct snd_kcontrol *kcontrol, 194 struct snd_ctl_elem_value *ucontrol) 195{ 196 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 197 unsigned int oval, nval; | 190 ucontrol->value.integer.value[0] = chip->beep->volume; 191 return 0; 192} 193 194static int snd_pmac_put_beep(struct snd_kcontrol *kcontrol, 195 struct snd_ctl_elem_value *ucontrol) 196{ 197 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 198 unsigned int oval, nval; |
198 snd_assert(chip->beep, return -ENXIO); | 199 if (snd_BUG_ON(!chip->beep)) 200 return -ENXIO; |
199 oval = chip->beep->volume; 200 nval = ucontrol->value.integer.value[0]; 201 if (nval > 100) 202 return -EINVAL; 203 chip->beep->volume = nval; 204 return oval != chip->beep->volume; 205} 206 --- 77 unchanged lines hidden --- | 201 oval = chip->beep->volume; 202 nval = ucontrol->value.integer.value[0]; 203 if (nval > 100) 204 return -EINVAL; 205 chip->beep->volume = nval; 206 return oval != chip->beep->volume; 207} 208 --- 77 unchanged lines hidden --- |