ARM: tegra12: set CPU rate to 2.2GHz for sku 0x87
[linux-3.10.git] / arch / arm / mach-tegra / baseband-xmm-power.h
1 /*
2  * arch/arm/mach-tegra/baseband-xmm-power.h
3  *
4  * Copyright (C) 2011 NVIDIA Corporation
5  *
6  * This software is licensed under the terms of the GNU General Public
7  * License version 2, as published by the Free Software Foundation, and
8  * may be copied, distributed, and modified under those terms.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  */
16
17 #ifndef BASEBAND_XMM_POWER_H
18 #define BASEBAND_XMM_POWER_H
19
20 #include <linux/pm.h>
21 #include <linux/suspend.h>
22
23 #define TEGRA_EHCI_DEVICE "/sys/devices/platform/tegra-ehci.1/ehci_power"
24
25 #define XMM_MODEM_VER_1121      0x1121
26 #define XMM_MODEM_VER_1130      0x1130
27
28 /* shared between baseband-xmm-* modules so they can agree on same
29  * modem configuration
30  */
31 extern unsigned long modem_ver;
32 extern unsigned long modem_flash;
33 extern unsigned long modem_pm;
34
35 enum baseband_type {
36         BASEBAND_XMM,
37 };
38
39 struct baseband_power_platform_data {
40         enum baseband_type baseband_type;
41         struct platform_device* (*hsic_register)(struct platform_device *);
42         void (*hsic_unregister)(struct platform_device **);
43         struct platform_device *ehci_device;
44         union {
45                 struct {
46                         int mdm_reset;
47                         int mdm_on;
48                         int ap2mdm_ack;
49                         int mdm2ap_ack;
50                         int ap2mdm_ack2;
51                         int mdm2ap_ack2;
52                         struct platform_device *device;
53                 } generic;
54                 struct {
55                         int bb_rst;
56                         int bb_on;
57                         int ipc_bb_wake;
58                         int ipc_ap_wake;
59                         int ipc_hsic_active;
60                         int ipc_hsic_sus_req;
61                         struct platform_device *hsic_device;
62                 } xmm;
63         } modem;
64 };
65
66 enum baseband_xmm_power_work_state_t {
67         BBXMM_WORK_UNINIT,
68         BBXMM_WORK_INIT,
69         /* initialize flash modem */
70         BBXMM_WORK_INIT_FLASH_STEP1,
71         /* initialize flash (with power management support) modem */
72         BBXMM_WORK_INIT_FLASH_PM_STEP1,
73         /* initialize flashless (with power management support) modem */
74         BBXMM_WORK_INIT_FLASHLESS_PM_STEP1,
75         BBXMM_WORK_INIT_FLASHLESS_PM_STEP2,
76         BBXMM_WORK_INIT_FLASHLESS_PM_STEP3,
77         BBXMM_WORK_INIT_FLASHLESS_PM_STEP4,
78 };
79
80 struct xmm_power_data {
81         /* xmm modem state */
82         enum baseband_xmm_power_work_state_t state;
83         struct baseband_power_platform_data *pdata;
84         struct work_struct work;
85         struct platform_device *hsic_device;
86         wait_queue_head_t bb_wait;
87         /* host wakeup gpio state*/
88         unsigned int hostwake;
89 };
90
91 enum baseband_xmm_powerstate_t {
92         BBXMM_PS_L0     = 0,
93         BBXMM_PS_L2     = 1,
94         BBXMM_PS_L0TOL2 = 2,
95         BBXMM_PS_L2TOL0 = 3,
96         BBXMM_PS_UNINIT = 4,
97         BBXMM_PS_INIT   = 5,
98         BBXMM_PS_L3     = 6,
99         BBXMM_PS_LAST   = -1,
100 };
101
102 enum ipc_ap_wake_state_t {
103         IPC_AP_WAKE_UNINIT,
104         IPC_AP_WAKE_IRQ_READY,
105         IPC_AP_WAKE_INIT1,
106         IPC_AP_WAKE_INIT2,
107         IPC_AP_WAKE_L,
108         IPC_AP_WAKE_H,
109 };
110
111 irqreturn_t xmm_power_ipc_ap_wake_irq(int value);
112
113 void baseband_xmm_set_power_status(unsigned int status);
114 extern struct xmm_power_data xmm_power_drv_data;
115
116 #endif  /* BASEBAND_XMM_POWER_H */