.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2014 NVIDIA Corporation |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify |
---|
5 | | - * it under the terms of the GNU General Public License version 2 as |
---|
6 | | - * published by the Free Software Foundation. |
---|
7 | 4 | */ |
---|
8 | 5 | |
---|
9 | 6 | #ifndef __SOC_TEGRA_MC_H__ |
---|
10 | 7 | #define __SOC_TEGRA_MC_H__ |
---|
11 | 8 | |
---|
| 9 | +#include <linux/err.h> |
---|
12 | 10 | #include <linux/reset-controller.h> |
---|
13 | 11 | #include <linux/types.h> |
---|
14 | 12 | |
---|
.. | .. |
---|
77 | 75 | |
---|
78 | 76 | struct tegra_mc; |
---|
79 | 77 | struct tegra_smmu; |
---|
| 78 | +struct gart_device; |
---|
80 | 79 | |
---|
81 | 80 | #ifdef CONFIG_TEGRA_IOMMU_SMMU |
---|
82 | 81 | struct tegra_smmu *tegra_smmu_probe(struct device *dev, |
---|
.. | .. |
---|
93 | 92 | |
---|
94 | 93 | static inline void tegra_smmu_remove(struct tegra_smmu *smmu) |
---|
95 | 94 | { |
---|
| 95 | +} |
---|
| 96 | +#endif |
---|
| 97 | + |
---|
| 98 | +#ifdef CONFIG_TEGRA_IOMMU_GART |
---|
| 99 | +struct gart_device *tegra_gart_probe(struct device *dev, struct tegra_mc *mc); |
---|
| 100 | +int tegra_gart_suspend(struct gart_device *gart); |
---|
| 101 | +int tegra_gart_resume(struct gart_device *gart); |
---|
| 102 | +#else |
---|
| 103 | +static inline struct gart_device * |
---|
| 104 | +tegra_gart_probe(struct device *dev, struct tegra_mc *mc) |
---|
| 105 | +{ |
---|
| 106 | + return ERR_PTR(-ENODEV); |
---|
| 107 | +} |
---|
| 108 | + |
---|
| 109 | +static inline int tegra_gart_suspend(struct gart_device *gart) |
---|
| 110 | +{ |
---|
| 111 | + return -ENODEV; |
---|
| 112 | +} |
---|
| 113 | + |
---|
| 114 | +static inline int tegra_gart_resume(struct gart_device *gart) |
---|
| 115 | +{ |
---|
| 116 | + return -ENODEV; |
---|
96 | 117 | } |
---|
97 | 118 | #endif |
---|
98 | 119 | |
---|
.. | .. |
---|
144 | 165 | struct tegra_mc { |
---|
145 | 166 | struct device *dev; |
---|
146 | 167 | struct tegra_smmu *smmu; |
---|
147 | | - void __iomem *regs, *regs2; |
---|
| 168 | + struct gart_device *gart; |
---|
| 169 | + void __iomem *regs; |
---|
148 | 170 | struct clk *clk; |
---|
149 | 171 | int irq; |
---|
150 | 172 | |
---|
.. | .. |
---|
159 | 181 | spinlock_t lock; |
---|
160 | 182 | }; |
---|
161 | 183 | |
---|
162 | | -void tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate); |
---|
| 184 | +int tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate); |
---|
163 | 185 | unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc); |
---|
164 | 186 | |
---|
165 | 187 | #endif /* __SOC_TEGRA_MC_H__ */ |
---|