sound/pci/ctxfi/ctamixer.h

Source file repositories/reference/linux-study-clean/sound/pci/ctxfi/ctamixer.h

File Facts

System
Linux kernel
Corpus path
sound/pci/ctxfi/ctamixer.h
Extension
.h
Size
2721 bytes
Lines
96
Domain
Driver Families
Bucket
sound/pci
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct sum {
	struct rsc rsc;		/* Basic resource info */
	unsigned char idx[8];
};

/* Define sum resource request description info */
struct sum_desc {
	unsigned int msr;
};

struct sum_mgr {
	struct rsc_mgr mgr;	/* Basic resource manager info */
	struct snd_card *card;	/* pointer to this card */
	spinlock_t mgr_lock;

	 /* request one sum resource */
	int (*get_sum)(struct sum_mgr *mgr,
			const struct sum_desc *desc, struct sum **rsum);
	/* return one sum resource */
	int (*put_sum)(struct sum_mgr *mgr, struct sum *sum);
};

/* Constructor and destructor of daio resource manager */
int sum_mgr_create(struct hw *hw, void **ptr);
int sum_mgr_destroy(void *ptr);

/* Define the descriptor of a amixer resource */
struct amixer_rsc_ops;

struct amixer {
	struct rsc rsc;		/* Basic resource info */
	unsigned char idx[8];
	struct rsc *input;	/* pointer to a resource acting as source */
	struct sum *sum;	/* Put amixer output to this summation node */
	const struct amixer_rsc_ops *ops;	/* AMixer specific operations */
};

struct amixer_rsc_ops {
	int (*set_input)(struct amixer *amixer, struct rsc *rsc);
	int (*set_scale)(struct amixer *amixer, unsigned int scale);
	int (*set_invalid_squash)(struct amixer *amixer, unsigned int iv);
	int (*set_sum)(struct amixer *amixer, struct sum *sum);
	int (*commit_write)(struct amixer *amixer);
	/* Only for interleaved recording */
	int (*commit_raw_write)(struct amixer *amixer);
	int (*setup)(struct amixer *amixer, struct rsc *input,
			unsigned int scale, struct sum *sum);
	int (*get_scale)(struct amixer *amixer);
};

/* Define amixer resource request description info */
struct amixer_desc {
	unsigned int msr;
};

struct amixer_mgr {
	struct rsc_mgr mgr;	/* Basic resource manager info */
	struct snd_card *card;	/* pointer to this card */
	spinlock_t mgr_lock;

	 /* request one amixer resource */
	int (*get_amixer)(struct amixer_mgr *mgr,
			  const struct amixer_desc *desc,
			  struct amixer **ramixer);
	/* return one amixer resource */
	int (*put_amixer)(struct amixer_mgr *mgr, struct amixer *amixer);
};

/* Constructor and destructor of amixer resource manager */
int amixer_mgr_create(struct hw *hw, void **ramixer_mgr);
int amixer_mgr_destroy(void *amixer_mgr);

#endif /* CTAMIXER_H */

Annotation

Implementation Notes