Lines Matching refs:mix

54 static int daca_set_volume(struct pmac_daca *mix)  in daca_set_volume()  argument
58 if (! mix->i2c.client) in daca_set_volume()
61 if (mix->left_vol > DACA_VOL_MAX) in daca_set_volume()
64 data[0] = mix->left_vol; in daca_set_volume()
65 if (mix->right_vol > DACA_VOL_MAX) in daca_set_volume()
68 data[1] = mix->right_vol; in daca_set_volume()
69 data[1] |= mix->deemphasis ? 0x40 : 0; in daca_set_volume()
70 if (i2c_smbus_write_block_data(mix->i2c.client, DACA_REG_AVOL, in daca_set_volume()
86 struct pmac_daca *mix; in daca_get_deemphasis() local
87 mix = chip->mixer_data; in daca_get_deemphasis()
88 if (!mix) in daca_get_deemphasis()
90 ucontrol->value.integer.value[0] = mix->deemphasis ? 1 : 0; in daca_get_deemphasis()
98 struct pmac_daca *mix; in daca_put_deemphasis() local
101 mix = chip->mixer_data; in daca_put_deemphasis()
102 if (!mix) in daca_put_deemphasis()
104 change = mix->deemphasis != ucontrol->value.integer.value[0]; in daca_put_deemphasis()
106 mix->deemphasis = !!ucontrol->value.integer.value[0]; in daca_put_deemphasis()
107 daca_set_volume(mix); in daca_put_deemphasis()
127 struct pmac_daca *mix; in daca_get_volume() local
128 mix = chip->mixer_data; in daca_get_volume()
129 if (!mix) in daca_get_volume()
131 ucontrol->value.integer.value[0] = mix->left_vol; in daca_get_volume()
132 ucontrol->value.integer.value[1] = mix->right_vol; in daca_get_volume()
140 struct pmac_daca *mix; in daca_put_volume() local
144 mix = chip->mixer_data; in daca_put_volume()
145 if (!mix) in daca_put_volume()
151 change = mix->left_vol != vol[0] || in daca_put_volume()
152 mix->right_vol != vol[1]; in daca_put_volume()
154 mix->left_vol = vol[0]; in daca_put_volume()
155 mix->right_vol = vol[1]; in daca_put_volume()
156 daca_set_volume(mix); in daca_put_volume()
168 struct pmac_daca *mix; in daca_get_amp() local
169 mix = chip->mixer_data; in daca_get_amp()
170 if (!mix) in daca_get_amp()
172 ucontrol->value.integer.value[0] = mix->amp_on ? 1 : 0; in daca_get_amp()
180 struct pmac_daca *mix; in daca_put_amp() local
183 mix = chip->mixer_data; in daca_put_amp()
184 if (!mix) in daca_put_amp()
186 change = mix->amp_on != ucontrol->value.integer.value[0]; in daca_put_amp()
188 mix->amp_on = !!ucontrol->value.integer.value[0]; in daca_put_amp()
189 i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_GCFG, in daca_put_amp()
190 mix->amp_on ? 0x05 : 0x04); in daca_put_amp()
220 struct pmac_daca *mix = chip->mixer_data; in daca_resume() local
221 i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_SR, 0x08); in daca_resume()
222 i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_GCFG, in daca_resume()
223 mix->amp_on ? 0x05 : 0x04); in daca_resume()
224 daca_set_volume(mix); in daca_resume()
231 struct pmac_daca *mix = chip->mixer_data; in daca_cleanup() local
232 if (! mix) in daca_cleanup()
234 snd_pmac_keywest_cleanup(&mix->i2c); in daca_cleanup()
235 kfree(mix); in daca_cleanup()
243 struct pmac_daca *mix; in snd_pmac_daca_init() local
247 mix = kzalloc(sizeof(*mix), GFP_KERNEL); in snd_pmac_daca_init()
248 if (! mix) in snd_pmac_daca_init()
250 chip->mixer_data = mix; in snd_pmac_daca_init()
252 mix->amp_on = 1; /* default on */ in snd_pmac_daca_init()
254 mix->i2c.addr = DACA_I2C_ADDR; in snd_pmac_daca_init()
255 mix->i2c.init_client = daca_init_client; in snd_pmac_daca_init()
256 mix->i2c.name = "DACA"; in snd_pmac_daca_init()
257 err = snd_pmac_keywest_init(&mix->i2c); in snd_pmac_daca_init()