diff options
Diffstat (limited to 'drivers/mfd/glamo/glamo-core.c')
-rw-r--r-- | drivers/mfd/glamo/glamo-core.c | 140 |
1 files changed, 30 insertions, 110 deletions
diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c index 28dc1f309ac..5a8fda2404c 100644 --- a/drivers/mfd/glamo/glamo-core.c +++ b/drivers/mfd/glamo/glamo-core.c @@ -175,93 +175,24 @@ static inline void glamo_vmem_read(struct glamo_core *glamo, u_int16_t *buf, /*********************************************************************** * resources of sibling devices ***********************************************************************/ - -#if 0 -static struct resource glamo_core_resources[] = { +static struct resource glamo_cmdq_resources[] = { { - .start = GLAMO_REGOFS_GENERIC, - .end = GLAMO_REGOFS_GENERIC + 0x400, - .flags = IORESOURCE_MEM, + .start = GLAMO_REGOFS_CMDQUEUE, + .end = GLAMO_REGOFS_RISC - 1, + .flags = IORESOURCE_MEM, }, { - .start = 0, - .end = 0, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device glamo_core_dev = { - .name = "glamo-core", - .resource = &glamo_core_resources, - .num_resources = ARRAY_SIZE(glamo_core_resources), -}; -#endif - -static struct resource glamo_jpeg_resources[] = { - { - .start = GLAMO_REGOFS_JPEG, - .end = GLAMO_REGOFS_MPEG - 1, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_GLAMO_JPEG, - .end = IRQ_GLAMO_JPEG, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device glamo_jpeg_dev = { - .name = "glamo-jpeg", - .resource = glamo_jpeg_resources, - .num_resources = ARRAY_SIZE(glamo_jpeg_resources), -}; - -static struct resource glamo_mpeg_resources[] = { - { - .start = GLAMO_REGOFS_MPEG, - .end = GLAMO_REGOFS_LCD - 1, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_GLAMO_MPEG, - .end = IRQ_GLAMO_MPEG, - .flags = IORESOURCE_IRQ, + .name = "glamo-work-mem", + .start = GLAMO_MEM_BASE + GLAMO_OFFSET_WORK, + .end = GLAMO_MEM_BASE + GLAMO_OFFSET_WORK + + GLAMO_WORK_SIZE - 1, + .flags = IORESOURCE_MEM, }, }; -static struct platform_device glamo_mpeg_dev = { - .name = "glamo-mpeg", - .resource = glamo_mpeg_resources, - .num_resources = ARRAY_SIZE(glamo_mpeg_resources), -}; - -static struct resource glamo_2d_resources[] = { - { - .start = GLAMO_REGOFS_2D, - .end = GLAMO_REGOFS_3D - 1, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_GLAMO_2D, - .end = IRQ_GLAMO_2D, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device glamo_2d_dev = { - .name = "glamo-2d", - .resource = glamo_2d_resources, - .num_resources = ARRAY_SIZE(glamo_2d_resources), -}; - -static struct resource glamo_3d_resources[] = { - { - .start = GLAMO_REGOFS_3D, - .end = GLAMO_REGOFS_END - 1, - .flags = IORESOURCE_MEM, - }, -}; - -static struct platform_device glamo_3d_dev = { - .name = "glamo-3d", - .resource = glamo_3d_resources, - .num_resources = ARRAY_SIZE(glamo_3d_resources), +static struct platform_device glamo_cmdq_dev = { + .name = "glamo-cmdq", + .resource = glamo_cmdq_resources, + .num_resources = ARRAY_SIZE(glamo_cmdq_resources), }; static struct platform_device glamo_spigpio_dev = { @@ -277,8 +208,9 @@ static struct resource glamo_fb_resources[] = { .flags = IORESOURCE_MEM, }, { .name = "glamo-fb-mem", - .start = GLAMO_OFFSET_FB, - .end = GLAMO_OFFSET_FB + GLAMO_FB_SIZE - 1, + .start = GLAMO_MEM_BASE + GLAMO_OFFSET_FB, + .end = GLAMO_MEM_BASE + GLAMO_OFFSET_FB + + GLAMO_FB_SIZE - 1, .flags = IORESOURCE_MEM, }, }; @@ -300,9 +232,9 @@ static struct resource glamo_mmc_resources[] = { .end = IRQ_GLAMO_MMC, .flags = IORESOURCE_IRQ, }, { /* our data buffer for MMC transfers */ - .start = GLAMO_OFFSET_FB + GLAMO_FB_SIZE, - .end = GLAMO_OFFSET_FB + GLAMO_FB_SIZE + - GLAMO_MMC_BUFFER_SIZE - 1, + .start = GLAMO_MEM_BASE + GLAMO_OFFSET_MMC, + .end = GLAMO_MEM_BASE + GLAMO_OFFSET_MMC + + GLAMO_MMC_BUFFER_SIZE - 1, .flags = IORESOURCE_MEM }, }; @@ -1308,52 +1240,40 @@ static int __init glamo_probe(struct platform_device *pdev) glamo->pdata->glamo_irq_is_wired; /* start creating the siblings */ + glamo->pdata->glamo = glamo; - glamo_2d_dev.dev.parent = &pdev->dev; - mangle_mem_resources(glamo_2d_dev.resource, - glamo_2d_dev.num_resources, glamo->mem); - platform_device_register(&glamo_2d_dev); - - glamo_3d_dev.dev.parent = &pdev->dev; - mangle_mem_resources(glamo_3d_dev.resource, - glamo_3d_dev.num_resources, glamo->mem); - platform_device_register(&glamo_3d_dev); - - glamo_jpeg_dev.dev.parent = &pdev->dev; - mangle_mem_resources(glamo_jpeg_dev.resource, - glamo_jpeg_dev.num_resources, glamo->mem); - platform_device_register(&glamo_jpeg_dev); - - glamo_mpeg_dev.dev.parent = &pdev->dev; - mangle_mem_resources(glamo_mpeg_dev.resource, - glamo_mpeg_dev.num_resources, glamo->mem); - platform_device_register(&glamo_mpeg_dev); + /* Command queue device (for DRM) */ + glamo_cmdq_dev.dev.parent = &pdev->dev; + glamo_cmdq_dev.dev.platform_data = glamo; + mangle_mem_resources(glamo_cmdq_dev.resource, + glamo_cmdq_dev.num_resources, glamo->mem); + platform_device_register(&glamo_cmdq_dev); - glamo->pdata->glamo = glamo; + /* Frambuffer device */ glamo_fb_dev.dev.parent = &pdev->dev; glamo_fb_dev.dev.platform_data = glamo->pdata; mangle_mem_resources(glamo_fb_dev.resource, glamo_fb_dev.num_resources, glamo->mem); platform_device_register(&glamo_fb_dev); + /* GPIO */ glamo->pdata->spigpio_info->glamo = glamo; glamo_spigpio_dev.dev.parent = &pdev->dev; glamo_spigpio_dev.dev.platform_data = glamo->pdata->spigpio_info; platform_device_register(&glamo_spigpio_dev); + /* MMC */ glamo_mmc_dev = glamo->pdata->mmc_dev; glamo_mmc_dev->name = "glamo-mci"; glamo_mmc_dev->dev.parent = &pdev->dev; glamo_mmc_dev->resource = glamo_mmc_resources; glamo_mmc_dev->num_resources = ARRAY_SIZE(glamo_mmc_resources); - - /* we need it later to give to the engine enable and disable */ glamo_mci_def_pdata.pglamo = glamo; mangle_mem_resources(glamo_mmc_dev->resource, glamo_mmc_dev->num_resources, glamo->mem); platform_device_register(glamo_mmc_dev); - /* only request the generic, hostbus and memory controller MMIO */ + /* Only request the generic, hostbus and memory controller MMIO */ glamo->mem = request_mem_region(glamo->mem->start, GLAMO_REGOFS_VIDCAP, "glamo-core"); if (!glamo->mem) { |