import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / pixi3_10 / sound / inc / yusu_android_speaker.h
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
89 enum 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
101 typedef struct {
102 unsigned long int command;
103 unsigned long int param1;
104 unsigned long int param2;
105 }AMP_Control;
106
107 enum SPEAKER_CHANNEL
108 {
109 Channel_None = 0 ,
110 Channel_Right,
111 Channel_Left,
112 Channel_Stereo
113 };
114
115 bool Speaker_Init(void);
116 bool Speaker_DeInit(void);
117 bool Speaker_Register(void);
118 int ExternalAmp(void);
119
120 void Sound_Speaker_Turnon(int channel);
121 void Sound_Speaker_Turnoff(int channel);
122 void Sound_Speaker_SetVolLevel(int level);
123
124 void Sound_Headset_Turnon(void);
125 void Sound_Headset_Turnoff(void);
126
127 //now for kernal use
128 void AudioAMPDevice_Suspend(void);
129 void AudioAMPDevice_Resume(void);
130 // used for AEE beep sound
131 void AudioAMPDevice_SpeakerLouderOpen(void); //some times kernal need to force speaker for notification
132 void AudioAMPDevice_SpeakerLouderClose(void);
133 void AudioAMPDevice_mute(void);
134
135
136 int Audio_eamp_command(unsigned int type, unsigned long args, unsigned int count);
137
138
139
140
141 kal_int32 Sound_ExtFunction(const char* name, void* param, int param_size);
142
143
144 #endif
145
146