23 #include <linux/i2c.h>
25 #include <linux/slab.h>
30 #define DACA_I2C_ADDR 0x4d
33 #define DACA_REG_SR 0x01
34 #define DACA_REG_AVOL 0x02
35 #define DACA_REG_GCFG 0x03
38 #define DACA_VOL_MAX 0x38
54 unsigned short wdata = 0x00;
61 2, (
unsigned char*)&wdata);
69 unsigned char data[2];
71 if (! mix->
i2c.client)
93 #define daca_info_deemphasis snd_ctl_boolean_mono_info
95 static int daca_get_deemphasis(
struct snd_kcontrol *kcontrol,
106 static int daca_put_deemphasis(
struct snd_kcontrol *kcontrol,
118 daca_set_volume(mix);
124 static int daca_info_volume(
struct snd_kcontrol *kcontrol,
134 static int daca_get_volume(
struct snd_kcontrol *kcontrol,
146 static int daca_put_volume(
struct snd_kcontrol *kcontrol,
156 vol[0] = ucontrol->
value.integer.value[0];
157 vol[1] = ucontrol->
value.integer.value[1];
165 daca_set_volume(mix);
171 #define daca_info_amp daca_info_deemphasis
180 ucontrol->
value.integer.value[0] = mix->
amp_on ? 1 : 0;
193 change = mix->
amp_on != ucontrol->
value.integer.value[0];
197 mix->
amp_on ? 0x05 : 0x04);
204 .name =
"Deemphasis Switch",
206 .get = daca_get_deemphasis,
207 .put = daca_put_deemphasis
210 .name =
"Master Playback Volume",
211 .info = daca_info_volume,
212 .get = daca_get_volume,
213 .put = daca_put_volume
216 .name =
"Power Amplifier Switch",
225 static void daca_resume(
struct snd_pmac *chip)
230 mix->
amp_on ? 0x05 : 0x04);
231 daca_set_volume(mix);
236 static void daca_cleanup(
struct snd_pmac *chip)
252 request_module(
"i2c-powermac");
262 mix->
i2c.init_client = daca_init_client;
263 mix->
i2c.name =
"DACA";
270 strcpy(chip->
card->mixername,
"PowerMac DACA");
272 for (i = 0; i <
ARRAY_SIZE(daca_mixers); i++) {
278 chip->resume = daca_resume;