Lines Matching +full:left +full:- +full:shift
1 // SPDX-License-Identifier: GPL-2.0-or-later
17 #define GF1_SINGLE(xname, xindex, shift, invert) \ argument
21 .private_value = shift | (invert << 8) }
28 int shift = kcontrol->private_value & 0xff; in snd_gf1_get_single() local
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()
41 int shift = kcontrol->private_value & 0xff; in snd_gf1_put_single() local
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()
49 nval <<= shift; 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()
52 nval = (oval & ~(1 << shift)) | nval; 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()
79 int addr = kcontrol->private_value & 0xff; in snd_ics_get_double()
80 unsigned char left, right; in snd_ics_get_double() local
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()
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()
119 spin_unlock_irqrestore(&gus->reg_lock, flags); in snd_ics_put_double()
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()