diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 09:09:46 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:20:00 -0500 |
commit | 65b29f5039b38a5854b5e12238b0688a33e235cc (patch) | |
tree | bcbb2986d8a6b247387c0f7516c8f43dddeaf07c /sound/ppc/daca.c | |
parent | bbe85bbd02b2220c819ad1e33c9d6327131ad281 (diff) |
[ALSA] Remove xxx_t typedefs: PowerMac
Remove xxx_t typedefs from the PowerMac driver.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/ppc/daca.c')
-rw-r--r-- | sound/ppc/daca.c | 72 |
1 files changed, 40 insertions, 32 deletions
diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c index a737f298e77d..08cde51177d7 100644 --- a/sound/ppc/daca.c +++ b/sound/ppc/daca.c | |||
@@ -40,18 +40,18 @@ | |||
40 | #define DACA_VOL_MAX 0x38 | 40 | #define DACA_VOL_MAX 0x38 |
41 | 41 | ||
42 | 42 | ||
43 | typedef struct pmac_daca_t { | 43 | struct pmac_daca { |
44 | pmac_keywest_t i2c; | 44 | struct pmac_keywest i2c; |
45 | int left_vol, right_vol; | 45 | int left_vol, right_vol; |
46 | unsigned int deemphasis : 1; | 46 | unsigned int deemphasis : 1; |
47 | unsigned int amp_on : 1; | 47 | unsigned int amp_on : 1; |
48 | } pmac_daca_t; | 48 | }; |
49 | 49 | ||
50 | 50 | ||
51 | /* | 51 | /* |
52 | * initialize / detect DACA | 52 | * initialize / detect DACA |
53 | */ | 53 | */ |
54 | static int daca_init_client(pmac_keywest_t *i2c) | 54 | static int daca_init_client(struct pmac_keywest *i2c) |
55 | { | 55 | { |
56 | unsigned short wdata = 0x00; | 56 | unsigned short wdata = 0x00; |
57 | /* SR: no swap, 1bit delay, 32-48kHz */ | 57 | /* SR: no swap, 1bit delay, 32-48kHz */ |
@@ -66,7 +66,7 @@ static int daca_init_client(pmac_keywest_t *i2c) | |||
66 | /* | 66 | /* |
67 | * update volume | 67 | * update volume |
68 | */ | 68 | */ |
69 | static int daca_set_volume(pmac_daca_t *mix) | 69 | static int daca_set_volume(struct pmac_daca *mix) |
70 | { | 70 | { |
71 | unsigned char data[2]; | 71 | unsigned char data[2]; |
72 | 72 | ||
@@ -92,7 +92,8 @@ static int daca_set_volume(pmac_daca_t *mix) | |||
92 | 92 | ||
93 | 93 | ||
94 | /* deemphasis switch */ | 94 | /* deemphasis switch */ |
95 | static int daca_info_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 95 | static int daca_info_deemphasis(struct snd_kcontrol *kcontrol, |
96 | struct snd_ctl_elem_info *uinfo) | ||
96 | { | 97 | { |
97 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 98 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
98 | uinfo->count = 1; | 99 | uinfo->count = 1; |
@@ -101,20 +102,22 @@ static int daca_info_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *u | |||
101 | return 0; | 102 | return 0; |
102 | } | 103 | } |
103 | 104 | ||
104 | static int daca_get_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 105 | static int daca_get_deemphasis(struct snd_kcontrol *kcontrol, |
106 | struct snd_ctl_elem_value *ucontrol) | ||
105 | { | 107 | { |
106 | pmac_t *chip = snd_kcontrol_chip(kcontrol); | 108 | struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); |
107 | pmac_daca_t *mix; | 109 | struct pmac_daca *mix; |
108 | if (! (mix = chip->mixer_data)) | 110 | if (! (mix = chip->mixer_data)) |
109 | return -ENODEV; | 111 | return -ENODEV; |
110 | ucontrol->value.integer.value[0] = mix->deemphasis ? 1 : 0; | 112 | ucontrol->value.integer.value[0] = mix->deemphasis ? 1 : 0; |
111 | return 0; | 113 | return 0; |
112 | } | 114 | } |
113 | 115 | ||
114 | static int daca_put_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 116 | static int daca_put_deemphasis(struct snd_kcontrol *kcontrol, |
117 | struct snd_ctl_elem_value *ucontrol) | ||
115 | { | 118 | { |
116 | pmac_t *chip = snd_kcontrol_chip(kcontrol); | 119 | struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); |
117 | pmac_daca_t *mix; | 120 | struct pmac_daca *mix; |
118 | int change; | 121 | int change; |
119 | 122 | ||
120 | if (! (mix = chip->mixer_data)) | 123 | if (! (mix = chip->mixer_data)) |
@@ -128,7 +131,8 @@ static int daca_put_deemphasis(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u | |||
128 | } | 131 | } |
129 | 132 | ||
130 | /* output volume */ | 133 | /* output volume */ |
131 | static int daca_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 134 | static int daca_info_volume(struct snd_kcontrol *kcontrol, |
135 | struct snd_ctl_elem_info *uinfo) | ||
132 | { | 136 | { |
133 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 137 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
134 | uinfo->count = 2; | 138 | uinfo->count = 2; |
@@ -137,10 +141,11 @@ static int daca_info_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo | |||
137 | return 0; | 141 | return 0; |
138 | } | 142 | } |
139 | 143 | ||
140 | static int daca_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 144 | static int daca_get_volume(struct snd_kcontrol *kcontrol, |
145 | struct snd_ctl_elem_value *ucontrol) | ||
141 | { | 146 | { |
142 | pmac_t *chip = snd_kcontrol_chip(kcontrol); | 147 | struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); |
143 | pmac_daca_t *mix; | 148 | struct pmac_daca *mix; |
144 | if (! (mix = chip->mixer_data)) | 149 | if (! (mix = chip->mixer_data)) |
145 | return -ENODEV; | 150 | return -ENODEV; |
146 | ucontrol->value.integer.value[0] = mix->left_vol; | 151 | ucontrol->value.integer.value[0] = mix->left_vol; |
@@ -148,10 +153,11 @@ static int daca_get_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont | |||
148 | return 0; | 153 | return 0; |
149 | } | 154 | } |
150 | 155 | ||
151 | static int daca_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 156 | static int daca_put_volume(struct snd_kcontrol *kcontrol, |
157 | struct snd_ctl_elem_value *ucontrol) | ||
152 | { | 158 | { |
153 | pmac_t *chip = snd_kcontrol_chip(kcontrol); | 159 | struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); |
154 | pmac_daca_t *mix; | 160 | struct pmac_daca *mix; |
155 | int change; | 161 | int change; |
156 | 162 | ||
157 | if (! (mix = chip->mixer_data)) | 163 | if (! (mix = chip->mixer_data)) |
@@ -169,20 +175,22 @@ static int daca_put_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont | |||
169 | /* amplifier switch */ | 175 | /* amplifier switch */ |
170 | #define daca_info_amp daca_info_deemphasis | 176 | #define daca_info_amp daca_info_deemphasis |
171 | 177 | ||
172 | static int daca_get_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 178 | static int daca_get_amp(struct snd_kcontrol *kcontrol, |
179 | struct snd_ctl_elem_value *ucontrol) | ||
173 | { | 180 | { |
174 | pmac_t *chip = snd_kcontrol_chip(kcontrol); | 181 | struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); |
175 | pmac_daca_t *mix; | 182 | struct pmac_daca *mix; |
176 | if (! (mix = chip->mixer_data)) | 183 | if (! (mix = chip->mixer_data)) |
177 | return -ENODEV; | 184 | return -ENODEV; |
178 | ucontrol->value.integer.value[0] = mix->amp_on ? 1 : 0; | 185 | ucontrol->value.integer.value[0] = mix->amp_on ? 1 : 0; |
179 | return 0; | 186 | return 0; |
180 | } | 187 | } |
181 | 188 | ||
182 | static int daca_put_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 189 | static int daca_put_amp(struct snd_kcontrol *kcontrol, |
190 | struct snd_ctl_elem_value *ucontrol) | ||
183 | { | 191 | { |
184 | pmac_t *chip = snd_kcontrol_chip(kcontrol); | 192 | struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); |
185 | pmac_daca_t *mix; | 193 | struct pmac_daca *mix; |
186 | int change; | 194 | int change; |
187 | 195 | ||
188 | if (! (mix = chip->mixer_data)) | 196 | if (! (mix = chip->mixer_data)) |
@@ -196,7 +204,7 @@ static int daca_put_amp(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol | |||
196 | return change; | 204 | return change; |
197 | } | 205 | } |
198 | 206 | ||
199 | static snd_kcontrol_new_t daca_mixers[] = { | 207 | static struct snd_kcontrol_new daca_mixers[] = { |
200 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 208 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
201 | .name = "Deemphasis Switch", | 209 | .name = "Deemphasis Switch", |
202 | .info = daca_info_deemphasis, | 210 | .info = daca_info_deemphasis, |
@@ -219,9 +227,9 @@ static snd_kcontrol_new_t daca_mixers[] = { | |||
219 | 227 | ||
220 | 228 | ||
221 | #ifdef CONFIG_PM | 229 | #ifdef CONFIG_PM |
222 | static void daca_resume(pmac_t *chip) | 230 | static void daca_resume(struct snd_pmac *chip) |
223 | { | 231 | { |
224 | pmac_daca_t *mix = chip->mixer_data; | 232 | struct pmac_daca *mix = chip->mixer_data; |
225 | i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_SR, 0x08); | 233 | i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_SR, 0x08); |
226 | i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_GCFG, | 234 | i2c_smbus_write_byte_data(mix->i2c.client, DACA_REG_GCFG, |
227 | mix->amp_on ? 0x05 : 0x04); | 235 | mix->amp_on ? 0x05 : 0x04); |
@@ -230,9 +238,9 @@ static void daca_resume(pmac_t *chip) | |||
230 | #endif /* CONFIG_PM */ | 238 | #endif /* CONFIG_PM */ |
231 | 239 | ||
232 | 240 | ||
233 | static void daca_cleanup(pmac_t *chip) | 241 | static void daca_cleanup(struct snd_pmac *chip) |
234 | { | 242 | { |
235 | pmac_daca_t *mix = chip->mixer_data; | 243 | struct pmac_daca *mix = chip->mixer_data; |
236 | if (! mix) | 244 | if (! mix) |
237 | return; | 245 | return; |
238 | snd_pmac_keywest_cleanup(&mix->i2c); | 246 | snd_pmac_keywest_cleanup(&mix->i2c); |
@@ -241,10 +249,10 @@ static void daca_cleanup(pmac_t *chip) | |||
241 | } | 249 | } |
242 | 250 | ||
243 | /* exported */ | 251 | /* exported */ |
244 | int __init snd_pmac_daca_init(pmac_t *chip) | 252 | int __init snd_pmac_daca_init(struct snd_pmac *chip) |
245 | { | 253 | { |
246 | int i, err; | 254 | int i, err; |
247 | pmac_daca_t *mix; | 255 | struct pmac_daca *mix; |
248 | 256 | ||
249 | #ifdef CONFIG_KMOD | 257 | #ifdef CONFIG_KMOD |
250 | if (current->fs->root) | 258 | if (current->fs->root) |