aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/ad1848.h
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-09-24 17:05:59 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-09-24 17:05:59 -0400
commit02b25fcff676125a88169c8a78d4c6dd647574ed (patch)
tree372fc8e885be41ba1819b2767c8889ecd97ff948 /include/sound/ad1848.h
parent1694176a210189312e31b083bac1e1688981219a (diff)
parenta68aa1cc6f3203b8a332683ebde67a00f39eec43 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/sound/ad1848.h')
-rw-r--r--include/sound/ad1848.h22
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
182int 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 */
185struct ad1848_mix_elem { 183struct 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
204static 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
217int 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 */