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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
/*
* mdm_ctrl_board.h
*
* Header for the Modem control driver.
*
* Copyright (C) 2010, 2011 Intel Corporation. All rights reserved.
*
* Contact: Frederic BERAT <fredericx.berat@intel.com>
* Faouaz TENOUTIT <faouazx.tenoutit@intel.com>
*
* 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.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef __MDM_CTRL_BOARD_H__
#define __MDM_CTRL_BOARD_H__
#include <asm/intel-mid.h>
#include <linux/module.h>
#define DEVICE_NAME "modem_control"
#define DRVNAME "mdm_ctrl"
/* Supported PMIC IDs*/
enum {
PMIC_UNSUP,
PMIC_MFLD,
PMIC_CLVT,
PMIC_MRFL,
PMIC_BYT,
PMIC_MOOR,
PMIC_CHT
};
/* Supported CPU IDs*/
enum {
CPU_UNSUP,
CPU_PWELL,
CPU_CLVIEW,
CPU_TANGIER,
CPU_VVIEW2,
CPU_ANNIEDALE,
CPU_CHERRYVIEW
};
struct mdm_ops {
int (*init) (void *data);
int (*cleanup) (void *data);
int (*get_cflash_delay) (void *data);
int (*get_wflash_delay) (void *data);
int (*power_on) (void *data);
int (*power_off) (void *data);
int (*warm_reset) (void *data, int gpio_rst);
};
struct cpu_ops {
int (*init) (void *data);
int (*cleanup) (void *data);
int (*get_mdm_state) (void *data);
int (*get_irq_cdump) (void *data);
int (*get_irq_rst) (void *data);
int (*get_gpio_rst) (void *data);
int (*get_gpio_pwr) (void *data);
int (*get_gpio_on) (void *data);
};
struct pmic_ops {
int (*init) (void *data);
int (*cleanup) (void *data);
int (*power_on_mdm) (void *data);
int (*power_off_mdm) (void *data);
int (*get_early_pwr_on) (void *data);
int (*get_early_pwr_off) (void *data);
};
struct mcd_base_info {
/* modem infos */
int mdm_ver;
struct mdm_ops mdm;
void *modem_data;
/* cpu infos */
int cpu_ver;
struct cpu_ops cpu;
void *cpu_data;
/* pmic infos */
int pmic_ver;
struct pmic_ops pmic;
void *pmic_data;
/* board type */
int board_type;
/* power on type */
int pwr_on_ctrl;
/* usb hub cotrol */
int usb_hub_ctrl;
};
struct sfi_to_mdm {
char modem_name[SFI_NAME_LEN + 1];
int modem_type;
};
/* GPIO names */
#define GPIO_RST_OUT "ifx_mdm_rst_out"
#define GPIO_PWR_ON "ifx_mdm_pwr_on"
#define GPIO_PWR_ON_2 "xenon_trigger"
#define GPIO_RST_BBN "ifx_mdm_rst_pmu"
#define GPIO_CDUMP "modem-gpio2"
#define GPIO_CDUMP_MRFL "MODEM_CORE_DUMP"
#define GPIO_ON_KEY "MODEM_RSVD_GPIO" /* @TODO: rename to adapt to the GPIO function */
/* Retrieve modem parameters on ACPI framework */
int retrieve_modem_platform_data(struct platform_device *pdev);
int get_nb_mdms(void);
int mcd_register_mdm_info(struct mcd_base_info *info,
struct platform_device *pdev);
void mcd_set_mdm(struct mcd_base_info *info, int mdm_ver);
int mcd_finalize_cpu_data(struct mcd_base_info *mcd_reg_info);
/* struct mcd_cpu_data
* @gpio_rst_out: Reset out gpio (self reset indicator)
* @gpio_pwr_on: Power on gpio (ON1 - Power up pin)
* @gpio_rst_bbn: RST_BB_N gpio (Reset pin)
* @gpio_cdump: CORE DUMP indicator
* @irq_cdump: CORE DUMP irq
* @irq_reset: RST_BB_N irq
*/
struct mdm_ctrl_cpu_data {
int entries[4];
/* GPIOs */
char *gpio_rst_out_name;
int gpio_rst_out;
char *gpio_pwr_on_name;
int gpio_pwr_on;
char *gpio_rst_bbn_name;
int gpio_rst_bbn;
char *gpio_cdump_name;
int gpio_cdump;
char *gpio_on_key_name;
int gpio_on_key;
char *gpio_wwan_disable_name;
char *gpio_wake_on_wwan_name;
/* NGFF specific */
int gpio_wwan_disable;
int gpio_wake_on_wwan;
/* IRQs */
int irq_cdump;
int irq_reset;
int irq_wake_on_wwan;
};
/* struct mdm_ctrl_pmic_data
* @chipctrl: PMIC base address
* @chipctrlon: Modem power on PMIC value
* @chipctrloff: Modem power off PMIC value
* @early_pwr_on: call to power_on on probe indicator
* @early_pwr_off: call to power_off on probe indicator
* @pwr_down_duration:Powering down duration (us)
*/
struct mdm_ctrl_pmic_data {
int chipctrl;
int chipctrlon;
int chipctrloff;
int chipctrl_mask;
bool early_pwr_on;
bool early_pwr_off;
int pwr_down_duration;
};
/* struct mdm_ctrl_device_info - Board and modem infos
*
* @pre_on_delay:Delay before pulse on ON1 (us)
* @on_duration:Pulse on ON1 duration (us)
* @pre_wflash_delay:Delay before flashing window, after warm_reset (ms)
* @pre_cflash_delay:Delay before flashing window, after cold_reset (ms)
* @flash_duration:Flashing window durtion (ms)int Not used ?
* @warm_rst_duration:Warm reset duration (ms)
*/
struct mdm_ctrl_mdm_data {
int pre_on_delay;
int on_duration;
int pre_wflash_delay;
int pre_cflash_delay;
int flash_duration;
int warm_rst_duration;
int pre_pwr_down_delay;
};
#endif /* __MDM_CTRL_BOARD_H__ */
|