1 /*******************************************************************************
5 * Yusu_android_speaker.h
17 * ChiPeng Chang (mtk02308)
20 *------------------------------------------------------------------------------
25 * 06 17 2012 weiguo.li
26 * [ALPS00302429] [Need Patch] [Volunteer Patch]modify speaker driver
29 * 12 14 2011 weiguo.li
30 * [ALPS00102848] [Need Patch] [Volunteer Patch] build waring in yusu_android_speaker.h
33 * 11 10 2011 weiguo.li
34 * [ALPS00091610] [Need Patch] [Volunteer Patch]chang yusu_android_speaker.c function name and modules use it
37 * 09 28 2011 weiguo.li
38 * [ALPS00076254] [Need Patch] [Volunteer Patch]LGE audio driver using Voicebuffer for incall
41 * 07 08 2011 weiguo.li
42 * [ALPS00059378] poring lge code to alps(audio)
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.
49 * 07 03 2010 chipeng.chang
50 * [ALPS00002838][Need Patch] [Volunteer Patch] for speech volume step
51 * modify for headset customization.
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>
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>
68 #ifndef _YUSU_ANDROID_SPEAKER_H_
69 #define _YUSU_ANDROID_SPEAKER_H_
71 enum EAMP_CONTROL_SUBCOMMAND
73 EAMP_SPEAKER_CLOSE
=0,
79 EAMP_GETREGISTER_VALUE
,
80 EAMP_SETREGISTER_VALUE
,
89 enum AUDIO_AMP_CONTROL_COMMAND
{
90 AUD_AMP_GET_CTRP_NUM
,
91 AUD_AMP_GET_CTRP_BITS
,
92 AUD_AMP_GET_CTRP_TABLE
,
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
102 unsigned long int command
;
103 unsigned long int param1
;
104 unsigned long int param2
;
115 bool Speaker_Init(void);
116 bool Speaker_DeInit(void);
117 bool Speaker_Register(void);
118 int ExternalAmp(void);
120 void Sound_Speaker_Turnon(int channel
);
121 void Sound_Speaker_Turnoff(int channel
);
122 void Sound_Speaker_SetVolLevel(int level
);
124 void Sound_Headset_Turnon(void);
125 void Sound_Headset_Turnoff(void);
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);
136 int Audio_eamp_command(unsigned int type
, unsigned long args
, unsigned int count
);
141 kal_int32
Sound_ExtFunction(const char* name
, void* param
, int param_size
);