hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/include/soc/tegra/mc.h
....@@ -1,14 +1,12 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * 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.
74 */
85
96 #ifndef __SOC_TEGRA_MC_H__
107 #define __SOC_TEGRA_MC_H__
118
9
+#include <linux/err.h>
1210 #include <linux/reset-controller.h>
1311 #include <linux/types.h>
1412
....@@ -77,6 +75,7 @@
7775
7876 struct tegra_mc;
7977 struct tegra_smmu;
78
+struct gart_device;
8079
8180 #ifdef CONFIG_TEGRA_IOMMU_SMMU
8281 struct tegra_smmu *tegra_smmu_probe(struct device *dev,
....@@ -93,6 +92,28 @@
9392
9493 static inline void tegra_smmu_remove(struct tegra_smmu *smmu)
9594 {
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;
96117 }
97118 #endif
98119
....@@ -144,7 +165,8 @@
144165 struct tegra_mc {
145166 struct device *dev;
146167 struct tegra_smmu *smmu;
147
- void __iomem *regs, *regs2;
168
+ struct gart_device *gart;
169
+ void __iomem *regs;
148170 struct clk *clk;
149171 int irq;
150172
....@@ -159,7 +181,7 @@
159181 spinlock_t lock;
160182 };
161183
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);
163185 unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc);
164186
165187 #endif /* __SOC_TEGRA_MC_H__ */