| .. | .. |
|---|
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note |
|---|
| 2 | 2 | /* |
|---|
| 3 | 3 | * |
|---|
| 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. |
|---|
| 5 | 5 | * |
|---|
| 6 | 6 | * This program is free software and is provided to you under the terms of the |
|---|
| 7 | 7 | * GNU General Public License version 2 as published by the Free Software |
|---|
| .. | .. |
|---|
| 32 | 32 | */ |
|---|
| 33 | 33 | #include <mali_kbase_config.h> |
|---|
| 34 | 34 | |
|---|
| 35 | +#ifndef CONFIG_OF |
|---|
| 36 | + |
|---|
| 35 | 37 | #define PLATFORM_CONFIG_RESOURCE_COUNT 4 |
|---|
| 36 | | -#define PLATFORM_CONFIG_IRQ_RES_COUNT 3 |
|---|
| 37 | 38 | |
|---|
| 38 | 39 | static struct platform_device *mali_device; |
|---|
| 39 | 40 | |
|---|
| 40 | | -#ifndef CONFIG_OF |
|---|
| 41 | 41 | /** |
|---|
| 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 |
|---|
| 43 | 44 | * @io_resources: Input IO resource data |
|---|
| 44 | 45 | * @linux_resources: Pointer to output array of Linux resource structures |
|---|
| 45 | 46 | * |
|---|
| .. | .. |
|---|
| 72 | 73 | linux_resources[3].end = io_resources->gpu_irq_number; |
|---|
| 73 | 74 | linux_resources[3].flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL; |
|---|
| 74 | 75 | } |
|---|
| 75 | | -#endif /* CONFIG_OF */ |
|---|
| 76 | 76 | |
|---|
| 77 | 77 | int kbase_platform_register(void) |
|---|
| 78 | 78 | { |
|---|
| 79 | 79 | struct kbase_platform_config *config; |
|---|
| 80 | | -#ifndef CONFIG_OF |
|---|
| 81 | 80 | struct resource resources[PLATFORM_CONFIG_RESOURCE_COUNT]; |
|---|
| 82 | | -#endif |
|---|
| 83 | 81 | int err; |
|---|
| 84 | 82 | |
|---|
| 85 | 83 | config = kbase_get_platform_config(); /* declared in midgard/mali_kbase_config.h but defined in platform folder */ |
|---|
| .. | .. |
|---|
| 92 | 90 | if (mali_device == NULL) |
|---|
| 93 | 91 | return -ENOMEM; |
|---|
| 94 | 92 | |
|---|
| 95 | | -#ifndef CONFIG_OF |
|---|
| 96 | 93 | kbasep_config_parse_io_resources(config->io_resources, resources); |
|---|
| 97 | 94 | err = platform_device_add_resources(mali_device, resources, PLATFORM_CONFIG_RESOURCE_COUNT); |
|---|
| 98 | 95 | if (err) { |
|---|
| .. | .. |
|---|
| 100 | 97 | mali_device = NULL; |
|---|
| 101 | 98 | return err; |
|---|
| 102 | 99 | } |
|---|
| 103 | | -#endif /* CONFIG_OF */ |
|---|
| 104 | 100 | |
|---|
| 105 | 101 | err = platform_device_add(mali_device); |
|---|
| 106 | 102 | if (err) { |
|---|
| .. | .. |
|---|
| 119 | 115 | platform_device_unregister(mali_device); |
|---|
| 120 | 116 | } |
|---|
| 121 | 117 | EXPORT_SYMBOL(kbase_platform_unregister); |
|---|
| 118 | + |
|---|
| 119 | +#endif /* CONFIG_OF */ |
|---|