Ameya Thakur | 552e58a | 2013-01-30 11:33:22 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. |
Joel King | b6f0f61 | 2011-11-01 16:59:14 -0700 | [diff] [blame] | 2 | * |
| 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 King | 96c96dc | 2012-07-30 09:06:15 -0700 | [diff] [blame] | 16 | #define MDM_DEBUG_MASK_VDDMIN_SETUP (0x00000002) |
Joel King | bf3e4b5 | 2012-09-26 09:10:34 -0700 | [diff] [blame] | 17 | #define MDM_DEBUG_MASK_SHDN_LOG (0x00000004) |
Ameya Thakur | e155ece | 2012-07-09 12:08:37 -0700 | [diff] [blame] | 18 | #define GPIO_IS_VALID(gpio) \ |
| 19 | (gpio != -1) |
Joel King | b6f0f61 | 2011-11-01 16:59:14 -0700 | [diff] [blame] | 20 | struct mdm_modem_drv; |
| 21 | |
Joel King | e9cd527 | 2012-01-28 12:48:59 -0800 | [diff] [blame] | 22 | struct mdm_ops { |
| 23 | void (*power_on_mdm_cb)(struct mdm_modem_drv *mdm_drv); |
Joel King | e92eb87 | 2012-05-06 09:30:24 -0700 | [diff] [blame] | 24 | void (*reset_mdm_cb)(struct mdm_modem_drv *mdm_drv); |
Joel King | a7a7b9a | 2012-06-28 13:35:28 -0700 | [diff] [blame] | 25 | void (*atomic_reset_mdm_cb)(struct mdm_modem_drv *mdm_drv); |
Joel King | e9cd527 | 2012-01-28 12:48:59 -0800 | [diff] [blame] | 26 | 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 King | d8052c0 | 2012-02-03 12:33:31 -0800 | [diff] [blame] | 29 | void (*status_cb)(struct mdm_modem_drv *mdm_drv, int value); |
Ameya Thakur | 43248fd | 2012-07-10 18:50:52 -0700 | [diff] [blame] | 30 | void (*image_upgrade_cb)(struct mdm_modem_drv *mdm_drv, int type); |
Joel King | e9cd527 | 2012-01-28 12:48:59 -0800 | [diff] [blame] | 31 | }; |
| 32 | |
Joel King | b6f0f61 | 2011-11-01 16:59:14 -0700 | [diff] [blame] | 33 | /* Private mdm2 data structure */ |
| 34 | struct 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 King | b6f0f61 | 2011-11-01 16:59:14 -0700 | [diff] [blame] | 41 | unsigned ap2mdm_kpdpwr_n_gpio; |
Joel King | e92eb87 | 2012-05-06 09:30:24 -0700 | [diff] [blame] | 42 | unsigned ap2mdm_soft_reset_gpio; |
| 43 | unsigned ap2mdm_pmic_pwr_en_gpio; |
Vamsi Krishna | c6dcd5e | 2012-05-09 15:38:01 -0700 | [diff] [blame] | 44 | unsigned mdm2ap_pblrdy; |
Ameya Thakur | 43248fd | 2012-07-10 18:50:52 -0700 | [diff] [blame] | 45 | unsigned usb_switch_gpio; |
Joel King | b6f0f61 | 2011-11-01 16:59:14 -0700 | [diff] [blame] | 46 | |
Ameya Thakur | 552e58a | 2013-01-30 11:33:22 -0800 | [diff] [blame] | 47 | atomic_t mdm_ready; |
Joel King | b6f0f61 | 2011-11-01 16:59:14 -0700 | [diff] [blame] | 48 | int mdm_boot_status; |
| 49 | int mdm_ram_dump_status; |
| 50 | enum charm_boot_type boot_type; |
| 51 | int mdm_debug_on; |
Joel King | e92eb87 | 2012-05-06 09:30:24 -0700 | [diff] [blame] | 52 | int mdm_unexpected_reset_occurred; |
Ameya Thakur | 43248fd | 2012-07-10 18:50:52 -0700 | [diff] [blame] | 53 | int disable_status_check; |
Ameya Thakur | 552e58a | 2013-01-30 11:33:22 -0800 | [diff] [blame] | 54 | unsigned int dump_timeout_ms; |
| 55 | int power_on_count; |
| 56 | int peripheral_status; |
| 57 | struct mutex peripheral_status_lock; |
| 58 | int device_id; |
Joel King | b6f0f61 | 2011-11-01 16:59:14 -0700 | [diff] [blame] | 59 | |
Joel King | 415af51 | 2012-02-03 10:22:43 -0800 | [diff] [blame] | 60 | struct mdm_platform_data *pdata; |
Joel King | b6f0f61 | 2011-11-01 16:59:14 -0700 | [diff] [blame] | 61 | }; |
Ameya Thakur | 552e58a | 2013-01-30 11:33:22 -0800 | [diff] [blame] | 62 | int mdm_get_ops(struct mdm_ops **mdm_ops); |
Joel King | b6f0f61 | 2011-11-01 16:59:14 -0700 | [diff] [blame] | 63 | |
| 64 | #endif |
| 65 | |