0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef CTAMIXER_H
0016 #define CTAMIXER_H
0017
0018 #include "ctresource.h"
0019 #include <linux/spinlock.h>
0020 #include <sound/core.h>
0021
0022
0023 struct sum {
0024 struct rsc rsc;
0025 unsigned char idx[8];
0026 };
0027
0028
0029 struct sum_desc {
0030 unsigned int msr;
0031 };
0032
0033 struct sum_mgr {
0034 struct rsc_mgr mgr;
0035 struct snd_card *card;
0036 spinlock_t mgr_lock;
0037
0038
0039 int (*get_sum)(struct sum_mgr *mgr,
0040 const struct sum_desc *desc, struct sum **rsum);
0041
0042 int (*put_sum)(struct sum_mgr *mgr, struct sum *sum);
0043 };
0044
0045
0046 int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr);
0047 int sum_mgr_destroy(struct sum_mgr *sum_mgr);
0048
0049
0050 struct amixer_rsc_ops;
0051
0052 struct amixer {
0053 struct rsc rsc;
0054 unsigned char idx[8];
0055 struct rsc *input;
0056 struct sum *sum;
0057 const struct amixer_rsc_ops *ops;
0058 };
0059
0060 struct amixer_rsc_ops {
0061 int (*set_input)(struct amixer *amixer, struct rsc *rsc);
0062 int (*set_scale)(struct amixer *amixer, unsigned int scale);
0063 int (*set_invalid_squash)(struct amixer *amixer, unsigned int iv);
0064 int (*set_sum)(struct amixer *amixer, struct sum *sum);
0065 int (*commit_write)(struct amixer *amixer);
0066
0067 int (*commit_raw_write)(struct amixer *amixer);
0068 int (*setup)(struct amixer *amixer, struct rsc *input,
0069 unsigned int scale, struct sum *sum);
0070 int (*get_scale)(struct amixer *amixer);
0071 };
0072
0073
0074 struct amixer_desc {
0075 unsigned int msr;
0076 };
0077
0078 struct amixer_mgr {
0079 struct rsc_mgr mgr;
0080 struct snd_card *card;
0081 spinlock_t mgr_lock;
0082
0083
0084 int (*get_amixer)(struct amixer_mgr *mgr,
0085 const struct amixer_desc *desc,
0086 struct amixer **ramixer);
0087
0088 int (*put_amixer)(struct amixer_mgr *mgr, struct amixer *amixer);
0089 };
0090
0091
0092 int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr);
0093 int amixer_mgr_destroy(struct amixer_mgr *amixer_mgr);
0094
0095 #endif