aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/mdm_private.h
blob: 37df78243a6c50bc3d9ae1e413cb52062ec566e0 (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
/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only 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.
 */

#ifndef _ARCH_ARM_MACH_MSM_MDM_PRIVATE_H
#define _ARCH_ARM_MACH_MSM_MDM_PRIVATE_H

struct mdm_modem_drv;

struct mdm_ops {
	void (*power_on_mdm_cb)(struct mdm_modem_drv *mdm_drv);
	void (*reset_mdm_cb)(struct mdm_modem_drv *mdm_drv);
	void (*normal_boot_done_cb)(struct mdm_modem_drv *mdm_drv);
	void (*power_down_mdm_cb)(struct mdm_modem_drv *mdm_drv);
	void (*debug_state_changed_cb)(int value);
	void (*status_cb)(struct mdm_modem_drv *mdm_drv, int value);
};

/* Private mdm2 data structure */
struct mdm_modem_drv {
	unsigned mdm2ap_errfatal_gpio;
	unsigned ap2mdm_errfatal_gpio;
	unsigned mdm2ap_status_gpio;
	unsigned ap2mdm_status_gpio;
	unsigned mdm2ap_wakeup_gpio;
	unsigned ap2mdm_wakeup_gpio;
	unsigned ap2mdm_kpdpwr_n_gpio;
	unsigned ap2mdm_soft_reset_gpio;
	unsigned ap2mdm_pmic_pwr_en_gpio;
	unsigned mdm2ap_pblrdy;
#ifdef CONFIG_SIM_DETECT
	unsigned sim_detect_gpio;
#endif
	int proto_is_dload;

	int mdm_errfatal_irq;
	int mdm_status_irq;
	int mdm_ready;
	int mdm_boot_status;
	int mdm_ram_dump_status;
	enum charm_boot_type boot_type;
	int mdm_debug_on;
	int mdm_unexpected_reset_occurred;
#ifdef CONFIG_SIM_DETECT
	int sim_state;
	bool sim_changed;
	wait_queue_head_t wq;
#endif
	struct mdm_ops *ops;
	struct mdm_platform_data *pdata;

	bool sim_shutdown_req;
	bool sim_irq;
};

int mdm_common_create(struct platform_device  *pdev,
					  struct mdm_ops *mdm_cb);
int mdm_common_modem_remove(struct platform_device *pdev);
void mdm_common_modem_shutdown(struct platform_device *pdev);
void mdm_common_set_debug_state(int value);
void mdm_peripheral_disconnect(struct mdm_modem_drv *mdm_drv);

void set_shutdown(void);
void notify_modem_fatal(void);
void request_autopm_lock(int status);
bool mdm_check_main_connect(const char *);
#ifdef CONFIG_SIM_DETECT
void get_sim_state_at_boot(void);
#endif
extern unsigned int lpcharge;
extern void ctrl_bridge_stop_all(void);
extern void rmnet_usb_ctrl_stop_all(void);
extern void silent_log_panic_handler(void);
#endif