1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
/*
* linux/arch/arm/mach-sprd/modem_interface.h
*
* Generic modem interface structure defination.
*
* Author: Jiayong.Yang(Jiayong.Yang@spreadtrum.com)
* Created: Jul 27, 2012
* Copyright: Spreadtrum Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef _MODEM_INTF_H
#define _MODEM_INTF_H
enum MODEM_Mode_type {
MODEM_MODE_SHUTDOWN,
MODEM_MODE_BOOT,
MODEM_MODE_BOOTCOMP,
MODEM_MODE_NORMAL,
MODEM_MODE_DUMP,
MODEM_MODE_RESET,
MODEM_MODE_UNKNOWN
};
enum MODEM_device_type {
MODEM_DEV_UART,
MODEM_DEV_SPI,
MODEM_DEV_SDIO,
MODEM_DEV_VPIP
};
enum {
MODEM_STATUS_REBOOT,
MODEM_STATUS_ALVIE,
MODEM_STATUS_ASSERT,
MODEM_STATUS_POWERON
};
enum {
MODEMSTS_LEVEL_MUX = 50,
MODEMSTS_LEVEL_SDIO = 100,
MODEMSTS_LEVEL_SPI = 150,
};
struct modemsts_chg {
struct list_head link;
int level;
void *data;
void (*modemsts_notifier)(struct modemsts_chg *h, unsigned int state);
};
struct modem_intf_platform_data{
enum MODEM_device_type dev_type;
void *modem_dev_parameter;
int modem_power_gpio;
int modem_boot_gpio;
int modem_watchdog_gpio;
int modem_alive_gpio;
int modem_crash_gpio;
int modem_reset_gpio;
};
extern int modem_intf_open(enum MODEM_Mode_type mode,int index);
extern int modem_intf_read(char *buffer, int size,int index);
extern int modem_intf_write(char *buffer, int size,int index);
extern void modem_intf_set_mode(enum MODEM_Mode_type mode,int index);
extern int modemsts_notifier_register(struct modemsts_chg *handler);
extern int modemsts_notifier_unregister(struct modemsts_chg *handler);
extern void modemsts_change_notification(unsigned int state);
#endif
|