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);
86 snd_i2c_lock(tea->bus);
87 ucontrol->value.integer.value[0] = tea->mleft - 0x14;
88 ucontrol->value.integer.value[1] = tea->mright - 0x14;
89 snd_i2c_unlock(tea->bus);
96 struct tea6330t *tea = snd_kcontrol_chip(kcontrol);
103 snd_i2c_lock(tea->bus);
104 change = val1 != tea->mleft || val2 != tea->mright;
105 tea->mleft = val1;
106 tea->mright = val2;
108 if (tea->regs[TEA6330T_SADDR_VOLUME_LEFT] != 0) {
110 bytes[count++] = tea->regs[TEA6330T_SADDR_VOLUME_LEFT] = tea->mleft;
112 if (tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] != 0) {
115 bytes[count++] = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] = tea->mright;
118 if ((err = snd_i2c_sendbytes(tea->device, bytes, count)) < 0)
121 snd_i2c_unlock(tea->bus);
135 struct tea6330t *tea = snd_kcontrol_chip(kcontrol);
137 snd_i2c_lock(tea->bus);
138 ucontrol->value.integer.value[0] = tea->regs[TEA6330T_SADDR_VOLUME_LEFT] == 0 ? 0 : 1;
139 ucontrol->value.integer.value[1] = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] == 0 ? 0 : 1;
140 snd_i2c_unlock(tea->bus);
147 struct tea6330t *tea = snd_kcontrol_chip(kcontrol);
154 snd_i2c_lock(tea->bus);
155 oval1 = tea->regs[TEA6330T_SADDR_VOLUME_LEFT] == 0 ? 0 : 1;
156 oval2 = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] == 0 ? 0 : 1;
158 tea->regs[TEA6330T_SADDR_VOLUME_LEFT] = val1 ? tea->mleft : 0;
159 tea->regs[TEA6330T_SADDR_VOLUME_RIGHT] = val2 ? tea->mright : 0;
161 bytes[1] = tea->regs[TEA6330T_SADDR_VOLUME_LEFT];
162 bytes[2] = tea->regs[TEA6330T_SADDR_VOLUME_RIGHT];
163 if ((err = snd_i2c_sendbytes(tea->device, bytes, 3)) < 0)
165 snd_i2c_unlock(tea->bus);
177 struct tea6330t *tea = snd_kcontrol_chip(kcontrol);
182 uinfo->value.integer.max = tea->max_bass;
189 struct tea6330t *tea = snd_kcontrol_chip(kcontrol);
191 ucontrol->value.integer.value[0] = tea->bass;
198 struct tea6330t *tea = snd_kcontrol_chip(kcontrol);
203 val1 = ucontrol->value.integer.value[0] % (tea->max_bass + 1);
204 snd_i2c_lock(tea->bus);
205 tea->bass = val1;
206 val1 += tea->equalizer ? 7 : 3;
207 change = tea->regs[TEA6330T_SADDR_BASS] != val1;
209 bytes[1] = tea->regs[TEA6330T_SADDR_BASS] = val1;
210 if ((err = snd_i2c_sendbytes(tea->device, bytes, 2)) < 0)
212 snd_i2c_unlock(tea->bus);
224 struct tea6330t *tea = snd_kcontrol_chip(kcontrol);
229 uinfo->value.integer.max = tea->max_treble;
236 struct tea6330t *tea = snd_kcontrol_chip(kcontrol);
238 ucontrol->value.integer.value[0] = tea->treble;
245 struct tea6330t *tea = snd_kcontrol_chip(kcontrol);
250 val1 = ucontrol->value.integer.value[0] % (tea->max_treble + 1);
251 snd_i2c_lock(tea->bus);
252 tea->treble = val1;
254 change = tea->regs[TEA6330T_SADDR_TREBLE] != val1;
256 bytes[1] = tea->regs[TEA6330T_SADDR_TREBLE] = val1;
257 if ((err = snd_i2c_sendbytes(tea->device, bytes, 2)) < 0)
259 snd_i2c_unlock(tea->bus);
280 struct tea6330t *tea;
287 tea = kzalloc(sizeof(*tea), GFP_KERNEL);
288 if (tea == NULL)
291 kfree(tea);
294 tea->device = device;
295 tea->bus = bus;
296 tea->equalizer = equalizer;
297 tea->fader = fader;
298 device->private_data = tea;
304 tea->regs[TEA6330T_SADDR_FADER] = 0x3f;
305 tea->regs[TEA6330T_SADDR_AUDIO_SWITCH] = equalizer ? 0 : TEA6330T_EQN;
307 if (!tea->equalizer) {
308 tea->max_bass = 9;
309 tea->max_treble = 8;
311 tea->bass = 4;
313 tea->treble = 4;
315 tea->max_bass = 5;
316 tea->max_treble = 0;
318 tea->bass = 4;
320 tea->treble = 0;
322 tea->mleft = tea->mright = 0x14;
323 tea->regs[TEA6330T_SADDR_BASS] = default_bass;
324 tea->regs[TEA6330T_SADDR_TREBLE] = default_treble;
329 bytes[idx+1] = tea->regs[idx];
339 if (tea->treble == 0 && !strcmp(knew->name, "Tone Control - Treble"))
341 if ((err = snd_ctl_add(card, snd_ctl_new1(knew, tea))) < 0)