import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / pixi3_10 / sound / inc / yusu_android_speaker.h
CommitLineData
6fa3eb70
S
1/*******************************************************************************
2 *
3 * Filename:
4 * ---------
5 * Yusu_android_speaker.h
6 *
7 * Project:
8 * --------
9 * Yusu
10 *
11 * Description:
12 * ------------
13 * speaker select
14 *
15 * Author:
16 * -------
17 * ChiPeng Chang (mtk02308)
18 *
19 *
20 *------------------------------------------------------------------------------
21 * $Revision$
22 * $Modtime:$
23 * $Log:$
24 *
25 * 06 17 2012 weiguo.li
26 * [ALPS00302429] [Need Patch] [Volunteer Patch]modify speaker driver
27 * .
28 *
29 * 12 14 2011 weiguo.li
30 * [ALPS00102848] [Need Patch] [Volunteer Patch] build waring in yusu_android_speaker.h
31 * .
32 *
33 * 11 10 2011 weiguo.li
34 * [ALPS00091610] [Need Patch] [Volunteer Patch]chang yusu_android_speaker.c function name and modules use it
35 * .
36 *
37 * 09 28 2011 weiguo.li
38 * [ALPS00076254] [Need Patch] [Volunteer Patch]LGE audio driver using Voicebuffer for incall
39 * .
40 *
41 * 07 08 2011 weiguo.li
42 * [ALPS00059378] poring lge code to alps(audio)
43 * .
44 *
45 * 07 23 2010 chipeng.chang
46 * [ALPS00122386][Music]The playing music is no sound after below steps.
47 * when mode change , record deivce for volume setting.
48 *
49 * 07 03 2010 chipeng.chang
50 * [ALPS00002838][Need Patch] [Volunteer Patch] for speech volume step
51 * modify for headset customization.
52 *
53 *******************************************************************************/
54#include <linux/kernel.h>
55#include <linux/module.h>
56#include <linux/init.h>
57#include <linux/device.h>
58#include <linux/slab.h>
59#include <linux/fs.h>
60#include <linux/mm.h>
61#include <linux/interrupt.h>
62#include <linux/vmalloc.h>
63#include <linux/wait.h>
64#include <linux/spinlock.h>
65#include <linux/semaphore.h>
66#include <mach/mt_typedefs.h>
67
68#ifndef _YUSU_ANDROID_SPEAKER_H_
69#define _YUSU_ANDROID_SPEAKER_H_
70
71 enum EAMP_CONTROL_SUBCOMMAND
72 {
73 EAMP_SPEAKER_CLOSE =0,
74 EAMP_SPEAKER_OPEN,
75 EAMP_HEADPHONE_OPEN,
76 EAMP_HEADPHONE_CLOSE,
77 EAMP_EARPIECE_OPEN,
78 EAMP_EARPIECE_CLOSE,
79 EAMP_GETREGISTER_VALUE,
80 EAMP_SETREGISTER_VALUE,
81 EAMP_SETAMP_GAIN,
82 EAMP_GETAMP_GAIN,
83 EAMP_GET_CTRP_NUM ,
84 EAMP_GET_CTRP_BITS,
85 EAMP_GET_CTRP_TABLE,
86 EAMP_SETMODE,
87 };
88
89enum AUDIO_AMP_CONTROL_COMMAND{
90 AUD_AMP_GET_CTRP_NUM ,
91 AUD_AMP_GET_CTRP_BITS,
92 AUD_AMP_GET_CTRP_TABLE,
93 AUD_AMP_GET_REGISTER,
94 AUD_AMP_SET_REGISTER,
95 AUD_AMP_SET_AMPGAIN, // gain is use for low 24bits as external amp , device should base on control point set to AMPLL_CON0_REG
96 AUD_AMP_GET_AMPGAIN,
97 AUD_AMP_SET_MODE,
98 NUM_AUD_AMP_COMMAND
99};
100
101typedef struct {
102 unsigned long int command;
103 unsigned long int param1;
104 unsigned long int param2;
105}AMP_Control;
106
107enum SPEAKER_CHANNEL
108{
109 Channel_None = 0 ,
110 Channel_Right,
111 Channel_Left,
112 Channel_Stereo
113};
114
115bool Speaker_Init(void);
116bool Speaker_DeInit(void);
117bool Speaker_Register(void);
118int ExternalAmp(void);
119
120void Sound_Speaker_Turnon(int channel);
121void Sound_Speaker_Turnoff(int channel);
122void Sound_Speaker_SetVolLevel(int level);
123
124void Sound_Headset_Turnon(void);
125void Sound_Headset_Turnoff(void);
126
127//now for kernal use
128void AudioAMPDevice_Suspend(void);
129void AudioAMPDevice_Resume(void);
130// used for AEE beep sound
131void AudioAMPDevice_SpeakerLouderOpen(void); //some times kernal need to force speaker for notification
132void AudioAMPDevice_SpeakerLouderClose(void);
133void AudioAMPDevice_mute(void);
134
135
136int Audio_eamp_command(unsigned int type, unsigned long args, unsigned int count);
137
138
139
140
141kal_int32 Sound_ExtFunction(const char* name, void* param, int param_size);
142
143
144#endif
145
146