X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/ca9c31d8ca049247c66033d5d4bc50958c260750..519de6658dad2a75b585b3904ba68b152f72a1f0:/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-fb.c?ds=sidebyside diff --git a/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-fb.c b/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-fb.c index 0a47f65d3..90a6541e6 100644 --- a/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-fb.c +++ b/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-fb.c @@ -79,11 +79,6 @@ struct glamofb_handle { int output_enabled; /* 0 if the video output is disabled */ }; -/* 'sibling' spi device for lcm init */ -static struct platform_device glamo_spi_dev = { - .name = "glamo-lcm-spi", -}; - static void glamo_output_enable(struct glamofb_handle *gfb) { struct glamo_core *gcore = gfb->mach_info->glamo; @@ -535,6 +530,31 @@ static int glamofb_setcolreg(unsigned regno, return 0; } +static int glamofb_ioctl(struct fb_info *info, unsigned int cmd, + unsigned long arg) { + struct glamofb_handle *gfb = (struct glamofb_handle*)info->par; + struct glamo_core *gcore = gfb->mach_info->glamo; + int retval = -ENOTTY; + + switch (cmd) { + case GLAMOFB_ENGINE_ENABLE: + retval = glamo_engine_enable(gcore, arg); + break; + case GLAMOFB_ENGINE_DISABLE: + retval = glamo_engine_disable(gcore, arg); + break; + case GLAMOFB_ENGINE_RESET: + glamo_engine_reset(gcore, arg); + retval = 0; + break; + default: + break; + } + + return retval; +} + + #ifdef CONFIG_MFD_GLAMO_HWACCEL static inline void glamofb_vsync_wait(struct glamofb_handle *glamo, int line, int size, int range) @@ -770,6 +790,7 @@ static struct fb_ops glamofb_ops = { .fb_set_par = glamofb_set_par, .fb_blank = glamofb_blank, .fb_setcolreg = glamofb_setcolreg, + .fb_ioctl = glamofb_ioctl, #ifdef CONFIG_MFD_GLAMO_HWACCEL .fb_cursor = glamofb_cursor, #endif @@ -835,7 +856,7 @@ static int __init glamofb_probe(struct platform_device *pdev) } glamofb->fb_res = request_mem_region(glamofb->fb_res->start, - mach_info->fb_mem_size, + resource_size(glamofb->fb_res), pdev->name); if (!glamofb->fb_res) { dev_err(&pdev->dev, "failed to request vram region\n"); @@ -849,6 +870,7 @@ static int __init glamofb_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to ioremap() mmio memory\n"); goto out_release_fb; } + fbinfo->fix.smem_start = (unsigned long) glamofb->fb_res->start; fbinfo->fix.smem_len = (__u32) resource_size(glamofb->fb_res); @@ -908,14 +930,6 @@ static int __init glamofb_probe(struct platform_device *pdev) goto out_unmap_fb; } - if (mach_info->spi_info) { - /* register the sibling spi device */ - mach_info->spi_info->glamofb_handle = glamofb; - glamo_spi_dev.dev.parent = &pdev->dev; - glamo_spi_dev.dev.platform_data = mach_info->spi_info; - platform_device_register(&glamo_spi_dev); - } - printk(KERN_INFO "fb%d: %s frame buffer device\n", fbinfo->node, fbinfo->fix.id);