From 18ec4c746a63bd12f7b47aba1aea9aa83f0ac78b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Sat, 12 Jul 2014 15:17:32 +0800 Subject: [PATCH] mali400: mali_osk_mali: fix get irq with dts --- .../arm/mali400/mali/linux/mali_osk_mali.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/arm/mali400/mali/linux/mali_osk_mali.c b/drivers/gpu/arm/mali400/mali/linux/mali_osk_mali.c index f59d12ef9ed4..e03b7440748e 100755 --- a/drivers/gpu/arm/mali400/mali/linux/mali_osk_mali.c +++ b/drivers/gpu/arm/mali400/mali/linux/mali_osk_mali.c @@ -22,6 +22,23 @@ #include "mali_osk.h" /* kernel side OS functions */ #include "mali_kernel_linux.h" +static u32 _mali_osk_resource_irq(_mali_osk_resource_t *res) +{ + int i; + char name[32]; + struct resource *resource; + + snprintf(name, sizeof(name), "%s_IRQ", res->description); + for (i = 0; i < mali_platform_device->num_resources; i++) { + resource = &mali_platform_device->resource[i]; + if (IORESOURCE_IRQ == resource_type(resource) && + !strncmp(name, resource->name, sizeof(name))) + return resource->start; + } + + return -1; +} + _mali_osk_errcode_t _mali_osk_resource_find(u32 addr, _mali_osk_resource_t *res) { int i; @@ -38,6 +55,8 @@ _mali_osk_errcode_t _mali_osk_resource_find(u32 addr, _mali_osk_resource_t *res) res->base = addr; res->description = mali_platform_device->resource[i].name; + res->irq = _mali_osk_resource_irq(res); +#if 0 /* Any (optional) IRQ resource belonging to this resource will follow */ if ((i + 1) < mali_platform_device->num_resources && IORESOURCE_IRQ == resource_type(&(mali_platform_device->resource[i+1]))) { @@ -45,6 +64,7 @@ _mali_osk_errcode_t _mali_osk_resource_find(u32 addr, _mali_osk_resource_t *res) } else { res->irq = -1; } +#endif } return _MALI_OSK_ERR_OK; } -- 2.34.1