xref: /linux/sound/pci/ctxfi/ctmixer.h (revision 8be98d2f2a0a262f8bf8a0bc1fdf522b3c7aab17)
15765e78eSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2*a08b9f2fSAditya Srivastava /*
38cc72361SWai Yew CHAY  * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved.
48cc72361SWai Yew CHAY  *
58cc72361SWai Yew CHAY  * @File	ctmixer.h
68cc72361SWai Yew CHAY  *
78cc72361SWai Yew CHAY  * @Brief
88cc72361SWai Yew CHAY  * This file contains the definition of the mixer device functions.
98cc72361SWai Yew CHAY  *
108cc72361SWai Yew CHAY  * @Author	Liu Chun
118cc72361SWai Yew CHAY  * @Date 	Mar 28 2008
128cc72361SWai Yew CHAY  */
138cc72361SWai Yew CHAY 
148cc72361SWai Yew CHAY #ifndef CTMIXER_H
158cc72361SWai Yew CHAY #define CTMIXER_H
168cc72361SWai Yew CHAY 
178cc72361SWai Yew CHAY #include "ctatc.h"
188cc72361SWai Yew CHAY #include "ctresource.h"
198cc72361SWai Yew CHAY 
208cc72361SWai Yew CHAY #define INIT_VOL	0x1c00
218cc72361SWai Yew CHAY 
228cc72361SWai Yew CHAY enum MIXER_PORT_T {
238cc72361SWai Yew CHAY 	MIX_WAVE_FRONT,
248cc72361SWai Yew CHAY 	MIX_WAVE_REAR,
258cc72361SWai Yew CHAY 	MIX_WAVE_CENTLFE,
268cc72361SWai Yew CHAY 	MIX_WAVE_SURROUND,
278cc72361SWai Yew CHAY 	MIX_SPDIF_OUT,
288cc72361SWai Yew CHAY 	MIX_PCMO_FRONT,
298cc72361SWai Yew CHAY 	MIX_MIC_IN,
308cc72361SWai Yew CHAY 	MIX_LINE_IN,
318cc72361SWai Yew CHAY 	MIX_SPDIF_IN,
328cc72361SWai Yew CHAY 	MIX_PCMI_FRONT,
338cc72361SWai Yew CHAY 	MIX_PCMI_REAR,
348cc72361SWai Yew CHAY 	MIX_PCMI_CENTLFE,
358cc72361SWai Yew CHAY 	MIX_PCMI_SURROUND,
368cc72361SWai Yew CHAY 
378cc72361SWai Yew CHAY 	NUM_MIX_PORTS
388cc72361SWai Yew CHAY };
398cc72361SWai Yew CHAY 
408cc72361SWai Yew CHAY /* alsa mixer descriptor */
418cc72361SWai Yew CHAY struct ct_mixer {
428cc72361SWai Yew CHAY 	struct ct_atc *atc;
438cc72361SWai Yew CHAY 
448cc72361SWai Yew CHAY 	void **amixers;		/* amixer resources for volume control */
458cc72361SWai Yew CHAY 	void **sums;		/* sum resources for signal collection */
468cc72361SWai Yew CHAY 	unsigned int switch_state; /* A bit-map to indicate state of switches */
478cc72361SWai Yew CHAY 
488cc72361SWai Yew CHAY 	int (*get_output_ports)(struct ct_mixer *mixer, enum MIXER_PORT_T type,
498cc72361SWai Yew CHAY 				  struct rsc **rleft, struct rsc **rright);
508cc72361SWai Yew CHAY 
518cc72361SWai Yew CHAY 	int (*set_input_left)(struct ct_mixer *mixer,
528cc72361SWai Yew CHAY 			      enum MIXER_PORT_T type, struct rsc *rsc);
538cc72361SWai Yew CHAY 	int (*set_input_right)(struct ct_mixer *mixer,
548cc72361SWai Yew CHAY 			       enum MIXER_PORT_T type, struct rsc *rsc);
55c7561cd8STakashi Iwai #ifdef CONFIG_PM_SLEEP
5629959a09SWai Yew CHAY 	int (*resume)(struct ct_mixer *mixer);
5729959a09SWai Yew CHAY #endif
588cc72361SWai Yew CHAY };
598cc72361SWai Yew CHAY 
608cc72361SWai Yew CHAY int ct_alsa_mix_create(struct ct_atc *atc,
618cc72361SWai Yew CHAY 		       enum CTALSADEVS device,
628cc72361SWai Yew CHAY 		       const char *device_name);
638cc72361SWai Yew CHAY int ct_mixer_create(struct ct_atc *atc, struct ct_mixer **rmixer);
648cc72361SWai Yew CHAY int ct_mixer_destroy(struct ct_mixer *mixer);
658cc72361SWai Yew CHAY 
668cc72361SWai Yew CHAY #endif /* CTMIXER_H */
67