Lines Matching refs:tea

70 static void snd_tea6330t_set(struct tea6330t *tea,
76 snd_i2c_write(tea->bus, TEA6330T_ADDR, addr, value, 1);
98 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_get_master_volume() local
100 snd_i2c_lock(tea->bus); in snd_tea6330t_get_master_volume()
101 ucontrol->value.integer.value[0] = tea->mleft - 0x14; in snd_tea6330t_get_master_volume()
102 ucontrol->value.integer.value[1] = tea->mright - 0x14; in snd_tea6330t_get_master_volume()
103 snd_i2c_unlock(tea->bus); in snd_tea6330t_get_master_volume()
110 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_put_master_volume() local
117 snd_i2c_lock(tea->bus); in snd_tea6330t_put_master_volume()
118 change = val1 != tea->mleft || val2 != tea->mright; in snd_tea6330t_put_master_volume()
119 tea->mleft = val1; in snd_tea6330t_put_master_volume()
120 tea->mright = val2; in snd_tea6330t_put_master_volume()
122 if (tea->regs[TEA6330T_SADDR_VOLUME_LEFT] != 0) { in snd_tea6330t_put_master_volume()
124 bytes[count++] = tea->regs[TEA6330T_SADDR_VOLUME_LEFT] = tea->mleft; in snd_tea6330t_put_master_volume()
126 if (tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] != 0) { in snd_tea6330t_put_master_volume()
129 bytes[count++] = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] = tea->mright; in snd_tea6330t_put_master_volume()
132 if ((err = snd_i2c_sendbytes(tea->device, bytes, count)) < 0) in snd_tea6330t_put_master_volume()
135 snd_i2c_unlock(tea->bus); in snd_tea6330t_put_master_volume()
149 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_get_master_switch() local
151 snd_i2c_lock(tea->bus); in snd_tea6330t_get_master_switch()
152 ucontrol->value.integer.value[0] = tea->regs[TEA6330T_SADDR_VOLUME_LEFT] == 0 ? 0 : 1; in snd_tea6330t_get_master_switch()
153 ucontrol->value.integer.value[1] = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] == 0 ? 0 : 1; in snd_tea6330t_get_master_switch()
154 snd_i2c_unlock(tea->bus); in snd_tea6330t_get_master_switch()
161 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_put_master_switch() local
168 snd_i2c_lock(tea->bus); in snd_tea6330t_put_master_switch()
169 oval1 = tea->regs[TEA6330T_SADDR_VOLUME_LEFT] == 0 ? 0 : 1; in snd_tea6330t_put_master_switch()
170 oval2 = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] == 0 ? 0 : 1; in snd_tea6330t_put_master_switch()
172 tea->regs[TEA6330T_SADDR_VOLUME_LEFT] = val1 ? tea->mleft : 0; in snd_tea6330t_put_master_switch()
173 tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] = val2 ? tea->mright : 0; in snd_tea6330t_put_master_switch()
175 bytes[1] = tea->regs[TEA6330T_SADDR_VOLUME_LEFT]; in snd_tea6330t_put_master_switch()
176 bytes[2] = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT]; in snd_tea6330t_put_master_switch()
177 if ((err = snd_i2c_sendbytes(tea->device, bytes, 3)) < 0) in snd_tea6330t_put_master_switch()
179 snd_i2c_unlock(tea->bus); in snd_tea6330t_put_master_switch()
191 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_info_bass() local
196 uinfo->value.integer.max = tea->max_bass; in snd_tea6330t_info_bass()
203 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_get_bass() local
205 ucontrol->value.integer.value[0] = tea->bass; in snd_tea6330t_get_bass()
212 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_put_bass() local
217 val1 = ucontrol->value.integer.value[0] % (tea->max_bass + 1); in snd_tea6330t_put_bass()
218 snd_i2c_lock(tea->bus); in snd_tea6330t_put_bass()
219 tea->bass = val1; in snd_tea6330t_put_bass()
220 val1 += tea->equalizer ? 7 : 3; in snd_tea6330t_put_bass()
221 change = tea->regs[TEA6330T_SADDR_BASS] != val1; in snd_tea6330t_put_bass()
223 bytes[1] = tea->regs[TEA6330T_SADDR_BASS] = val1; in snd_tea6330t_put_bass()
224 if ((err = snd_i2c_sendbytes(tea->device, bytes, 2)) < 0) in snd_tea6330t_put_bass()
226 snd_i2c_unlock(tea->bus); in snd_tea6330t_put_bass()
238 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_info_treble() local
243 uinfo->value.integer.max = tea->max_treble; in snd_tea6330t_info_treble()
250 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_get_treble() local
252 ucontrol->value.integer.value[0] = tea->treble; in snd_tea6330t_get_treble()
259 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_put_treble() local
264 val1 = ucontrol->value.integer.value[0] % (tea->max_treble + 1); in snd_tea6330t_put_treble()
265 snd_i2c_lock(tea->bus); in snd_tea6330t_put_treble()
266 tea->treble = val1; in snd_tea6330t_put_treble()
268 change = tea->regs[TEA6330T_SADDR_TREBLE] != val1; in snd_tea6330t_put_treble()
270 bytes[1] = tea->regs[TEA6330T_SADDR_TREBLE] = val1; in snd_tea6330t_put_treble()
271 if ((err = snd_i2c_sendbytes(tea->device, bytes, 2)) < 0) in snd_tea6330t_put_treble()
273 snd_i2c_unlock(tea->bus); in snd_tea6330t_put_treble()
294 struct tea6330t *tea; in snd_tea6330t_update_mixer() local
301 tea = kzalloc(sizeof(*tea), GFP_KERNEL); in snd_tea6330t_update_mixer()
302 if (tea == NULL) in snd_tea6330t_update_mixer()
305 kfree(tea); in snd_tea6330t_update_mixer()
308 tea->device = device; in snd_tea6330t_update_mixer()
309 tea->bus = bus; in snd_tea6330t_update_mixer()
310 tea->equalizer = equalizer; in snd_tea6330t_update_mixer()
311 tea->fader = fader; in snd_tea6330t_update_mixer()
312 device->private_data = tea; in snd_tea6330t_update_mixer()
318 tea->regs[TEA6330T_SADDR_FADER] = 0x3f; in snd_tea6330t_update_mixer()
319 tea->regs[TEA6330T_SADDR_AUDIO_SWITCH] = equalizer ? 0 : TEA6330T_EQN; in snd_tea6330t_update_mixer()
321 if (!tea->equalizer) { in snd_tea6330t_update_mixer()
322 tea->max_bass = 9; in snd_tea6330t_update_mixer()
323 tea->max_treble = 8; in snd_tea6330t_update_mixer()
325 tea->bass = 4; in snd_tea6330t_update_mixer()
327 tea->treble = 4; in snd_tea6330t_update_mixer()
329 tea->max_bass = 5; in snd_tea6330t_update_mixer()
330 tea->max_treble = 0; in snd_tea6330t_update_mixer()
332 tea->bass = 4; in snd_tea6330t_update_mixer()
334 tea->treble = 0; in snd_tea6330t_update_mixer()
336 tea->mleft = tea->mright = 0x14; in snd_tea6330t_update_mixer()
337 tea->regs[TEA6330T_SADDR_BASS] = default_bass; in snd_tea6330t_update_mixer()
338 tea->regs[TEA6330T_SADDR_TREBLE] = default_treble; in snd_tea6330t_update_mixer()
343 bytes[idx+1] = tea->regs[idx]; in snd_tea6330t_update_mixer()
353 if (tea->treble == 0 && !strcmp(knew->name, "Tone Control - Treble")) in snd_tea6330t_update_mixer()
355 if ((err = snd_ctl_add(card, snd_ctl_new1(knew, tea))) < 0) in snd_tea6330t_update_mixer()