diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /drivers/misc/tegra-baseband/bb-power.h | |
parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) |
Diffstat (limited to 'drivers/misc/tegra-baseband/bb-power.h')
-rw-r--r-- | drivers/misc/tegra-baseband/bb-power.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/drivers/misc/tegra-baseband/bb-power.h b/drivers/misc/tegra-baseband/bb-power.h new file mode 100644 index 00000000000..cdd69380203 --- /dev/null +++ b/drivers/misc/tegra-baseband/bb-power.h | |||
@@ -0,0 +1,99 @@ | |||
1 | /* | ||
2 | * drivers/misc/tegra-baseband/bb-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 | enum tegra_bb_state { | ||
18 | BBSTATE_UNKNOWN, | ||
19 | /* Baseband state L0 - Running */ | ||
20 | BBSTATE_L0, | ||
21 | /* Baseband state L2 - Suspended */ | ||
22 | BBSTATE_L2, | ||
23 | /* Baseband state L3 - Suspended and detached */ | ||
24 | BBSTATE_L3, | ||
25 | }; | ||
26 | |||
27 | enum tegra_bb_pwrstate { | ||
28 | /* System power state - Entering suspend */ | ||
29 | PWRSTATE_L2L3, | ||
30 | /* System power state - Resuming from suspend */ | ||
31 | PWRSTATE_L3L0, | ||
32 | PWRSTATE_INVALID, | ||
33 | }; | ||
34 | |||
35 | struct tegra_bb_gpio_data { | ||
36 | /* Baseband gpio data */ | ||
37 | struct gpio data; | ||
38 | /* Baseband gpio - Should it be exported to sysfs ? */ | ||
39 | bool doexport; | ||
40 | }; | ||
41 | |||
42 | struct tegra_bb_gpio_irqdata { | ||
43 | /* Baseband gpio IRQ - Id */ | ||
44 | int id; | ||
45 | /* Baseband gpio IRQ - Friendly name */ | ||
46 | const char *name; | ||
47 | /* Baseband gpio IRQ - IRQ handler */ | ||
48 | irq_handler_t handler; | ||
49 | /* Baseband gpio IRQ - IRQ trigger flags */ | ||
50 | int flags; | ||
51 | /* Baseband gpio IRQ - Can the gpio wake system from sleep ? */ | ||
52 | bool wake_capable; | ||
53 | void *cookie; | ||
54 | }; | ||
55 | |||
56 | typedef void* (*bb_get_cblist)(void); | ||
57 | typedef void* (*bb_init_cb)(void *pdata); | ||
58 | typedef void* (*bb_deinit_cb)(void); | ||
59 | typedef int (*bb_power_cb)(int code); | ||
60 | typedef int (*bb_attrib_cb)(struct device *dev, int value); | ||
61 | typedef int (*modem_register_cb)(struct usb_device *udev); | ||
62 | |||
63 | struct tegra_bb_power_gdata { | ||
64 | struct tegra_bb_gpio_data *gpio; | ||
65 | struct tegra_bb_gpio_irqdata *gpioirq; | ||
66 | }; | ||
67 | |||
68 | struct tegra_bb_power_mdata { | ||
69 | /* Baseband USB vendor ID */ | ||
70 | int vid; | ||
71 | /* Baseband USB product ID */ | ||
72 | int pid; | ||
73 | /* Baseband capability - Can it generate a wakeup ? */ | ||
74 | bool wake_capable; | ||
75 | /* Baseband capability - Can it be auto/runtime suspended ? */ | ||
76 | bool autosuspend_ready; | ||
77 | /* Baseband callback after a successful registration */ | ||
78 | modem_register_cb reg_cb; | ||
79 | }; | ||
80 | |||
81 | struct tegra_bb_power_data { | ||
82 | struct tegra_bb_power_gdata *gpio_data; | ||
83 | struct tegra_bb_power_mdata *modem_data; | ||
84 | }; | ||
85 | |||
86 | struct tegra_bb_callback { | ||
87 | bb_init_cb init; | ||
88 | bb_deinit_cb deinit; | ||
89 | bb_power_cb power; | ||
90 | bb_attrib_cb attrib; | ||
91 | bool valid; | ||
92 | }; | ||
93 | |||
94 | #ifdef CONFIG_TEGRA_BB_M7400 | ||
95 | extern void *m7400_get_cblist(void); | ||
96 | #define M7400_CB m7400_get_cblist | ||
97 | #else | ||
98 | #define M7400_CB NULL | ||
99 | #endif | ||