diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-08-22 07:16:25 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-09-23 04:43:28 -0400 |
commit | eac06a10d2b814dfacc36a8fff35ef07bf4eec8e (patch) | |
tree | b58b442323d539ae6edaebede6643f49213e4978 /include/sound | |
parent | 0e7febf15851fb438b9518654340d1f704d202e5 (diff) |
[ALSA] Add dB scale information to ad1848 driver
Added the dB scale information to ad1848 driver.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/ad1848.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/include/sound/ad1848.h b/include/sound/ad1848.h index 57af1fe7b309..c8de6f83338f 100644 --- a/include/sound/ad1848.h +++ b/include/sound/ad1848.h | |||
@@ -179,14 +179,13 @@ enum { AD1848_MIX_SINGLE, AD1848_MIX_DOUBLE, AD1848_MIX_CAPTURE }; | |||
179 | #define AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) \ | 179 | #define AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) \ |
180 | ((left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22)) | 180 | ((left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22)) |
181 | 181 | ||
182 | int snd_ad1848_add_ctl(struct snd_ad1848 *chip, const char *name, int index, int type, unsigned long value); | ||
183 | |||
184 | /* for ease of use */ | 182 | /* for ease of use */ |
185 | struct ad1848_mix_elem { | 183 | struct ad1848_mix_elem { |
186 | const char *name; | 184 | const char *name; |
187 | int index; | 185 | int index; |
188 | int type; | 186 | int type; |
189 | unsigned long private_value; | 187 | unsigned long private_value; |
188 | unsigned int *tlv; | ||
190 | }; | 189 | }; |
191 | 190 | ||
192 | #define AD1848_SINGLE(xname, xindex, reg, shift, mask, invert) \ | 191 | #define AD1848_SINGLE(xname, xindex, reg, shift, mask, invert) \ |
@@ -195,15 +194,26 @@ struct ad1848_mix_elem { | |||
195 | .type = AD1848_MIX_SINGLE, \ | 194 | .type = AD1848_MIX_SINGLE, \ |
196 | .private_value = AD1848_MIXVAL_SINGLE(reg, shift, mask, invert) } | 195 | .private_value = AD1848_MIXVAL_SINGLE(reg, shift, mask, invert) } |
197 | 196 | ||
197 | #define AD1848_SINGLE_TLV(xname, xindex, reg, shift, mask, invert, xtlv) \ | ||
198 | { .name = xname, \ | ||
199 | .index = xindex, \ | ||
200 | .type = AD1848_MIX_SINGLE, \ | ||
201 | .private_value = AD1848_MIXVAL_SINGLE(reg, shift, mask, invert), \ | ||
202 | .tlv = xtlv } | ||
203 | |||
198 | #define AD1848_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ | 204 | #define AD1848_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ |
199 | { .name = xname, \ | 205 | { .name = xname, \ |
200 | .index = xindex, \ | 206 | .index = xindex, \ |
201 | .type = AD1848_MIX_DOUBLE, \ | 207 | .type = AD1848_MIX_DOUBLE, \ |
202 | .private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) } | 208 | .private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) } |
203 | 209 | ||
204 | static inline int snd_ad1848_add_ctl_elem(struct snd_ad1848 *chip, const struct ad1848_mix_elem *c) | 210 | #define AD1848_DOUBLE_TLV(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert, xtlv) \ |
205 | { | 211 | { .name = xname, \ |
206 | return snd_ad1848_add_ctl(chip, c->name, c->index, c->type, c->private_value); | 212 | .index = xindex, \ |
207 | } | 213 | .type = AD1848_MIX_DOUBLE, \ |
214 | .private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert), \ | ||
215 | .tlv = xtlv } | ||
216 | |||
217 | int snd_ad1848_add_ctl_elem(struct snd_ad1848 *chip, const struct ad1848_mix_elem *c); | ||
208 | 218 | ||
209 | #endif /* __SOUND_AD1848_H */ | 219 | #endif /* __SOUND_AD1848_H */ |