blob: 48ed8b1aaa81b67af35eb539275d6b3fa5645e3f [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2005
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * drvsignals.h
41 *
42 * Project:
43 * --------
44 * Maui_Software
45 *
46 * Description:
47 * ------------
48 * This file is intends for driver primitives.
49 *
50 * Author:
51 * -------
52 * -------
53 *
54 *============================================================================
55 * HISTORY
56 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
57 *------------------------------------------------------------------------------
58 * removed!
59 * removed!
60 * removed!
61 * removed!
62 * removed!
63 * removed!
64 * removed!
65 *
66 * removed!
67 * removed!
68 * removed!
69 *
70 * removed!
71 * removed!
72 * removed!
73 *
74 * removed!
75 * removed!
76 * removed!
77 *
78 * removed!
79 * removed!
80 * removed!
81 *
82 * removed!
83 * removed!
84 * removed!
85 *
86 * removed!
87 * removed!
88 * removed!
89 *
90 * removed!
91 * removed!
92 * removed!
93 *
94 * removed!
95 * removed!
96 * removed!
97 *
98 * removed!
99 * removed!
100 * removed!
101 *
102 * removed!
103 * removed!
104 * removed!
105 *
106 * removed!
107 * removed!
108 * removed!
109 *
110 * removed!
111 * removed!
112 * removed!
113 *
114 * removed!
115 * removed!
116 * removed!
117 *
118 * removed!
119 * removed!
120 * removed!
121 *
122 * removed!
123 * removed!
124 * removed!
125 *
126 * removed!
127 * removed!
128 * removed!
129 *
130 * removed!
131 * removed!
132 * removed!
133 *
134 * removed!
135 * removed!
136 * removed!
137 *
138 * removed!
139 * removed!
140 * removed!
141 *
142 * removed!
143 * removed!
144 * removed!
145 *
146 * removed!
147 * removed!
148 * removed!
149 *
150 * removed!
151 * removed!
152 * removed!
153 *
154 * removed!
155 * removed!
156 * removed!
157 *
158 * removed!
159 * removed!
160 * removed!
161 * removed!
162 * removed!
163 * removed!
164 * removed!
165 * removed!
166 * removed!
167 * removed!
168 * removed!
169 * removed!
170 * removed!
171 * removed!
172 * removed!
173 * removed!
174 * removed!
175 * removed!
176 * removed!
177 * removed!
178 * removed!
179 * removed!
180 * removed!
181 * removed!
182 * removed!
183 * removed!
184 * removed!
185 * removed!
186 * removed!
187 * removed!
188 * removed!
189 * removed!
190 * removed!
191 * removed!
192 * removed!
193 * removed!
194 * removed!
195 * removed!
196 * removed!
197 * removed!
198 * removed!
199 * removed!
200 * removed!
201 * removed!
202 * removed!
203 * removed!
204 * removed!
205 * removed!
206 * removed!
207 * removed!
208 * removed!
209 * removed!
210 * removed!
211 * removed!
212 * removed!
213 * removed!
214 * removed!
215 * removed!
216 * removed!
217 * removed!
218 * removed!
219 * removed!
220 * removed!
221 * removed!
222 * removed!
223 * removed!
224 * removed!
225 * removed!
226 * removed!
227 * removed!
228 * removed!
229 * removed!
230 * removed!
231 * removed!
232 * removed!
233 *
234 *------------------------------------------------------------------------------
235 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
236 *============================================================================
237 ****************************************************************************/
238#ifndef _DRVSIGNALS_H
239#define _DRVSIGNALS_H
240
241#include "bmt.h"
242#include "usb_comm.h"
243#include "kal_public_api.h" //#include "stack_ltlcom.h" //MSBB change #include "app_ltlcom.h"
244#include "kal_general_types.h"
245#include "dcl.h"
246
247
248/*RTC driver*/
249#define RTC_TC_IND 0
250#define RTC_AL_IND 1
251typedef struct {
252 LOCAL_PARA_HDR
253 kal_uint8 rtc_ind;
254} RTC_Primitive;
255
256typedef struct {
257 LOCAL_PARA_HDR
258 DCL_RTC_DATA_T previous_rtc;
259 DCL_RTC_DATA_T new_rtc;
260} RTC_Time_Change_IND_Struct;
261
262/*Kbd driver*/
263#define Kbd_KeyPress 0
264#define Kbd_KeyRelease 1
265typedef struct {
266 LOCAL_PARA_HDR
267 kal_uint8 kp_status;
268 kal_uint8 key;
269} Kbd_Primitive;
270
271/*Communicated with MMI, charging status*/
272typedef enum
273{
274 BMT_CHARGER_IN = 0,
275 BMT_CHARGER_OUT,
276 BMT_OVERVOLPROTECT,
277 BMT_OVERBATTEMP,
278 BMT_LOWBATTEMP,
279 BMT_OVERCHARGECURRENT,
280 BMT_CHARGE_COMPLETE,
281 BMT_INVALID_BAT,
282 BMT_INVALID_CHARGER,
283 BMT_CHARGE_TIMEOUT,
284 BMT_LOWCHARGECURRENT,
285 BMT_CHARGE_BAD_CONTACT,
286 BMT_BATTERY_BAD_CONTACT,
287 BMT_USB_CHARGER_IN,
288 BMT_USB_CHARGER_OUT,
289 BMT_USB_NO_CHARGING_IN,
290 BMT_USB_NO_CHARGING_OUT,
291 BMT_BATT_IN,
292 BMT_BATT_OUT
293}BMT_CHR_STAT;
294
295typedef struct {
296 LOCAL_PARA_HDR
297 BMT_CHR_STAT status;
298} drvuem_pmic_ind_struct;
299
300/*ADC scheduler*/
301typedef struct {
302 LOCAL_PARA_HDR
303 double adc_value;
304 kal_int32 adc_handle;
305 kal_int32 volt;
306 kal_uint8 adc_sche_id;
307} bmt_adc_measure_done_conf_struct;
308
309typedef struct {
310 LOCAL_PARA_HDR
311 kal_int32 adc_handle;
312 kal_uint8 adc_sche_id;
313} bmt_adc_add_item_req_struct;
314
315typedef struct {
316 LOCAL_PARA_HDR
317 kal_int32 adc_handle;
318 kal_uint8 adc_sche_id;
319} bmt_adc_remove_item_req_struct;
320
321typedef struct {
322 LOCAL_PARA_HDR
323 kal_int32 adc_handle;
324 kal_uint32 period;
325 kal_uint8 evaluate_count;
326 kal_uint8 adc_sche_id;
327} bmt_adc_modify_parameters_req_struct;
328
329/*AUX task*/
330typedef enum
331{
332 AUX_ID_PLUGOUT=0,
333 AUX_ID_TVOUT,
334 AUX_ID_EARPHONE,
335 AUX_ID_KEY_PRESS,
336 AUX_ID_KEY_RELEASE,
337 AUX_ID_UART,
338 AUX_ID_CLAM_OPEN,
339 AUX_ID_CLAM_CLOSE,
340 AUX_ID_TVOUT_OUT,
341 AUX_ID_TVOUT_INIT1,
342 AUX_ID_DETECTION_DONE,
343 AUX_ID_PLUGIN,
344 AUX_ID_TRANSMITTER_HOLD_ON,
345 AUX_ID_TRANSMITTER_PUT_DOWN,
346 AUX_MAX_ID
347}AUX_ID;
348typedef struct {
349 LOCAL_PARA_HDR
350 AUX_ID aux_id;
351} aux_id_struct;
352
353/*Engineering mode*/
354typedef struct {
355 LOCAL_PARA_HDR
356 kal_int32 vbat; /*Battery Voltage(micro-voltage)*/
357 kal_int32 bat_temp; /*Battery Temperature(¢J)*/
358 kal_int32 vaux; /*AUX Voltage(micro-voltage)*/
359 kal_int32 charge_current; /*Charge current(micro-A)*/
360 kal_int32 vcharger; /*Charger Voltage(micro-voltage)*/
361} adc_all_channel_struct;
362
363/*USB driver*/
364typedef struct {
365 LOCAL_PARA_HDR
366 void *pData; /* Pointer to data buffer */
367 kal_int32 nBuffLen; /* Length of data buffer */
368 kal_int32 nBytesRecv; /* Number of bytes received */
369} usb_ms_rec_done_conf_struct;
370
371/*L4->USB*/
372typedef struct {
373 LOCAL_PARA_HDR
374 USB_DEVICE_TYPE mode;
375 kal_uint32 *parameter;
376} drvuem_usbcfg_req_struct;
377
378/*USB->USB*/
379typedef struct {
380 LOCAL_PARA_HDR
381 USB_DEVICE_TYPE mode;
382 kal_uint32 *parameter;
383 kal_uint32 device_code;
384 kal_uint32 subclass_code;
385 kal_uint32 protocol_code;
386 kal_uint32 product_code;
387} drvusb_usbcfg_req_struct;
388
389/*USB->L4*/
390typedef struct {
391 LOCAL_PARA_HDR
392 USB_DEVICE_TYPE mode;
393 kal_uint32 reserved;
394 kal_bool result;
395} drvuem_usbcfg_cnf_struct;
396
397/*USB->L4*/
398typedef enum
399{
400 DETECT_ACTION_UNKNOWN=0,
401 DETECT_ACTION_PLUGIN,
402 DETECT_ACTION_PLUGOUT,
403 DETECT_ACTION_USB_SUSPEND,
404 DETECT_ACTION_MAX_ID
405}USB_DETECT_ACTION_ID;
406
407typedef struct {
408 LOCAL_PARA_HDR
409 USB_DETECT_ACTION_ID action; /*1: Plugin, 0:PlugOut*/
410}drvuem_usbdetect_ind_struct;
411
412// add for usb charging
413typedef enum{
414 BMT_USB_100,
415 BMT_USB_500
416}bmt_usb_ind_enum;
417
418typedef struct{
419 LOCAL_PARA_HDR
420 PMU_CHR_CURRENT_ENUM usb_ind;
421}bmt_usb_ind_struct;
422
423typedef struct{
424 LOCAL_PARA_HDR
425 PW_CTRL_POWER_ON_REASON power_on;
426 kal_uint32 poweron_time_left;
427}drvuem_power_on_ind_struct;
428
429
430
431typedef struct {
432 LOCAL_PARA_HDR
433 kal_uint8 usb_ip_port;
434 kal_uint8 feature_index;
435// USB_HCD_STATUS result;
436 kal_uint8 result;
437 kal_uint32 param;
438}usb_host_usbattach_ind_struct;
439
440
441
442typedef struct {
443 LOCAL_PARA_HDR
444 kal_bool confirm;
445}rndis_usb_config_cnf_struct;
446
447
448
449/* ----------------------------------MTP------------------------------------*/
450
451/*
452 * Macro
453 */
454#define MTP_PARAM_MAX 5
455#define MTP_EVENT_MAX 3
456
457/*
458 * Enum
459 */
460
461typedef enum {
462 USB_MTP_RESULT_OK = 0,
463 USB_MTP_RESULT_CONTINUE,
464 USB_MTP_RESULT_ABORTED,
465 USB_MTP_RESULT_DEVICE_BUSY,
466 USB_MTP_RESULT_NOT_ENABLE,
467 USB_MTP_RESULT_ALREADY_ENABLE,
468 USB_MTP_RESULT_UNKNOWN_ERROR
469}usb_mtp_result_enum;
470
471
472typedef enum {
473 USB_MTP_EVENT_NORMAL = 0,
474 USB_MTP_EVENT_ABORT
475}usb_mtp_event_enum;
476
477
478/*
479 * Struct
480 */
481
482typedef struct {
483 LOCAL_PARA_HDR
484 kal_int32 result_code; /* < 0: FS error
485 >= 0: usb_mtp_result_enum */
486}usb_mtp_enable_rsp_struct, usb_mtp_disable_rsp_struct;
487
488
489typedef struct {
490 LOCAL_PARA_HDR
491 kal_uint16 op_code; /* operation */
492 kal_uint32 op_params[MTP_PARAM_MAX]; /* operation */
493
494// kal_uint16 op_serial_no; /* start from 0 */
495
496 /* Data phase */
497 kal_uint32 data_total_size; /* size of total data, 0 means no Data phase */
498 kal_uint8 *data_pool_ptr; /* data pool */
499 kal_uint32 data_pool_size; /* size of data pool */
500 kal_uint32 data_size; /* size of real data, signle direction */
501}usb_mtp_operation_req_struct;
502
503
504typedef struct {
505 LOCAL_PARA_HDR
506
507 kal_int32 result_code; /* < 0: FS error
508 >= 0: usb_mtp_result_enum */
509 kal_uint16 rsp_code;
510 kal_uint32 rsp_params[MTP_PARAM_MAX];
511
512 kal_uint16 op_code;
513// kal_uint16 op_serial_no; /* start from 0 */
514
515 /* Data phase */
516 kal_uint32 data_total_size; /* size of total data, 0 means no Data phase */
517 kal_uint8 *data_pool_ptr; /* data pool */
518 kal_uint32 data_pool_size; /* size of data pool */
519 kal_uint32 data_size; /* size of real data */
520}usb_mtp_operation_rsp_struct;
521
522
523typedef struct {
524 LOCAL_PARA_HDR
525 kal_uint16 event; // see usb_mtp_event_enum
526 kal_uint16 event_code;
527 kal_uint32 params[MTP_EVENT_MAX];
528}usb_mtp_event_ind_struct;
529
530
531#endif
532