aboutsummaryrefslogtreecommitdiff
path: root/include/sound/msm_hdmi_audio.h
blob: 8ada49f82234e6794dfcaebac3dc795e9ebc5006 (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
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __MSM_HDMI_AUDIO_H
#define __MSM_HDMI_AUDIO_H

/* Supported HDMI Audio channels */
#define MSM_HDMI_AUDIO_CHANNEL_2		0
#define MSM_HDMI_AUDIO_CHANNEL_4		1
#define MSM_HDMI_AUDIO_CHANNEL_6		2
#define MSM_HDMI_AUDIO_CHANNEL_8		3

#define TRUE   1
#define FALSE  0

enum hdmi_supported_sample_rates {
	HDMI_SAMPLE_RATE_32KHZ,
	HDMI_SAMPLE_RATE_44_1KHZ,
	HDMI_SAMPLE_RATE_48KHZ,
	HDMI_SAMPLE_RATE_88_2KHZ,
	HDMI_SAMPLE_RATE_96KHZ,
	HDMI_SAMPLE_RATE_176_4KHZ,
	HDMI_SAMPLE_RATE_192KHZ
};

int hdmi_audio_enable(bool on , u32 fifo_water_mark);
int hdmi_audio_packet_enable(bool on);
int hdmi_msm_audio_get_sample_rate(void);

#if defined(CONFIG_FB_MSM_HDMI_MSM_PANEL) || defined(CONFIG_DRM_MSM)
int hdmi_msm_audio_info_setup(bool enabled, u32 num_of_channels,
	u32 channel_allocation, u32 level_shift, bool down_mix);
void hdmi_msm_audio_sample_rate_reset(int rate);
#else
static inline int hdmi_msm_audio_info_setup(bool enabled,
	u32 num_of_channels, u32 channel_allocation, u32 level_shift,
	bool down_mix)
{
	return 0;
}
static inline void hdmi_msm_audio_sample_rate_reset(int rate)
{
}
#endif
#endif /* __MSM_HDMI_AUDIO_H*/