summaryrefslogtreecommitdiff
path: root/drivers/gpu/host1x/context_bus.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2022-06-03 11:35:46 +1000
committerDave Airlie <airlied@redhat.com>2022-06-03 12:59:45 +1000
commit404204340c0dc54e4b779737201044dcb231f0bf (patch)
tree8384d9cfa3c6ba56aaa0191b81e688bfac7e0962 /drivers/gpu/host1x/context_bus.c
parentb8042ff4faa59ed3608beeeddc5d87ce55c62a98 (diff)
parent597b89d30b42dcc8e6b262e6876b42dde66f97f0 (diff)
Merge tag 'drm/tegra/for-5.19-prep-work' of https://gitlab.freedesktop.org/drm/tegra into drm-next
drm/tegra: Preparatory work for v5.19 This contains a single patch from a series that's ready to go for v5.10 but is also a shared build-time dependency for an IOMMU series that is planned for v5.20. The idea is to take this into v5.19 to fulfill that dependency and remove the need for close coordination for the two series. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thierry Reding <thierry.reding@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220601100335.3841301-1-thierry.reding@gmail.com
Diffstat (limited to 'drivers/gpu/host1x/context_bus.c')
-rw-r--r--drivers/gpu/host1x/context_bus.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/gpu/host1x/context_bus.c b/drivers/gpu/host1x/context_bus.c
new file mode 100644
index 000000000000..b0d35b2bbe89
--- /dev/null
+++ b/drivers/gpu/host1x/context_bus.c
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2021, NVIDIA Corporation.
+ */
+
+#include <linux/device.h>
+#include <linux/of.h>
+
+struct bus_type host1x_context_device_bus_type = {
+ .name = "host1x-context",
+};
+EXPORT_SYMBOL_GPL(host1x_context_device_bus_type);
+
+static int __init host1x_context_device_bus_init(void)
+{
+ int err;
+
+ if (!of_machine_is_compatible("nvidia,tegra186") &&
+ !of_machine_is_compatible("nvidia,tegra194") &&
+ !of_machine_is_compatible("nvidia,tegra234"))
+ return 0;
+
+ err = bus_register(&host1x_context_device_bus_type);
+ if (err < 0) {
+ pr_err("bus type registration failed: %d\n", err);
+ return err;
+ }
+
+ return 0;
+}
+postcore_initcall(host1x_context_device_bus_init);