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