summaryrefslogtreecommitdiff
path: root/mali_pixel/mali_pixel_mod.c
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2021-03-22 22:13:08 -0700
committerJesse Hall <jessehall@google.com>2021-03-23 08:20:33 -0700
commite0072f7ba56eac21aeb7cdbb7b809e57be3b9e02 (patch)
treed718c89ae3aa8ebca9c6c031d7d171dec842aead /mali_pixel/mali_pixel_mod.c
parent93bc11f6bce0fd9852b58bd0fea7ac008f2da7e5 (diff)
downloadgpu-e0072f7ba56eac21aeb7cdbb7b809e57be3b9e02.tar.gz
mali_pixel: consolidate mali_mgm and mali_pcm
Test: boot to Android home, check dmesg for mali-mcm and mali-pcm probe Signed-off-by: Jesse Hall <jessehall@google.com> Change-Id: I47a7da5fd3b4a24832e2978dcce0b99fe7b54c7c
Diffstat (limited to 'mali_pixel/mali_pixel_mod.c')
-rw-r--r--mali_pixel/mali_pixel_mod.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/mali_pixel/mali_pixel_mod.c b/mali_pixel/mali_pixel_mod.c
new file mode 100644
index 0000000..47b5090
--- /dev/null
+++ b/mali_pixel/mali_pixel_mod.c
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include "mali_pixel_mod.h"
+#include <linux/module.h>
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Pixel platform integration for GPU");
+MODULE_AUTHOR("<sidaths@google.com>");
+MODULE_VERSION("1.0");
+
+static int __init mali_pixel_init(void)
+{
+ int ret = 0;
+
+#ifdef CONFIG_MALI_MEMORY_GROUP_MANAGER
+ ret = platform_driver_register(&memory_group_manager_driver);
+#endif
+ if (ret)
+ goto fail_mgm;
+
+#ifdef CONFIG_MALI_PRIORITY_CONTROL_MANAGER
+ ret = platform_driver_register(&priority_control_manager_driver);
+#else
+#endif
+ if (ret)
+ goto fail_pcm;
+
+ goto exit;
+
+fail_pcm:
+#ifdef CONFIG_MALI_MEMORY_GROUP_MANAGER
+ platform_driver_unregister(&memory_group_manager_driver);
+#endif
+
+fail_mgm:
+ /* nothing to clean up here */
+
+exit:
+ return ret;
+}
+module_init(mali_pixel_init);
+
+static void __exit mali_pixel_exit(void)
+{
+#ifdef CONFIG_MALI_PRIORITY_CONTROL_MANAGER
+ platform_driver_unregister(&priority_control_manager_driver);
+#endif
+#ifdef CONFIG_MALI_MEMORY_GROUP_MANAGER
+ platform_driver_unregister(&memory_group_manager_driver);
+#endif
+}
+module_exit(mali_pixel_exit);