hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/arm/bifrost/mali_kbase_platform_fake.c
....@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
22 /*
33 *
4
- * (C) COPYRIGHT 2011-2014, 2016-2017, 2020-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2011-2014, 2016-2017, 2020-2022 ARM Limited. All rights reserved.
55 *
66 * This program is free software and is provided to you under the terms of the
77 * GNU General Public License version 2 as published by the Free Software
....@@ -32,14 +32,15 @@
3232 */
3333 #include <mali_kbase_config.h>
3434
35
+#ifndef CONFIG_OF
36
+
3537 #define PLATFORM_CONFIG_RESOURCE_COUNT 4
36
-#define PLATFORM_CONFIG_IRQ_RES_COUNT 3
3738
3839 static struct platform_device *mali_device;
3940
40
-#ifndef CONFIG_OF
4141 /**
42
- * Convert data in struct kbase_io_resources struct to Linux-specific resources
42
+ * kbasep_config_parse_io_resources - Convert data in struct kbase_io_resources
43
+ * struct to Linux-specific resources
4344 * @io_resources: Input IO resource data
4445 * @linux_resources: Pointer to output array of Linux resource structures
4546 *
....@@ -72,14 +73,11 @@
7273 linux_resources[3].end = io_resources->gpu_irq_number;
7374 linux_resources[3].flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL;
7475 }
75
-#endif /* CONFIG_OF */
7676
7777 int kbase_platform_register(void)
7878 {
7979 struct kbase_platform_config *config;
80
-#ifndef CONFIG_OF
8180 struct resource resources[PLATFORM_CONFIG_RESOURCE_COUNT];
82
-#endif
8381 int err;
8482
8583 config = kbase_get_platform_config(); /* declared in midgard/mali_kbase_config.h but defined in platform folder */
....@@ -92,7 +90,6 @@
9290 if (mali_device == NULL)
9391 return -ENOMEM;
9492
95
-#ifndef CONFIG_OF
9693 kbasep_config_parse_io_resources(config->io_resources, resources);
9794 err = platform_device_add_resources(mali_device, resources, PLATFORM_CONFIG_RESOURCE_COUNT);
9895 if (err) {
....@@ -100,7 +97,6 @@
10097 mali_device = NULL;
10198 return err;
10299 }
103
-#endif /* CONFIG_OF */
104100
105101 err = platform_device_add(mali_device);
106102 if (err) {
....@@ -119,3 +115,5 @@
119115 platform_device_unregister(mali_device);
120116 }
121117 EXPORT_SYMBOL(kbase_platform_unregister);
118
+
119
+#endif /* CONFIG_OF */