diff options
| -rw-r--r-- | drivers/soc/tegra/pmc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 8e358dbffaed..e4fd40fa27e8 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c | |||
| @@ -176,7 +176,10 @@ static void tegra_pmc_writel(u32 value, unsigned long offset) | |||
| 176 | 176 | ||
| 177 | static inline bool tegra_powergate_state(int id) | 177 | static inline bool tegra_powergate_state(int id) |
| 178 | { | 178 | { |
| 179 | return (tegra_pmc_readl(PWRGATE_STATUS) & BIT(id)) != 0; | 179 | if (id == TEGRA_POWERGATE_3D && pmc->soc->has_gpu_clamps) |
| 180 | return (tegra_pmc_readl(GPU_RG_CNTRL) & 0x1) == 0; | ||
| 181 | else | ||
| 182 | return (tegra_pmc_readl(PWRGATE_STATUS) & BIT(id)) != 0; | ||
| 180 | } | 183 | } |
| 181 | 184 | ||
| 182 | static inline bool tegra_powergate_is_valid(int id) | 185 | static inline bool tegra_powergate_is_valid(int id) |
| @@ -191,6 +194,9 @@ static inline bool tegra_powergate_is_valid(int id) | |||
| 191 | */ | 194 | */ |
| 192 | static int tegra_powergate_set(unsigned int id, bool new_state) | 195 | static int tegra_powergate_set(unsigned int id, bool new_state) |
| 193 | { | 196 | { |
| 197 | if (id == TEGRA_POWERGATE_3D && pmc->soc->has_gpu_clamps) | ||
| 198 | return -EINVAL; | ||
| 199 | |||
| 194 | mutex_lock(&pmc->powergates_lock); | 200 | mutex_lock(&pmc->powergates_lock); |
| 195 | 201 | ||
| 196 | if (tegra_powergate_state(id) == new_state) { | 202 | if (tegra_powergate_state(id) == new_state) { |
