]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge tag 'fbdev-3.11-2' of git://gitorious.org/linux-omap-dss2/linux into fbdev...
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Fri, 28 Jun 2013 10:01:28 +0000 (18:01 +0800)
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Fri, 28 Jun 2013 10:01:28 +0000 (18:01 +0800)
Various fbdev changes for 3.11

* xilinxfb updates
* Small cleanups and fixes to multiple drivers

35 files changed:
drivers/video/Kconfig
drivers/video/aty/aty128fb.c
drivers/video/aty/atyfb_base.c
drivers/video/aty/radeon_pm.c
drivers/video/au1100fb.c
drivers/video/bf54x-lq043fb.c
drivers/video/bfin-lq035q1-fb.c
drivers/video/bfin-t350mcqb-fb.c
drivers/video/ep93xx-fb.c
drivers/video/fbmem.c
drivers/video/fsl-diu-fb.c
drivers/video/i740fb.c
drivers/video/imxfb.c
drivers/video/jz4740_fb.c
drivers/video/mmp/fb/mmpfb.c
drivers/video/mmp/hw/mmp_ctrl.c
drivers/video/mxsfb.c
drivers/video/nuc900fb.c
drivers/video/omap2/displays/panel-taal.c
drivers/video/omap2/dss/dpi.c
drivers/video/pxa3xx-gcu.c
drivers/video/pxafb.c
drivers/video/s3c2410fb.c
drivers/video/sa1100fb.c
drivers/video/sh7760fb.c
drivers/video/sh_mipi_dsi.c
drivers/video/smscufx.c
drivers/video/tmiofb.c
drivers/video/udlfb.c
drivers/video/uvesafb.c
drivers/video/vga16fb.c
drivers/video/vt8500lcdfb.c
drivers/video/wm8505fb.c
drivers/video/xilinxfb.c
include/video/of_display_timing.h

index 2e937bdace6f123a1b6f1c0c055b4422dde78875..2c301f8441e98decdb9ec0d10f12c9c3d55a843b 100644 (file)
@@ -2188,7 +2188,7 @@ config FB_PS3_DEFAULT_SIZE_M
 
 config FB_XILINX
        tristate "Xilinx frame buffer support"
-       depends on FB && (XILINX_VIRTEX || MICROBLAZE)
+       depends on FB && (XILINX_VIRTEX || MICROBLAZE || ARCH_ZYNQ)
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
index 8c55011313dc7c382a17f8e552ea3b4a536b3457..a4dfe8cb0a0a1b2cb5022c8e27f23f6b314a8026 100644 (file)
@@ -2016,7 +2016,7 @@ static int aty128_init(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        aty128_init_engine(par);
 
-       par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM);
+       par->pm_reg = pdev->pm_cap;
        par->pdev = pdev;
        par->asleep = 0;
        par->lock_blank = 0;
index 4f27fdc58d8463650fec54d9020496c89810b9bc..a89c15de9f45c885f3dc7fe76bad22bde184013d 100644 (file)
@@ -58,6 +58,7 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
+#include <linux/compiler.h>
 #include <linux/console.h>
 #include <linux/fb.h>
 #include <linux/init.h>
@@ -434,8 +435,8 @@ static int correct_chipset(struct atyfb_par *par)
        const char *name;
        int i;
 
-       for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
-               if (par->pci_id == aty_chips[i].pci_id)
+       for (i = ARRAY_SIZE(aty_chips); i > 0; i--)
+               if (par->pci_id == aty_chips[i - 1].pci_id)
                        break;
 
        if (i < 0)
@@ -531,8 +532,8 @@ static int correct_chipset(struct atyfb_par *par)
        return 0;
 }
 
-static char ram_dram[] = "DRAM";
-static char ram_resv[] = "RESV";
+static char ram_dram[] __maybe_unused = "DRAM";
+static char ram_resv[] __maybe_unused = "RESV";
 #ifdef CONFIG_FB_ATY_GX
 static char ram_vram[] = "VRAM";
 #endif /* CONFIG_FB_ATY_GX */
index 92bda58485165a55ac2acc711ddfed5781bf49fe..f7091ece580d6e52c2c7a5d6f4d77492c77cdebb 100644 (file)
@@ -2805,7 +2805,7 @@ static void radeonfb_early_resume(void *data)
 void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
 {
        /* Find PM registers in config space if any*/
-       rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM);
+       rinfo->pm_reg = rinfo->pdev->pm_cap;
 
        /* Enable/Disable dynamic clocks: TODO add sysfs access */
        if (rinfo->family == CHIP_FAMILY_RS480)
