[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/cp/ps/driver/inc/io/audio_api.h b/cp/ps/driver/inc/io/audio_api.h
new file mode 100644
index 0000000..82786b2
--- /dev/null
+++ b/cp/ps/driver/inc/io/audio_api.h
@@ -0,0 +1,365 @@
+/***********************************************************************
+* Copyright (C) 2008, ZTE Corporation.
+*
+* File Name: audio_api.h
+* File Mark:
+* Description: Provide audio module function prototype declaration and type declaration.
+* For no multimedia processor platform.
+* Others:
+* Version: v0.5
+* Author: DangMaochang
+* Date: 2008-06-30
+*
+* History 1:
+* Date:
+* Version:
+* Author:
+* Modification:
+* History 2:
+**********************************************************************/
+
+#ifndef _AUDIO_API_H
+#define _AUDIO_API_H
+
+#include "drvs_io.h"
+#include "drvs_io_voice.h"
+
+/**************************************************************************
+ * Include files *
+ **************************************************************************/
+
+
+/**************************************************************************
+ * Macro *
+ **************************************************************************/
+#define ZDRV_DEV_AUDIO "audio" /*The device name of audio driver.*/
+
+/**************************************************************************
+ * Types *
+ **************************************************************************/
+
+/*Information from driver to upper application.*/
+typedef enum {
+ AUDIO_INFO_FILE_INVALID = 0,
+ AUDIO_INFO_PLAY_END ,
+ AUDIO_INFO_PLAY_ERR ,
+ AUDIO_INFO_REC_END ,
+ AUDIO_INFO_REC_ERR ,
+
+ MAX_AUDIO_INFO
+} T_ZDrvAudio_Info;
+
+/* Audio input channel volum level selection. */
+typedef enum{
+ AUDIO_INPUT_VOL_LEVEL_0 = 0,
+ AUDIO_INPUT_VOL_LEVEL_1,
+ AUDIO_INPUT_VOL_LEVEL_2,
+ AUDIO_INPUT_VOL_LEVEL_3,
+ AUDIO_INPUT_VOL_LEVEL_4,
+ AUDIO_INPUT_VOL_LEVEL_5,
+ AUDIO_INPUT_VOL_LEVEL_6,
+ AUDIO_INPUT_VOL_LEVEL_7,
+ AUDIO_INPUT_VOL_LEVEL_8,
+ AUDIO_INPUT_VOL_LEVEL_9,
+ AUDIO_INPUT_VOL_LEVEL_10,
+ AUDIO_INPUT_VOL_LEVEL_11,
+ MAX_AUDIO_INPUT_VOL_LEVEL
+} T_ZDrvAudio_InputVolLevel;
+
+/* Audio output channel volum level selection. */
+typedef enum{
+ AUDIO_OUTPUT_VOL_LEVEL_0 = 0,
+ AUDIO_OUTPUT_VOL_LEVEL_1,
+ AUDIO_OUTPUT_VOL_LEVEL_2,
+ AUDIO_OUTPUT_VOL_LEVEL_3,
+ AUDIO_OUTPUT_VOL_LEVEL_4,
+ AUDIO_OUTPUT_VOL_LEVEL_5,
+ AUDIO_OUTPUT_VOL_LEVEL_6,
+ AUDIO_OUTPUT_VOL_LEVEL_7,
+ AUDIO_OUTPUT_VOL_LEVEL_8,
+ AUDIO_OUTPUT_VOL_LEVEL_9,
+ AUDIO_OUTPUT_VOL_LEVEL_10,
+ AUDIO_OUTPUT_VOL_LEVEL_11,
+
+ MAX_AUDIO_OUTPUT_VOL_LEVEL
+} T_ZDrvAudio_OutputVolLevel;
+
+/* brief Select the audio data sampling rate for the Stereo DAC.
+ * note: This enumeration defines all of the possible sampling rates currently
+ * supported by the Stereo DAC. One of these sampling rates must be selected
+ * and it must match that of the audio stream or else signal distortion will
+ * occur.
+ */
+typedef enum
+{
+ AUDIO_RATE_8_KHZ, /* Use 8 kHz sampling rate. */
+ AUDIO_RATE_11_025_KHZ, /* Use 11.025 kHz sampling rate. */
+ AUDIO_RATE_12_KHZ, /* Use 12 kHz sampling rate. */
+ AUDIO_RATE_16_KHZ, /* Use 16 kHz sampling rate. */
+ AUDIO_RATE_22_050_KHZ, /* Use 22.050 kHz sampling rate. */
+ AUDIO_RATE_24_KHZ, /* Use 24 kHz sampling rate. */
+ AUDIO_RATE_32_KHZ, /* Use 32 kHz sampling rate. */
+ AUDIO_RATE_44_1_KHZ, /* Use 44.1 kHz sampling rate. */
+ AUDIO_RATE_48_KHZ, /* Use 48 kHz sampling rate. */
+ AUDIO_RATE_64_KHZ, /* Use 64 kHz sampling rate */
+ AUDIO_RATE_96_KHZ, /* Use 96 kHz sampling rate. */
+ MAX_AUDIO_RATE
+ } T_ZDrvAudio_SampleRate;
+
+/* Audio stereoDAC balance left level selection. */
+typedef enum{
+ AUDIO_STEREO_BALANCE_LEVEL_0 = 0,
+ AUDIO_STEREO_BALANCE_LEVEL_1,
+ AUDIO_STEREO_BALANCE_LEVEL_2,
+ AUDIO_STEREO_BALANCE_LEVEL_3,
+ AUDIO_STEREO_BALANCE_LEVEL_4,
+ AUDIO_STEREO_BALANCE_LEVEL_5,
+ AUDIO_STEREO_BALANCE_LEVEL_6,
+ AUDIO_STEREO_BALANCE_LEVEL_7,
+ MAX_AUDIO_STEREO_BALANCE_LEVEL
+} T_ZDrvAudio_BalanceLevel;
+
+/* Audio stereoDAC BANLANCE */
+typedef struct
+{
+ T_ZDrvAudio_BalanceLevel balanceLeft; /* left */
+ T_ZDrvAudio_BalanceLevel balanceright; /* right */
+} T_ZDrvAudio_Banlance;
+
+/* Audio 3DEFFECT */
+typedef struct
+{
+ UINT16 setbass; /*set bass effect*/
+ UINT16 setsurr; /*set surround effect*/
+}T_ZDrvAudio_3DEFFECT;
+
+/* Audio eq mode */
+typedef enum
+{
+ AUDIO_EQMODE_NORMAL=0,
+ AUDIO_EQMODE_CLASSIC,
+ AUDIO_EQMODE_POP,
+ AUDIO_EQMODE_JAZZ,
+ AUDIO_EQMODE_ROCK,
+ MAX_AUDIO_EQMODE
+}T_ZDrvAUDIO_EQMODE;
+
+/* Audio play info */
+typedef struct
+{
+ UINT32 DataLenth; /*Total play datalenth(byte).*/
+
+} T_ZDrvAudio_PlayInfo;
+
+/* Audio buffer info */
+typedef struct
+{
+ VOID *buf; /* Audio buffer pointer */
+ UINT32 buffersize; /* Audio buffer size */
+}T_ZDrvAudio_BufInfo;
+
+#if 0
+typedef enum
+{
+ AUDIO_MONO_CHANNEL,
+ AUDIO_DUAL_CHANNEL
+}T_ZDrvAudio_Channel;
+#endif
+
+/* Audio buffer size */
+typedef struct
+{
+ T_ZDrvAudio_Channel channel;
+ UINT32 buffersize;
+}T_ZDrvAudio_PlayParam;
+
+/**************************************************************************
+ * Global Variable *
+ **************************************************************************/
+
+
+/**************************************************************************
+ * Function Prototypes *
+ **************************************************************************/
+typedef void (*T_ZDrvAudio_CallbackFunc) (T_ZDrvAudio_Info);
+
+/**************************************************************************
+* Function: zDrv_Open
+* Description: This function is used to open device according to device name.
+* Parameters:
+* Input:
+ pathname:device name, ZDRV_DEV_AUDIO in audio
+* flags: no use
+* Output: None
+* Returns:
+* device file descriptor if successed. [1, ZDRV_MAX_DEV_FILE_NUM), please refer to dal_api.h
+* DRV_ERR_NO_THIS_DEVICE: this device hasn't been installed yet
+* DRV_ERR_FD_OVERFLOW: no free fd entry
+* DRV_ERR_NOT_SUPPORTED: this device don't support open operation.
+* DRV_ERR_OPEN_TIMES: has been opened already.
+* others: others error code. for detailed information, please refer to the header file of hal layer
+* Others: None
+**************************************************************************/
+/*SINT32 zDrv_Open (const CHAR *pathname, SINT32 flags)*/
+
+
+/**************************************************************************
+* Function: zDrv_Close
+* Description: This function is used to close a device according to device file descriptor.
+* Parameters:
+* Input:
+* fd :device file descriptor
+* Output:None
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_FD_TABLE: device driver table has been invalid.
+* DRV_ERR_NOT_SUPPORTED: this device don't support close operation.
+* others: others error code. for detailed information, please refer to the header file of hal layer
+* Others: None
+**************************************************************************/
+/*SINT32 zDrv_Close(UINT32 fd)*/
+
+/**************************************************************************
+* Function: zDrv_Write
+* Description: This function is used to write data to a device according to the device file descriptor.
+* Parameters:
+* (IN)
+* fd: device file descriptor
+* buf_len: buffer length
+* buf: pointer to the data to be written
+* (OUT)
+* None
+* Returns:
+* the write byte number of read data if successed
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERR_DEV_CLOSED: has not been opend yet.
+* DRV_ERR_NOT_SUPPORTED: this device don't support read operation.
+* others: for detailed information, please refer to the header file of hal layer
+* Others:
+* None.
+
+**************************************************************************/
+/* SINT32 zDrv_Write(UINT32 fd, VOID *buf, UINT32 buf_len) */
+
+/**************************************************************************
+* Function: zDrv_Ioctl
+* Description: This function is used to control audio device.
+* Parameters:
+* Input:
+* private:device private data
+* cmd:command code
+* param:command parameters
+* Output:None
+* Returns:
+* T_ZDrv_ErrCode
+* others: if errcode<-100 ,please refer to the hal layer errcode file
+
+* Others: cmd-arg
+ 1 CMD:IOCTL_AUDIO_RECORD_START:
+ arg: T_ZDrvRcd_InfoParam*
+ return:
+
+ 2 CMD:IOCTL_AUDIO_RECORD_STOP:
+ arg: void
+ return:
+
+ 3 CMD:IOCTL_AUDIO_SET_RECORD_PATH:
+ arg: T_HalAudio_Block*
+ return:
+
+ 4 CMD:IOCTL_AUDIO_SET_RECORD_VOL:
+ arg: T_HalAudio_Block*
+ return:
+
+ 5 CMD:IOCTL_AUDIO_RECORD_GETDATA:
+ arg: T_ZDrvAudio_BufInfo*
+ return:
+
+ 6 CMD:IOCTL_AUDIO_RCD_FREE_BUFF:
+ arg: VOID
+ return:
+
+ 7 CMD:IOCTL_AUDIO_SET_SAMPLE:
+ arg: T_ZDrvAudio_SampleRate*
+ return:
+
+ 8 CMD:IOCTL_AUDIO_SET_BANLANCE:
+ arg: T_ZDrvAudio_Banlance*
+ return:
+
+ 9 CMD:IOCTL_AUDIO_SET_OUTPUT_PATH:
+ arg: T_ZDrv_AudioOutputPath*
+ return:
+
+ 10 CMD:IOCTL_AUDIO_SET_OUTPUT_VOL:
+ arg: T_ZDrvAudio_OutputVolLevel*
+ return:
+
+ 11 CMD:IOCTL_AUDIO_SET_EQMODE:
+ arg: T_ZDrvAUDIO_EQMODE*
+ return:
+
+ 12 CMD:IOCTL_AUDIO_ENABLE_3DEFFECT:
+ arg: T_ZDrvAudio_3DEFFECT*
+ return:
+
+ 13 CMD:IOCTL_AUDIO_SET_MUTE:
+ arg: BOOL*
+ return:
+
+ 14 CMD:IOCTL_AUDIO_PLAY_START:
+ arg: VOID*;
+ return:
+
+ 15 CMD:IOCTL_AUDIO_PLAY_STOP:
+ arg: VOID*;
+ return:
+
+ 16 CMD:IOCTL_AUDIO_PLAY_PAUSE:
+ arg: VOID*;
+ return:
+
+ 17 CMD:IOCTL_AUDIO_PLAY_RESUME:
+ arg: VOID*;
+ return:
+
+ 18 CMD:IOCTL_AUDIO_GET_PLAY_INFO:
+ arg: T_ZDrvAudio_PlayInfo*
+ return:
+
+ 19 CMD:IOCTL_AUDIO_GET_BUFFER:
+ arg: T_ZDrvAudio_BufInfo*
+ return:
+ 20. CMD :IOCTL_AUDIO_SET_RECORD_SAMPLE:
+ arg: T_ZDrvAudio_SampleRate*
+ return:
+
+ 21 CMD:MAX_IOCTL_AUDIO
+ ERROR CMD INPUT
+
+**************************************************************************/
+/* SINT32 zDrv_Ioctl(UINT32 fd, UINT32 cmd, VOID* arg); */
+
+/**************************************************************************
+* Function: zDrv_Read
+* Description: This function is used to read data from a device according to device file descriptor.
+* Parameters:
+* Input:
+* fd:device file descriptor
+* buf: user buffer pointer
+* buf_len:buffer length
+* Output:
+* buf:pointer to the read data buffer
+* Returns:
+* DRV_SUCCESS:success to read data
+* DRV_ERR_NOT_OPENED:device is not openned before
+* DRV_ERROR:fail to read data
+* DRV_ERR_INVALID_PARAM: invalid paraments.
+* Others: None
+
+**************************************************************************/
+/*SINT32 zDrv_Read(UINT32 fd, VOID *buf, UINT32 buf_len)*/
+
+
+#endif /* _AUDIO_API_H */
diff --git a/cp/ps/driver/inc/io/drvs_io.h b/cp/ps/driver/inc/io/drvs_io.h
new file mode 100644
index 0000000..32b35cb
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io.h
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name:
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: geanfeng
+ * Date: 2013-09-25
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IO_H_
+#define _DRVS_IO_H_
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_io_keys.h"
+#include "drvs_io_names.h"
+
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define ZDRVIO_INVALID_HANDLE NULL
+
+
+/****************************************************************************
+* Types
+****************************************************************************/
+/*IO handle*/
+typedef void * T_ZDrvIO_Handle;
+
+/*Open Flags*/
+typedef struct _T_ZDRVIO_FLAGS
+{
+ UINT32 READ:1;
+ UINT32 WRITE:1;
+ UINT32 MULTI_READ:1;
+ UINT32 MULTI_WRITE:1;
+ UINT32 SHARED:1;
+ UINT32 RESERVE:27;
+}
+T_ZDRVIO_FLAGS;
+
+
+/*Global Notify Handle*/
+typedef VOID * T_ZDrvIO_GNotifyHandle;
+
+
+/*Global Notify Callback Function*/
+typedef VOID (*T_ZDrvIO_GNotifyCallBack)(const char* devName, T_DRVIO_EVENT event);
+
+/****************************************************************************
+* Constants
+****************************************************************************/
+
+/****************************************************************************
+* Global Variables
+****************************************************************************/
+
+/****************************************************************************
+* Function Prototypes
+****************************************************************************/
+/*******************************************************************************
+ * Function: zDrvIO_Open
+ * Description:search device by device name, open it, and set the action flags.
+ * Input:
+ name: device name.
+ flags: open flags, control the device action.
+ * Output:None
+ *
+ * Returns:
+ T_ZDrvIO_Handle: the opened device handle. if error happened, return NULL.
+ * Others:
+ ********************************************************************************/
+T_ZDrvIO_Handle zDrvIO_Open(const char *name, T_ZDRVIO_FLAGS flags);
+/*******************************************************************************
+ * Function: zDrvIO_Read
+ * Description:read data from device.
+ * Input:
+ handle:the device handle for read.
+ buffer: the read data buffer. the buffer space supplied by high layer.
+ length:the data length need to read.
+ * Output:None
+ *
+ * Returns:
+ ret >= 0: return the actual read length.
+ DRV_ERROR_NOCONNECT: the device disconnect event happend, need return error to inform higher user.
+ other: other error maked by device.
+ * Others:
+ ********************************************************************************/
+SINT32 zDrvIO_Read(T_ZDrvIO_Handle handle, UINT8* buffer, UINT32 length);
+/*******************************************************************************
+ * Function: zDrvIO_Write
+ * Description:write data to IO handle
+ * Input:
+ handle:the device handle for write.
+ buffer: the write data buffer. the buffer space supplied by high layer.
+ length:the write data length.
+* Output:None
+ *
+ * Returns:
+ ret >= 0: return the actual write length.
+ DRV_ERROR_NOCONNECT: the device disconnect event happend, need return error to inform higher user.
+ other: other error maked by device.
+ * Others:
+ ********************************************************************************/
+SINT32 zDrvIO_Write(T_ZDrvIO_Handle handle, UINT8* buffer, UINT32 length);
+/*******************************************************************************
+ * Function: zDrvIO_BRead
+ * Description:read data from device.
+ * Input:
+ handle:the device handle for read.
+ buffer: the read data buffer. the buffer space supplied by high layer.
+ length:the data length need to read.
+ pos:the read data position in device storage space.
+ * Output:None
+ *
+ * Returns:
+ ret >= 0: return the actual read length.
+ DRV_ERROR_NOCONNECT: the device disconnect event happend, need return error to inform higher user.
+ other: other error maked by device.
+ * Others:
+ ********************************************************************************/
+SINT32 zDrvIO_BRead(T_ZDrvIO_Handle handle, UINT8* buffer, UINT32 blkCnt, UINT32 pos);
+/*******************************************************************************
+ * Function: zDrvIO_BWrite
+ * Description:write data to IO handle
+ * Input:
+ handle:the device handle for write.
+ buffer: the write data buffer. the buffer space supplied by high layer.
+ length:the write data length.
+ pos:the write data position in device storage space.
+* Output:None
+ *
+ * Returns:
+ ret >= 0: return the actual write length.
+ DRV_ERROR_NOCONNECT: the device disconnect event happend, need return error to inform higher user.
+ other: other error maked by device.
+ * Others:
+ ********************************************************************************/
+SINT32 zDrvIO_BWrite(T_ZDrvIO_Handle handle, UINT8* buffer, UINT32 blkCnt, UINT32 pos);
+/*******************************************************************************
+ * Function: zDrvIO_Ctrl
+ * Description:control device.
+ * Input:
+ handle:the device handle for control.
+ function:the control function.
+ handle:the control function arguments.
+* Output:None
+ *
+ * Returns:
+ DRV_SUCCESS: success.
+ DRV_ERROR: error.
+ * Others:
+ ********************************************************************************/
+SINT32 zDrvIO_Ctrl(T_ZDrvIO_Handle handle, T_DRVIO_CTRL_KEY function, VOID *arg);
+/*******************************************************************************
+ * Function: zDrvIO_Close
+ * Description:close the device
+ * Input:
+ handle:the device handle to be closed.
+ * Output:None
+ *
+ * Returns:
+ DRV_SUCCESS: success.
+ DRV_ERROR: error.
+ * Others:
+ ********************************************************************************/
+SINT32 zDrvIO_Close(T_ZDrvIO_Handle handle);
+
+/*******************************************************************************
+ * Function: zDrvIO_RegisterGlobalNotify
+ * Description: register global notifier.
+ * Input:
+ * globalNotifyFn: global noitifier callback function
+ * Output:None
+ *
+ * Returns:
+ * T_ZDrvIO_GNotifyHandle : the global notifier handler.
+ * Others:
+ ********************************************************************************/
+T_ZDrvIO_GNotifyHandle zDrvIO_RegisterGlobalNotify(T_ZDrvIO_GNotifyCallBack globalNotifyFn);
+/*******************************************************************************
+ * Function: zDrvIO_UnregisterGlobalNotify
+ * Description: unregister global notifier.
+ * Input:
+ * gNotifyHandle: the global notifier handler
+ * Output:None
+ *
+ * Returns:
+ *
+ * Others:
+ ********************************************************************************/
+VOID zDrvIO_UnregisterGlobalNotify(T_ZDrvIO_GNotifyHandle gNotifyHandle);
+
+
+#endif/*_DRVS_IO_H_*/
+
diff --git a/cp/ps/driver/inc/io/drvs_io_charger.h b/cp/ps/driver/inc/io/drvs_io_charger.h
new file mode 100644
index 0000000..d34be61
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_charger.h
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name: drvs_io_led.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: yuxiang
+ * Date: 2014-07-03
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IO_CHG_H
+#define _DRVS_IO_CHG_H
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_io.h"
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define ZDRV_DEV_CHG "charger"
+
+/****************************************************************************
+* Types
+****************************************************************************/
+typedef enum
+{
+ CHG_STATE_CALLBACK_AC_IN,
+ CHG_STATE_CALLBACK_AC_OUT,
+ CHG_STATE_CALLBACK_USB_IN,
+ CHG_STATE_CALLBACK_USB_OUT,
+ CHG_STATE_CALLBACK_START,
+ CHG_STATE_CALLBACK_STOP,
+ CHG_STATE_CALLBACK_FINISH,
+ CHG_STATE_CALLBACK_LOAD_IN,
+ CHG_STATE_CALLBACK_LOAD_OUT,
+ CHG_STATE_CALLBACK_ABNORMAL,
+ CHG_STATE_CALLBACK_LOW_VOL_DETECT,
+ CHG_STATE_CALLBACK_OVER_TEMP_PROTECT,
+
+ CHG_STATE_CALLBACK_MAX
+}T_ZDrvChg_CallbackState;
+
+/*the message that should send to dm*/
+ typedef enum
+ {
+ STATE_CHARGING, /*charge start msg*/
+ STATE_DISCHARGING, /*charge stop msg*/
+ STATE_FINISH, /*charge stop msg*/
+ STATE_TEMP_ABORT,
+ STATE_TEMP_ERROR,
+ STATE_ERROR,
+
+ STATE_MAX
+
+} T_ZDrvChg_Status;
+
+ typedef enum
+ {
+ DISCHG_STATUS_ON = 0,
+ DISCHG_STATUS_OFF,
+ DISCHG_STATUS_MAX
+ }T_ZDrvChg_DisChgStatus;
+
+ typedef enum
+ {
+ USB_STATUS_IN = 0,
+ USB_STATUS_OUT,
+ USB_STATUS_MAX
+ }T_ZDrvChg_UsbStatus;
+
+
+ typedef enum
+ {
+ CHG_TYPE_NOTHING,
+ CHG_TYPE_COMPUTER,
+ CHG_TYPE_CHARGER,
+
+ CHG_TYPE_MAX
+} T_ZDrvChg_ChgType;
+
+/*temperature detect*/
+typedef enum
+{
+ CHG_TEMP_DETECT_SUPER_LOW,
+ CHG_TEMP_DETECT_LOW,
+ CHG_TEMP_DETECT_NORMAL,
+ CHG_TEMP_DETECT_HIGH,
+ CHG_TEMP_DETECT_HIGH_55,
+ CHG_TEMP_DETECT_SUPER_HIGH,
+
+ CHG_TEMP_DETECT_MAX
+}T_ZDrvChg_TempDetect;
+
+typedef enum
+{
+ CHG_SWTICH_CHG_OFF,
+ CHG_SWTICH_CHG_ON,
+
+ CHG_SWTICH_CHG_MAX
+}T_ZDrvChg_ChgSwitch;
+
+typedef enum
+{
+ CHG_SWTICH_DISCHG_OFF,
+ CHG_SWTICH_DISCHG_ON,
+
+ CHG_SWTICH_DISCHG_MAX
+}T_ZDrvChg_DisChgSwitch;
+
+typedef enum
+{
+ CHG_OTG_STATE_OFF,
+ CHG_OTG_STATE_ON,
+
+ CHG_OTG_STATE_MAX
+}T_ZDrvChg_OTGState;
+
+typedef enum
+{
+ CHG_SHIPPINGMODE_OFF,
+ CHG_SHIPPINGMODE_ON,
+
+ CHG_SHIPPINGMODE_MAX
+}T_ZDrvChg_ShippingMode;
+
+
+typedef enum
+{
+ CHG_ERROR_DPM_STATE = 1<<11,
+ CHG_ERROR_POWER_BAD = 1<<10, /*the diff*/
+ CHG_ERROR_VSYS_MINI = 1<<8,
+ CHG_ERROR_TERM_STATE = 1<<9,
+ CHG_ERROR_WACHDOG_FAULT = 1<<7,
+ CHG_ERROR_OTG_FAULT = 1<<6,
+ CHG_ERROR_CHRG_OVP = 1<<5,
+ CHG_ERROR_CHRG_TIMEOUT = 1<<4,
+ CHG_ERROR_BAT_FAULT = 1<<3,
+ CHG_ERROR_NTC_COLD = 1<<1,
+ CHG_ERROR_NTC_HOT = 1<<0,
+ CHG_ERROR_STATE_CONFLIT = 1<<15,
+
+
+ CHG_ERROR_MAX = 1<<16,
+}T_ZDrvChg_ErrorCode;
+
+
+typedef enum
+{
+ CHG_QUICK_START_OFF,
+ CHG_QUICK_START_ON,
+
+ CHG_QUICK_START_MAX
+}T_ZDrvChg_QucikStartFlag;
+
+typedef enum
+{
+ CHG_NOT_STOP,
+ CHG_COMPLETE,
+ AC_NOT_EXIST,
+ CHG_TEMP_OVERFLOW,
+ CHG_OTHER_REASON
+}T_ZDrvChg_StopReason;
+/*charge stop reason*/
+
+
+typedef void(*T_ZDrvCHG_CALLBACK)(T_ZDrvChg_CallbackState); /*the send msg callback function */
+
+
+#endif/*_DRVS_IO_LED_H*/
+
diff --git a/cp/ps/driver/inc/io/drvs_io_dev.h b/cp/ps/driver/inc/io/drvs_io_dev.h
new file mode 100644
index 0000000..c59e20c
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_dev.h
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name:
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: geanfeng
+ * Date: 2013-09-25
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IODEV_H_
+#define _DRVS_IODEV_H_
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_general.h"
+#include "drvs_io.h"
+
+/****************************************************************************
+* Macros
+****************************************************************************/
+
+
+/****************************************************************************
+* Types
+****************************************************************************/
+/*µ×²ãÉ豸¾ä±ú*/
+typedef void * T_ZDrvIODev_Handle;
+
+
+/*É豸Çý¶¯¹Ò½ÓʵÏÖ½Ó¿Ú*/
+typedef struct _T_ZDrvIODev_Ops
+{
+ SINT32 (*open)(VOID *devData, T_ZDRVIO_FLAGS flags);
+ SINT32 (*read)(VOID *devData, VOID *buffer, UINT32 length);
+ SINT32 (*write)(VOID *devData, const VOID *buffer, UINT32 length);
+ SINT32 (*bread)(VOID *devData, VOID *buffer, UINT32 blkCnt, UINT32 pos);
+ SINT32 (*bwrite)(VOID *devData, const VOID *buffer, UINT32 blkCnt, UINT32 pos);
+ SINT32 (*ctrl)(VOID *devData, T_DRVIO_CTRL_KEY function, VOID* arg);
+ SINT32 (*close)(VOID *devData);
+}
+T_ZDrvIODev_Ops;
+
+
+/****************************************************************************
+* Constants
+****************************************************************************/
+
+/****************************************************************************
+* Global Variables
+****************************************************************************/
+
+/****************************************************************************
+* Function Prototypes
+****************************************************************************/
+
+/*******************************************************************************
+ * Function: zDrvIODev_Connect
+ * Description:install and connect io device to device table.
+ * Input:
+ name: the device name to connect.
+ devData: the device private data to be combined.
+ ops: the device I/O operation.
+ * Output:None
+ *
+ * Returns:
+ T_ZDrvIODev_Handle: none zero.
+ NULL: error.
+ * Others:
+ ********************************************************************************/
+T_ZDrvIODev_Handle zDrvIODev_Connect(const char *name, VOID *devData, T_ZDrvIODev_Ops *ops);
+
+/*******************************************************************************
+ * Function: zDrvIODev_Disconnect
+ * Description:uninstall the io device.
+ * Input:
+ handle: the device handle to disconnect.
+ * Output:None
+ *
+ * Returns:
+ NULL: error.
+ * Others:
+ ********************************************************************************/
+VOID zDrvIODev_Disconnect(T_ZDrvIODev_Handle handle);
+
+/*******************************************************************************
+ * Function: zDrvIODev_Show
+ * Description:show the device debug information.
+ * Input:
+ * Output:None
+ *
+ * Returns:None
+ * Others:
+ ********************************************************************************/
+VOID zDrvIODev_Show(VOID);
+
+/*******************************************************************************
+ * Function: zDrvIODev_Initiate
+ * Description:initialize the io base structure.
+ * Input:
+ * Output:None
+ *
+ * Returns:
+ DRV_SUCCESS: success.
+ DRV_ERROR: error.
+ * Others:
+ ********************************************************************************/
+SINT32 zDrvIODev_Initiate(VOID);
+
+
+
+
+#endif/*_DRVS_IO_H_*/
+
diff --git a/cp/ps/driver/inc/io/drvs_io_flashlight.h b/cp/ps/driver/inc/io/drvs_io_flashlight.h
new file mode 100644
index 0000000..6cdfc30
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_flashlight.h
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name: drvs_io_flashlight.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: liuyi
+ * Date: 2016-09-03
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IO_FLASHLIGHT_H
+#define _DRVS_IO_FLASHLIGHT_H
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_io.h"
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define ZDRV_DEV_FLASHLIGHT "flashlight"
+/****************************************************************************
+* Types
+****************************************************************************/
+
+
+/* */
+typedef enum
+{
+ FLASHLIGHT_DISABLE,
+ FLASHLIGHT_ENABLE,
+
+ MAX_FLASHLIGHT_ENABLE
+}
+T_ZDrvFlashlight_Enable;
+
+typedef enum
+{
+ FLASHLIGHT_STATE_OFF,
+ FLASHLIGHT_STATE_ON,
+
+ MAX_FLASHLIGHT_STATE
+}
+T_ZDrvFlashlight_State;
+
+
+
+#endif/*_DRVS_IO_FLASHLIGHT_H*/
+
diff --git a/cp/ps/driver/inc/io/drvs_io_fm.h b/cp/ps/driver/inc/io/drvs_io_fm.h
new file mode 100644
index 0000000..3684b81
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_fm.h
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name: drvs_io_fm.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: liuyi
+ * Date: 2016-09-03
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IO_FM_H
+#define _DRVS_IO_FM_H
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_io.h"
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define ZDRV_DEV_FM "fm"
+/****************************************************************************
+* Types
+****************************************************************************/
+
+
+/* stereo or mono */
+typedef enum
+{
+ MODE_STEREO,
+ MODE_MONO,
+
+ MAX_MODE
+}
+T_ZDrvFm_StereoMode;
+
+typedef struct
+{
+ SINT32 direction;
+ UINT32 ret_freq;
+}
+T_ZDrvFm_SeekInfo;
+
+
+
+/*IOCTL¿ØÖƲÙ×÷´«µÝ²ÎÊýÀàÐÍ*/
+typedef struct
+{
+ T_ZDrvFm_StereoMode TimeDate;
+ T_ZDrvFm_SeekInfo mode;
+}T_ZDrvfm_Descriptor;
+
+
+
+
+#endif/*_DRVS_IO_FM_H*/
+
diff --git a/cp/ps/driver/inc/io/drvs_io_keys.h b/cp/ps/driver/inc/io/drvs_io_keys.h
new file mode 100644
index 0000000..ef1a438
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_keys.h
@@ -0,0 +1,370 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name: drvs_iokeys.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: geanfeng
+ * Date: 2014-02-11
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IOKEYS_H
+#define _DRVS_IOKEYS_H
+
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define IOKEYS(x) (1)
+/****************************************************************************
+* Types
+****************************************************************************/
+/*IO CTRL Function KEY*/
+typedef enum _T_DRVIO_CTRL_KEY
+{
+// for io dal layer use
+ IOCTL_IODEV_REGISTER_NOTIFY = 2,
+ IOCTL_IODEV_GET_DEV_STATUS,
+ IOCTL_IODEV_WAIT_CONNECT,
+ IOCTL_IODEV_DISALLOW_DISCONNECT,
+ IOCTL_IODEV_ALLOW_DISCONNECT,
+ IOCTL_IODEV_VENDOR = 31,
+//end
+
+ /*ÒÔÏ¿ØÖÆ×ÖÔÚÉ豸Á¬½Óºó²ÅÓÐЧ*/
+
+// for common io device
+
+ IOCTL_IODEV_SET_BLOCKTIME = 0x1000,
+
+// for block device function
+
+ IOCTL_BLKDEV_GET_INFO=0x2000,
+ IOCTL_BLKDEV_EREASE,
+ IOCTL_BLKDEV_GET_STATE,
+
+// for serial device function
+
+ IOCTL_SERIAL_SET_CONFIG=0x3000,
+ IOCTL_SERIAL_UART_SET_CTSRTS,
+ IOCTL_SERIAL_UART_SET_CONFIG,
+
+// for virtual com port
+
+ IOCTL_VCOM_GET_USB_STATUS=0x4000,
+ IOCTL_VCOM_OPEN_ECHO,
+ IOCTL_VCOM_CLOSE_ECHO,
+
+
+// for virtual NIC(Netword Interface Card)
+
+ IOCTL_VNIC_CONNECT=0x5000,
+ IOCTL_VNIC_DISCONNECT,
+
+ IOCTL_VNIC_REG_CBK_XFER_STATISTICS,
+ IOCTL_VNIC_FREE_UNREAD_BUF,
+ IOCTL_VNIC_REG_CBK_NIC_DISABLE,
+ IOCTL_VNIC_GET_USB_STATUS,
+ IOCTL_VNIC_REG_CBK_NIC_ENABLE,
+ IOCTL_VNIC_GET_VNIC_STATE,
+ IOCTL_VNIC_SET_ECM_TPYE,
+ IOCTL_VNIC_SET_NET_DEV,
+
+// for io voice
+
+ IOCTL_VOICE_SET_SAMPLE = 0x6000, /*Set sample.param:T_ZDrvVoice_Sample*/
+ IOCTL_VOICE_SET_INPUT_PATH, /*Set input path. param:T_ZDrv_VoiceInputPath*/
+ IOCTL_VOICE_SET_OUTPUT_PATH, /*Set output path. param:T_ZDrv_VoiceOutputPath*/
+ IOCTL_VOICE_SET_INPUT_VOL, /*Set input volume. param:T_ZDrvVoice_InputVolLevel*/
+ IOCTL_VOICE_SET_OUTPUT_VOL, /*Set output volume. param:T_ZDrvVoice_OutputVolLevel*/
+ IOCTL_VOICE_ENABLE, /*enable voice channel.param:none*/
+ IOCTL_VOICE_DISABLE, /*disable voice channel.param:none*/
+
+ IOCTL_VOICE_SET_VT_START, /*Start voice for VideoTelephone. param:T_ZDrvVoice_AmrInfoPtr*/
+ IOCTL_VOICE_SET_VT_STOP, /*Stop voice for VideoTelephone. param:NULL*/
+ IOCTL_VOICE_SET_MUTE, /*Set voice mute or not. param:T_ZDrvVoice_MuteInfo*/
+ IOCTL_VOICE_RECORD_START, /*record start.param:T_ZDrvRcd_InfoParam*/
+ IOCTL_VOICE_RECORD_STOP, /*record stop.param:none*/
+ IOCTL_VOICE_RECORD_DATA_READ, /*read record data. param:T_ZDrvVoice_BufInfo*/
+ IOCTL_VOICE_TEST_LOOPBACK, /*Set voice loop or not. param:T_ZDrvVoice_Switch*/
+ IOCTL_VOICE_RCD_FREE_BUFF, /*free record buffer. param:VOID*/
+
+ IOCTL_VOICE_CONFIG_PARAM, /*config volte param .param:T_ZDrvVp_Cfg, for volte*/
+ IOCTL_VOICE_READ_START, /* volte read start .param:VOID, for volte*/
+ IOCTL_VOICE_READ_STOP, /* volte read stop .param:VOID, for volte*/
+ IOCTL_VOICE_WRITE_START, /* volte write start .param:VOID, for volte*/
+ IOCTL_VOICE_WRITE_STOP, /* volte write stop .param:VOID, for volte*/
+ IOCTL_VOICE_MODE_CONFIG,
+
+// for audio
+ IOCTL_AUDIO_RECORD_START, /* start record,param:T_ZDrvRcd_InfoParam */
+ IOCTL_AUDIO_RECORD_STOP, /* stop record,param:none */
+ IOCTL_AUDIO_SET_RECORD_PATH, /* set record input path,param:T_ZDrv_CodecInputPath */
+ IOCTL_AUDIO_SET_RECORD_VOL, /* set record volum,param:T_ZDrvAudio_InputVolLevel */
+ IOCTL_AUDIO_RCD_FREE_BUFF, /* free record buffer,param:VOID * */
+ IOCTL_AUDIO_SET_RECORD_SAMPLE, /* Set audio codec config for RECORD, SAMPLE param:T_ZDrvAudio_SampleRate */
+ IOCTL_AUDIO_SET_SAMPLE, /* Set audio codec config for PLAY, SAMPLE param:T_ZDrvAudio_SampleRate */
+ IOCTL_AUDIO_SET_BANLANCE, /* set balance,param:T_ZDrvAudio_Banlance */
+ IOCTL_AUDIO_SET_OUTPUT_PATH, /* Set OUTPUT path for play ,param:T_ZDrv_AudioOutputPath */
+ IOCTL_AUDIO_SET_OUTPUT_VOL, /* Set OUTPUT volume for play ,param:T_ZDrvAudio_OutputVolLevel */
+ IOCTL_AUDIO_SET_EQMODE, /* set EQmode,param:T_ZDrvAUDIO_EQMODE */
+ IOCTL_AUDIO_ENABLE_3DEFFECT, /* set 3deffect,param:T_ZDrvAudio_3DEFFECT */
+ IOCTL_AUDIO_SET_MUTE, /* set mute,param:BOOL */
+ IOCTL_AUDIO_PLAY_START, /* start audio play ,param:T_ZDrvAudio_PlayParam */
+ IOCTL_AUDIO_PLAY_STOP, /* stop audio play,param:none */
+ IOCTL_AUDIO_PLAY_PAUSE, /* pause audio play,param:none */
+ IOCTL_AUDIO_PLAY_RESUME, /* resume audio play ,param:none */
+ IOCTL_AUDIO_GET_PLAY_INFO, /* get the audio play info ,param:T_ZDrvAudio_PlayInfo */
+ IOCTL_AUDIO_GET_BUFFER, /* get the audio buffer ,param:T_ZDrvAudio_BufInfo */
+ IOCTL_AUDIO_SET_CALLBACK, /* set audio callback func,param:T_ZDrvAudio_CallbackFunc */
+
+//for earpiece
+ IOCTL_EARP_SET_CALLBACK , /*Set callback function, it is used to register the callback function which will send the earpiece switch status to user.*/
+ IOCTL_EARP_GET_PLUG_STATUS , /*Get earpiece plug status, replace the read function.*/
+ IOCTL_EARP_SET_HOOK_ENABLE,
+ IOCTL_EARP_SET_HOOK_DISABLE,
+
+// for io led
+ IOCTL_LED_WAN = 0x7000,
+ IOCTL_LED_LAN,
+ IOCTL_LED_SMS,
+ IOCTL_LED_BATTERY,
+ IOCTL_LED_TRAFFIC,
+ IOCTL_LED_SLEEP,
+ IOCTL_LED_LEFT_1,
+ IOCTL_LED_LEFT_2,
+ IOCTL_LED_LEFT_3,
+ IOCTL_LED_LEFT_4,
+ IOCTL_LED_1_2_ON,
+ IOCTL_LED_1_2_3_ON,
+ IOCTL_LED_ALL_ON,
+ IOCTL_LED_ALL_OFF,
+ IOCTL_LED_CTRL_MOD,
+ IOCTL_LED_LGP,
+
+// for rtc
+ IOCTL_PMIC_RTC_SET_TIME = 0x8000,
+ IOCTL_PMIC_RTC_GET_TIME,
+ IOCTL_PMIC_RTC_SET_ALARM,
+ IOCTL_PMIC_RTC_GET_ALARM,
+ IOCTL_PMIC_RTC_ENABLE_ALARM,
+ IOCTL_PMIC_RTC_ENABLE_CYCLE,
+ IOCTL_PMIC_RTC_REGIS_CYCLE_NOTIFY,
+ IOCTL_PMIC_RTC_REGIS_ALARM_NOTIFY,
+ IOCTL_PMIC_RTC_ENABLE_TIMER, //Éètimerʱ¼ä, 0¹Ø±Õ
+ IOCTL_PMIC_RTC_REGIS_TIMER_NOTIFY, //Éètimerʱ¼ä»Øµ÷º¯Êý
+ IOCTL_PMIC_RTC_GET_TIMER_REMAIN, //»ñÈ¡timerÊ£Óàʱ¼ä
+ IOCTL_PMIC_RTC_CYCLE_INT_SEL,
+
+
+//for charger
+ IOCTL_CHARGER_SET_CALLBACK = 0x9000,
+ IOCTL_CHARGER_GET_VOLTAGE,
+ IOCTL_CHARGER_GET_CHG_STATUS,
+ IOCTL_CHARGER_GET_DISCHG_STATUS,
+ IOCTL_CHARGER_TEMP_DETECT,
+ IOCTL_CHARGER_CHG_SWITCH,
+ IOCTL_CHARGER_DISCHG_SWITCH,
+ IOCTL_CHARGER_QUICK_START_FLAG,
+ IOCTL_CHARGER_GET_CHGTYPE,
+ IOCTL_CHARGER_BOOST_ON,
+ IOCTL_CHARGER_RELEASE_BUTTON,
+ IOCTL_CHARGER_GET_ELECQUAN,
+ IOCTL_CHARGER_DEBUG,
+
+
+ IOCTL_CHARGER_SET_OTG,
+ IOCTL_CHARGER_SET_SHIPPING_MODE,
+ IOCTL_CHARGER_GET_ERROR_CODE,
+ IOCTL_CHARGER_SET_STOP_CURRENT,
+ IOCTL_CHARGER_GET_STOP_REASON,
+ IOCTL_CHARGER_GET_USB_STATUS,
+
+//for LCD
+ IOCTL_LCD_UPDATE = 0xA000,
+ IOCTL_LCD_SLEEP,
+ IOCTL_LCD_BACKLIGHT,
+ IOCTL_LCD_BRIGHTNESS,
+ IOCTL_LCD_GET_INFO,
+ IOCTL_LCD_VOU_WBUPDATE,
+//for spi
+ IOCTL_SSP_SET_XFER_WIDTH,
+ IOCTL_SSP_SET_CHG_FREQ,
+ IOCTL_SSP_SET_MSMODE,
+ IOCTL_SSP_SET_TXTHES,
+ IOCTL_SSP_SET_RXTHES,
+
+//for FM
+ IOCTL_FM_SET_OUTPATH = 0xB000,
+ IOCTL_FM_SET_VOL,
+ IOCTL_FM_SET_SOUNDMODE,
+ IOCTL_FM_SET_FREQ,
+ IOCTL_FM_SET_SCANNEXT,
+ IOCTL_FM_GET_CURFREQ,
+ IOCTL_FM_GET_CURVOL,
+
+//for VIB
+ IOCTL_VIB_ENABLE = 0xC000,
+ IOCTL_VIB_CHECKSTA,
+
+/* for Keypad */
+ IOCTL_KPD_SET_BLG_ON = 0xD000,
+ IOCTL_KPD_SET_BLG_OFF,
+ IOCTL_KPD_SET_BLG_BRIGHTNESS,
+ IOCTL_KPD_GET_BLG_STATUS,
+ IOCTL_KPD_GET_KEYS_STATUS,
+ IOCTL_KPD_GET_HEADPHONE_STATE,
+
+//for FLASHLIGHT
+ IOCTL_FLASHLIGHT_ENABLE = 0xF000,
+ IOCTL_FLASHLIGHT_CHECKSTA,
+//for CAMERA
+ IOCTL_CAM_SENSOR_GET_INFO = 0x10000,
+ IOCTL_CAM_SENSOR_SELECT,
+ IOCTL_CAM_SET_ZOOM,
+ IOCTL_CAM_SET_IMG_SIZE,
+ IOCTL_CAM_SET_EFFECT,
+ IOCTL_CAM_SET_MIRRORFLIP,
+ IOCTL_CAM_SET_BRIGHTNESS,
+ IOCTL_CAM_SET_CONTRAST,
+ IOCTL_CAM_SET_SATURATION,
+ IOCTL_CAM_SET_WHITE_BALANCE,
+ IOCTL_CAM_SET_LIGHTMODE,
+ IOCTL_CAM_SET_NIGHTMODE,
+ IOCTL_CAM_SET_FRAMERATE,
+ IOCTL_CAM_GET_ONEFRAME,
+ IOCTL_CAM_FREE_FRAME_BUFFER,
+// IOCTL_CAM_SET_EXPOSURE_COMPENSATION,
+ IOCTL_CAM_SET_ANTIFLICKER,
+ IOCTL_CAM_START,
+ IOCTL_CAM_STOP,
+ IOCTL_UNDEFINE=0x7FFFFFFF
+
+} T_DRVIO_CTRL_KEY;
+
+//===================IO DEV===============
+
+#if IOKEYS(IOCTL_VNIC_GET_VNIC_STATE)
+/*VNIC State*/
+typedef enum _T_DRVIO_VNIC_STATE
+{
+ DRVIO_VNIC_DISABLE = 0x0, //½ûÓÃ״̬
+ DRVIO_VNIC_READY = 0x1, //δÁ¬½Ó£¬¿É²¦ºÅ
+ DRVIO_VNIC_CONNECT = 0x2, //ÒÑÁ¬½Ó
+ DRVIO_VNIC_ERR = 0xff, //Ò쳣״̬
+}
+T_DRVIO_VNIC_STATE;
+#endif
+
+#if IOKEYS(IOCTL_IODEV_GET_DEV_STATUS)
+/*Device Status*/
+typedef struct _T_DRVIO_DEV_STATUS
+{
+ UINT32 CONNECT: 1;
+ UINT32 reserved:31;
+}
+T_DRVIO_DEV_STATUS;
+#endif
+
+#if IOKEYS(IOCTL_IODEV_REGISTER_NOTIFY)
+/*Global Event*/
+typedef enum _T_DRVIO_EVENT
+{
+ DRVIO_EV_CONNECT = 2,
+ DRVIO_EV_PRE_DISCONNECT,
+ DRVIO_EV_DISCONNECT,
+} T_DRVIO_EVENT;
+
+/*Device Notify*/
+typedef struct _T_ZDrvIO_DevNotify
+{
+ VOID ( *notify_fn )(VOID *privData, T_DRVIO_EVENT event);
+ VOID *privData;
+}
+T_ZDrvIO_DevNotify;
+#endif
+
+//===================block device===============
+
+#if IOKEYS(IOCTL_BLKDEV_GET_INFO)
+typedef struct _T_BlkDev_Info
+{
+ UINT32 blkSize;
+ UINT32 blkCnt;
+}T_BlkDev_Info;
+#endif
+
+
+#if IOKEYS(IOCTL_BLKDEV_EREASE)
+typedef struct _T_BlkDev_EraseInfo
+{
+ UINT32 startBlk;
+ UINT32 blkCnt;
+}T_BlkDev_EraseInfo;
+#endif
+
+
+#if IOKEYS(IOCTL_SERIAL_SET_CONFIG)
+typedef struct _T_UartDev_ConfigInfo
+{
+ UINT8 dataBits;
+ UINT8 stopBits;
+ UINT8 parity;
+ UINT32 baudrate;
+}T_UartDev_ConfigInfo;
+#endif
+
+
+
+typedef union
+{
+ UINT8 nodeInBytes[8];
+ struct
+ {
+ UINT8* pNodeBuf;
+ UINT32 uiNodeBufLen;
+ }
+ node;
+}
+T_ZDrv_BufNode;
+
+typedef T_ZDrv_BufNode T_ZDrvVcom_BufNode;
+
+typedef unsigned long long UINT64;
+
+#if IOKEYS(IOCTL_VNIC_REG_CBK_XFER_STATISTICS)
+typedef struct _T_ZDrvVnic_XferStatistics
+{
+ UINT64 TxOkCnt;
+ UINT64 RxOkCnt;
+ UINT64 TxErrCnt;
+ UINT64 RxErrCnt;
+ UINT64 TxOverFlowCnt;
+ UINT64 RxOverFlowCnt;
+}
+T_ZDrvVnic_XferStatistics;
+
+typedef T_ZDrvVnic_XferStatistics* (* VnicCbk_XferStatistics) (VOID);
+#endif
+
+
+#if IOKEYS(IOCTL_VNIC_REG_CBK_NIC_DISABLE)
+typedef VOID (* VnicCbk_Disable) (VOID*privData);
+#endif
+
+
+#if IOKEYS(IOCTL_VNIC_REG_CBK_NIC_ENABLE)
+typedef VOID (* VnicCbk_Enable) (VOID*privData);
+#endif
+
+//typedef UINT32 (* VnicCbk_GetSpeed) (VOID);
+
+#endif/*_DRVS_IOKEYS_H*/
+
diff --git a/cp/ps/driver/inc/io/drvs_io_kpd.h b/cp/ps/driver/inc/io/drvs_io_kpd.h
new file mode 100644
index 0000000..a711853
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_kpd.h
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (C) 2014, ZTE Corporation.
+ *
+ * File Name: drvs_io_kpd.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: yuxiang
+ * Date: 2014-07-11
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IO_KPD_H
+#define _DRVS_IO_KPD_H
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_io.h"
+
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define ZDRV_DEV_KPD "kpd"
+
+/****************************************************************************
+* Types
+****************************************************************************/
+
+/* tianbao zhou 20171122 */
+typedef enum
+{
+ KPD_VK_NULL,
+
+ KPD_VK_1, /* number 1 */
+ KPD_VK_2, /* number 2 */
+ KPD_VK_3, /* number 3 */
+ KPD_VK_4, /* number 4 */
+ KPD_VK_5, /* number 5 */
+ KPD_VK_6, /* number 6 */
+ KPD_VK_7, /* number 7 */
+ KPD_VK_8, /* number 8 */
+ KPD_VK_9, /* number 9 */
+ KPD_VK_0, /* number 0 */
+ KPD_VK_STAR, /* 11: key * */
+ KPD_VK_HASH, /* 12: key # */
+
+ KPD_VK_NV_UP, /* 13: key up */
+ KPD_VK_NV_DOWN, /* 14: key down */
+ KPD_VK_NV_LEFT, /* 15: key left */
+ KPD_VK_NV_RIGHT, /* 16: key right */
+ KPD_VK_NV_CENTER, /* 17: key ok */
+ KPD_VK_SOFT_LEFT, /* 18: left soft */
+ KPD_VK_SOFT_RIGHT, /* 19: right soft */
+ KPD_VK_CALL, /* 20: call key */
+
+ /* Use only KPD_VK_POWER if a key is both KPD_VK_CANCEL and KPD_VK_POWER */
+ KPD_VK_CANCEL, /* cancel key. */
+ KPD_VK_POWER, /* 22: power key. */
+
+ KPD_VK_SOFT_1, /* 23: soft key 1 for additional functional key */
+ KPD_VK_SOFT_2, /* 24: soft key 2 for additional functional key */
+ KPD_VK_SOFT_3, /* 25: soft key 3 for additional functional key */
+ KPD_VK_SOFT_4, /* 26: soft key 4 for additional functional key */
+
+ KPD_VK_SIDE_UP, /* 27: up key on the side */
+ KPD_VK_SIDE_DOWN, /* 28: down key on the side */
+ KPD_VK_WEB, /* 29: web key */
+ KPD_VK_CAMERA, /* 30: camera key */
+ KPD_VK_FLIP, /* 31: flip key */
+
+ KPD_VK_SHORTCUT1, /* 32: */
+ KPD_VK_SHORTCUT2,
+ KPD_VK_SHORTCUT3,
+ KPD_VK_SHORTCUT4,
+ KPD_VK_SHORTCUT5,
+ KPD_VK_SHORTCUT6,
+ KPD_VK_VOLUME, /* 38: ÒôÁ¿µ÷½Ú½çÃæ¿ì½Ý¼ü */
+ KPD_VK_SETTING, /* 39: ¿ì½ÝÉèÖà */
+ KPD_VK_WEATHERPORT, /* 40: ÌìÆøÔ¤±¨ */
+ KPD_VK_MESSAGE, /* 41: ¶ÌÐÅ */
+ KPD_VK_12580, /* 42: */
+ KPD_VK_SOS, /* 43: */
+ KPD_VK_REDIAL, /* 44: ÖØ²¥ */
+ KPD_VK_HEADFREE, /* 45: ÃâÌá¼ü */
+ KPD_VK_HEADSET, /* 46: Õª»ú »ò ¹Ò»ú */
+ KPD_VK_HEADSETUP, /* 47: ͻȜ */
+ KPD_VK_HEADSETDOWN, /* 48: ¹Ò»ú */
+
+ KPD_VK_WIFI,
+ KPD_VK_RESET,
+ KPD_VK_WPS,
+
+ KPD_VK_NUM /* 52 */
+} T_ZDrvKpd_VirtualKey;
+
+/* key state */
+typedef enum
+{
+ KEY_RELEASED, /* key has been released */
+ KEY_PRESSED, /* key has been pressed */
+
+ MAX_KEY_STATE
+} T_ZDrvKpd_KeyState;
+
+typedef struct
+{
+ T_ZDrvKpd_VirtualKey key; /* key code */
+ T_ZDrvKpd_KeyState state; /* key state */
+ UINT8 times; /* scaned times when pressed, and by this can get the de pressed
+ * time equal to times x scan interval( 100ms ) */
+} T_ZDrvKpd_KeyItem;
+
+#if IOKEYS(IOCTL_KPD_SET_BLG_BRIGHTNESS) || IOKEYS(IOCTL_KPD_GET_BLG_STATUS)
+typedef UINT8 T_ZDrvKpd_BlgBrightness; /* 0~255 */
+#endif
+
+#if IOKEYS(IOCTL_KPD_GET_BLG_STATUS)
+typedef struct
+{
+ UINT8 isBlgOn;
+ T_ZDrvKpd_BlgBrightness brightness;
+} T_ZDrvKpd_BlgStatus;
+#endif
+
+
+#endif/*_DRVS_IO_KPD_H*/
+
diff --git a/cp/ps/driver/inc/io/drvs_io_lcd.h b/cp/ps/driver/inc/io/drvs_io_lcd.h
new file mode 100644
index 0000000..7973e22
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_lcd.h
@@ -0,0 +1,135 @@
+/***********************************************************************
+* Copyright (C) 2014, ZTE Corporation.
+*
+* File Name: drvs_io_lcd.h
+* File Mark:
+* Description: lcd define.
+* Others:
+* Version: 1.0
+* Author: YinWenguan
+* Date: 2014-11-11
+*
+* History 1:
+* Date:
+* Version:
+* Author:
+* Modification:
+
+* History 2:
+**********************************************************************/
+
+#ifndef _DRVS_IO_LCD_H_
+#define _DRVS_IO_LCD_H_
+#include "drvs_vou.h"
+#include "drvs_vou_ref.h"
+
+/*************************************************************************
+ * Include files *
+ *************************************************************************/
+
+
+/*************************************************************************
+ * Macro *
+ *************************************************************************/
+
+/**************************************************************************
+ * Types *
+ **************************************************************************/
+typedef enum
+{
+ LCD_DCX_CMD = 0, // µÍµçƽÃüÁî
+ LCD_DCX_DATA, // ¸ßµçƽ²ÎÊý»òÊý¾Ý
+
+ MAX_LCD_DCX_TYPE
+} T_ZDrvLcd_DcxType; // transmission byte type
+
+typedef enum
+{
+ LCD_XFER_POLL = 0, // ÂÖѯ·½Ê½
+ LCD_XFER_INT, // ÖжϷ½Ê½
+ LCD_XFER_DMA, // DMA·½Ê½
+ LCD_XFER_CPU,
+
+ MAX_LCD_XFER_TYPE
+} T_ZDrvLcd_XferType;
+
+/* lcd mode */
+typedef enum
+{
+ LCD_NORMAL, /* normal mode */
+ LCD_SLEEP, /* sleep mode */
+
+ MAX_LCD_MODE
+} T_ZDrvLcd_Mode;
+
+/* lcd instance */
+typedef struct
+{
+ BOOL bOpen; /* status: open, close */
+ T_ZDrvLcd_Mode eMode; /* working mode: normal, sleep */
+ T_ZDrvLcd_XferType eXferType; /* poll, interrupt or DMA */
+ T_ZDrvLcd_DcxType eDcxType; /* command or parameter/data */
+ ZOSS_MUTEX_ID mutexUpdate; /* mutex for updating rectangle */
+ ZOSS_SEMAPHORE_ID semDmaInt; /* semaphore for DMA transimision */
+} T_ZDrvLcd_Instance;
+
+#if IOKEYS(IOCTL_LCD_UPDATE)
+typedef struct
+{
+ UINT16 uiLeft;
+ UINT16 uiTop;
+ UINT16 uiWidth;
+ UINT16 uiHeight;
+ UINT8* pBuf;
+} T_ZDrvLcd_DisplayParam;
+#endif
+
+#if IOKEYS(IOCTL_LCD_SLEEP)
+typedef enum
+{
+ LCD_SLEEP_OUT = 0,
+ LCD_SLEEP_IN,
+
+} T_ZDrvLcd_SleepStatus;
+#endif
+
+#if IOKEYS(IOCTL_LCD_BACKLIGHT)
+typedef enum
+{
+ LCD_BACKLIGHT_OFF = 0,
+ LCD_BACKLIGHT_ON,
+
+} T_ZDrvLcd_BacklightStatus;
+#endif
+
+#if IOKEYS(IOCTL_LCD_BRIGHTNESS)
+typedef unsigned int T_ZDrvLcd_Brightness; /* [0, 255]: 0 - darkest; 255 - brightest */
+#endif
+
+#if IOKEYS(IOCTL_LCD_GET_INFO)
+typedef struct
+{
+ UINT16 width;
+ UINT16 height;
+ UINT16 bitsPerPixel;
+ UINT16 rMask;
+ UINT16 gMask;
+ UINT16 bMask;
+ UINT16 lcd_pow_st;
+ UINT16 lcd_pix_st;
+ T_ZDrvLcd_Instance instance;
+ T_ZDrvLcd_BacklightStatus backlight;
+ T_ZDrvLcd_Brightness brightness;
+
+} T_ZDrvLcd_Info;
+
+typedef struct
+{
+ T_ZDrv_OSDInfo *OSD_Info;
+ T_ZDrvLcd_Info *Lcd_Info;
+
+}T_ZDrv_LCDVOUInfo;
+
+#endif
+
+#endif
diff --git a/cp/ps/driver/inc/io/drvs_io_led.h b/cp/ps/driver/inc/io/drvs_io_led.h
new file mode 100644
index 0000000..5529ece
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_led.h
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name: drvs_io_led.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: yuxiang
+ * Date: 2014-07-03
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IO_LED_H
+#define _DRVS_IO_LED_H
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_io.h"
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define ZDRV_DEV_LED "led"
+/****************************************************************************
+* Types
+****************************************************************************/
+typedef enum {
+ LED_BRIGHTNESS_0 = 0,
+ LED_BRIGHTNESS_1 , /* 0000 - 10mA */
+ LED_BRIGHTNESS_2 , /* 0001 - 15mA */
+ LED_BRIGHTNESS_3 , /* 0010 - 20mA */
+ LED_BRIGHTNESS_4 , /* 30mA */
+ LED_BRIGHTNESS_5 , /* 40mA */
+ LED_BRIGHTNESS_6 , /* 50mA */
+ LED_BRIGHTNESS_7 , /* 60mA */
+ LED_BRIGHTNESS_8 , /* 70mA */
+ LED_BRIGHTNESS_9 , /* 80mA */
+ LED_BRIGHTNESS_10 , /* 90mA */
+ LED_BRIGHTNESS_11 , /* 100mA */
+ LED_BRIGHTNESS_12 , /* 110mA */
+ LED_BRIGHTNESS_13 , /* 1100 - 120mA */
+ LED_BRIGHTNESS_14 , /* 1101 - 120mA */
+ LED_BRIGHTNESS_15 , /* 1110 - 120mA */
+ LED_BRIGHTNESS_16 , /* 1111 - 120mA */
+ LED_BRIGHTNESS_MAX,
+}T_ZDrvLed_Brightness;
+
+#define LED_RED_ON (1<<0)
+#define LED_GREEN_ON (1<<1)
+#define LED_BLUE_ON (1<<2)
+typedef enum
+{
+ LED_COLOR_RED =LED_RED_ON,
+ LED_COLOR_GREEN =LED_GREEN_ON,
+ LED_COLOR_BLUE =LED_BLUE_ON,
+ LED_COLOR_YELLOW=LED_RED_ON | LED_GREEN_ON,
+ LED_COLOR_PURPLE=LED_RED_ON | LED_BLUE_ON,
+ LED_COLOR_CYAN =LED_GREEN_ON | LED_BLUE_ON,
+ LED_COLOR_WHITE =LED_RED_ON |LED_GREEN_ON | LED_BLUE_ON,
+ //LED_COLOR_BLACK,
+ LED_COLOR_MAX,
+}T_ZDrvLed_Color;
+
+typedef enum
+{
+ LED_STATE_OFF = 0,
+ LED_STATE_ON ,
+ //LED_STATE_BLINK_OFF,
+ //LED_STATE_BLINK_ON,
+ LED_STATE_BLINK,
+ LED_STATE_MAX,
+}T_ZDrvLed_State;
+
+typedef enum
+{
+ LED_TRAFFIC_10 = 0,
+ LED_TRAFFIC_20 ,
+ LED_TRAFFIC_30,
+ LED_TRAFFIC_40,
+ LED_TRAFFIC_50,
+ LED_TRAFFIC_60,
+ LED_TRAFFIC_70,
+ LED_TRAFFIC_80,
+ LED_TRAFFIC_90,
+ LED_TRAFFIC_100,
+ LED_TRAFFIC_MAX,
+}T_ZDrvLed_Traffic;
+
+typedef enum
+{
+ LED_SLEEP_ENTER = 0,
+ LED_SLEEP_EXIT,
+ LED_SLEEP_MAX,
+
+}T_ZDrvLed_Sleep;
+
+typedef enum
+{
+ LED_DEVICE_NAME_WAN = 0,
+ LED_DEVICE_NAME_LAN,
+ LED_DEVICE_NAME_SMS,
+ LED_DEVICE_NAME_BATTERY,
+ LED_DEVICE_NAME_TRAFFIC,
+ LED_DEVICE_LEFT_1,
+ LED_DEVICE_LEFT_2,
+ LED_DEVICE_LEFT_3,
+ LED_DEVICE_LEFT_4,
+ LED_DEVICE_NAME_LGP,
+
+ LED_DEVICE_NAME_SLEEP,
+ LED_DEVICE_NAME_MAX,
+}T_ZDrvLed_DevName;
+
+typedef struct
+{
+ UINT32 uBlinkOnTime;
+ UINT32 uBlinkOffTime;
+}T_ZDrvLed_Blink;
+
+/*define for led ctrl mod by mcu or hardware 0x01 BLED_REG*/
+
+typedef enum
+{
+ LED_HW_CTRL = 0,
+ LED_MCU_CTRL,
+
+ LED_MAX_CTRL,
+}T_ZDrvLed_CtrlMod;
+
+
+/*IOCTL¿ØÖƲÙ×÷´«µÝ²ÎÊýÀàÐÍ*/
+typedef struct
+{
+ //T_ZDrvLed_DevName uDeviceName;
+ T_ZDrvLed_Brightness uBrightness;
+ T_ZDrvLed_Color uColor;
+ T_ZDrvLed_State uState;
+ T_ZDrvLed_Traffic uTraffic;
+ T_ZDrvLed_Sleep uSleep;
+ T_ZDrvLed_Blink ledBlink;
+ T_ZDrvLed_CtrlMod ledCtrlMod;
+}T_ZDrvLed_Descriptor;
+
+#if 0
+/*ÓÃÓÚ»ñÈ¡É豸ÐÅÏ¢*/
+typedef struct
+{
+ T_ZDrvLed_DevName ledName;
+ T_ZDrvLed_State ledState ;
+ T_ZDrvLed_Color ledColor ;
+ T_ZDrvLed_Brightness ledBrightNess;
+
+}T_LED_INFO;
+#endif
+
+#endif/*_DRVS_IO_LED_H*/
+
diff --git a/cp/ps/driver/inc/io/drvs_io_names.h b/cp/ps/driver/inc/io/drvs_io_names.h
new file mode 100644
index 0000000..fe6812a
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_names.h
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name:
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: geanfeng
+ * Date: 2014-07-23
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IO_NAMES_H_
+#define _DRVS_IO_NAMES_H_
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define ZDRV_DEV_USBSIO_NAME "usbsio/%d"
+#define ZDRV_DEV_USBSIO_0 "usbsio/0"
+#define ZDRV_DEV_USBSIO_1 "usbsio/1"
+#define ZDRV_DEV_USBSIO_2 "usbsio/2"
+#define ZDRV_DEV_USBSIO_3 "usbsio/3"
+
+
+/*names of virtual serial port */
+#define ZDRV_DEV_VCOM_AT "USB-AT"
+#define ZDRV_DEV_VCOM_AT_02 "USB-AT2"
+#define ZDRV_DEV_VCOM_UPDATE "USB-UPDATE"
+#define ZDRV_DEV_VCOM_MODEM "USB-MODEM"
+#define ZDRV_DEV_VCOM_LOG "USB-LOG"
+#define ZDRV_DEV_VCOM_ADB "USB-ADB"
+#define ZDRV_DEV_VCOM_SOUND "USB-SOUND"
+#define ZDRV_DEV_VCOM_MUX "USB-MUX" //this port is used for mux!
+
+#define ZDRV_DEV_VCOM_AMT "USB-AMT" //For amt version
+
+/*names of virtual NIC */
+#define ZDRV_DEV_VNIC1 "USB-VNIC"
+#define ZDRV_DEV_VNIC2 "USB-VNIC2"
+#define ZDRV_DEV_VNIC3 "USB-VNIC3"
+#define ZDRV_DEV_VNIC4 "USB-VNIC4"
+#define ZDRV_DEV_VNIC5 "USB-VNIC5"
+#define ZDRV_DEV_VNIC6 "USB-VNIC6"
+#define ZDRV_DEV_VNIC7 "USB-VNIC7"
+
+
+/*names of uart device */
+
+#define ZDRV_DEV_UART_NAME "uart/%d"
+#define ZDRV_DEV_UART_0 "uart/0"
+#define ZDRV_DEV_UART_1 "uart/1"
+#define ZDRV_DEV_UART_BT "uart/2"
+
+
+//MUX COM PORT
+#define ZDRV_DEV_VCOM_DLC1 "mux/dlc1"
+#define ZDRV_DEV_VCOM_DLC2 "mux/dlc2"
+#define ZDRV_DEV_VCOM_DLC3 "mux/dlc3"
+#define ZDRV_DEV_VCOM_DLC4 "mux/dlc4"
+#define ZDRV_DEV_VCOM_DLC5 "mux/dlc5"
+#define ZDRV_DEV_VCOM_DLC6 "mux/dlc6"
+#define ZDRV_DEV_VCOM_DLC7 "mux/dlc7"
+#define ZDRV_DEV_VCOM_DLC8 "mux/dlc8"
+#define ZDRV_DEV_VCOM_DLC9 "mux/dlc9"
+#define ZDRV_DEV_VCOM_DLC10 "mux/dlc10"
+#define ZDRV_DEV_VCOM_DLC11 "mux/dlc11"
+#define ZDRV_DEV_VCOM_DLC12 "mux/dlc12"
+#define ZDRV_DEV_VCOM_DLC13 "mux/dlc13"
+#define ZDRV_DEV_VCOM_DLC14 "mux/dlc14"
+#define ZDRV_DEV_VCOM_DLC15 "mux/dlc15"
+#define ZDRV_DEV_VCOM_DLC16 "mux/dlc16"
+#define ZDRV_DEV_VCOM_DLC17 "mux/dlc17"
+#define ZDRV_DEV_VCOM_DLC18 "mux/dlc18"
+
+//SD define
+#define ZDRV_DEV_SD0 "sd0"
+#define ZDRV_DEV_SD0P1 "sd0p1"
+#define ZDRV_DEV_SD0P2 "sd0p2"
+
+#define ZDRV_DEV_SD1 "sd1"
+#define ZDRV_DEV_SD1P1 "sd1p1"
+#define ZDRV_DEV_SD1P2 "sd1p2"
+
+//CDROM define
+#define ZDRV_DEV_CDROM "cdrom"
+
+
+//EMMC define
+#define ZDRV_DEV_EMMC_FS "MMCuserdata"
+
+//LCD define
+#define ZDRV_DEV_LCD "lcd"
+//CAMERA define
+#define ZDRV_DEV_CAMERA1 "camera1"
+
+
+/****************************************************************************
+* Types
+****************************************************************************/
+
+/****************************************************************************
+* Constants
+****************************************************************************/
+
+/****************************************************************************
+* Global Variables
+****************************************************************************/
+
+/****************************************************************************
+* Function Prototypes
+****************************************************************************/
+
+#endif/*_DRVS_IO_NAMES_H_*/
+
diff --git a/cp/ps/driver/inc/io/drvs_io_rtc.h b/cp/ps/driver/inc/io/drvs_io_rtc.h
new file mode 100644
index 0000000..59de596
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_rtc.h
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name: drvs_io_led.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: yuxiang
+ * Date: 2014-07-03
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IO_RTC_H
+#define _DRVS_IO_RTC_H
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_io.h"
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define ZDRV_DEV_RTC "rtc"
+/****************************************************************************
+* Types
+****************************************************************************/
+
+
+typedef struct
+{
+ BOOL mode_12_hour; /* TRUE->12 hour mode ; FALSE-> 24 hour mode */
+ BOOL PM_flag; /* if 12 hour flag = TRUE TRUE->PM ; FALSE->AM */
+ UINT8 second; /* seconds after the minute - [0,59] */
+ UINT8 minute; /* minutes after the hour - [0,59] */
+ UINT8 hour; /* hours after the midnight - [0,23] */
+ UINT8 day; /* day of the month - [1,31] */
+ UINT8 month; /* months - [01,12] */
+ UINT8 wday; /* days in a week - [1,7] */
+ UINT16 year; /* years - [0000,9999] */
+} T_ZDrvRtc_TimeDate;
+
+
+typedef enum
+{
+ RTC_IRQ_SEC_INT, /*second interrupt */
+ RTC_IRQ_MIN_INT, /* minute interrupt */
+ RTC_IRQ_HOUR_INT, /* hour interrupt */
+ RTC_IRQ_DAY_INT, /* day interrupt */
+
+ RTC_IRQ_INT_MAX
+} T_ZDrvRtc_EventInt;
+
+typedef enum
+{
+ RTC_INT_DISABLE,
+ RTC_INT_ENABLE,
+
+ MAX_RTC_INT_SETUP
+}T_ZDrvRtc_IntSetup;
+
+typedef enum
+{
+ ALARM_POWER_OFF,
+ ALARM_POWER_ON,
+
+ MAX_ALARM_POWER
+} T_ZDrvRtc_AlarmPower;
+
+typedef VOID (*zDrvRtc_AlarmCallbackFunc)(VOID);
+typedef VOID (*zDrvRtc_CycleCallbackFunc)(T_ZDrvRtc_EventInt);
+
+
+/*IOCTL¿ØÖƲÙ×÷´«µÝ²ÎÊýÀàÐÍ*/
+typedef struct
+{
+ T_ZDrvRtc_TimeDate TimeDate;
+ T_ZDrvRtc_AlarmPower AlarmEnable;
+ T_ZDrvRtc_IntSetup IntEnable;
+ zDrvRtc_CycleCallbackFunc CycleCallback;
+ zDrvRtc_AlarmCallbackFunc AlarmCallback;
+}T_ZDrvRtc_Descriptor;
+
+
+
+/*¶Ôƽ̨µ¥¶ÀÌṩµÄ¶ÁÈ¡ÓëÉèÖÃʱ¼äÈÕÆÚµÄ½Ó¿Ú*/
+SINT32 Rtc_GetDateTime(T_ZDrvRtc_TimeDate * pDateTime);
+SINT32 Rtc_SetDateTime(T_ZDrvRtc_TimeDate * pDateTime);
+
+
+#endif/*_DRVS_IO_LED_H*/
+
diff --git a/cp/ps/driver/inc/io/drvs_io_sio.h b/cp/ps/driver/inc/io/drvs_io_sio.h
new file mode 100644
index 0000000..8912b78
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_sio.h
@@ -0,0 +1,138 @@
+/***********************************************************************
+* Copyright (C) 2001, ZTE Corporation.
+*
+* File Name: drvs_io_sio.h
+* File Mark:
+* Description: sio define.
+* Others:
+* Version: 1.4.9
+* Author: wangxia
+* Date: 2010-04-2
+*
+* History 1:
+* Date:
+* Version:
+* Author:
+* Modification:
+
+* History 2:
+**********************************************************************/
+#include "drvs_io_keys.h"
+#ifndef _DRVS_SIO_H_
+#define _DRVS_SIO_H_
+
+/*************************************************************************
+ * Include files *
+ *************************************************************************/
+
+
+/*************************************************************************
+ * Macro *
+ *************************************************************************/
+
+/**************************************************************************
+ * Types *
+ **************************************************************************/
+
+typedef struct _T_ZDrvSio_DataConfig
+{
+ UINT32 baudrate;
+ UINT32 flowControl;
+ UINT8 dataBits;
+ UINT8 stopBits;
+ UINT8 parity;
+ UINT8 workMode;
+}T_ZDrvSio_DataConfig;
+
+
+typedef enum
+{
+ ZDRV_DEV_UART_FCTL_OFF,
+ ZDRV_DEV_UART_FCTL_SW,
+ ZDRV_DEV_UART_FCTL_HW
+}T_ZDrvSio_UartFlowCtrl_Types;
+
+typedef enum
+{
+ ZDRV_DEV_UART_PARITY_EVEN,
+ ZDRV_DEV_UART_PARITY_ODD,
+ ZDRV_DEV_UART_PARITY_NULL
+}T_ZDrvSio_UartParity_Types;
+
+typedef enum
+{
+ ZDRV_DEV_UART_MODE_CPU,
+ ZDRV_DEV_UART_MODE_DMA,
+ ZDRV_DEV_UART_MODE_NULL
+}T_ZDrvSio_UartWorkMode_Types;
+
+/*sio ioctl command*/
+typedef enum
+{
+ IOCTL_SIO_SET_DATA, /*set data config command,set baudrate.param:T_ZDrvSio_DataConfig*/
+ IOCTL_SIO_SET_BUFFER, /*set data buffer command,param:T_ZDrvSio_SetConfig */
+ IOCTL_SIO_CLEAN_BLOCK, /*clean the sio block read*/
+ IOCTL_SIO_CALLBACK, /*set sio non block callback function.param:T_ZDrvSio_Read_CallBack*/
+
+ IOCTL_SIO_CMD_MAX
+} T_ZDrvSio_IOCTL; /*sio ioctl command*/
+
+
+
+typedef struct _T_ZDrvUsbSio_SetConfig
+{
+
+ UINT8 endpoint;
+ UINT32 txBufferSize;
+ UINT32 rxBufferSize;
+ BOOL block;
+ UINT32 blocktime;
+
+}T_ZDrvUsbSio_SetConfig; /*usbsio use to config the param*/
+
+typedef struct _T_ZDrvSio_SetConfig
+{
+
+ UINT8 endpoint;
+ UINT32 txBufferSize;
+ UINT32 rxBufferSize;
+ BOOL block;
+ UINT32 blocktime;
+ T_ZDrvSio_DataConfig dataconfig;
+}T_ZDrvSio_SetConfig; /*usbsio use to config the param*/
+
+
+typedef struct _T_Sio_Dev_Hw
+{
+ VOID * regs;
+ T_ZDrvSio_DataConfig settings;
+ VOID * upLayerSet;
+
+}
+T_Sio_Dev_Hw;
+
+
+typedef struct _T_Sio_HalOpt
+{
+ SINT32 (*open)(UINT32 portNum,T_ZDrvSio_DataConfig * portConfig);
+ SINT32 (*read)(UINT32 portNum, UINT8* pBuf, UINT32 len);
+ SINT32 (*write)(UINT32 portNum, UINT8* pBuf, UINT32 len);
+ SINT32 (*close)(UINT32 portNum);
+ SINT32 (*ctrl)(UINT32 portNum,T_DRVIO_CTRL_KEY function, VOID* arg);
+}
+T_Sio_HalOpt;
+
+/**************************************************************************
+ * Global Variable *
+ **************************************************************************/
+
+/**************************************************************************
+ * Function Prototypes *
+ **************************************************************************/
+SINT32 zDrvSio_Install(UINT32 portNum, CHAR* name, T_Sio_HalOpt * pDevHalOpt);
+
+
+#endif/*_DRVS_SIO_H_ */
+
+
+
diff --git a/cp/ps/driver/inc/io/drvs_io_vib.h b/cp/ps/driver/inc/io/drvs_io_vib.h
new file mode 100644
index 0000000..d7014c4
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_vib.h
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name: drvs_io_vib.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: liuyi
+ * Date: 2016-09-03
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IO_VIB_H
+#define _DRVS_IO_VIB_H
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_io.h"
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define ZDRV_DEV_VIB "vib"
+/****************************************************************************
+* Types
+****************************************************************************/
+
+
+/* */
+typedef enum
+{
+ VIB_POWER_DISABLE,
+ VIB_POWER_ENABLE,
+
+ MAX_VIB_POWER
+}
+T_ZDrvVib_Power;
+
+typedef enum
+{
+ VIB_STATE_OFF,
+ VIB_STATE_ON,
+
+ MAX_VIB_STATE
+}
+T_ZDrvVib_State;
+
+
+
+#endif/*_DRVS_IO_VIB_H*/
+
diff --git a/cp/ps/driver/inc/io/drvs_io_voice.h b/cp/ps/driver/inc/io/drvs_io_voice.h
new file mode 100644
index 0000000..f157311
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_io_voice.h
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name: drvs_iokeys.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: geanfeng
+ * Date: 2014-02-11
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_IO_VOICE_H
+#define _DRVS_IO_VOICE_H
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_io.h"
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define ZDRV_DEV_VOICE "voice" /*The device name of voice driver.*/
+#define ZDRV_DEV_VOLTE "volte" /*The device name of voice driver.*/
+
+/****************************************************************************
+* Types
+****************************************************************************/
+/* Voice input channel selection. */
+typedef enum
+{
+ CODEC_INPUT_MICPHONE =0, /*input path in earphone mic*/
+ CODEC_INPUT_HEADSET, /*input path in headset*/
+ CODEC_INPUT_BLUETOOTH, /*input path in bluetooth*/
+ CODEC_INPUT_HANDSFREE, /*input path in mic(handsfree)*/
+
+ MAX_CODEC_INPUT_PATH
+} T_ZDrv_CodecInputPath;
+
+/* Voice output channel selection. */
+typedef enum
+{
+ CODEC_OUTPUT_RECEIVER =0, /*output path in receiver*/
+ CODEC_OUTPUT_SPEAKER, /*output path in speaker*/
+ CODEC_OUTPUT_HEADSET, /*output path in headset*/
+ CODEC_OUTPUT_BLUETOOTH, /*output path in bluetooth*/
+ CODEC_OUTPUT_HSANDSPK, /*output path in both headset and speaker*/
+
+
+ MAX_CODEC_OUTPUT_PATH
+}T_ZDrv_CodecOutputPath;
+
+#define T_ZDrv_AudioInputPath T_ZDrv_CodecInputPath
+#define T_ZDrv_VoiceInputPath T_ZDrv_CodecInputPath
+#define T_ZDrv_AudioOutputPath T_ZDrv_CodecOutputPath
+#define T_ZDrv_VoiceOutputPath T_ZDrv_CodecOutputPath
+
+
+typedef struct
+{
+ UINT16 uiStartX;
+ UINT16 uiStartY;
+ UINT16 uiWidth;
+ UINT16 uiHeight;
+} T_ZDrv_Rect;
+
+/* Record data format. */
+typedef enum
+{
+ RECORD_DATA_FORMAT_AMR = 0,
+ RECORD_DATA_FORMAT_FR,
+ RECORD_DATA_FORMAT_HR,
+ RECORD_DATA_FORMAT_EFR,
+
+ MAX_RECORD_DATA_FORMAT
+} T_ZDrvRcd_DataFormat;
+
+/*add on the platform of 7502 for record the different of channel online voice*/
+/* channel selection for voice record function */
+typedef enum
+{
+ VOICE_RECORD_UPLINK = 0,
+ VOICE_RECORD_DOWNLINK,
+ VOICE_RECORD_UPLINK_AND_DOWNLINK,
+ MAX_VOICE_RECORD_CHANNEL
+} T_ZDrvVoice_RecordChannel;
+
+typedef struct
+{
+ T_ZDrvRcd_DataFormat dataformat;
+ UINT32 bufsize;
+ T_ZDrvVoice_RecordChannel channel; /*add on the platform of 7502 for record the different of channel online voice*/
+} T_ZDrvRcd_InfoParam;
+
+/* Voice input channel volum level selection.*/
+typedef enum{
+ VOICE_INPUT_VOL_LEVEL_0 = 0,
+ VOICE_INPUT_VOL_LEVEL_1 ,
+ VOICE_INPUT_VOL_LEVEL_2 ,
+ VOICE_INPUT_VOL_LEVEL_3 ,
+ VOICE_INPUT_VOL_LEVEL_4 ,
+ VOICE_INPUT_VOL_LEVEL_5 ,
+
+ MAX_VOICE_INPUT_VOL_LEVEL
+} T_ZDrvVoice_InputVolLevel;
+
+/* Audio output channel volum level selection.*/
+typedef enum{
+ VOICE_OUTPUT_VOL_LEVEL_0 = 0,
+ VOICE_OUTPUT_VOL_LEVEL_1 ,
+ VOICE_OUTPUT_VOL_LEVEL_2 ,
+ VOICE_OUTPUT_VOL_LEVEL_3 ,
+ VOICE_OUTPUT_VOL_LEVEL_4 ,
+ VOICE_OUTPUT_VOL_LEVEL_5 ,
+ VOICE_OUTPUT_VOL_LEVEL_6 ,
+ VOICE_OUTPUT_VOL_LEVEL_7 ,
+ VOICE_OUTPUT_VOL_LEVEL_8 ,
+ VOICE_OUTPUT_VOL_LEVEL_9 ,
+ VOICE_OUTPUT_VOL_LEVEL_10 ,
+ VOICE_OUTPUT_VOL_LEVEL_11 ,
+
+ MAX_VOICE_OUTPUT_VOL_LEVEL
+} T_ZDrvVoice_OutputVolLevel;
+
+/* voice sample rate selection. */
+typedef enum
+{
+ VOICE_SAMPLE_8K =0, /* voice sample rate 8K. */
+ VOICE_SAMPLE_16K , /* voice sample rate 16K. */
+
+ MAX_VOICE_SAMPLE
+} T_ZDrvVoice_Sample;
+
+/* voice codec format, which is not the codec of PCM format */
+typedef enum
+{
+ VOICE_DATA_FORMAT_AMR = 0,
+ VOICE_DATA_FORMAT_FR,
+ VOICE_DATA_FORMAT_HR,
+ VOICE_DATA_FORMAT_EFR,
+ MAX_VOICE_DATA_FORMAT
+} T_ZDrvVoice_DataFormat;
+/* channel selection for voice mute function */
+typedef enum
+{
+ VOICE_UPLINK = 0,
+ VOICE_DOWNLINK,
+ VOICE_UPLINK_AND_DOWNLINK,
+ MAX_VOICE_MUTE_CHANNEL
+} T_ZDrvVoice_MuteChannel;
+
+/* voice mute switch */
+typedef enum
+{
+ VOICE_MUTE_DISABLE = 0,
+ VOICE_MUTE_ENABLE,
+ MAX_VOICE_MUTE_SWITCH
+} T_ZDrvVoice_mute_Switch;
+
+/* voice mute control information */
+typedef struct
+{
+ T_ZDrvVoice_mute_Switch enable;
+ T_ZDrvVoice_MuteChannel channel; /* input & output function */
+} T_ZDrvVoice_MuteInfo;
+
+/* voice switch */
+typedef enum
+{
+ VOICE_DISABLE = 0,
+ VOICE_ENABLE,
+ MAX_VOICE_SWITCH
+} T_ZDrvVoice_Switch;
+
+/* voice buffer information */
+typedef struct
+{
+ VOID *pBuf; /* voice buffer */
+ UINT32 bufferSize; /* voice buffer size */
+}T_ZDrvVoice_BufInfo;
+
+/* The frame type of AMR */
+typedef enum {
+ VOICE_FRAME_MR475 = 0,
+ VOICE_FRAME_MR515,
+ VOICE_FRAME_MR59,
+ VOICE_FRAME_MR67,
+ VOICE_FRAME_MR74,
+ VOICE_FRAME_MR795,
+ VOICE_FRAME_MR102,
+ VOICE_FRAME_MR122,
+
+ MAX_VOICE_FRAME_TYPE
+}T_ZDrvVoice_FrameType;
+
+/* The frame formate of AMR */
+typedef enum {
+ VOICE_AMR_IF2,
+ VOICE_AMR_IF1,
+
+ MAX_VOICE_AMR_IF
+}T_ZDrvVoice_AmrIf;
+
+/* The frame formate of AMR information*/
+typedef struct
+{
+ T_ZDrvVoice_FrameType frametype; /* The frame type of AMR */
+ T_ZDrvVoice_AmrIf amrif; /* The frame formate of AMR */
+}T_ZDrvVoice_AmrInfo, *T_ZDrvVoice_AmrInfoPtr;
+
+/* Audio channel */
+typedef enum
+{
+ AUDIO_MONO_CHANNEL,
+ AUDIO_DUAL_CHANNEL
+}T_ZDrvAudio_Channel;
+#endif/*_DRVS_IO_VOICE_H*/
+
diff --git a/cp/ps/driver/inc/io/drvs_serial_device.h b/cp/ps/driver/inc/io/drvs_serial_device.h
new file mode 100644
index 0000000..b4a7f68
--- /dev/null
+++ b/cp/ps/driver/inc/io/drvs_serial_device.h
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name: drvs_serial_device.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: 1.0
+ * Author: weizhigang
+ * Date: 2009-11-12
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_SERIAL_DEVICE_H
+#define _DRVS_SERIAL_DEVICE_H
+
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_io.h"
+#include "drvs_io_keys.h"
+#include "drvs_io_sio.h"
+#include "drvs_io_names.h"
+/****************************************************************************
+* Macros
+****************************************************************************/
+
+
+/****************************************************************************
+* Types
+****************************************************************************/
+
+
+/****************************************************************************
+* Function Prototypes
+****************************************************************************/
+
+
+#endif/*_DRVS_SERIAL_DEVICE_H*/
+
+
+
diff --git a/cp/ps/driver/inc/io/earpiece_api.h b/cp/ps/driver/inc/io/earpiece_api.h
new file mode 100644
index 0000000..e4d6716
--- /dev/null
+++ b/cp/ps/driver/inc/io/earpiece_api.h
@@ -0,0 +1,161 @@
+/***********************************************************************
+* Copyright (C) 2001, ZTE Corporation.
+*
+* File Name: earpiece_api.h
+* File Mark:
+* Description: Provide earpiece module function prototype declaration and type declaration.
+* Others:
+* Version: v0.5
+* Author: LvWenhua
+* Date: 2007-10-25
+*
+* History 1:
+* Date:
+* Version:
+* Author:
+* Modification:
+* History 2:
+**********************************************************************/
+
+#ifndef _EARPIECE_API_H
+#define _EARPIECE_API_H
+
+/**************************************************************************
+ * Include files *
+ **************************************************************************/
+
+/**************************************************************************
+ * Macro *
+ **************************************************************************/
+#define ZDRV_DEV_EARP "earpiece" /*The device name of earpiece driver.*/
+
+/**************************************************************************
+ * Types *
+ **************************************************************************/
+/*Information from driver to upper application.*/
+typedef enum {
+ EARP_INFO_PLUG = 0, /*Earpiece is plugged.*/
+ EARP_INFO_UNPLUG , /*Earpiece is unplugged.*/
+ EARP_INFO_HOOK_SWITCH , /*Earpiece hook key is pressed and released.*/
+
+ MAX_EARP_INFO
+} T_ZDrvEarp_Info;
+
+typedef enum {
+ EARP_STATE_PLUG = 0, /*Earpiece is plugged.*/
+ EARP_STATE_UNPLUG , /*Earpiece is unplugged.*/
+
+ MAX_EARP_STATE
+} T_ZDrvEarp_State;
+
+typedef void (*T_ZDrvEarp_CallbackFunc) (T_ZDrvEarp_Info);
+
+#if 0
+typedef enum
+{
+ IOCTL_EARP_SET_CALLBACK = 0, /*Set callback function, it is used to register the callback function which will send the earpiece switch status to user.*/
+ IOCTL_EARP_GET_PLUG_STATUS , /*Get earpiece plug status, replace the read function.*/
+ IOCTL_EARP_SET_HOOK_ENABLE,
+ IOCTL_EARP_SET_HOOK_DISABLE,
+ MAX_IOCTL_EARP
+}T_ZDrvEarp_IoCtl;
+#endif
+
+/**************************************************************************
+ * Global Variable *
+ **************************************************************************/
+
+/**************************************************************************
+ * Function Prototypes *
+ **************************************************************************/
+
+/**************************************************************************
+* Function: zDrv_Open
+* Description: This function is used to open device according to device name.
+* Parameters:
+* Input:
+ pathname:device name, ZDRV_DEV_EARP in earpiece
+* flags: no use, 0
+* Output: None
+* Returns:
+* device file descriptor if successed. [1, ZDRV_MAX_DEV_FILE_NUM), please refer to dal_api.h
+* DRV_ERR_NO_THIS_DEVICE: this device hasn't been installed yet
+* DRV_ERR_FD_OVERFLOW: no free fd entry
+* DRV_ERR_NOT_SUPPORTED: this device don't support open operation.
+* DRV_ERR_OPEN_TIMES: has been opened already.
+* others: others error code. for detailed information, please refer to the header file of hal layer
+* Others: None
+**************************************************************************/
+/*SINT32 zDrv_Open (const CHAR *pathname, SINT32 flags)*/
+
+/**************************************************************************
+* Function: zDrv_Close
+* Description: This function is used to close a device according to device file descriptor.
+* Parameters:
+* Input:
+* fd :device file descriptor
+* Output:None
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_FD_TABLE: device driver table has been invalid.
+* DRV_ERR_NOT_SUPPORTED: this device don't support close operation.
+* others: others error code. for detailed information, please refer to the header file of hal layer
+* Others: None
+**************************************************************************/
+/*SINT32 zDrv_Close(UINT32 fd)*/
+
+/**************************************************************************
+* Function: zDrv_Ioctl
+* Description: This function is used to control device according to fd(device file descriptor).
+* Parameters:
+* Input:
+* fd:device file descriptor
+* cmd:command code
+* arg:command parameters
+* Output:None
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_FD_TABLE: device driver table has been invalid.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_INVALID_IOCTL_CMD: this command has not been supported yet.
+* others: for detailed information, please refer to the header file of hal layer
+*
+* Others: None
+**************************************************************************/
+/*SINT32 zDrv_Ioctl(UINT32 fd, UINT32 cmd, VOID* arg)*/
+
+/**************************************************************************
+* Function: zDrvEarp_Init
+* Description: This function is used to install earpiece driver.
+* Parameters:
+* Input:None
+* Output:None
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERROR: error
+* DRV_ERR_DEV_OVERFLOW: no free device driver entry in table
+* DRV_ERR_MEM_ALLOC: failed to alloc memory
+* Others: None
+**************************************************************************/
+SINT32 zDrvEarp_Init(VOID);
+
+/**************************************************************************
+* Function: zDrvEarp_Exit
+* Description: This function is used to uninstall earpiece driver.
+* Parameters:
+* Input:None
+* Output:None
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERROR: error
+* DRV_ERR_DEV_TABLE: device driver table has been invalid.
+* DRV_ERR_NO_THIS_DEVICE: this device hasn't been installed yet
+* Others: None
+**************************************************************************/
+SINT32 zDrvEarp_Exit(VOID);
+
+#endif /* _EARPIECE_API_H */
+