int kbase_platform_fake_register(void) { kbase_platform_config *config; int attribute_count; #ifndef CONFIG_OF struct resource resources[PLATFORM_CONFIG_RESOURCE_COUNT]; #endif int err; config = kbase_get_platform_config(); /* declared in midgard/mali_kbase_config.h but defined in platform folder */ if (config == NULL) { pr_err("%s: couldn't get platform config\n", __func__); return -ENODEV; } attribute_count = kbasep_get_config_attribute_count(config->attributes); #ifdef CONFIG_MACH_MANTA err = platform_device_add_data(&exynos5_device_g3d, config->attributes, attribute_count * sizeof(config->attributes[0])); if (err) return err; #else mali_device = platform_device_alloc("mali", 0); if (mali_device == NULL) return -ENOMEM; #ifndef CONFIG_OF kbasep_config_parse_io_resources(config->io_resources, resources); err = platform_device_add_resources(mali_device, resources, PLATFORM_CONFIG_RESOURCE_COUNT); if (err) { platform_device_put(mali_device); mali_device = NULL; return err; } #endif /* CONFIG_OF */ err = platform_device_add_data(mali_device, config->attributes, attribute_count * sizeof(config->attributes[0])); if (err) { platform_device_unregister(mali_device); mali_device = NULL; return err; } err = platform_device_add(mali_device); if (err) { platform_device_unregister(mali_device); mali_device = NULL; return err; } #endif /* CONFIG_CONFIG_MACH_MANTA */ return 0; }
int kbase_platform_early_init(void) { kbase_platform_config *config; int attribute_count; config = &platform_config; attribute_count = kbasep_get_config_attribute_count(config->attributes); return platform_device_add_data( &exynos5_device_g3d, config->attributes, attribute_count * sizeof(config->attributes[0])); }
int kbase_platform_early_init(struct platform_device *pdev) { kbase_platform_config *config; int attribute_count; config = &platform_config; attribute_count = kbasep_get_config_attribute_count(config->attributes); return platform_device_add_data( #ifndef CONFIG_MALI_PLATFORM_FAKE #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) pdev, #else &exynos5_device_g3d, #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) */ #endif /* CONFIG_MALI_PLATFORM_FAKE */ config->attributes, attribute_count * sizeof(config->attributes[0])); }