summaryrefslogtreecommitdiff
path: root/sound/arm/mxc-alsa-common.h
blob: 09d8d8de842a16c9908cee464f1e1f51fefc9a6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 * Copyright 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
 */

/*
 * The code contained herein is licensed under the GNU General Public
 * License. You may obtain a copy of the GNU General Public License
 * Version 2 or later at the following locations:
 *
 * http://www.opensource.org/licenses/gpl-license.html
 * http://www.gnu.org/copyleft/gpl.html
 */

 /*!
  * @file mxc-alsa-common.h
  * @brief
  * @ingroup SOUND_DRV
  */

#ifndef __MXC_ALSA_COMMON_H__
#define __MXC_ALSA_COMMON_H__

/* Enums typically used by the Mixer support APIs
  * Emunerates IP, OP and mixer sources.
  */

typedef enum {
	CODEC_DIR_OUT,
	MIXER_OUT
} OUTPUT_SOURCE;

typedef enum {
	OP_NODEV = -1,
	OP_EARPIECE,
	OP_HANDSFREE,
	OP_HEADSET,
	OP_LINEOUT,
	OP_MAXDEV,
	OP_MONO
} OUTPUT_DEVICES;

typedef enum {
	IP_NODEV = -1,
	IP_HANDSET,
	IP_HEADSET,
	IP_LINEIN,
	IP_MAXDEV
} INPUT_DEVICES;

extern int mxc_alsa_create_ctl(struct snd_card *card, void *p_value);

extern int set_mixer_output_device(PMIC_AUDIO_HANDLE handle, OUTPUT_SOURCE src,
				   OUTPUT_DEVICES dev, bool enable);
extern int set_mixer_output_volume(PMIC_AUDIO_HANDLE handle, int volume,
				   OUTPUT_DEVICES dev);
extern int set_mixer_input_device(PMIC_AUDIO_HANDLE handle, INPUT_DEVICES dev,
				  bool enable);
extern int set_mixer_output_mono_adder(PMIC_AUDIO_MONO_ADDER_MODE mode);
extern int set_mixer_input_gain(PMIC_AUDIO_HANDLE handle, int val);
extern int set_mixer_output_balance(int bal);

extern int get_mixer_output_device(void);
extern int get_mixer_output_volume(void);
extern int get_mixer_output_mono_adder(void);
extern int get_mixer_output_balance(void);
extern int get_mixer_input_gain(void);
extern int get_mixer_input_device(void);
#endif				/* __MXC_ALSA_COMMON_H__ */