summaryrefslogtreecommitdiff
path: root/patches.tizen/0316-modem_if-Add-modem.h-to-include-linux-platform_data.patch
blob: 90bcde1a30eb34b45f34b9eca61655b5bfa7ba14 (plain)
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
From 85d24760a443e69db2163519c62af463d6253d94 Mon Sep 17 00:00:00 2001
From: Kamil Debski <k.debski@samsung.com>
Date: Wed, 22 May 2013 14:31:10 +0200
Subject: [PATCH 0316/1302] modem_if: Add modem.h to
 include/linux/platform_data

This file is needed by modem_if driver.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
---
 include/linux/platform_data/modem.h | 330 ++++++++++++++++++++++++++++++++++++
 1 file changed, 330 insertions(+)
 create mode 100644 include/linux/platform_data/modem.h

diff --git a/include/linux/platform_data/modem.h b/include/linux/platform_data/modem.h
new file mode 100644
index 0000000..8a83ed0
--- /dev/null
+++ b/include/linux/platform_data/modem.h
@@ -0,0 +1,330 @@
+/*
+ * Copyright (C) 2010 Google, Inc.
+ * Copyright (C) 2010 Samsung Electronics.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ */
+
+#ifndef __MODEM_IF_H__
+#define __MODEM_IF_H__
+
+enum modem_t {
+	IMC_XMM6260,
+	IMC_XMM6262,
+	VIA_CBP71,
+	VIA_CBP72,
+	SEC_CMC221,
+	QC_MDM6600,
+	QC_ESC6270,
+	DUMMY,
+	MAX_MODEM_TYPE
+};
+
+enum dev_format {
+	IPC_FMT,
+	IPC_RAW,
+	IPC_RFS,
+	IPC_CMD,
+	IPC_BOOT,
+	IPC_MULTI_RAW,
+	IPC_RAMDUMP,
+	MAX_DEV_FORMAT,
+};
+#define MAX_IPC_DEV	(IPC_RFS + 1)	/* FMT, RAW, RFS */
+#define MAX_SIPC5_DEV	(IPC_RAW + 1)	/* FMT, RAW */
+
+enum modem_io {
+	IODEV_MISC,
+	IODEV_NET,
+	IODEV_DUMMY,
+};
+
+enum modem_link {
+	LINKDEV_UNDEFINED,
+	LINKDEV_MIPI,
+	LINKDEV_DPRAM,
+	LINKDEV_SPI,
+	LINKDEV_USB,
+	LINKDEV_HSIC,
+	LINKDEV_C2C,
+	LINKDEV_PLD,
+	LINKDEV_MAX,
+};
+#define LINKTYPE(modem_link) (1u << (modem_link))
+
+enum modem_network {
+	UMTS_NETWORK,
+	CDMA_NETWORK,
+	LTE_NETWORK,
+};
+
+enum sipc_ver {
+	NO_SIPC_VER = 0,
+	SIPC_VER_40 = 40,
+	SIPC_VER_41 = 41,
+	SIPC_VER_42 = 42,
+	SIPC_VER_50 = 50,
+	MAX_SIPC_VER,
+};
+
+/**
+ * struct modem_io_t - declaration for io_device
+ * @name:	device name
+ * @id:		for SIPC4, contains format & channel information
+ *		(id & 11100000b)>>5 = format  (eg, 0=FMT, 1=RAW, 2=RFS)
+ *		(id & 00011111b)    = channel (valid only if format is RAW)
+ *		for SIPC5, contains only 8-bit channel ID
+ * @format:	device format
+ * @io_type:	type of this io_device
+ * @links:	list of link_devices to use this io_device
+ *		for example, if you want to use DPRAM and USB in an io_device.
+ *		.links = LINKTYPE(LINKDEV_DPRAM) | LINKTYPE(LINKDEV_USB)
+ * @tx_link:	when you use 2+ link_devices, set the link for TX.
+ *		If define multiple link_devices in @links,
+ *		you can receive data from them. But, cannot send data to all.
+ *		TX is only one link_device.
+ * @app:	the name of the application that will use this IO device
+ *
+ * This structure is used in board-*-modem.c
+ */
+struct modem_io_t {
+	char *name;
+	int   id;
+	enum dev_format format;
+	enum modem_io io_type;
+	enum modem_link links;
+	enum modem_link tx_link;
+	char *app;
+};
+
+struct modemlink_pm_data {
+	char *name;
+	/* link power contol 2 types : pin & regulator control */
+	int (*link_ldo_enable)(bool);
+	unsigned gpio_link_enable;
+	unsigned gpio_link_active;
+	unsigned gpio_link_hostwake;
+	unsigned gpio_link_slavewake;
+	int (*link_reconnect)(void);
+
+	/* usb hub only */
+	int (*port_enable)(int, int);
+	int (*hub_standby)(void *);
+	void *hub_pm_data;
+	bool has_usbhub;
+
+	/* cpu/bus frequency lock */
+	atomic_t freqlock;
+	int (*freq_lock)(struct device *dev);
+	int (*freq_unlock)(struct device *dev);
+
+	int autosuspend_delay_ms; /* if zero, the default value is used */
+	void (*ehci_reg_dump)(struct device *);
+};
+
+struct modemlink_pm_link_activectl {
+	int gpio_initialized;
+	int gpio_request_host_active;
+};
+
+#define RES_CP_ACTIVE_IRQ_ID	0
+#define RES_DPRAM_MEM_ID	1
+#define RES_DPRAM_IRQ_ID	2
+#define RES_DPRAM_SFR_ID	3
+
+#define STR_CP_ACTIVE_IRQ	"cp_active_irq"
+#define STR_DPRAM_BASE		"dpram_base"
+#define STR_DPRAM_IRQ		"dpram_irq"
+#define STR_DPRAM_SFR_BASE	"dpram_sfr_base"
+
+enum dpram_type {
+	EXT_DPRAM,
+	AP_IDPRAM,
+	CP_IDPRAM,
+	SHM_DPRAM,
+	MAX_DPRAM_TYPE
+};
+
+#define DPRAM_SIZE_8KB		0x02000
+#define DPRAM_SIZE_16KB		0x04000
+#define DPRAM_SIZE_32KB		0x08000
+#define DPRAM_SIZE_64KB		0x10000
+#define DPRAM_SIZE_128KB	0x20000
+
+enum dpram_speed {
+	DPRAM_SPEED_LOW,
+	DPRAM_SPEED_MID,
+	DPRAM_SPEED_HIGH,
+	MAX_DPRAM_SPEED
+};
+
+struct dpram_circ {
+	u16 __iomem *head;
+	u16 __iomem *tail;
+	u8  __iomem *buff;
+	u32          size;
+};
+
+struct dpram_ipc_device {
+	char name[16];
+	int  id;
+
+	struct dpram_circ txq;
+	struct dpram_circ rxq;
+
+	u16 mask_req_ack;
+	u16 mask_res_ack;
+	u16 mask_send;
+};
+
+struct dpram_ipc_map {
+#if defined(CONFIG_LINK_DEVICE_PLD)
+	u16 __iomem *mbx_ap2cp;
+	u16 __iomem *magic_ap2cp;
+	u16 __iomem *access_ap2cp;
+
+	u16 __iomem *mbx_cp2ap;
+	u16 __iomem *magic_cp2ap;
+	u16 __iomem *access_cp2ap;
+
+	struct dpram_ipc_device dev[MAX_IPC_DEV];
+
+	u16 __iomem *address_buffer;
+#else
+	u16 __iomem *magic;
+	u16 __iomem *access;
+
+	struct dpram_ipc_device dev[MAX_IPC_DEV];
+
+	u16 __iomem *mbx_cp2ap;
+	u16 __iomem *mbx_ap2cp;
+#endif
+};
+
+struct modemlink_dpram_control {
+	enum dpram_type dp_type;	/* DPRAM type */
+	int aligned;			/* Aligned access is required */
+	bool disabled;			/* Disabled during phone booting */
+	u8 __iomem *dp_base;
+	u32 dp_size;
+
+	int dpram_irq;
+	unsigned long dpram_irq_flags;
+
+	int max_ipc_dev;
+	struct dpram_ipc_map *ipc_map;
+
+	unsigned boot_size_offset;
+	unsigned boot_tag_offset;
+	unsigned boot_count_offset;
+	unsigned max_boot_frame_size;
+
+	void (*setup_speed)(enum dpram_speed);
+};
+
+/* platform data */
+struct modem_data {
+	char *name;
+
+	unsigned gpio_cp_on;
+	unsigned gpio_cp_off;
+	unsigned gpio_reset_req_n;
+	unsigned gpio_cp_reset;
+	unsigned gpio_pda_active;
+	unsigned gpio_phone_active;
+	unsigned gpio_cp_dump_int;
+	unsigned gpio_ap_dump_int;
+	unsigned gpio_flm_uart_sel;
+#if defined(CONFIG_MACH_M0_CTC)
+	unsigned gpio_flm_uart_sel_rev06;
+	unsigned gpio_host_wakeup;
+#endif
+	unsigned gpio_cp_warm_reset;
+	unsigned gpio_sim_detect;
+	unsigned gpio_dpram_int;
+
+#ifdef CONFIG_LINK_DEVICE_PLD
+	unsigned gpio_fpga1_creset;
+	unsigned gpio_fpga1_cdone;
+	unsigned gpio_fpga1_rst_n;
+	unsigned gpio_fpga1_cs_n;
+
+	unsigned gpio_fpga2_creset;
+	unsigned gpio_fpga2_cdone;
+	unsigned gpio_fpga2_rst_n;
+	unsigned gpio_fpga2_cs_n;
+#endif
+
+#ifdef CONFIG_LTE_MODEM_CMC221
+	unsigned gpio_dpram_status;
+	unsigned gpio_dpram_wakeup;
+	unsigned gpio_slave_wakeup;
+	unsigned gpio_host_active;
+	unsigned gpio_host_wakeup;
+	int      irq_host_wakeup;
+#endif
+#ifdef CONFIG_MACH_U1_KOR_LGT
+	unsigned gpio_cp_reset_msm;
+	unsigned gpio_boot_sw_sel;
+	void (*vbus_on)(void);
+	void (*vbus_off)(void);
+	struct regulator *cp_vbus;
+#endif
+#ifdef CONFIG_SEC_MODEM_IRON_TD
+	unsigned gpio_cp_uart_sel;
+#endif
+	/* Switch with 2 links in a modem */
+	unsigned gpio_dynamic_switching;
+
+	/* Modem component */
+	enum modem_network  modem_net;
+	enum modem_t        modem_type;
+	enum modem_link     link_types;
+	char               *link_name;
+
+	/* Link to DPRAM control functions dependent on each platform */
+	struct modemlink_dpram_control *dpram_ctl;
+
+	/* SIPC version */
+	enum sipc_ver ipc_version;
+
+	/* Information of IO devices */
+	unsigned            num_iodevs;
+	struct modem_io_t  *iodevs;
+
+	/* Modem link PM support */
+	struct modemlink_pm_data *link_pm_data;
+
+	void (*gpio_revers_bias_clear)(void);
+	void (*gpio_revers_bias_restore)(void);
+
+	/* Handover with 2+ modems */
+	bool use_handover;
+
+	/* Debugging option */
+	bool use_mif_log;
+	/* SIM Detect polarity */
+	bool sim_polarity;
+};
+
+#define LOG_TAG "mif: "
+
+#define mif_err(fmt, ...) \
+	pr_err(LOG_TAG "%s: " pr_fmt(fmt), __func__, ##__VA_ARGS__)
+#define mif_debug(fmt, ...) \
+	pr_debug(LOG_TAG "%s: " pr_fmt(fmt), __func__, ##__VA_ARGS__)
+#define mif_info(fmt, ...) \
+	pr_info(LOG_TAG "%s: " pr_fmt(fmt), __func__, ##__VA_ARGS__)
+#define mif_trace(fmt, ...) \
+	printk(KERN_DEBUG "mif: %s: %d: called(%pF): " fmt, \
+		__func__, __LINE__, __builtin_return_address(0), ##__VA_ARGS__)
+
+#endif
-- 
1.8.3.2