index 700cac067b4611891af50d90ee083bdbb0f94eb9..606a3babe7920ec7c2a4571f14e0151247ac33f3 100644 (file)
@@ -579,7 +579,6 @@ failed:
        if (fbdev->info.cmap.len != 0) {
                fb_dealloc_cmap(&fbdev->info.cmap);
        }
-       platform_set_drvdata(dev, NULL);
 
        return -ENODEV;
 }
index 2726a5b6674129ef8b16938f669577929572ba8e..87f288bfc58c3464e44645e9264a991d28045895 100644 (file)
@@ -681,7 +681,6 @@ out3:
 out2:
        free_dma(CH_EPPI0);
 out1:
-       platform_set_drvdata(pdev, NULL);
 
        return ret;
 }
index 29d8c0443a1f618203e70e65402f5557d679a000..b594a58ff21d3e63e5c7a6dd29bc6c86919cf491 100644 (file)
@@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi)
        return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
 }
 
-#ifdef CONFIG_PM
-static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int lq035q1_spidev_suspend(struct device *dev)
 {
+       struct spi_device *spi = to_spi_device(dev);
+
        return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
 }
 
-static int lq035q1_spidev_resume(struct spi_device *spi)
+static int lq035q1_spidev_resume(struct device *dev)
 {
-       int ret;
+       struct spi_device *spi = to_spi_device(dev);
        struct spi_control *ctl = spi_get_drvdata(spi);
+       int ret;
 
        ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode);
        if (ret)
@@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi)
 
        return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON);
 }
+
+static SIMPLE_DEV_PM_OPS(lq035q1_spidev_pm_ops, lq035q1_spidev_suspend,
+       lq035q1_spidev_resume);
+#define LQ035Q1_SPIDEV_PM_OPS (&lq035q1_spidev_pm_ops)
+
 #else
-# define lq035q1_spidev_suspend NULL
-# define lq035q1_spidev_resume  NULL
+#define LQ035Q1_SPIDEV_PM_OPS NULL
 #endif
 
 /* Power down all displays on reboot, poweroff or halt */
@@ -708,8 +715,7 @@ static int bfin_lq035q1_probe(struct platform_device *pdev)
        info->spidrv.probe    = lq035q1_spidev_probe;
        info->spidrv.remove   = lq035q1_spidev_remove;
        info->spidrv.shutdown = lq035q1_spidev_shutdown;
-       info->spidrv.suspend  = lq035q1_spidev_suspend;
-       info->spidrv.resume   = lq035q1_spidev_resume;
+       info->spidrv.driver.pm = LQ035Q1_SPIDEV_PM_OPS;
 
        ret = spi_register_driver(&info->spidrv);
        if (ret < 0) {
@@ -759,7 +765,6 @@ static int bfin_lq035q1_probe(struct platform_device *pdev)
  out2:
        free_dma(CH_PPI);
  out1:
-       platform_set_drvdata(pdev, NULL);
 
        return ret;
 }
@@ -788,7 +793,6 @@ static int bfin_lq035q1_remove(struct platform_device *pdev)
        bfin_lq035q1_free_ports(info->disp_info->ppi_mode ==
                                USE_RGB565_16_BIT_PPI);
 
-       platform_set_drvdata(pdev, NULL);
        framebuffer_release(fbinfo);
 
        dev_info(&pdev->dev, "unregistered LCD driver\n");
index d46da01c31ae5536ddf10dfa3b0b443c2ff6dc2f..48c0c4e38a62a0e4be7bb43c4999e9927247ddc6 100644 (file)
@@ -578,7 +578,6 @@ out3:
 out2:
        free_dma(CH_PPI);
 out1:
-       platform_set_drvdata(pdev, NULL);
 
        return ret;
 }
@@ -608,7 +607,6 @@ static int bfin_t350mcqb_remove(struct platform_device *pdev)
 
        bfin_t350mcqb_request_ports(0);
 
-       platform_set_drvdata(pdev, NULL);
        framebuffer_release(fbinfo);
 
        printk(KERN_INFO DRIVER_NAME ": Unregister LCD driver.\n");
index ee1ee5401544517e253e991af991e11c31880eac..28a837dfddd1cde2974ced029ebd4900de6204b3 100644 (file)
@@ -595,7 +595,6 @@ failed_videomem:
        fb_dealloc_cmap(&info->cmap);
 failed_cmap:
        kfree(info);
-       platform_set_drvdata(pdev, NULL);
 
        return err;
 }
@@ -614,7 +613,6 @@ static int ep93xxfb_remove(struct platform_device *pdev)
                fbi->mach_info->teardown(pdev);
 
        kfree(info);
-       platform_set_drvdata(pdev, NULL);
 
        return 0;
 }
