blob: 92fb1411aa892c1500e06268898b065bd3e5577c [file] [log] [blame]
Duy Truong790f06d2013-02-13 16:38:12 -08001/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
Joel Kingb6f0f612011-11-01 16:59:14 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef _ARCH_ARM_MACH_MSM_MDM_PRIVATE_H
14#define _ARCH_ARM_MACH_MSM_MDM_PRIVATE_H
15
Joel King96c96dc2012-07-30 09:06:15 -070016#define MDM_DEBUG_MASK_VDDMIN_SETUP (0x00000002)
Joel Kingbf3e4b52012-09-26 09:10:34 -070017#define MDM_DEBUG_MASK_SHDN_LOG (0x00000004)
Ameya Thakure155ece2012-07-09 12:08:37 -070018#define GPIO_IS_VALID(gpio) \
19 (gpio != -1)
Joel Kingb6f0f612011-11-01 16:59:14 -070020struct mdm_modem_drv;
21
Joel Kinge9cd5272012-01-28 12:48:59 -080022struct mdm_ops {
23 void (*power_on_mdm_cb)(struct mdm_modem_drv *mdm_drv);
Joel Kinge92eb872012-05-06 09:30:24 -070024 void (*reset_mdm_cb)(struct mdm_modem_drv *mdm_drv);
Joel Kinga7a7b9a2012-06-28 13:35:28 -070025 void (*atomic_reset_mdm_cb)(struct mdm_modem_drv *mdm_drv);
Joel Kinge9cd5272012-01-28 12:48:59 -080026 void (*normal_boot_done_cb)(struct mdm_modem_drv *mdm_drv);
27 void (*power_down_mdm_cb)(struct mdm_modem_drv *mdm_drv);
28 void (*debug_state_changed_cb)(int value);
Joel Kingd8052c02012-02-03 12:33:31 -080029 void (*status_cb)(struct mdm_modem_drv *mdm_drv, int value);
Ameya Thakur43248fd2012-07-10 18:50:52 -070030 void (*image_upgrade_cb)(struct mdm_modem_drv *mdm_drv, int type);
Joel Kinge9cd5272012-01-28 12:48:59 -080031};
32
Joel Kingb6f0f612011-11-01 16:59:14 -070033/* Private mdm2 data structure */
34struct mdm_modem_drv {
35 unsigned mdm2ap_errfatal_gpio;
36 unsigned ap2mdm_errfatal_gpio;
37 unsigned mdm2ap_status_gpio;
38 unsigned ap2mdm_status_gpio;
39 unsigned mdm2ap_wakeup_gpio;
40 unsigned ap2mdm_wakeup_gpio;
Joel Kingb6f0f612011-11-01 16:59:14 -070041 unsigned ap2mdm_kpdpwr_n_gpio;
Joel Kinge92eb872012-05-06 09:30:24 -070042 unsigned ap2mdm_soft_reset_gpio;
43 unsigned ap2mdm_pmic_pwr_en_gpio;
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -070044 unsigned mdm2ap_pblrdy;
Ameya Thakur43248fd2012-07-10 18:50:52 -070045 unsigned usb_switch_gpio;
Joel Kingb6f0f612011-11-01 16:59:14 -070046
47 int mdm_errfatal_irq;
48 int mdm_status_irq;
49 int mdm_ready;
50 int mdm_boot_status;
51 int mdm_ram_dump_status;
52 enum charm_boot_type boot_type;
53 int mdm_debug_on;
Joel Kinge92eb872012-05-06 09:30:24 -070054 int mdm_unexpected_reset_occurred;
Ameya Thakur43248fd2012-07-10 18:50:52 -070055 int disable_status_check;
Joel Kingb6f0f612011-11-01 16:59:14 -070056
Joel Kinge9cd5272012-01-28 12:48:59 -080057 struct mdm_ops *ops;
Joel King415af512012-02-03 10:22:43 -080058 struct mdm_platform_data *pdata;
Joel Kingb6f0f612011-11-01 16:59:14 -070059};
60
61int mdm_common_create(struct platform_device *pdev,
Joel Kinge9cd5272012-01-28 12:48:59 -080062 struct mdm_ops *mdm_cb);
Joel Kingb6f0f612011-11-01 16:59:14 -070063int mdm_common_modem_remove(struct platform_device *pdev);
64void mdm_common_modem_shutdown(struct platform_device *pdev);
65void mdm_common_set_debug_state(int value);
66
67#endif
68