Lines Matching refs:tea
56 static void snd_tea6330t_set(struct tea6330t *tea,
62 snd_i2c_write(tea->bus, TEA6330T_ADDR, addr, value, 1);
84 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_get_master_volume() local
86 snd_i2c_lock(tea->bus); in snd_tea6330t_get_master_volume()
87 ucontrol->value.integer.value[0] = tea->mleft - 0x14; in snd_tea6330t_get_master_volume()
88 ucontrol->value.integer.value[1] = tea->mright - 0x14; in snd_tea6330t_get_master_volume()
89 snd_i2c_unlock(tea->bus); in snd_tea6330t_get_master_volume()
96 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_put_master_volume() local
103 snd_i2c_lock(tea->bus); in snd_tea6330t_put_master_volume()
104 change = val1 != tea->mleft || val2 != tea->mright; in snd_tea6330t_put_master_volume()
105 tea->mleft = val1; in snd_tea6330t_put_master_volume()
106 tea->mright = val2; in snd_tea6330t_put_master_volume()
108 if (tea->regs[TEA6330T_SADDR_VOLUME_LEFT] != 0) { in snd_tea6330t_put_master_volume()
110 bytes[count++] = tea->regs[TEA6330T_SADDR_VOLUME_LEFT] = tea->mleft; in snd_tea6330t_put_master_volume()
112 if (tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] != 0) { in snd_tea6330t_put_master_volume()
115 bytes[count++] = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] = tea->mright; in snd_tea6330t_put_master_volume()
118 err = snd_i2c_sendbytes(tea->device, bytes, count); in snd_tea6330t_put_master_volume()
122 snd_i2c_unlock(tea->bus); in snd_tea6330t_put_master_volume()
136 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_get_master_switch() local
138 snd_i2c_lock(tea->bus); in snd_tea6330t_get_master_switch()
139 ucontrol->value.integer.value[0] = tea->regs[TEA6330T_SADDR_VOLUME_LEFT] == 0 ? 0 : 1; in snd_tea6330t_get_master_switch()
140 ucontrol->value.integer.value[1] = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] == 0 ? 0 : 1; in snd_tea6330t_get_master_switch()
141 snd_i2c_unlock(tea->bus); in snd_tea6330t_get_master_switch()
148 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_put_master_switch() local
155 snd_i2c_lock(tea->bus); in snd_tea6330t_put_master_switch()
156 oval1 = tea->regs[TEA6330T_SADDR_VOLUME_LEFT] == 0 ? 0 : 1; in snd_tea6330t_put_master_switch()
157 oval2 = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] == 0 ? 0 : 1; in snd_tea6330t_put_master_switch()
159 tea->regs[TEA6330T_SADDR_VOLUME_LEFT] = val1 ? tea->mleft : 0; in snd_tea6330t_put_master_switch()
160 tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] = val2 ? tea->mright : 0; in snd_tea6330t_put_master_switch()
162 bytes[1] = tea->regs[TEA6330T_SADDR_VOLUME_LEFT]; in snd_tea6330t_put_master_switch()
163 bytes[2] = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT]; in snd_tea6330t_put_master_switch()
164 err = snd_i2c_sendbytes(tea->device, bytes, 3); in snd_tea6330t_put_master_switch()
167 snd_i2c_unlock(tea->bus); in snd_tea6330t_put_master_switch()
179 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_info_bass() local
184 uinfo->value.integer.max = tea->max_bass; in snd_tea6330t_info_bass()
191 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_get_bass() local
193 ucontrol->value.integer.value[0] = tea->bass; in snd_tea6330t_get_bass()
200 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_put_bass() local
205 val1 = ucontrol->value.integer.value[0] % (tea->max_bass + 1); in snd_tea6330t_put_bass()
206 snd_i2c_lock(tea->bus); in snd_tea6330t_put_bass()
207 tea->bass = val1; in snd_tea6330t_put_bass()
208 val1 += tea->equalizer ? 7 : 3; in snd_tea6330t_put_bass()
209 change = tea->regs[TEA6330T_SADDR_BASS] != val1; in snd_tea6330t_put_bass()
211 bytes[1] = tea->regs[TEA6330T_SADDR_BASS] = val1; in snd_tea6330t_put_bass()
212 err = snd_i2c_sendbytes(tea->device, bytes, 2); in snd_tea6330t_put_bass()
215 snd_i2c_unlock(tea->bus); in snd_tea6330t_put_bass()
227 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_info_treble() local
232 uinfo->value.integer.max = tea->max_treble; in snd_tea6330t_info_treble()
239 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_get_treble() local
241 ucontrol->value.integer.value[0] = tea->treble; in snd_tea6330t_get_treble()
248 struct tea6330t *tea = snd_kcontrol_chip(kcontrol); in snd_tea6330t_put_treble() local
253 val1 = ucontrol->value.integer.value[0] % (tea->max_treble + 1); in snd_tea6330t_put_treble()
254 snd_i2c_lock(tea->bus); in snd_tea6330t_put_treble()
255 tea->treble = val1; in snd_tea6330t_put_treble()
257 change = tea->regs[TEA6330T_SADDR_TREBLE] != val1; in snd_tea6330t_put_treble()
259 bytes[1] = tea->regs[TEA6330T_SADDR_TREBLE] = val1; in snd_tea6330t_put_treble()
260 err = snd_i2c_sendbytes(tea->device, bytes, 2); in snd_tea6330t_put_treble()
263 snd_i2c_unlock(tea->bus); in snd_tea6330t_put_treble()
284 struct tea6330t *tea; in snd_tea6330t_update_mixer() local
291 tea = kzalloc(sizeof(*tea), GFP_KERNEL); in snd_tea6330t_update_mixer()
292 if (tea == NULL) in snd_tea6330t_update_mixer()
296 kfree(tea); in snd_tea6330t_update_mixer()
299 tea->device = device; in snd_tea6330t_update_mixer()
300 tea->bus = bus; in snd_tea6330t_update_mixer()
301 tea->equalizer = equalizer; in snd_tea6330t_update_mixer()
302 tea->fader = fader; in snd_tea6330t_update_mixer()
303 device->private_data = tea; in snd_tea6330t_update_mixer()
309 tea->regs[TEA6330T_SADDR_FADER] = 0x3f; in snd_tea6330t_update_mixer()
310 tea->regs[TEA6330T_SADDR_AUDIO_SWITCH] = equalizer ? 0 : TEA6330T_EQN; in snd_tea6330t_update_mixer()
312 if (!tea->equalizer) { in snd_tea6330t_update_mixer()
313 tea->max_bass = 9; in snd_tea6330t_update_mixer()
314 tea->max_treble = 8; in snd_tea6330t_update_mixer()
316 tea->bass = 4; in snd_tea6330t_update_mixer()
318 tea->treble = 4; in snd_tea6330t_update_mixer()
320 tea->max_bass = 5; in snd_tea6330t_update_mixer()
321 tea->max_treble = 0; in snd_tea6330t_update_mixer()
323 tea->bass = 4; in snd_tea6330t_update_mixer()
325 tea->treble = 0; in snd_tea6330t_update_mixer()
327 tea->mleft = tea->mright = 0x14; in snd_tea6330t_update_mixer()
328 tea->regs[TEA6330T_SADDR_BASS] = default_bass; in snd_tea6330t_update_mixer()
329 tea->regs[TEA6330T_SADDR_TREBLE] = default_treble; in snd_tea6330t_update_mixer()
334 bytes[idx+1] = tea->regs[idx]; in snd_tea6330t_update_mixer()
346 if (tea->treble == 0 && !strcmp(knew->name, "Tone Control - Treble")) in snd_tea6330t_update_mixer()
348 err = snd_ctl_add(card, snd_ctl_new1(knew, tea)); in snd_tea6330t_update_mixer()