index d8d5779145db773e64c154b29b56d47ff06cd365..36e1fe21b9b5e1b2bd41750d1bedbbc833e917cf 100644 (file)
@@ -1305,7 +1305,9 @@ static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix,
        err |= copy_to_user(fix32->reserved, fix->reserved,
                            sizeof(fix->reserved));
 
-       return err;
+       if (err)
+               return -EFAULT;
+       return 0;
 }
 
 static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd,
index 6c278056fc60c858209b987f97163b1901f4d61f..6dd72250111e699952537702d3260603a76dcc0c 100644 (file)
@@ -469,7 +469,7 @@ static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s)
        unsigned long val;
 
        if (s) {
-               if (!strict_strtoul(s, 10, &val) && (val <= 2))
+               if (!kstrtoul(s, 10, &val) && (val <= 2))
                        port = (enum fsl_diu_monitor_port) val;
                else if (strncmp(s, "lvds", 4) == 0)
                        port = FSL_DIU_PORT_LVDS;
@@ -1853,7 +1853,7 @@ static int __init fsl_diu_setup(char *options)
                if (!strncmp(opt, "monitor=", 8)) {
                        monitor_port = fsl_diu_name_to_port(opt + 8);
                } else if (!strncmp(opt, "bpp=", 4)) {
-                       if (!strict_strtoul(opt + 4, 10, &val))
+                       if (!kstrtoul(opt + 4, 10, &val))
                                default_bpp = val;
                } else
                        fb_mode = opt;
index cfd0c52e8f737fb60a6279c668c90bf35a3ce24f..6c48388189505f4b92fa4746252700e15c1d9235 100644 (file)
@@ -1302,7 +1302,7 @@ static int  __init i740fb_setup(char *options)
 }
 #endif
 
-int __init i740fb_init(void)
+static int __init i740fb_init(void)
 {
 #ifndef MODULE
        char *option = NULL;
index 0abf2bf2083604c48006a63682c410c7125109fb..12af22ba4d928e0e3e8f9c954fb545d738cd0f1b 100644 (file)
@@ -923,7 +923,6 @@ failed_getclock:
 failed_req:
        kfree(info->pseudo_palette);
 failed_init:
-       platform_set_drvdata(pdev, NULL);
        framebuffer_release(info);
        return ret;
 }
@@ -955,12 +954,10 @@ static int imxfb_remove(struct platform_device *pdev)
        iounmap(fbi->regs);
        release_mem_region(res->start, resource_size(res));
 
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
-void  imxfb_shutdown(struct platform_device * dev)
+static void imxfb_shutdown(struct platform_device *dev)
 {
        struct fb_info *info = platform_get_drvdata(dev);
        struct imxfb_info *fbi = info->par;
@@ -999,7 +996,7 @@ static int imxfb_setup(void)
        return 0;
 }
 
-int __init imxfb_init(void)
+static int __init imxfb_init(void)
 {
        int ret = imxfb_setup();
 
index 36979b4131ab0d24f724e2565c7fcc0c9bbe285b..2c49112fdd6c4166bd040c0bbb6a89e0fcc06fec 100644 (file)
@@ -737,8 +737,6 @@ static int jzfb_remove(struct platform_device *pdev)
        fb_dealloc_cmap(&jzfb->fb->cmap);
        jzfb_free_devmem(jzfb);
 
-       platform_set_drvdata(pdev, NULL);
-
        framebuffer_release(jzfb->fb);
 
        return 0;
index 6d1fa96c5cc389ddf54a2aa9ffdc5c789c66292c..4ab95b8daed31fbf191523d862f668697806d502 100644 (file)
@@ -659,7 +659,6 @@ failed_destroy_mutex:
        mutex_destroy(&fbi->access_ok);
 failed:
        dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n");
-       platform_set_drvdata(pdev, NULL);
 
        framebuffer_release(info);
 
index 8612590ea9439f0b8a963a6ff73bde05eef236bc..75dca19bf2149a968f733ed1ff8a0cd468baa745 100644 (file)
@@ -566,7 +566,6 @@ failed:
                devm_kfree(ctrl->dev, ctrl);
        }
 
-       platform_set_drvdata(pdev, NULL);
        dev_err(&pdev->dev, "device init failed\n");
 
        return ret;
index 21223d475b39bb54aff2f58e95a73282f37754dd..3ba37713b1f97795c875ded477e5dfe37b2259b7 100644 (file)
@@ -899,7 +899,6 @@ static int mxsfb_probe(struct platform_device *pdev)
 
        host->base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(host->base)) {
-               dev_err(&pdev->dev, "ioremap failed\n");
                ret = PTR_ERR(host->base);
                goto fb_release;
        }
