Lines Matching +full:0 +full:- +full:127

1 // SPDX-License-Identifier: GPL-2.0-or-later
28 int shift = kcontrol->private_value & 0xff; in snd_gf1_get_single()
29 int invert = (kcontrol->private_value >> 8) & 1; in snd_gf1_get_single()
31 ucontrol->value.integer.value[0] = (gus->mix_cntrl_reg >> shift) & 1; in snd_gf1_get_single()
33 ucontrol->value.integer.value[0] ^= 1; in snd_gf1_get_single()
34 return 0; in snd_gf1_get_single()
41 int shift = kcontrol->private_value & 0xff; in snd_gf1_put_single()
42 int invert = (kcontrol->private_value >> 8) & 1; in snd_gf1_put_single()
46 nval = ucontrol->value.integer.value[0] & 1; in snd_gf1_put_single()
50 spin_lock_irqsave(&gus->reg_lock, flags); in snd_gf1_put_single()
51 oval = gus->mix_cntrl_reg; in snd_gf1_put_single()
54 outb(gus->mix_cntrl_reg = nval, GUSP(gus, MIXCNTRLREG)); in snd_gf1_put_single()
55 outb(gus->gf1.active_voice = 0, GUSP(gus, GF1PAGE)); in snd_gf1_put_single()
56 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_gf1_put_single()
68 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; in snd_ics_info_double()
69 uinfo->count = 2; in snd_ics_info_double()
70 uinfo->value.integer.min = 0; in snd_ics_info_double()
71 uinfo->value.integer.max = 127; in snd_ics_info_double()
72 return 0; in snd_ics_info_double()
79 int addr = kcontrol->private_value & 0xff; in snd_ics_get_double()
82 spin_lock_irqsave(&gus->reg_lock, flags); in snd_ics_get_double()
83 left = gus->gf1.ics_regs[addr][0]; in snd_ics_get_double()
84 right = gus->gf1.ics_regs[addr][1]; in snd_ics_get_double()
85 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_ics_get_double()
86 ucontrol->value.integer.value[0] = left & 127; in snd_ics_get_double()
87 ucontrol->value.integer.value[1] = right & 127; in snd_ics_get_double()
88 return 0; in snd_ics_get_double()
95 int addr = kcontrol->private_value & 0xff; in snd_ics_put_double()
99 val1 = ucontrol->value.integer.value[0] & 127; in snd_ics_put_double()
100 val2 = ucontrol->value.integer.value[1] & 127; in snd_ics_put_double()
101 spin_lock_irqsave(&gus->reg_lock, flags); in snd_ics_put_double()
102 oval1 = gus->gf1.ics_regs[addr][0]; in snd_ics_put_double()
103 oval2 = gus->gf1.ics_regs[addr][1]; in snd_ics_put_double()
105 gus->gf1.ics_regs[addr][0] = val1; in snd_ics_put_double()
106 gus->gf1.ics_regs[addr][1] = val2; in snd_ics_put_double()
107 if (gus->ics_flag && gus->ics_flipped && in snd_ics_put_double()
111 outb(addr | 0, GUSP(gus, MIXCNTRLPORT)); in snd_ics_put_double()
119 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_ics_put_double()
124 GF1_SINGLE("Master Playback Switch", 0, 1, 1),
125 GF1_SINGLE("Line Switch", 0, 0, 1),
126 GF1_SINGLE("Mic Switch", 0, 2, 0)
130 GF1_SINGLE("Master Playback Switch", 0, 1, 1),
131 ICS_DOUBLE("Master Playback Volume", 0, SNDRV_ICS_MASTER_DEV),
132 ICS_DOUBLE("Synth Playback Volume", 0, SNDRV_ICS_GF1_DEV),
133 GF1_SINGLE("Line Switch", 0, 0, 1),
134 ICS_DOUBLE("Line Playback Volume", 0, SNDRV_ICS_LINE_DEV),
135 GF1_SINGLE("Mic Switch", 0, 2, 0),
136 ICS_DOUBLE("Mic Playback Volume", 0, SNDRV_ICS_MIC_DEV),
137 ICS_DOUBLE("CD Playback Volume", 0, SNDRV_ICS_CD_DEV)
147 return -EINVAL; in snd_gf1_new_mixer()
148 card = gus->card; in snd_gf1_new_mixer()
150 return -EINVAL; in snd_gf1_new_mixer()
152 if (gus->ics_flag) in snd_gf1_new_mixer()
154 if (card->mixername[0] == '\0') { in snd_gf1_new_mixer()
155 strcpy(card->mixername, gus->ics_flag ? "GF1,ICS2101" : "GF1"); in snd_gf1_new_mixer()
157 if (gus->ics_flag) in snd_gf1_new_mixer()
158 strcat(card->mixername, ",ICS2101"); in snd_gf1_new_mixer()
159 strcat(card->mixername, ",GF1"); in snd_gf1_new_mixer()
162 if (!gus->ics_flag) { in snd_gf1_new_mixer()
163 max = gus->ess_flag ? 1 : ARRAY_SIZE(snd_gf1_controls); in snd_gf1_new_mixer()
164 for (idx = 0; idx < max; idx++) { in snd_gf1_new_mixer()
165 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_gf1_controls[idx], gus))) < 0) in snd_gf1_new_mixer()
169 for (idx = 0; idx < ARRAY_SIZE(snd_ics_controls); idx++) { in snd_gf1_new_mixer()
170 if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_ics_controls[idx], gus))) < 0) in snd_gf1_new_mixer()
174 return 0; in snd_gf1_new_mixer()