1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef CTAMIXER_H
16 #define CTAMIXER_H
17
18 #include "ctresource.h"
19 #include <linux/spinlock.h>
20 #include <sound/core.h>
21
22
23 struct sum {
24 struct rsc rsc;
25 unsigned char idx[8];
26 };
27
28
29 struct sum_desc {
30 unsigned int msr;
31 };
32
33 struct sum_mgr {
34 struct rsc_mgr mgr;
35 struct snd_card *card;
36 spinlock_t mgr_lock;
37
38
39 int (*get_sum)(struct sum_mgr *mgr,
40 const struct sum_desc *desc, struct sum **rsum);
41
42 int (*put_sum)(struct sum_mgr *mgr, struct sum *sum);
43 };
44
45
46 int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr);
47 int sum_mgr_destroy(struct sum_mgr *sum_mgr);
48
49
50 struct amixer_rsc_ops;
51
52 struct amixer {
53 struct rsc rsc;
54 unsigned char idx[8];
55 struct rsc *input;
56 struct sum *sum;
57 const struct amixer_rsc_ops *ops;
58 };
59
60 struct amixer_rsc_ops {
61 int (*set_input)(struct amixer *amixer, struct rsc *rsc);
62 int (*set_scale)(struct amixer *amixer, unsigned int scale);
63 int (*set_invalid_squash)(struct amixer *amixer, unsigned int iv);
64 int (*set_sum)(struct amixer *amixer, struct sum *sum);
65 int (*commit_write)(struct amixer *amixer);
66
67 int (*commit_raw_write)(struct amixer *amixer);
68 int (*setup)(struct amixer *amixer, struct rsc *input,
69 unsigned int scale, struct sum *sum);
70 int (*get_scale)(struct amixer *amixer);
71 };
72
73
74 struct amixer_desc {
75 unsigned int msr;
76 };
77
78 struct amixer_mgr {
79 struct rsc_mgr mgr;
80 struct snd_card *card;
81 spinlock_t mgr_lock;
82
83
84 int (*get_amixer)(struct amixer_mgr *mgr,
85 const struct amixer_desc *desc,
86 struct amixer **ramixer);
87
88 int (*put_amixer)(struct amixer_mgr *mgr, struct amixer *amixer);
89 };
90
91
92 int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr);
93 int amixer_mgr_destroy(struct amixer_mgr *amixer_mgr);
94
95 #endif