@@ -986,8 +985,6 @@ static int mxsfb_remove(struct platform_device *pdev)
 
        framebuffer_release(fb_info);
 
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
index 32581c72ad097f8eebb75a140b0389897708f284..8c527e5b293cbe5bf91718f5c1f68b0ffbcc4c44 100644 (file)
@@ -707,7 +707,6 @@ static int nuc900fb_remove(struct platform_device *pdev)
        release_resource(fbi->mem);
        kfree(fbi->mem);
 
-       platform_set_drvdata(pdev, NULL);
        framebuffer_release(fbinfo);
 
        return 0;
index c731d3c068b4c36d562245cbb7f32175fb6e7abe..54a07da8587af84c456eaf8b43e22247eaa43f47 100644 (file)
@@ -573,7 +573,7 @@ static ssize_t taal_store_esd_interval(struct device *dev,
        unsigned long t;
        int r;
 
-       r = strict_strtoul(buf, 10, &t);
+       r = kstrtoul(buf, 10, &t);
        if (r)
                return r;
 
@@ -611,7 +611,7 @@ static ssize_t taal_store_ulps(struct device *dev,
        unsigned long t;
        int r;
 
-       r = strict_strtoul(buf, 10, &t);
+       r = kstrtoul(buf, 10, &t);
        if (r)
                return r;
 
@@ -660,7 +660,7 @@ static ssize_t taal_store_ulps_timeout(struct device *dev,
        unsigned long t;
        int r;
 
-       r = strict_strtoul(buf, 10, &t);
+       r = kstrtoul(buf, 10, &t);
        if (r)
                return r;
 
index 6433eab6bcf28b7e41eb5ceb65186642087c8e90..a6b331ef7763c9bd901ac8257b6d53e2b7585cdc 100644 (file)
@@ -131,7 +131,7 @@ static bool dpi_calc_dispc_cb(int lckd, int pckd, unsigned long lck,
         * shifted. So skip all odd dividers when the pixel clock is on the
         * higher side.
         */
-       if (ctx->pck_min >= 1000000) {
+       if (ctx->pck_min >= 100000000) {
                if (lckd > 1 && lckd % 2 != 0)
                        return false;
 
@@ -158,7 +158,7 @@ static bool dpi_calc_hsdiv_cb(int regm_dispc, unsigned long dispc,
         * shifted. So skip all odd dividers when the pixel clock is on the
         * higher side.
         */
-       if (regm_dispc > 1 && regm_dispc % 2 != 0 && ctx->pck_min >= 1000000)
+       if (regm_dispc > 1 && regm_dispc % 2 != 0 && ctx->pck_min >= 100000000)
                return false;
 
        ctx->dsi_cinfo.regm_dispc = regm_dispc;
index 97563c55af63e46d8a6a00cf6f036b3df6e8e203..95c3c4ae81cc7dc0fc6904c53e0b9ab0828395cc 100644 (file)
@@ -711,7 +711,6 @@ err_misc_deregister:
        misc_deregister(&priv->misc_dev);
 
 err_free_priv:
-       platform_set_drvdata(dev, NULL);
        free_buffers(dev, priv);
        kfree(priv);
        return ret;
@@ -729,7 +728,6 @@ static int pxa3xx_gcu_remove(struct platform_device *dev)
                        priv->shared, priv->shared_phys);
        iounmap(priv->mmio_base);
        release_mem_region(r->start, resource_size(r));
-       platform_set_drvdata(dev, NULL);
        clk_disable(priv->clk);
        free_buffers(dev, priv);
        kfree(priv);
index 580f80cc586fc7a0030cbe2f8ce57b8df4896727..eca2de45f7a62d838f65e8a201aade28869c780b 100644 (file)
@@ -2256,7 +2256,6 @@ failed_free_res:
        release_mem_region(r->start, resource_size(r));
 failed_fbi:
        clk_put(fbi->clk);
-       platform_set_drvdata(dev, NULL);
        kfree(fbi);
 failed:
        return ret;
index 76a0e7fbd69297d96a755a111d53597a439fe24f..21a32adbb8ead4dde3e423f62108e2111be05533 100644 (file)
@@ -1005,7 +1005,6 @@ release_regs:
 release_mem:
        release_mem_region(res->start, size);
 dealloc_fb:
-       platform_set_drvdata(pdev, NULL);
        framebuffer_release(fbinfo);
        return ret;
 }
@@ -1051,7 +1050,6 @@ static int s3c2410fb_remove(struct platform_device *pdev)
 
        release_mem_region(info->mem->start, resource_size(info->mem));
 
-       platform_set_drvdata(pdev, NULL);
        framebuffer_release(fbinfo);
 
        return 0;
index f34c858642e8713440f64cfd7ea9df6f40ec4bae..de76da0c6429a942ca87e5e73841259371aff4b4 100644 (file)
@@ -1271,7 +1271,6 @@ static int sa1100fb_probe(struct platform_device *pdev)
  failed:
        if (fbi)
                iounmap(fbi->base);
-       platform_set_drvdata(pdev, NULL);
        kfree(fbi);
        release_mem_region(res->start, resource_size(res));
        return ret;
index 5fbb0c7ab0c8e54071c3d463511882a146fb7034..a8c6c43a4658565c8b21fa38a3baaf1c5bd82e36 100644 (file)
@@ -571,7 +571,6 @@ static int sh7760fb_remove(struct platform_device *dev)
        iounmap(par->base);
        release_mem_region(par->ioarea->start, resource_size(par->ioarea));
        framebuffer_release(info);
-       platform_set_drvdata(dev, NULL);
 
        return 0;
 }
index 6cad53075e99321ae07696bab203088df1b5bc6e..8f6e8ff620d4004272030598ba89e9911ac73ad0 100644 (file)
@@ -567,7 +567,6 @@ static int sh_mipi_remove(struct platform_device *pdev)
        iounmap(mipi->base);
        if (res)
                release_mem_region(res->start, resource_size(res));
-       platform_set_drvdata(pdev, NULL);
        kfree(mipi);
 
        return 0;
index b2b33fc1ac3faa9953cab079bc094e1f04041646..e188ada2ffd1cf7d72c826dbbb18a134d49b1458 100644 (file)
@@ -1622,7 +1622,7 @@ static int ufx_usb_probe(struct usb_interface *interface,
 {
        struct usb_device *usbdev;
        struct ufx_data *dev;
-       struct fb_info *info = 0;
+       struct fb_info *info = NULL;
        int retval = -ENOMEM;
        u32 id_rev, fpga_rev;
 
index dc4fb862015605738fba8ca7eb07aac1ca0a5b9e..deb8733f3c70dd3f8e83508b8ff086cbf6cbcdbf 100644 (file)
@@ -794,7 +794,6 @@ err_hw_init:
                cell->disable(dev);
 err_enable:
 err_find_mode:
-       platform_set_drvdata(dev, NULL);
        free_irq(irq, info);
 err_request_irq:
        iounmap(info->screen_base);
@@ -823,8 +822,6 @@ static int tmiofb_remove(struct platform_device *dev)
                if (cell->disable)
                        cell->disable(dev);
 
-               platform_set_drvdata(dev, NULL);
-
                free_irq(irq, info);
 
                iounmap(info->screen_base);
index ec03e726c94008791481bfade233e5b384bb2ddb..d2e5bc3cf9696f4b1ab9785f10ff0a56c102a41a 100644 (file)
@@ -434,10 +434,10 @@ static void dlfb_compress_hline(
 
        while ((pixel_end > pixel) &&
               (cmd_buffer_end - MIN_RLX_CMD_BYTES > cmd)) {
-               uint8_t *raw_pixels_count_byte = 0;
-               uint8_t *cmd_pixels_count_byte = 0;
-               const uint16_t *raw_pixel_start = 0;
-               const uint16_t *cmd_pixel_start, *cmd_pixel_end = 0;
+               uint8_t *raw_pixels_count_byte = NULL;
+               uint8_t *cmd_pixels_count_byte = NULL;
+               const uint16_t *raw_pixel_start = NULL;
+               const uint16_t *cmd_pixel_start, *cmd_pixel_end = NULL;
 
                prefetchw((void *) cmd); /* pull in one cache line at least */
 
@@ -573,7 +573,7 @@ static int dlfb_render_hline(struct dlfb_data *dev, struct urb **urb_ptr,
        return 0;
 }
 
-int dlfb_handle_damage(struct dlfb_data *dev, int x, int y,
+static int dlfb_handle_damage(struct dlfb_data *dev, int x, int y,
               int width, int height, char *data)
 {
        int i, ret;
@@ -1588,7 +1588,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
                        const struct usb_device_id *id)
 {
        struct usb_device *usbdev;
-       struct dlfb_data *dev = 0;
+       struct dlfb_data *dev = NULL;
        int retval = -ENOMEM;
 
        /* usb initialization */
index e328a61b64ba976a8906353b686e5203498d8c8c..10138b60fd70688d7c96c0a8aa59483ff995aaa4 100644 (file)
@@ -819,8 +819,8 @@ static int uvesafb_vbe_init(struct fb_info *info)
        if (par->pmi_setpal || par->ypan) {
                if (__supported_pte_mask & _PAGE_NX) {
                        par->pmi_setpal = par->ypan = 0;
-                       printk(KERN_WARNING "uvesafb: NX protection is actively."
-                               "We have better not to use the PMI.\n");
+                       printk(KERN_WARNING "uvesafb: NX protection is active"
+                                           "better not use the PMI.\n");
                } else {
                        uvesafb_vbe_getpmi(task, par);
                }
index 545faeccdb445f78fc4eaf3809b2c65c792edd55..830ded45fd4758a9a3d9ba6c6640653ac9b32490 100644 (file)
@@ -1269,7 +1269,6 @@ static void vga16fb_destroy(struct fb_info *info)
        iounmap(info->screen_base);
        fb_dealloc_cmap(&info->cmap);
        /* XXX unshare VGA regions */
-       platform_set_drvdata(dev, NULL);
        framebuffer_release(info);
 }
 
index 9547e1831e0310da3ed9be93c4f3d291f9062458..897484903c305d59588529ab616a6cb5d9260bcd 100644 (file)
@@ -448,7 +448,6 @@ failed_free_io:
 failed_free_res:
        release_mem_region(res->start, resource_size(res));
 failed_fbi:
-       platform_set_drvdata(pdev, NULL);
        kfree(fbi);
 failed:
        return ret;
index 01f9ace068e20e6de2979fb8740a454b699ef73c..3072f30cad1984d23309a2d3430adc2f60d625f8 100644 (file)
@@ -173,7 +173,7 @@ static ssize_t contrast_store(struct device *dev,
        struct wm8505fb_info *fbi = to_wm8505fb_info(info);
        unsigned long tmp;
 
-       if (strict_strtoul(buf, 10, &tmp) || (tmp > 0xff))
+       if (kstrtoul(buf, 10, &tmp) || (tmp > 0xff))
                return -EINVAL;
        fbi->contrast = tmp;
 
index af0b4fdf9aa9a709340304a9490797360081b1b6..f3d4a69e1e4e9058c4c4cc605705f1d62d923a48 100644 (file)
@@ -44,7 +44,7 @@
 
 
 /*
- * Xilinx calls it "PLB TFT LCD Controller" though it can also be used for
+ * Xilinx calls it "TFT LCD Controller" though it can also be used for
  * the VGA port on the Xilinx ML40x board. This is a hardware display
  * controller for a 640x480 resolution TFT or VGA screen.
  *
  * don't start thinking about scrolling).  The second allows the LCD to
  * be turned on or off as well as rotated 180 degrees.
  *
- * In case of direct PLB access the second control register will be at
+ * In case of direct BUS access the second control register will be at
  * an offset of 4 as compared to the DCR access where the offset is 1
  * i.e. REG_CTRL. So this is taken care in the function
- * xilinx_fb_out_be32 where it left shifts the offset 2 times in case of
- * direct PLB access.
+ * xilinx_fb_out32 where it left shifts the offset 2 times in case of
+ * direct BUS access.
  */
 #define NUM_REGS       2
 #define REG_FB_ADDR    0
@@ -116,7 +116,8 @@ static struct fb_var_screeninfo xilinx_fb_var = {
 };
 
 
-#define PLB_ACCESS_FLAG        0x1             /* 1 = PLB, 0 = DCR */
+#define BUS_ACCESS_FLAG                0x1 /* 1 = BUS, 0 = DCR */
+#define LITTLE_ENDIAN_ACCESS   0x2 /* LITTLE ENDIAN IO functions */
 
 struct xilinxfb_drvdata {
 
@@ -146,21 +147,40 @@ struct xilinxfb_drvdata {
        container_of(_info, struct xilinxfb_drvdata, info)
 
 /*
- * The XPS TFT Controller can be accessed through PLB or DCR interface.
+ * The XPS TFT Controller can be accessed through BUS or DCR interface.
  * To perform the read/write on the registers we need to check on
  * which bus its connected and call the appropriate write API.
  */
-static void xilinx_fb_out_be32(struct xilinxfb_drvdata *drvdata, u32 offset,
+static void xilinx_fb_out32(struct xilinxfb_drvdata *drvdata, u32 offset,
                                u32 val)
 {
-       if (drvdata->flags & PLB_ACCESS_FLAG)
-               out_be32(drvdata->regs + (offset << 2), val);
+       if (drvdata->flags & BUS_ACCESS_FLAG) {
+               if (drvdata->flags & LITTLE_ENDIAN_ACCESS)
+                       iowrite32(val, drvdata->regs + (offset << 2));
+               else
+                       iowrite32be(val, drvdata->regs + (offset << 2));
+       }
 #ifdef CONFIG_PPC_DCR
        else
                dcr_write(drvdata->dcr_host, offset, val);
 #endif
 }
 
+static u32 xilinx_fb_in32(struct xilinxfb_drvdata *drvdata, u32 offset)
+{
+       if (drvdata->flags & BUS_ACCESS_FLAG) {
+               if (drvdata->flags & LITTLE_ENDIAN_ACCESS)
+                       return ioread32(drvdata->regs + (offset << 2));
+               else
+                       return ioread32be(drvdata->regs + (offset << 2));
+       }
+#ifdef CONFIG_PPC_DCR
+       else
+               return dcr_read(drvdata->dcr_host, offset);
+#endif
+       return 0;
+}
+
 static int
 xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
        unsigned transp, struct fb_info *fbi)
@@ -197,7 +217,7 @@ xilinx_fb_blank(int blank_mode, struct fb_info *fbi)
        switch (blank_mode) {
        case FB_BLANK_UNBLANK:
                /* turn on panel */
-               xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
+               xilinx_fb_out32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
                break;
 
        case FB_BLANK_NORMAL:
@@ -205,7 +225,7 @@ xilinx_fb_blank(int blank_mode, struct fb_info *fbi)
        case FB_BLANK_HSYNC_SUSPEND:
        case FB_BLANK_POWERDOWN:
                /* turn off panel */
-               xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
+               xilinx_fb_out32(drvdata, REG_CTRL, 0);
        default:
                break;
 
@@ -227,33 +247,23 @@ static struct fb_ops xilinxfb_ops =
  * Bus independent setup/teardown
  */
 
-static int xilinxfb_assign(struct device *dev,
+static int xilinxfb_assign(struct platform_device *pdev,
                           struct xilinxfb_drvdata *drvdata,
-                          unsigned long physaddr,
                           struct xilinxfb_platform_data *pdata)
 {
        int rc;
+       struct device *dev = &pdev->dev;
        int fbsize = pdata->xvirt * pdata->yvirt * BYTES_PER_PIXEL;
 
-       if (drvdata->flags & PLB_ACCESS_FLAG) {
-               /*
-                * Map the control registers in if the controller
-                * is on direct PLB interface.
-                */
-               if (!request_mem_region(physaddr, 8, DRIVER_NAME)) {
-                       dev_err(dev, "Couldn't lock memory region at 0x%08lX\n",
-                               physaddr);
-                       rc = -ENODEV;
-                       goto err_region;
-               }
+       if (drvdata->flags & BUS_ACCESS_FLAG) {
+               struct resource *res;
 
-               drvdata->regs_phys = physaddr;
-               drvdata->regs = ioremap(physaddr, 8);
+               res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+               drvdata->regs_phys = res->start;
+               drvdata->regs = devm_request_and_ioremap(&pdev->dev, res);
                if (!drvdata->regs) {
-                       dev_err(dev, "Couldn't lock memory region at 0x%08lX\n",
-                               physaddr);
-                       rc = -ENODEV;
-                       goto err_map;
+                       rc = -EADDRNOTAVAIL;
+                       goto err_region;
                }
        }
 
@@ -270,7 +280,7 @@ static int xilinxfb_assign(struct device *dev,
        if (!drvdata->fb_virt) {
                dev_err(dev, "Could not allocate frame buffer memory\n");
                rc = -ENOMEM;
-               if (drvdata->flags & PLB_ACCESS_FLAG)
+               if (drvdata->flags & BUS_ACCESS_FLAG)
                        goto err_fbmem;
                else
                        goto err_region;
@@ -280,13 +290,19 @@ static int xilinxfb_assign(struct device *dev,
        memset_io((void __iomem *)drvdata->fb_virt, 0, fbsize);
 
        /* Tell the hardware where the frame buffer is */
-       xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
+       xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
+       rc = xilinx_fb_in32(drvdata, REG_FB_ADDR);
+       /* Endianess detection */
+       if (rc != drvdata->fb_phys) {
+               drvdata->flags |= LITTLE_ENDIAN_ACCESS;
+               xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
+       }
 
        /* Turn on the display */
        drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
        if (pdata->rotate_screen)
                drvdata->reg_ctrl_default |= REG_CTRL_ROTATE;
-       xilinx_fb_out_be32(drvdata, REG_CTRL,
+       xilinx_fb_out32(drvdata, REG_CTRL,
                                        drvdata->reg_ctrl_default);
 
        /* Fill struct fb_info */
@@ -323,9 +339,9 @@ static int xilinxfb_assign(struct device *dev,
                goto err_regfb;
        }
 
-       if (drvdata->flags & PLB_ACCESS_FLAG) {
+       if (drvdata->flags & BUS_ACCESS_FLAG) {
                /* Put a banner in the log (for DEBUG) */
-               dev_dbg(dev, "regs: phys=%lx, virt=%p\n", physaddr,
+               dev_dbg(dev, "regs: phys=%x, virt=%p\n", drvdata->regs_phys,
                                        drvdata->regs);
        }
        /* Put a banner in the log (for DEBUG) */
@@ -345,15 +361,11 @@ err_cmap:
                iounmap(drvdata->fb_virt);
 
        /* Turn off the display */
-       xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
+       xilinx_fb_out32(drvdata, REG_CTRL, 0);
 
 err_fbmem:
-       if (drvdata->flags & PLB_ACCESS_FLAG)
-               iounmap(drvdata->regs);
-
-err_map:
-       if (drvdata->flags & PLB_ACCESS_FLAG)
-               release_mem_region(physaddr, 8);
+       if (drvdata->flags & BUS_ACCESS_FLAG)
+               devm_iounmap(dev, drvdata->regs);
 
 err_region:
        kfree(drvdata);
@@ -381,13 +393,11 @@ static int xilinxfb_release(struct device *dev)
                iounmap(drvdata->fb_virt);
 
        /* Turn off the display */
-       xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
+       xilinx_fb_out32(drvdata, REG_CTRL, 0);
 
        /* Release the resources, as allocated based on interface */
-       if (drvdata->flags & PLB_ACCESS_FLAG) {
-               iounmap(drvdata->regs);
-               release_mem_region(drvdata->regs_phys, 8);
-       }
+       if (drvdata->flags & BUS_ACCESS_FLAG)
+               devm_iounmap(dev, drvdata->regs);
 #ifdef CONFIG_PPC_DCR
        else
                dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
@@ -406,11 +416,9 @@ static int xilinxfb_release(struct device *dev)
 static int xilinxfb_of_probe(struct platform_device *op)
 {
        const u32 *prop;
-       u32 *p;
-       u32 tft_access;
+       u32 tft_access = 0;
        struct xilinxfb_platform_data pdata;
-       struct resource res;
-       int size, rc;
+       int size;
        struct xilinxfb_drvdata *drvdata;
 
        /* Copy with the default pdata (not a ptr reference!) */
@@ -424,34 +432,29 @@ static int xilinxfb_of_probe(struct platform_device *op)
        }
 
        /*
-        * To check whether the core is connected directly to DCR or PLB
+        * To check whether the core is connected directly to DCR or BUS
         * interface and initialize the tft_access accordingly.
         */
-       p = (u32 *)of_get_property(op->dev.of_node, "xlnx,dcr-splb-slave-if", NULL);
-       tft_access = p ? *p : 0;
+       of_property_read_u32(op->dev.of_node, "xlnx,dcr-splb-slave-if",
+                            &tft_access);
 
        /*
-        * Fill the resource structure if its direct PLB interface
+        * Fill the resource structure if its direct BUS interface
         * otherwise fill the dcr_host structure.
         */
        if (tft_access) {
-               drvdata->flags |= PLB_ACCESS_FLAG;
-               rc = of_address_to_resource(op->dev.of_node, 0, &res);
-               if (rc) {
-                       dev_err(&op->dev, "invalid address\n");
-                       goto err;
-               }
+               drvdata->flags |= BUS_ACCESS_FLAG;
        }
 #ifdef CONFIG_PPC_DCR
        else {
                int start;
-               res.start = 0;
                start = dcr_resource_start(op->dev.of_node, 0);
                drvdata->dcr_len = dcr_resource_len(op->dev.of_node, 0);
                drvdata->dcr_host = dcr_map(op->dev.of_node, start, drvdata->dcr_len);
                if (!DCR_MAP_OK(drvdata->dcr_host)) {
                        dev_err(&op->dev, "invalid DCR address\n");
-                       goto err;
+                       kfree(drvdata);
+                       return -ENODEV;
                }
        }
 #endif
@@ -478,11 +481,7 @@ static int xilinxfb_of_probe(struct platform_device *op)
                pdata.rotate_screen = 1;
 
        dev_set_drvdata(&op->dev, drvdata);
-       return xilinxfb_assign(&op->dev, drvdata, res.start, &pdata);
-
- err:
-       kfree(drvdata);
-       return -ENODEV;
+       return xilinxfb_assign(op, drvdata, &pdata);
 }
 
 static int xilinxfb_of_remove(struct platform_device *op)
index 6562ad965889724a7543961c830c53fac90175f6..79e6697af6cff177712d619e0c4ac7102bff009b 100644 (file)
@@ -10,6 +10,7 @@
 #define __LINUX_OF_DISPLAY_TIMING_H
 
 struct device_node;
+struct display_timing;
 struct display_timings;
 
 #define OF_USE_NATIVE_MODE -1