diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2013-06-28 06:01:28 -0400 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2013-06-28 06:01:28 -0400 |
commit | 19fd7441e9cc29b6c6d73c5469b3c93aa245fbb5 (patch) | |
tree | ab5e98ae677baecab3155b34983d97ffd08281c0 /drivers | |
parent | b75bf98b5d2b7fdb876d3dd7eaec8246d4cc7174 (diff) | |
parent | 464d8a54a0ca7827a2278e2122e5eb22462ae044 (diff) |
Merge tag 'fbdev-3.11-2' of git://gitorious.org/linux-omap-dss2/linux into fbdev/for-next
Various fbdev changes for 3.11
* xilinxfb updates
* Small cleanups and fixes to multiple drivers
Diffstat (limited to 'drivers')
34 files changed, 112 insertions, 136 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 2e937bdace6f..2c301f8441e9 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -2188,7 +2188,7 @@ config FB_PS3_DEFAULT_SIZE_M | |||
2188 | 2188 | ||
2189 | config FB_XILINX | 2189 | config FB_XILINX |
2190 | tristate "Xilinx frame buffer support" | 2190 | tristate "Xilinx frame buffer support" |
2191 | depends on FB && (XILINX_VIRTEX || MICROBLAZE) | 2191 | depends on FB && (XILINX_VIRTEX || MICROBLAZE || ARCH_ZYNQ) |
2192 | select FB_CFB_FILLRECT | 2192 | select FB_CFB_FILLRECT |
2193 | select FB_CFB_COPYAREA | 2193 | select FB_CFB_COPYAREA |
2194 | select FB_CFB_IMAGEBLIT | 2194 | select FB_CFB_IMAGEBLIT |
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index 8c55011313dc..a4dfe8cb0a0a 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c | |||
@@ -2016,7 +2016,7 @@ static int aty128_init(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2016 | 2016 | ||
2017 | aty128_init_engine(par); | 2017 | aty128_init_engine(par); |
2018 | 2018 | ||
2019 | par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM); | 2019 | par->pm_reg = pdev->pm_cap; |
2020 | par->pdev = pdev; | 2020 | par->pdev = pdev; |
2021 | par->asleep = 0; | 2021 | par->asleep = 0; |
2022 | par->lock_blank = 0; | 2022 | par->lock_blank = 0; |
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 4f27fdc58d84..a89c15de9f45 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -58,6 +58,7 @@ | |||
58 | #include <linux/slab.h> | 58 | #include <linux/slab.h> |
59 | #include <linux/vmalloc.h> | 59 | #include <linux/vmalloc.h> |
60 | #include <linux/delay.h> | 60 | #include <linux/delay.h> |
61 | #include <linux/compiler.h> | ||
61 | #include <linux/console.h> | 62 | #include <linux/console.h> |
62 | #include <linux/fb.h> | 63 | #include <linux/fb.h> |
63 | #include <linux/init.h> | 64 | #include <linux/init.h> |
@@ -434,8 +435,8 @@ static int correct_chipset(struct atyfb_par *par) | |||
434 | const char *name; | 435 | const char *name; |
435 | int i; | 436 | int i; |
436 | 437 | ||
437 | for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--) | 438 | for (i = ARRAY_SIZE(aty_chips); i > 0; i--) |
438 | if (par->pci_id == aty_chips[i].pci_id) | 439 | if (par->pci_id == aty_chips[i - 1].pci_id) |
439 | break; | 440 | break; |
440 | 441 | ||
441 | if (i < 0) | 442 | if (i < 0) |
@@ -531,8 +532,8 @@ static int correct_chipset(struct atyfb_par *par) | |||
531 | return 0; | 532 | return 0; |
532 | } | 533 | } |
533 | 534 | ||
534 | static char ram_dram[] = "DRAM"; | 535 | static char ram_dram[] __maybe_unused = "DRAM"; |
535 | static char ram_resv[] = "RESV"; | 536 | static char ram_resv[] __maybe_unused = "RESV"; |
536 | #ifdef CONFIG_FB_ATY_GX | 537 | #ifdef CONFIG_FB_ATY_GX |
537 | static char ram_vram[] = "VRAM"; | 538 | static char ram_vram[] = "VRAM"; |
538 | #endif /* CONFIG_FB_ATY_GX */ | 539 | #endif /* CONFIG_FB_ATY_GX */ |
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index 92bda5848516..f7091ece580d 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c | |||
@@ -2805,7 +2805,7 @@ static void radeonfb_early_resume(void *data) | |||
2805 | void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep) | 2805 | void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep) |
2806 | { | 2806 | { |
2807 | /* Find PM registers in config space if any*/ | 2807 | /* Find PM registers in config space if any*/ |
2808 | rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM); | 2808 | rinfo->pm_reg = rinfo->pdev->pm_cap; |
2809 | 2809 | ||
2810 | /* Enable/Disable dynamic clocks: TODO add sysfs access */ | 2810 | /* Enable/Disable dynamic clocks: TODO add sysfs access */ |
2811 | if (rinfo->family == CHIP_FAMILY_RS480) | 2811 | if (rinfo->family == CHIP_FAMILY_RS480) |
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index 700cac067b46..606a3babe792 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c | |||
@@ -579,7 +579,6 @@ failed: | |||
579 | if (fbdev->info.cmap.len != 0) { | 579 | if (fbdev->info.cmap.len != 0) { |
580 | fb_dealloc_cmap(&fbdev->info.cmap); | 580 | fb_dealloc_cmap(&fbdev->info.cmap); |
581 | } | 581 | } |
582 | platform_set_drvdata(dev, NULL); | ||
583 | 582 | ||
584 | return -ENODEV; | 583 | return -ENODEV; |
585 | } | 584 | } |
diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c index 2726a5b66741..87f288bfc58c 100644 --- a/drivers/video/bf54x-lq043fb.c +++ b/drivers/video/bf54x-lq043fb.c | |||
@@ -681,7 +681,6 @@ out3: | |||
681 | out2: | 681 | out2: |
682 | free_dma(CH_EPPI0); | 682 | free_dma(CH_EPPI0); |
683 | out1: | 683 | out1: |
684 | platform_set_drvdata(pdev, NULL); | ||
685 | 684 | ||
686 | return ret; | 685 | return ret; |
687 | } | 686 | } |
diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c index 29d8c0443a1f..b594a58ff21d 100644 --- a/drivers/video/bfin-lq035q1-fb.c +++ b/drivers/video/bfin-lq035q1-fb.c | |||
@@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi) | |||
170 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); | 170 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); |
171 | } | 171 | } |
172 | 172 | ||
173 | #ifdef CONFIG_PM | 173 | #ifdef CONFIG_PM_SLEEP |
174 | static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state) | 174 | static int lq035q1_spidev_suspend(struct device *dev) |
175 | { | 175 | { |
176 | struct spi_device *spi = to_spi_device(dev); | ||
177 | |||
176 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); | 178 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); |
177 | } | 179 | } |
178 | 180 | ||
179 | static int lq035q1_spidev_resume(struct spi_device *spi) | 181 | static int lq035q1_spidev_resume(struct device *dev) |
180 | { | 182 | { |
181 | int ret; | 183 | struct spi_device *spi = to_spi_device(dev); |
182 | struct spi_control *ctl = spi_get_drvdata(spi); | 184 | struct spi_control *ctl = spi_get_drvdata(spi); |
185 | int ret; | ||
183 | 186 | ||
184 | ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode); | 187 | ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode); |
185 | if (ret) | 188 | if (ret) |
@@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi) | |||
187 | 190 | ||
188 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON); | 191 | return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON); |
189 | } | 192 | } |
193 | |||
194 | static SIMPLE_DEV_PM_OPS(lq035q1_spidev_pm_ops, lq035q1_spidev_suspend, | ||
195 | lq035q1_spidev_resume); | ||
196 | #define LQ035Q1_SPIDEV_PM_OPS (&lq035q1_spidev_pm_ops) | ||
197 | |||
190 | #else | 198 | #else |
191 | # define lq035q1_spidev_suspend NULL | 199 | #define LQ035Q1_SPIDEV_PM_OPS NULL |
192 | # define lq035q1_spidev_resume NULL | ||
193 | #endif | 200 | #endif |
194 | 201 | ||
195 | /* Power down all displays on reboot, poweroff or halt */ | 202 | /* Power down all displays on reboot, poweroff or halt */ |
@@ -708,8 +715,7 @@ static int bfin_lq035q1_probe(struct platform_device *pdev) | |||
708 | info->spidrv.probe = lq035q1_spidev_probe; | 715 | info->spidrv.probe = lq035q1_spidev_probe; |
709 | info->spidrv.remove = lq035q1_spidev_remove; | 716 | info->spidrv.remove = lq035q1_spidev_remove; |
710 | info->spidrv.shutdown = lq035q1_spidev_shutdown; | 717 | info->spidrv.shutdown = lq035q1_spidev_shutdown; |
711 | info->spidrv.suspend = lq035q1_spidev_suspend; | 718 | info->spidrv.driver.pm = LQ035Q1_SPIDEV_PM_OPS; |
712 | info->spidrv.resume = lq035q1_spidev_resume; | ||
713 | 719 | ||
714 | ret = spi_register_driver(&info->spidrv); | 720 | ret = spi_register_driver(&info->spidrv); |
715 | if (ret < 0) { | 721 | if (ret < 0) { |
@@ -759,7 +765,6 @@ static int bfin_lq035q1_probe(struct platform_device *pdev) | |||
759 | out2: | 765 | out2: |
760 | free_dma(CH_PPI); | 766 | free_dma(CH_PPI); |
761 | out1: | 767 | out1: |
762 | platform_set_drvdata(pdev, NULL); | ||
763 | 768 | ||
764 | return ret; | 769 | return ret; |
765 | } | 770 | } |
@@ -788,7 +793,6 @@ static int bfin_lq035q1_remove(struct platform_device *pdev) | |||
788 | bfin_lq035q1_free_ports(info->disp_info->ppi_mode == | 793 | bfin_lq035q1_free_ports(info->disp_info->ppi_mode == |
789 | USE_RGB565_16_BIT_PPI); | 794 | USE_RGB565_16_BIT_PPI); |
790 | 795 | ||
791 | platform_set_drvdata(pdev, NULL); | ||
792 | framebuffer_release(fbinfo); | 796 | framebuffer_release(fbinfo); |
793 | 797 | ||
794 | dev_info(&pdev->dev, "unregistered LCD driver\n"); | 798 | dev_info(&pdev->dev, "unregistered LCD driver\n"); |
diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c index d46da01c31ae..48c0c4e38a62 100644 --- a/drivers/video/bfin-t350mcqb-fb.c +++ b/drivers/video/bfin-t350mcqb-fb.c | |||
@@ -578,7 +578,6 @@ out3: | |||
578 | out2: | 578 | out2: |
579 | free_dma(CH_PPI); | 579 | free_dma(CH_PPI); |
580 | out1: | 580 | out1: |
581 | platform_set_drvdata(pdev, NULL); | ||
582 | 581 | ||
583 | return ret; | 582 | return ret; |
584 | } | 583 | } |
@@ -608,7 +607,6 @@ static int bfin_t350mcqb_remove(struct platform_device *pdev) | |||
608 | 607 | ||
609 | bfin_t350mcqb_request_ports(0); | 608 | bfin_t350mcqb_request_ports(0); |
610 | 609 | ||
611 | platform_set_drvdata(pdev, NULL); | ||
612 | framebuffer_release(fbinfo); | 610 | framebuffer_release(fbinfo); |
613 | 611 | ||
614 | printk(KERN_INFO DRIVER_NAME ": Unregister LCD driver.\n"); | 612 | printk(KERN_INFO DRIVER_NAME ": Unregister LCD driver.\n"); |
diff --git a/drivers/video/ep93xx-fb.c b/drivers/video/ep93xx-fb.c index ee1ee5401544..28a837dfddd1 100644 --- a/drivers/video/ep93xx-fb.c +++ b/drivers/video/ep93xx-fb.c | |||
@@ -595,7 +595,6 @@ failed_videomem: | |||
595 | fb_dealloc_cmap(&info->cmap); | 595 | fb_dealloc_cmap(&info->cmap); |
596 | failed_cmap: | 596 | failed_cmap: |
597 | kfree(info); | 597 | kfree(info); |
598 | platform_set_drvdata(pdev, NULL); | ||
599 | 598 | ||
600 | return err; | 599 | return err; |
601 | } | 600 | } |
@@ -614,7 +613,6 @@ static int ep93xxfb_remove(struct platform_device *pdev) | |||
614 | fbi->mach_info->teardown(pdev); | 613 | fbi->mach_info->teardown(pdev); |
615 | 614 | ||
616 | kfree(info); | 615 | kfree(info); |
617 | platform_set_drvdata(pdev, NULL); | ||
618 | 616 | ||
619 | return 0; | 617 | return 0; |
620 | } | 618 | } |
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index d8d5779145db..36e1fe21b9b5 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -1305,7 +1305,9 @@ static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix, | |||
1305 | err |= copy_to_user(fix32->reserved, fix->reserved, | 1305 | err |= copy_to_user(fix32->reserved, fix->reserved, |
1306 | sizeof(fix->reserved)); | 1306 | sizeof(fix->reserved)); |
1307 | 1307 | ||
1308 | return err; | 1308 | if (err) |
1309 | return -EFAULT; | ||
1310 | return 0; | ||
1309 | } | 1311 | } |
1310 | 1312 | ||
1311 | static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd, | 1313 | static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd, |
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index 6c278056fc60..6dd72250111e 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c | |||
@@ -469,7 +469,7 @@ static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s) | |||
469 | unsigned long val; | 469 | unsigned long val; |
470 | 470 | ||
471 | if (s) { | 471 | if (s) { |
472 | if (!strict_strtoul(s, 10, &val) && (val <= 2)) | 472 | if (!kstrtoul(s, 10, &val) && (val <= 2)) |
473 | port = (enum fsl_diu_monitor_port) val; | 473 | port = (enum fsl_diu_monitor_port) val; |
474 | else if (strncmp(s, "lvds", 4) == 0) | 474 | else if (strncmp(s, "lvds", 4) == 0) |
475 | port = FSL_DIU_PORT_LVDS; | 475 | port = FSL_DIU_PORT_LVDS; |
@@ -1853,7 +1853,7 @@ static int __init fsl_diu_setup(char *options) | |||
1853 | if (!strncmp(opt, "monitor=", 8)) { | 1853 | if (!strncmp(opt, "monitor=", 8)) { |
1854 | monitor_port = fsl_diu_name_to_port(opt + 8); | 1854 | monitor_port = fsl_diu_name_to_port(opt + 8); |
1855 | } else if (!strncmp(opt, "bpp=", 4)) { | 1855 | } else if (!strncmp(opt, "bpp=", 4)) { |
1856 | if (!strict_strtoul(opt + 4, 10, &val)) | 1856 | if (!kstrtoul(opt + 4, 10, &val)) |
1857 | default_bpp = val; | 1857 | default_bpp = val; |
1858 | } else | 1858 | } else |
1859 | fb_mode = opt; | 1859 | fb_mode = opt; |
diff --git a/drivers/video/i740fb.c b/drivers/video/i740fb.c index cfd0c52e8f73..6c4838818950 100644 --- a/drivers/video/i740fb.c +++ b/drivers/video/i740fb.c | |||
@@ -1302,7 +1302,7 @@ static int __init i740fb_setup(char *options) | |||
1302 | } | 1302 | } |
1303 | #endif | 1303 | #endif |
1304 | 1304 | ||
1305 | int __init i740fb_init(void) | 1305 | static int __init i740fb_init(void) |
1306 | { | 1306 | { |
1307 | #ifndef MODULE | 1307 | #ifndef MODULE |
1308 | char *option = NULL; | 1308 | char *option = NULL; |
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index 0abf2bf20836..12af22ba4d92 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c | |||
@@ -923,7 +923,6 @@ failed_getclock: | |||
923 | failed_req: | 923 | failed_req: |
924 | kfree(info->pseudo_palette); | 924 | kfree(info->pseudo_palette); |
925 | failed_init: | 925 | failed_init: |
926 | platform_set_drvdata(pdev, NULL); | ||
927 | framebuffer_release(info); | 926 | framebuffer_release(info); |
928 | return ret; | 927 | return ret; |
929 | } | 928 | } |
@@ -955,12 +954,10 @@ static int imxfb_remove(struct platform_device *pdev) | |||
955 | iounmap(fbi->regs); | 954 | iounmap(fbi->regs); |
956 | release_mem_region(res->start, resource_size(res)); | 955 | release_mem_region(res->start, resource_size(res)); |
957 | 956 | ||
958 | platform_set_drvdata(pdev, NULL); | ||
959 | |||
960 | return 0; | 957 | return 0; |
961 | } | 958 | } |
962 | 959 | ||
963 | void imxfb_shutdown(struct platform_device * dev) | 960 | static void imxfb_shutdown(struct platform_device *dev) |
964 | { | 961 | { |
965 | struct fb_info *info = platform_get_drvdata(dev); | 962 | struct fb_info *info = platform_get_drvdata(dev); |
966 | struct imxfb_info *fbi = info->par; | 963 | struct imxfb_info *fbi = info->par; |
@@ -999,7 +996,7 @@ static int imxfb_setup(void) | |||
999 | return 0; | 996 | return 0; |
1000 | } | 997 | } |
1001 | 998 | ||
1002 | int __init imxfb_init(void) | 999 | static int __init imxfb_init(void) |
1003 | { | 1000 | { |
1004 | int ret = imxfb_setup(); | 1001 | int ret = imxfb_setup(); |
1005 | 1002 | ||
diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c index 36979b4131ab..2c49112fdd6c 100644 --- a/drivers/video/jz4740_fb.c +++ b/drivers/video/jz4740_fb.c | |||
@@ -737,8 +737,6 @@ static int jzfb_remove(struct platform_device *pdev) | |||
737 | fb_dealloc_cmap(&jzfb->fb->cmap); | 737 | fb_dealloc_cmap(&jzfb->fb->cmap); |
738 | jzfb_free_devmem(jzfb); | 738 | jzfb_free_devmem(jzfb); |
739 | 739 | ||
740 | platform_set_drvdata(pdev, NULL); | ||
741 | |||
742 | framebuffer_release(jzfb->fb); | 740 | framebuffer_release(jzfb->fb); |
743 | 741 | ||
744 | return 0; | 742 | return 0; |
diff --git a/drivers/video/mmp/fb/mmpfb.c b/drivers/video/mmp/fb/mmpfb.c index 6d1fa96c5cc3..4ab95b8daed3 100644 --- a/drivers/video/mmp/fb/mmpfb.c +++ b/drivers/video/mmp/fb/mmpfb.c | |||
@@ -659,7 +659,6 @@ failed_destroy_mutex: | |||
659 | mutex_destroy(&fbi->access_ok); | 659 | mutex_destroy(&fbi->access_ok); |
660 | failed: | 660 | failed: |
661 | dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n"); | 661 | dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n"); |
662 | platform_set_drvdata(pdev, NULL); | ||
663 | 662 | ||
664 | framebuffer_release(info); | 663 | framebuffer_release(info); |
665 | 664 | ||
diff --git a/drivers/video/mmp/hw/mmp_ctrl.c b/drivers/video/mmp/hw/mmp_ctrl.c index 8612590ea943..75dca19bf214 100644 --- a/drivers/video/mmp/hw/mmp_ctrl.c +++ b/drivers/video/mmp/hw/mmp_ctrl.c | |||
@@ -566,7 +566,6 @@ failed: | |||
566 | devm_kfree(ctrl->dev, ctrl); | 566 | devm_kfree(ctrl->dev, ctrl); |
567 | } | 567 | } |
568 | 568 | ||
569 | platform_set_drvdata(pdev, NULL); | ||
570 | dev_err(&pdev->dev, "device init failed\n"); | 569 | dev_err(&pdev->dev, "device init failed\n"); |
571 | 570 | ||
572 | return ret; | 571 | return ret; |
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index 21223d475b39..3ba37713b1f9 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c | |||
@@ -899,7 +899,6 @@ static int mxsfb_probe(struct platform_device *pdev) | |||
899 | 899 | ||
900 | host->base = devm_ioremap_resource(&pdev->dev, res); | 900 | host->base = devm_ioremap_resource(&pdev->dev, res); |
901 | if (IS_ERR(host->base)) { | 901 | if (IS_ERR(host->base)) { |
902 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
903 | ret = PTR_ERR(host->base); | 902 | ret = PTR_ERR(host->base); |
904 | goto fb_release; | 903 | goto fb_release; |
905 | } | 904 | } |
@@ -986,8 +985,6 @@ static int mxsfb_remove(struct platform_device *pdev) | |||
986 | 985 | ||
987 | framebuffer_release(fb_info); | 986 | framebuffer_release(fb_info); |
988 | 987 | ||
989 | platform_set_drvdata(pdev, NULL); | ||
990 | |||
991 | return 0; | 988 | return 0; |
992 | } | 989 | } |
993 | 990 | ||
diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c index 32581c72ad09..8c527e5b293c 100644 --- a/drivers/video/nuc900fb.c +++ b/drivers/video/nuc900fb.c | |||
@@ -707,7 +707,6 @@ static int nuc900fb_remove(struct platform_device *pdev) | |||
707 | release_resource(fbi->mem); | 707 | release_resource(fbi->mem); |
708 | kfree(fbi->mem); | 708 | kfree(fbi->mem); |
709 | 709 | ||
710 | platform_set_drvdata(pdev, NULL); | ||
711 | framebuffer_release(fbinfo); | 710 | framebuffer_release(fbinfo); |
712 | 711 | ||
713 | return 0; | 712 | return 0; |
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index c731d3c068b4..54a07da8587a 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c | |||
@@ -573,7 +573,7 @@ static ssize_t taal_store_esd_interval(struct device *dev, | |||
573 | unsigned long t; | 573 | unsigned long t; |
574 | int r; | 574 | int r; |
575 | 575 | ||
576 | r = strict_strtoul(buf, 10, &t); | 576 | r = kstrtoul(buf, 10, &t); |
577 | if (r) | 577 | if (r) |
578 | return r; | 578 | return r; |
579 | 579 | ||
@@ -611,7 +611,7 @@ static ssize_t taal_store_ulps(struct device *dev, | |||
611 | unsigned long t; | 611 | unsigned long t; |
612 | int r; | 612 | int r; |
613 | 613 | ||
614 | r = strict_strtoul(buf, 10, &t); | 614 | r = kstrtoul(buf, 10, &t); |
615 | if (r) | 615 | if (r) |
616 | return r; | 616 | return r; |
617 | 617 | ||
@@ -660,7 +660,7 @@ static ssize_t taal_store_ulps_timeout(struct device *dev, | |||
660 | unsigned long t; | 660 | unsigned long t; |
661 | int r; | 661 | int r; |
662 | 662 | ||
663 | r = strict_strtoul(buf, 10, &t); | 663 | r = kstrtoul(buf, 10, &t); |
664 | if (r) | 664 | if (r) |
665 | return r; | 665 | return r; |
666 | 666 | ||
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 6433eab6bcf2..a6b331ef7763 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c | |||
@@ -131,7 +131,7 @@ static bool dpi_calc_dispc_cb(int lckd, int pckd, unsigned long lck, | |||
131 | * shifted. So skip all odd dividers when the pixel clock is on the | 131 | * shifted. So skip all odd dividers when the pixel clock is on the |
132 | * higher side. | 132 | * higher side. |
133 | */ | 133 | */ |
134 | if (ctx->pck_min >= 1000000) { | 134 | if (ctx->pck_min >= 100000000) { |
135 | if (lckd > 1 && lckd % 2 != 0) | 135 | if (lckd > 1 && lckd % 2 != 0) |
136 | return false; | 136 | return false; |
137 | 137 | ||
@@ -158,7 +158,7 @@ static bool dpi_calc_hsdiv_cb(int regm_dispc, unsigned long dispc, | |||
158 | * shifted. So skip all odd dividers when the pixel clock is on the | 158 | * shifted. So skip all odd dividers when the pixel clock is on the |
159 | * higher side. | 159 | * higher side. |
160 | */ | 160 | */ |
161 | if (regm_dispc > 1 && regm_dispc % 2 != 0 && ctx->pck_min >= 1000000) | 161 | if (regm_dispc > 1 && regm_dispc % 2 != 0 && ctx->pck_min >= 100000000) |
162 | return false; | 162 | return false; |
163 | 163 | ||
164 | ctx->dsi_cinfo.regm_dispc = regm_dispc; | 164 | ctx->dsi_cinfo.regm_dispc = regm_dispc; |
diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c index 97563c55af63..95c3c4ae81cc 100644 --- a/drivers/video/pxa3xx-gcu.c +++ b/drivers/video/pxa3xx-gcu.c | |||
@@ -711,7 +711,6 @@ err_misc_deregister: | |||
711 | misc_deregister(&priv->misc_dev); | 711 | misc_deregister(&priv->misc_dev); |
712 | 712 | ||
713 | err_free_priv: | 713 | err_free_priv: |
714 | platform_set_drvdata(dev, NULL); | ||
715 | free_buffers(dev, priv); | 714 | free_buffers(dev, priv); |
716 | kfree(priv); | 715 | kfree(priv); |
717 | return ret; | 716 | return ret; |
@@ -729,7 +728,6 @@ static int pxa3xx_gcu_remove(struct platform_device *dev) | |||
729 | priv->shared, priv->shared_phys); | 728 | priv->shared, priv->shared_phys); |
730 | iounmap(priv->mmio_base); | 729 | iounmap(priv->mmio_base); |
731 | release_mem_region(r->start, resource_size(r)); | 730 | release_mem_region(r->start, resource_size(r)); |
732 | platform_set_drvdata(dev, NULL); | ||
733 | clk_disable(priv->clk); | 731 | clk_disable(priv->clk); |
734 | free_buffers(dev, priv); | 732 | free_buffers(dev, priv); |
735 | kfree(priv); | 733 | kfree(priv); |
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 580f80cc586f..eca2de45f7a6 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -2256,7 +2256,6 @@ failed_free_res: | |||
2256 | release_mem_region(r->start, resource_size(r)); | 2256 | release_mem_region(r->start, resource_size(r)); |
2257 | failed_fbi: | 2257 | failed_fbi: |
2258 | clk_put(fbi->clk); | 2258 | clk_put(fbi->clk); |
2259 | platform_set_drvdata(dev, NULL); | ||
2260 | kfree(fbi); | 2259 | kfree(fbi); |
2261 | failed: | 2260 | failed: |
2262 | return ret; | 2261 | return ret; |
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c index 76a0e7fbd692..21a32adbb8ea 100644 --- a/drivers/video/s3c2410fb.c +++ b/drivers/video/s3c2410fb.c | |||
@@ -1005,7 +1005,6 @@ release_regs: | |||
1005 | release_mem: | 1005 | release_mem: |
1006 | release_mem_region(res->start, size); | 1006 | release_mem_region(res->start, size); |
1007 | dealloc_fb: | 1007 | dealloc_fb: |
1008 | platform_set_drvdata(pdev, NULL); | ||
1009 | framebuffer_release(fbinfo); | 1008 | framebuffer_release(fbinfo); |
1010 | return ret; | 1009 | return ret; |
1011 | } | 1010 | } |
@@ -1051,7 +1050,6 @@ static int s3c2410fb_remove(struct platform_device *pdev) | |||
1051 | 1050 | ||
1052 | release_mem_region(info->mem->start, resource_size(info->mem)); | 1051 | release_mem_region(info->mem->start, resource_size(info->mem)); |
1053 | 1052 | ||
1054 | platform_set_drvdata(pdev, NULL); | ||
1055 | framebuffer_release(fbinfo); | 1053 | framebuffer_release(fbinfo); |
1056 | 1054 | ||
1057 | return 0; | 1055 | return 0; |
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index f34c858642e8..de76da0c6429 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c | |||
@@ -1271,7 +1271,6 @@ static int sa1100fb_probe(struct platform_device *pdev) | |||
1271 | failed: | 1271 | failed: |
1272 | if (fbi) | 1272 | if (fbi) |
1273 | iounmap(fbi->base); | 1273 | iounmap(fbi->base); |
1274 | platform_set_drvdata(pdev, NULL); | ||
1275 | kfree(fbi); | 1274 | kfree(fbi); |
1276 | release_mem_region(res->start, resource_size(res)); | 1275 | release_mem_region(res->start, resource_size(res)); |
1277 | return ret; | 1276 | return ret; |
diff --git a/drivers/video/sh7760fb.c b/drivers/video/sh7760fb.c index 5fbb0c7ab0c8..a8c6c43a4658 100644 --- a/drivers/video/sh7760fb.c +++ b/drivers/video/sh7760fb.c | |||
@@ -571,7 +571,6 @@ static int sh7760fb_remove(struct platform_device *dev) | |||
571 | iounmap(par->base); | 571 | iounmap(par->base); |
572 | release_mem_region(par->ioarea->start, resource_size(par->ioarea)); | 572 | release_mem_region(par->ioarea->start, resource_size(par->ioarea)); |
573 | framebuffer_release(info); | 573 | framebuffer_release(info); |
574 | platform_set_drvdata(dev, NULL); | ||
575 | 574 | ||
576 | return 0; | 575 | return 0; |
577 | } | 576 | } |
diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c index 6cad53075e99..8f6e8ff620d4 100644 --- a/drivers/video/sh_mipi_dsi.c +++ b/drivers/video/sh_mipi_dsi.c | |||
@@ -567,7 +567,6 @@ static int sh_mipi_remove(struct platform_device *pdev) | |||
567 | iounmap(mipi->base); | 567 | iounmap(mipi->base); |
568 | if (res) | 568 | if (res) |
569 | release_mem_region(res->start, resource_size(res)); | 569 | release_mem_region(res->start, resource_size(res)); |
570 | platform_set_drvdata(pdev, NULL); | ||
571 | kfree(mipi); | 570 | kfree(mipi); |
572 | 571 | ||
573 | return 0; | 572 | return 0; |
diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c index b2b33fc1ac3f..e188ada2ffd1 100644 --- a/drivers/video/smscufx.c +++ b/drivers/video/smscufx.c | |||
@@ -1622,7 +1622,7 @@ static int ufx_usb_probe(struct usb_interface *interface, | |||
1622 | { | 1622 | { |
1623 | struct usb_device *usbdev; | 1623 | struct usb_device *usbdev; |
1624 | struct ufx_data *dev; | 1624 | struct ufx_data *dev; |
1625 | struct fb_info *info = 0; | 1625 | struct fb_info *info = NULL; |
1626 | int retval = -ENOMEM; | 1626 | int retval = -ENOMEM; |
1627 | u32 id_rev, fpga_rev; | 1627 | u32 id_rev, fpga_rev; |
1628 | 1628 | ||
diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c index dc4fb8620156..deb8733f3c70 100644 --- a/drivers/video/tmiofb.c +++ b/drivers/video/tmiofb.c | |||
@@ -794,7 +794,6 @@ err_hw_init: | |||
794 | cell->disable(dev); | 794 | cell->disable(dev); |
795 | err_enable: | 795 | err_enable: |
796 | err_find_mode: | 796 | err_find_mode: |
797 | platform_set_drvdata(dev, NULL); | ||
798 | free_irq(irq, info); | 797 | free_irq(irq, info); |
799 | err_request_irq: | 798 | err_request_irq: |
800 | iounmap(info->screen_base); | 799 | iounmap(info->screen_base); |
@@ -823,8 +822,6 @@ static int tmiofb_remove(struct platform_device *dev) | |||
823 | if (cell->disable) | 822 | if (cell->disable) |
824 | cell->disable(dev); | 823 | cell->disable(dev); |
825 | 824 | ||
826 | platform_set_drvdata(dev, NULL); | ||
827 | |||
828 | free_irq(irq, info); | 825 | free_irq(irq, info); |
829 | 826 | ||
830 | iounmap(info->screen_base); | 827 | iounmap(info->screen_base); |
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index ec03e726c940..d2e5bc3cf969 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c | |||
@@ -434,10 +434,10 @@ static void dlfb_compress_hline( | |||
434 | 434 | ||
435 | while ((pixel_end > pixel) && | 435 | while ((pixel_end > pixel) && |
436 | (cmd_buffer_end - MIN_RLX_CMD_BYTES > cmd)) { | 436 | (cmd_buffer_end - MIN_RLX_CMD_BYTES > cmd)) { |
437 | uint8_t *raw_pixels_count_byte = 0; | 437 | uint8_t *raw_pixels_count_byte = NULL; |
438 | uint8_t *cmd_pixels_count_byte = 0; | 438 | uint8_t *cmd_pixels_count_byte = NULL; |
439 | const uint16_t *raw_pixel_start = 0; | 439 | const uint16_t *raw_pixel_start = NULL; |
440 | const uint16_t *cmd_pixel_start, *cmd_pixel_end = 0; | 440 | const uint16_t *cmd_pixel_start, *cmd_pixel_end = NULL; |
441 | 441 | ||
442 | prefetchw((void *) cmd); /* pull in one cache line at least */ | 442 | prefetchw((void *) cmd); /* pull in one cache line at least */ |
443 | 443 | ||
@@ -573,7 +573,7 @@ static int dlfb_render_hline(struct dlfb_data *dev, struct urb **urb_ptr, | |||
573 | return 0; | 573 | return 0; |
574 | } | 574 | } |
575 | 575 | ||
576 | int dlfb_handle_damage(struct dlfb_data *dev, int x, int y, | 576 | static int dlfb_handle_damage(struct dlfb_data *dev, int x, int y, |
577 | int width, int height, char *data) | 577 | int width, int height, char *data) |
578 | { | 578 | { |
579 | int i, ret; | 579 | int i, ret; |
@@ -1588,7 +1588,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, | |||
1588 | const struct usb_device_id *id) | 1588 | const struct usb_device_id *id) |
1589 | { | 1589 | { |
1590 | struct usb_device *usbdev; | 1590 | struct usb_device *usbdev; |
1591 | struct dlfb_data *dev = 0; | 1591 | struct dlfb_data *dev = NULL; |
1592 | int retval = -ENOMEM; | 1592 | int retval = -ENOMEM; |
1593 | 1593 | ||
1594 | /* usb initialization */ | 1594 | /* usb initialization */ |
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index e328a61b64ba..10138b60fd70 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c | |||
@@ -819,8 +819,8 @@ static int uvesafb_vbe_init(struct fb_info *info) | |||
819 | if (par->pmi_setpal || par->ypan) { | 819 | if (par->pmi_setpal || par->ypan) { |
820 | if (__supported_pte_mask & _PAGE_NX) { | 820 | if (__supported_pte_mask & _PAGE_NX) { |
821 | par->pmi_setpal = par->ypan = 0; | 821 | par->pmi_setpal = par->ypan = 0; |
822 | printk(KERN_WARNING "uvesafb: NX protection is actively." | 822 | printk(KERN_WARNING "uvesafb: NX protection is active, " |
823 | "We have better not to use the PMI.\n"); | 823 | "better not use the PMI.\n"); |
824 | } else { | 824 | } else { |
825 | uvesafb_vbe_getpmi(task, par); | 825 | uvesafb_vbe_getpmi(task, par); |
826 | } | 826 | } |
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c index 545faeccdb44..830ded45fd47 100644 --- a/drivers/video/vga16fb.c +++ b/drivers/video/vga16fb.c | |||
@@ -1269,7 +1269,6 @@ static void vga16fb_destroy(struct fb_info *info) | |||
1269 | iounmap(info->screen_base); | 1269 | iounmap(info->screen_base); |
1270 | fb_dealloc_cmap(&info->cmap); | 1270 | fb_dealloc_cmap(&info->cmap); |
1271 | /* XXX unshare VGA regions */ | 1271 | /* XXX unshare VGA regions */ |
1272 | platform_set_drvdata(dev, NULL); | ||
1273 | framebuffer_release(info); | 1272 | framebuffer_release(info); |
1274 | } | 1273 | } |
1275 | 1274 | ||
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c index 9547e1831e03..897484903c30 100644 --- a/drivers/video/vt8500lcdfb.c +++ b/drivers/video/vt8500lcdfb.c | |||
@@ -448,7 +448,6 @@ failed_free_io: | |||
448 | failed_free_res: | 448 | failed_free_res: |
449 | release_mem_region(res->start, resource_size(res)); | 449 | release_mem_region(res->start, resource_size(res)); |
450 | failed_fbi: | 450 | failed_fbi: |
451 | platform_set_drvdata(pdev, NULL); | ||
452 | kfree(fbi); | 451 | kfree(fbi); |
453 | failed: | 452 | failed: |
454 | return ret; | 453 | return ret; |
diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c index 01f9ace068e2..3072f30cad19 100644 --- a/drivers/video/wm8505fb.c +++ b/drivers/video/wm8505fb.c | |||
@@ -173,7 +173,7 @@ static ssize_t contrast_store(struct device *dev, | |||
173 | struct wm8505fb_info *fbi = to_wm8505fb_info(info); | 173 | struct wm8505fb_info *fbi = to_wm8505fb_info(info); |
174 | unsigned long tmp; | 174 | unsigned long tmp; |
175 | 175 | ||
176 | if (strict_strtoul(buf, 10, &tmp) || (tmp > 0xff)) | 176 | if (kstrtoul(buf, 10, &tmp) || (tmp > 0xff)) |
177 | return -EINVAL; | 177 | return -EINVAL; |
178 | fbi->contrast = tmp; | 178 | fbi->contrast = tmp; |
179 | 179 | ||
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c index af0b4fdf9aa9..f3d4a69e1e4e 100644 --- a/drivers/video/xilinxfb.c +++ b/drivers/video/xilinxfb.c | |||
@@ -44,7 +44,7 @@ | |||
44 | 44 | ||
45 | 45 | ||
46 | /* | 46 | /* |
47 | * Xilinx calls it "PLB TFT LCD Controller" though it can also be used for | 47 | * Xilinx calls it "TFT LCD Controller" though it can also be used for |
48 | * the VGA port on the Xilinx ML40x board. This is a hardware display | 48 | * the VGA port on the Xilinx ML40x board. This is a hardware display |
49 | * controller for a 640x480 resolution TFT or VGA screen. | 49 | * controller for a 640x480 resolution TFT or VGA screen. |
50 | * | 50 | * |
@@ -54,11 +54,11 @@ | |||
54 | * don't start thinking about scrolling). The second allows the LCD to | 54 | * don't start thinking about scrolling). The second allows the LCD to |
55 | * be turned on or off as well as rotated 180 degrees. | 55 | * be turned on or off as well as rotated 180 degrees. |
56 | * | 56 | * |
57 | * In case of direct PLB access the second control register will be at | 57 | * In case of direct BUS access the second control register will be at |
58 | * an offset of 4 as compared to the DCR access where the offset is 1 | 58 | * an offset of 4 as compared to the DCR access where the offset is 1 |
59 | * i.e. REG_CTRL. So this is taken care in the function | 59 | * i.e. REG_CTRL. So this is taken care in the function |
60 | * xilinx_fb_out_be32 where it left shifts the offset 2 times in case of | 60 | * xilinx_fb_out32 where it left shifts the offset 2 times in case of |
61 | * direct PLB access. | 61 | * direct BUS access. |
62 | */ | 62 | */ |
63 | #define NUM_REGS 2 | 63 | #define NUM_REGS 2 |
64 | #define REG_FB_ADDR 0 | 64 | #define REG_FB_ADDR 0 |
@@ -116,7 +116,8 @@ static struct fb_var_screeninfo xilinx_fb_var = { | |||
116 | }; | 116 | }; |
117 | 117 | ||
118 | 118 | ||
119 | #define PLB_ACCESS_FLAG 0x1 /* 1 = PLB, 0 = DCR */ | 119 | #define BUS_ACCESS_FLAG 0x1 /* 1 = BUS, 0 = DCR */ |
120 | #define LITTLE_ENDIAN_ACCESS 0x2 /* LITTLE ENDIAN IO functions */ | ||
120 | 121 | ||
121 | struct xilinxfb_drvdata { | 122 | struct xilinxfb_drvdata { |
122 | 123 | ||
@@ -146,21 +147,40 @@ struct xilinxfb_drvdata { | |||
146 | container_of(_info, struct xilinxfb_drvdata, info) | 147 | container_of(_info, struct xilinxfb_drvdata, info) |
147 | 148 | ||
148 | /* | 149 | /* |
149 | * The XPS TFT Controller can be accessed through PLB or DCR interface. | 150 | * The XPS TFT Controller can be accessed through BUS or DCR interface. |
150 | * To perform the read/write on the registers we need to check on | 151 | * To perform the read/write on the registers we need to check on |
151 | * which bus its connected and call the appropriate write API. | 152 | * which bus its connected and call the appropriate write API. |
152 | */ | 153 | */ |
153 | static void xilinx_fb_out_be32(struct xilinxfb_drvdata *drvdata, u32 offset, | 154 | static void xilinx_fb_out32(struct xilinxfb_drvdata *drvdata, u32 offset, |
154 | u32 val) | 155 | u32 val) |
155 | { | 156 | { |
156 | if (drvdata->flags & PLB_ACCESS_FLAG) | 157 | if (drvdata->flags & BUS_ACCESS_FLAG) { |
157 | out_be32(drvdata->regs + (offset << 2), val); | 158 | if (drvdata->flags & LITTLE_ENDIAN_ACCESS) |
159 | iowrite32(val, drvdata->regs + (offset << 2)); | ||
160 | else | ||
161 | iowrite32be(val, drvdata->regs + (offset << 2)); | ||
162 | } | ||
158 | #ifdef CONFIG_PPC_DCR | 163 | #ifdef CONFIG_PPC_DCR |
159 | else | 164 | else |
160 | dcr_write(drvdata->dcr_host, offset, val); | 165 | dcr_write(drvdata->dcr_host, offset, val); |
161 | #endif | 166 | #endif |
162 | } | 167 | } |
163 | 168 | ||
169 | static u32 xilinx_fb_in32(struct xilinxfb_drvdata *drvdata, u32 offset) | ||
170 | { | ||
171 | if (drvdata->flags & BUS_ACCESS_FLAG) { | ||
172 | if (drvdata->flags & LITTLE_ENDIAN_ACCESS) | ||
173 | return ioread32(drvdata->regs + (offset << 2)); | ||
174 | else | ||
175 | return ioread32be(drvdata->regs + (offset << 2)); | ||
176 | } | ||
177 | #ifdef CONFIG_PPC_DCR | ||
178 | else | ||
179 | return dcr_read(drvdata->dcr_host, offset); | ||
180 | #endif | ||
181 | return 0; | ||
182 | } | ||
183 | |||
164 | static int | 184 | static int |
165 | xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, | 185 | xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, |
166 | unsigned transp, struct fb_info *fbi) | 186 | unsigned transp, struct fb_info *fbi) |
@@ -197,7 +217,7 @@ xilinx_fb_blank(int blank_mode, struct fb_info *fbi) | |||
197 | switch (blank_mode) { | 217 | switch (blank_mode) { |
198 | case FB_BLANK_UNBLANK: | 218 | case FB_BLANK_UNBLANK: |
199 | /* turn on panel */ | 219 | /* turn on panel */ |
200 | xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default); | 220 | xilinx_fb_out32(drvdata, REG_CTRL, drvdata->reg_ctrl_default); |
201 | break; | 221 | break; |
202 | 222 | ||
203 | case FB_BLANK_NORMAL: | 223 | case FB_BLANK_NORMAL: |
@@ -205,7 +225,7 @@ xilinx_fb_blank(int blank_mode, struct fb_info *fbi) | |||
205 | case FB_BLANK_HSYNC_SUSPEND: | 225 | case FB_BLANK_HSYNC_SUSPEND: |
206 | case FB_BLANK_POWERDOWN: | 226 | case FB_BLANK_POWERDOWN: |
207 | /* turn off panel */ | 227 | /* turn off panel */ |
208 | xilinx_fb_out_be32(drvdata, REG_CTRL, 0); | 228 | xilinx_fb_out32(drvdata, REG_CTRL, 0); |
209 | default: | 229 | default: |
210 | break; | 230 | break; |
211 | 231 | ||
@@ -227,33 +247,23 @@ static struct fb_ops xilinxfb_ops = | |||
227 | * Bus independent setup/teardown | 247 | * Bus independent setup/teardown |
228 | */ | 248 | */ |
229 | 249 | ||
230 | static int xilinxfb_assign(struct device *dev, | 250 | static int xilinxfb_assign(struct platform_device *pdev, |
231 | struct xilinxfb_drvdata *drvdata, | 251 | struct xilinxfb_drvdata *drvdata, |
232 | unsigned long physaddr, | ||
233 | struct xilinxfb_platform_data *pdata) | 252 | struct xilinxfb_platform_data *pdata) |
234 | { | 253 | { |
235 | int rc; | 254 | int rc; |
255 | struct device *dev = &pdev->dev; | ||
236 | int fbsize = pdata->xvirt * pdata->yvirt * BYTES_PER_PIXEL; | 256 | int fbsize = pdata->xvirt * pdata->yvirt * BYTES_PER_PIXEL; |
237 | 257 | ||
238 | if (drvdata->flags & PLB_ACCESS_FLAG) { | 258 | if (drvdata->flags & BUS_ACCESS_FLAG) { |
239 | /* | 259 | struct resource *res; |
240 | * Map the control registers in if the controller | ||
241 | * is on direct PLB interface. | ||
242 | */ | ||
243 | if (!request_mem_region(physaddr, 8, DRIVER_NAME)) { | ||
244 | dev_err(dev, "Couldn't lock memory region at 0x%08lX\n", | ||
245 | physaddr); | ||
246 | rc = -ENODEV; | ||
247 | goto err_region; | ||
248 | } | ||
249 | 260 | ||
250 | drvdata->regs_phys = physaddr; | 261 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
251 | drvdata->regs = ioremap(physaddr, 8); | 262 | drvdata->regs_phys = res->start; |
263 | drvdata->regs = devm_request_and_ioremap(&pdev->dev, res); | ||
252 | if (!drvdata->regs) { | 264 | if (!drvdata->regs) { |
253 | dev_err(dev, "Couldn't lock memory region at 0x%08lX\n", | 265 | rc = -EADDRNOTAVAIL; |
254 | physaddr); | 266 | goto err_region; |
255 | rc = -ENODEV; | ||
256 | goto err_map; | ||
257 | } | 267 | } |
258 | } | 268 | } |
259 | 269 | ||
@@ -270,7 +280,7 @@ static int xilinxfb_assign(struct device *dev, | |||
270 | if (!drvdata->fb_virt) { | 280 | if (!drvdata->fb_virt) { |
271 | dev_err(dev, "Could not allocate frame buffer memory\n"); | 281 | dev_err(dev, "Could not allocate frame buffer memory\n"); |
272 | rc = -ENOMEM; | 282 | rc = -ENOMEM; |
273 | if (drvdata->flags & PLB_ACCESS_FLAG) | 283 | if (drvdata->flags & BUS_ACCESS_FLAG) |
274 | goto err_fbmem; | 284 | goto err_fbmem; |
275 | else | 285 | else |
276 | goto err_region; | 286 | goto err_region; |
@@ -280,13 +290,19 @@ static int xilinxfb_assign(struct device *dev, | |||
280 | memset_io((void __iomem *)drvdata->fb_virt, 0, fbsize); | 290 | memset_io((void __iomem *)drvdata->fb_virt, 0, fbsize); |
281 | 291 | ||
282 | /* Tell the hardware where the frame buffer is */ | 292 | /* Tell the hardware where the frame buffer is */ |
283 | xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys); | 293 | xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); |
294 | rc = xilinx_fb_in32(drvdata, REG_FB_ADDR); | ||
295 | /* Endianess detection */ | ||
296 | if (rc != drvdata->fb_phys) { | ||
297 | drvdata->flags |= LITTLE_ENDIAN_ACCESS; | ||
298 | xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); | ||
299 | } | ||
284 | 300 | ||
285 | /* Turn on the display */ | 301 | /* Turn on the display */ |
286 | drvdata->reg_ctrl_default = REG_CTRL_ENABLE; | 302 | drvdata->reg_ctrl_default = REG_CTRL_ENABLE; |
287 | if (pdata->rotate_screen) | 303 | if (pdata->rotate_screen) |
288 | drvdata->reg_ctrl_default |= REG_CTRL_ROTATE; | 304 | drvdata->reg_ctrl_default |= REG_CTRL_ROTATE; |
289 | xilinx_fb_out_be32(drvdata, REG_CTRL, | 305 | xilinx_fb_out32(drvdata, REG_CTRL, |
290 | drvdata->reg_ctrl_default); | 306 | drvdata->reg_ctrl_default); |
291 | 307 | ||
292 | /* Fill struct fb_info */ | 308 | /* Fill struct fb_info */ |
@@ -323,9 +339,9 @@ static int xilinxfb_assign(struct device *dev, | |||
323 | goto err_regfb; | 339 | goto err_regfb; |
324 | } | 340 | } |
325 | 341 | ||
326 | if (drvdata->flags & PLB_ACCESS_FLAG) { | 342 | if (drvdata->flags & BUS_ACCESS_FLAG) { |
327 | /* Put a banner in the log (for DEBUG) */ | 343 | /* Put a banner in the log (for DEBUG) */ |
328 | dev_dbg(dev, "regs: phys=%lx, virt=%p\n", physaddr, | 344 | dev_dbg(dev, "regs: phys=%x, virt=%p\n", drvdata->regs_phys, |
329 | drvdata->regs); | 345 | drvdata->regs); |
330 | } | 346 | } |
331 | /* Put a banner in the log (for DEBUG) */ | 347 | /* Put a banner in the log (for DEBUG) */ |
@@ -345,15 +361,11 @@ err_cmap: | |||
345 | iounmap(drvdata->fb_virt); | 361 | iounmap(drvdata->fb_virt); |
346 | 362 | ||
347 | /* Turn off the display */ | 363 | /* Turn off the display */ |
348 | xilinx_fb_out_be32(drvdata, REG_CTRL, 0); | 364 | xilinx_fb_out32(drvdata, REG_CTRL, 0); |
349 | 365 | ||
350 | err_fbmem: | 366 | err_fbmem: |
351 | if (drvdata->flags & PLB_ACCESS_FLAG) | 367 | if (drvdata->flags & BUS_ACCESS_FLAG) |
352 | iounmap(drvdata->regs); | 368 | devm_iounmap(dev, drvdata->regs); |
353 | |||
354 | err_map: | ||
355 | if (drvdata->flags & PLB_ACCESS_FLAG) | ||
356 | release_mem_region(physaddr, 8); | ||
357 | 369 | ||
358 | err_region: | 370 | err_region: |
359 | kfree(drvdata); | 371 | kfree(drvdata); |
@@ -381,13 +393,11 @@ static int xilinxfb_release(struct device *dev) | |||
381 | iounmap(drvdata->fb_virt); | 393 | iounmap(drvdata->fb_virt); |
382 | 394 | ||
383 | /* Turn off the display */ | 395 | /* Turn off the display */ |
384 | xilinx_fb_out_be32(drvdata, REG_CTRL, 0); | 396 | xilinx_fb_out32(drvdata, REG_CTRL, 0); |
385 | 397 | ||
386 | /* Release the resources, as allocated based on interface */ | 398 | /* Release the resources, as allocated based on interface */ |
387 | if (drvdata->flags & PLB_ACCESS_FLAG) { | 399 | if (drvdata->flags & BUS_ACCESS_FLAG) |
388 | iounmap(drvdata->regs); | 400 | devm_iounmap(dev, drvdata->regs); |
389 | release_mem_region(drvdata->regs_phys, 8); | ||
390 | } | ||
391 | #ifdef CONFIG_PPC_DCR | 401 | #ifdef CONFIG_PPC_DCR |
392 | else | 402 | else |
393 | dcr_unmap(drvdata->dcr_host, drvdata->dcr_len); | 403 | dcr_unmap(drvdata->dcr_host, drvdata->dcr_len); |
@@ -406,11 +416,9 @@ static int xilinxfb_release(struct device *dev) | |||
406 | static int xilinxfb_of_probe(struct platform_device *op) | 416 | static int xilinxfb_of_probe(struct platform_device *op) |
407 | { | 417 | { |
408 | const u32 *prop; | 418 | const u32 *prop; |
409 | u32 *p; | 419 | u32 tft_access = 0; |
410 | u32 tft_access; | ||
411 | struct xilinxfb_platform_data pdata; | 420 | struct xilinxfb_platform_data pdata; |
412 | struct resource res; | 421 | int size; |
413 | int size, rc; | ||
414 | struct xilinxfb_drvdata *drvdata; | 422 | struct xilinxfb_drvdata *drvdata; |
415 | 423 | ||
416 | /* Copy with the default pdata (not a ptr reference!) */ | 424 | /* Copy with the default pdata (not a ptr reference!) */ |
@@ -424,34 +432,29 @@ static int xilinxfb_of_probe(struct platform_device *op) | |||
424 | } | 432 | } |
425 | 433 | ||
426 | /* | 434 | /* |
427 | * To check whether the core is connected directly to DCR or PLB | 435 | * To check whether the core is connected directly to DCR or BUS |
428 | * interface and initialize the tft_access accordingly. | 436 | * interface and initialize the tft_access accordingly. |
429 | */ | 437 | */ |
430 | p = (u32 *)of_get_property(op->dev.of_node, "xlnx,dcr-splb-slave-if", NULL); | 438 | of_property_read_u32(op->dev.of_node, "xlnx,dcr-splb-slave-if", |
431 | tft_access = p ? *p : 0; | 439 | &tft_access); |
432 | 440 | ||
433 | /* | 441 | /* |
434 | * Fill the resource structure if its direct PLB interface | 442 | * Fill the resource structure if its direct BUS interface |
435 | * otherwise fill the dcr_host structure. | 443 | * otherwise fill the dcr_host structure. |
436 | */ | 444 | */ |
437 | if (tft_access) { | 445 | if (tft_access) { |
438 | drvdata->flags |= PLB_ACCESS_FLAG; | 446 | drvdata->flags |= BUS_ACCESS_FLAG; |
439 | rc = of_address_to_resource(op->dev.of_node, 0, &res); | ||
440 | if (rc) { | ||
441 | dev_err(&op->dev, "invalid address\n"); | ||
442 | goto err; | ||
443 | } | ||
444 | } | 447 | } |
445 | #ifdef CONFIG_PPC_DCR | 448 | #ifdef CONFIG_PPC_DCR |
446 | else { | 449 | else { |
447 | int start; | 450 | int start; |
448 | res.start = 0; | ||
449 | start = dcr_resource_start(op->dev.of_node, 0); | 451 | start = dcr_resource_start(op->dev.of_node, 0); |
450 | drvdata->dcr_len = dcr_resource_len(op->dev.of_node, 0); | 452 | drvdata->dcr_len = dcr_resource_len(op->dev.of_node, 0); |
451 | drvdata->dcr_host = dcr_map(op->dev.of_node, start, drvdata->dcr_len); | 453 | drvdata->dcr_host = dcr_map(op->dev.of_node, start, drvdata->dcr_len); |
452 | if (!DCR_MAP_OK(drvdata->dcr_host)) { | 454 | if (!DCR_MAP_OK(drvdata->dcr_host)) { |
453 | dev_err(&op->dev, "invalid DCR address\n"); | 455 | dev_err(&op->dev, "invalid DCR address\n"); |
454 | goto err; | 456 | kfree(drvdata); |
457 | return -ENODEV; | ||
455 | } | 458 | } |
456 | } | 459 | } |
457 | #endif | 460 | #endif |
@@ -478,11 +481,7 @@ static int xilinxfb_of_probe(struct platform_device *op) | |||
478 | pdata.rotate_screen = 1; | 481 | pdata.rotate_screen = 1; |
479 | 482 | ||
480 | dev_set_drvdata(&op->dev, drvdata); | 483 | dev_set_drvdata(&op->dev, drvdata); |
481 | return xilinxfb_assign(&op->dev, drvdata, res.start, &pdata); | 484 | return xilinxfb_assign(op, drvdata, &pdata); |
482 | |||
483 | err: | ||
484 | kfree(drvdata); | ||
485 | return -ENODEV; | ||
486 | } | 485 | } |
487 | 486 | ||
488 | static int xilinxfb_of_remove(struct platform_device *op) | 487 | static int xilinxfb_of_remove(struct platform_device *op) |