| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2010 Google, Inc |
|---|
| 3 | 4 | * Copyright (c) 2014 NVIDIA Corporation |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * Author: |
|---|
| 6 | 7 | * Colin Cross <ccross@google.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This software is licensed under the terms of the GNU General Public |
|---|
| 9 | | - * License version 2, as published by the Free Software Foundation, and |
|---|
| 10 | | - * may be copied, distributed, and modified under those terms. |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | | - * GNU General Public License for more details. |
|---|
| 16 | | - * |
|---|
| 17 | 8 | */ |
|---|
| 18 | 9 | |
|---|
| 19 | 10 | #ifndef __SOC_TEGRA_PMC_H__ |
|---|
| .. | .. |
|---|
| 26 | 17 | struct clk; |
|---|
| 27 | 18 | struct reset_control; |
|---|
| 28 | 19 | |
|---|
| 29 | | -#ifdef CONFIG_SMP |
|---|
| 30 | 20 | bool tegra_pmc_cpu_is_powered(unsigned int cpuid); |
|---|
| 31 | 21 | int tegra_pmc_cpu_power_on(unsigned int cpuid); |
|---|
| 32 | 22 | int tegra_pmc_cpu_remove_clamping(unsigned int cpuid); |
|---|
| 33 | | -#endif /* CONFIG_SMP */ |
|---|
| 34 | 23 | |
|---|
| 35 | 24 | /* |
|---|
| 36 | 25 | * powergate and I/O rail APIs |
|---|
| .. | .. |
|---|
| 90 | 79 | TEGRA_IO_PAD_CSID, |
|---|
| 91 | 80 | TEGRA_IO_PAD_CSIE, |
|---|
| 92 | 81 | TEGRA_IO_PAD_CSIF, |
|---|
| 82 | + TEGRA_IO_PAD_CSIG, |
|---|
| 83 | + TEGRA_IO_PAD_CSIH, |
|---|
| 84 | + TEGRA_IO_PAD_DAP3, |
|---|
| 85 | + TEGRA_IO_PAD_DAP5, |
|---|
| 93 | 86 | TEGRA_IO_PAD_DBG, |
|---|
| 94 | 87 | TEGRA_IO_PAD_DEBUG_NONAO, |
|---|
| 95 | 88 | TEGRA_IO_PAD_DMIC, |
|---|
| .. | .. |
|---|
| 102 | 95 | TEGRA_IO_PAD_EDP, |
|---|
| 103 | 96 | TEGRA_IO_PAD_EMMC, |
|---|
| 104 | 97 | TEGRA_IO_PAD_EMMC2, |
|---|
| 98 | + TEGRA_IO_PAD_EQOS, |
|---|
| 105 | 99 | TEGRA_IO_PAD_GPIO, |
|---|
| 100 | + TEGRA_IO_PAD_GP_PWM2, |
|---|
| 101 | + TEGRA_IO_PAD_GP_PWM3, |
|---|
| 106 | 102 | TEGRA_IO_PAD_HDMI, |
|---|
| 107 | 103 | TEGRA_IO_PAD_HDMI_DP0, |
|---|
| 108 | 104 | TEGRA_IO_PAD_HDMI_DP1, |
|---|
| 105 | + TEGRA_IO_PAD_HDMI_DP2, |
|---|
| 106 | + TEGRA_IO_PAD_HDMI_DP3, |
|---|
| 109 | 107 | TEGRA_IO_PAD_HSIC, |
|---|
| 110 | 108 | TEGRA_IO_PAD_HV, |
|---|
| 111 | 109 | TEGRA_IO_PAD_LVDS, |
|---|
| .. | .. |
|---|
| 116 | 114 | TEGRA_IO_PAD_PEX_CLK1, |
|---|
| 117 | 115 | TEGRA_IO_PAD_PEX_CLK2, |
|---|
| 118 | 116 | TEGRA_IO_PAD_PEX_CLK3, |
|---|
| 117 | + TEGRA_IO_PAD_PEX_CLK_2_BIAS, |
|---|
| 118 | + TEGRA_IO_PAD_PEX_CLK_2, |
|---|
| 119 | 119 | TEGRA_IO_PAD_PEX_CNTRL, |
|---|
| 120 | + TEGRA_IO_PAD_PEX_CTL2, |
|---|
| 121 | + TEGRA_IO_PAD_PEX_L0_RST_N, |
|---|
| 122 | + TEGRA_IO_PAD_PEX_L1_RST_N, |
|---|
| 123 | + TEGRA_IO_PAD_PEX_L5_RST_N, |
|---|
| 124 | + TEGRA_IO_PAD_PWR_CTL, |
|---|
| 120 | 125 | TEGRA_IO_PAD_SDMMC1, |
|---|
| 121 | 126 | TEGRA_IO_PAD_SDMMC1_HV, |
|---|
| 122 | 127 | TEGRA_IO_PAD_SDMMC2, |
|---|
| .. | .. |
|---|
| 124 | 129 | TEGRA_IO_PAD_SDMMC3, |
|---|
| 125 | 130 | TEGRA_IO_PAD_SDMMC3_HV, |
|---|
| 126 | 131 | TEGRA_IO_PAD_SDMMC4, |
|---|
| 132 | + TEGRA_IO_PAD_SOC_GPIO10, |
|---|
| 133 | + TEGRA_IO_PAD_SOC_GPIO12, |
|---|
| 134 | + TEGRA_IO_PAD_SOC_GPIO13, |
|---|
| 135 | + TEGRA_IO_PAD_SOC_GPIO53, |
|---|
| 127 | 136 | TEGRA_IO_PAD_SPI, |
|---|
| 128 | 137 | TEGRA_IO_PAD_SPI_HV, |
|---|
| 129 | 138 | TEGRA_IO_PAD_SYS_DDC, |
|---|
| 130 | 139 | TEGRA_IO_PAD_UART, |
|---|
| 140 | + TEGRA_IO_PAD_UART4, |
|---|
| 141 | + TEGRA_IO_PAD_UART5, |
|---|
| 131 | 142 | TEGRA_IO_PAD_UFS, |
|---|
| 132 | 143 | TEGRA_IO_PAD_USB0, |
|---|
| 133 | 144 | TEGRA_IO_PAD_USB1, |
|---|
| .. | .. |
|---|
| 141 | 152 | #define TEGRA_IO_RAIL_HDMI TEGRA_IO_PAD_HDMI |
|---|
| 142 | 153 | #define TEGRA_IO_RAIL_LVDS TEGRA_IO_PAD_LVDS |
|---|
| 143 | 154 | |
|---|
| 144 | | -/** |
|---|
| 145 | | - * enum tegra_io_pad_voltage - voltage level of the I/O pad's source rail |
|---|
| 146 | | - * @TEGRA_IO_PAD_1800000UV: 1.8 V |
|---|
| 147 | | - * @TEGRA_IO_PAD_3300000UV: 3.3 V |
|---|
| 148 | | - */ |
|---|
| 149 | | -enum tegra_io_pad_voltage { |
|---|
| 150 | | - TEGRA_IO_PAD_1800000UV, |
|---|
| 151 | | - TEGRA_IO_PAD_3300000UV, |
|---|
| 152 | | -}; |
|---|
| 153 | | - |
|---|
| 154 | 155 | #ifdef CONFIG_SOC_TEGRA_PMC |
|---|
| 155 | | -int tegra_powergate_is_powered(unsigned int id); |
|---|
| 156 | 156 | int tegra_powergate_power_on(unsigned int id); |
|---|
| 157 | 157 | int tegra_powergate_power_off(unsigned int id); |
|---|
| 158 | 158 | int tegra_powergate_remove_clamping(unsigned int id); |
|---|
| .. | .. |
|---|
| 163 | 163 | |
|---|
| 164 | 164 | int tegra_io_pad_power_enable(enum tegra_io_pad id); |
|---|
| 165 | 165 | int tegra_io_pad_power_disable(enum tegra_io_pad id); |
|---|
| 166 | | -int tegra_io_pad_set_voltage(enum tegra_io_pad id, |
|---|
| 167 | | - enum tegra_io_pad_voltage voltage); |
|---|
| 168 | | -int tegra_io_pad_get_voltage(enum tegra_io_pad id); |
|---|
| 169 | 166 | |
|---|
| 170 | 167 | /* deprecated, use tegra_io_pad_power_{enable,disable}() instead */ |
|---|
| 171 | 168 | int tegra_io_rail_power_on(unsigned int id); |
|---|
| 172 | 169 | int tegra_io_rail_power_off(unsigned int id); |
|---|
| 173 | 170 | |
|---|
| 174 | | -enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void); |
|---|
| 175 | 171 | void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode); |
|---|
| 176 | 172 | void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode); |
|---|
| 177 | 173 | |
|---|
| 178 | 174 | #else |
|---|
| 179 | | -static inline int tegra_powergate_is_powered(unsigned int id) |
|---|
| 180 | | -{ |
|---|
| 181 | | - return -ENOSYS; |
|---|
| 182 | | -} |
|---|
| 183 | | - |
|---|
| 184 | 175 | static inline int tegra_powergate_power_on(unsigned int id) |
|---|
| 185 | 176 | { |
|---|
| 186 | 177 | return -ENOSYS; |
|---|
| .. | .. |
|---|
| 213 | 204 | return -ENOSYS; |
|---|
| 214 | 205 | } |
|---|
| 215 | 206 | |
|---|
| 216 | | -static inline int tegra_io_pad_set_voltage(enum tegra_io_pad id, |
|---|
| 217 | | - enum tegra_io_pad_voltage voltage) |
|---|
| 218 | | -{ |
|---|
| 219 | | - return -ENOSYS; |
|---|
| 220 | | -} |
|---|
| 221 | | - |
|---|
| 222 | 207 | static inline int tegra_io_pad_get_voltage(enum tegra_io_pad id) |
|---|
| 223 | 208 | { |
|---|
| 224 | 209 | return -ENOSYS; |
|---|
| .. | .. |
|---|
| 234 | 219 | return -ENOSYS; |
|---|
| 235 | 220 | } |
|---|
| 236 | 221 | |
|---|
| 237 | | -static inline enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void) |
|---|
| 238 | | -{ |
|---|
| 239 | | - return TEGRA_SUSPEND_NONE; |
|---|
| 240 | | -} |
|---|
| 241 | | - |
|---|
| 242 | 222 | static inline void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode) |
|---|
| 243 | 223 | { |
|---|
| 244 | 224 | } |
|---|
| .. | .. |
|---|
| 249 | 229 | |
|---|
| 250 | 230 | #endif /* CONFIG_SOC_TEGRA_PMC */ |
|---|
| 251 | 231 | |
|---|
| 232 | +#if defined(CONFIG_SOC_TEGRA_PMC) && defined(CONFIG_PM_SLEEP) |
|---|
| 233 | +enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void); |
|---|
| 234 | +#else |
|---|
| 235 | +static inline enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void) |
|---|
| 236 | +{ |
|---|
| 237 | + return TEGRA_SUSPEND_NONE; |
|---|
| 238 | +} |
|---|
| 239 | +#endif |
|---|
| 240 | + |
|---|
| 252 | 241 | #endif /* __SOC_TEGRA_PMC_H__ */ |
|---|