Various fbdev changes for 3.11

* xilinxfb updates
 * Small cleanups and fixes to multiple drivers
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJRy/7gAAoJEPo9qoy8lh71vfEQAKr7rkOCvzXfPjtq5Rh/vpNm
 H/1NU8nBdChwvBk3Anvi0gUpXahT4hItfS5+2/FpAyoI9Kms9kCT4BXck94+Hbjf
 DHkSE6SXN6djbiuXvkR6e9ruL8XSXo6mG1Yu9WzFPVBvUUEvnds/Q0QjwaLPMDhW
 Wajkuk2E0x0NgmdUV3QeapFuTsq6JV3aDLH9Rx8ziiQSkr59+PyJ6bL8P24VqIaR
 MOC4avjUjs1aA81oEsPVo5HJpdkk+/YhYVfCJf2QvtjppyH4mjNbapN9kOyjz6kF
 dslzbjI9/veWvzgvA3ViuflSxp0qsccts+D40YxW7KbMZh5M8gSd51pci3VfQQQt
 Q//FaVSYP0BBhZp7+LHD8h41eKIYNYAstL25bbvTJ6IXPVJWU278+wIK7KpeRqyB
 MKJjJKWjUPSVqsZkA8f97fevjB2nDX2gdriCiGYJysDAUEsgBaseNVUkOEFkd/v3
 npO5NpcqKaOgv2Vplasi4US5jwCgOairraL3LMyjIYdYGkwezqISL8aXO4jipce/
 PfA2Z7OMH1/658gsefDfPCSChksnnF38IxS07cylgxTqsAqFkea+u3ULWwWBvCtN
 eBbxqSZEh+N5SzQYwOJDurCIMeVnFY4fkxZiw+MvcLBzUuqkC/I/pvvmBPAxQFzy
 HTr+YkDY6eUILAbBMHWs
 =KFzn
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2013-06-28 18:01:28 +08:00
commit 19fd7441e9
35 changed files with 113 additions and 136 deletions

View File

@ -2188,7 +2188,7 @@ config FB_PS3_DEFAULT_SIZE_M
config FB_XILINX config FB_XILINX
tristate "Xilinx frame buffer support" 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_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT select FB_CFB_IMAGEBLIT

View File

@ -2016,7 +2016,7 @@ static int aty128_init(struct pci_dev *pdev, const struct pci_device_id *ent)
aty128_init_engine(par); 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->pdev = pdev;
par->asleep = 0; par->asleep = 0;
par->lock_blank = 0; par->lock_blank = 0;

View File

@ -58,6 +58,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/compiler.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/init.h> #include <linux/init.h>
@ -434,8 +435,8 @@ static int correct_chipset(struct atyfb_par *par)
const char *name; const char *name;
int i; int i;
for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--) for (i = ARRAY_SIZE(aty_chips); i > 0; i--)
if (par->pci_id == aty_chips[i].pci_id) if (par->pci_id == aty_chips[i - 1].pci_id)
break; break;
if (i < 0) if (i < 0)
@ -531,8 +532,8 @@ static int correct_chipset(struct atyfb_par *par)
return 0; return 0;
} }
static char ram_dram[] = "DRAM"; static char ram_dram[] __maybe_unused = "DRAM";
static char ram_resv[] = "RESV"; static char ram_resv[] __maybe_unused = "RESV";
#ifdef CONFIG_FB_ATY_GX #ifdef CONFIG_FB_ATY_GX
static char ram_vram[] = "VRAM"; static char ram_vram[] = "VRAM";
#endif /* CONFIG_FB_ATY_GX */ #endif /* CONFIG_FB_ATY_GX */

View 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) void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
{ {
/* Find PM registers in config space if any*/ /* 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 */ /* Enable/Disable dynamic clocks: TODO add sysfs access */
if (rinfo->family == CHIP_FAMILY_RS480) if (rinfo->family == CHIP_FAMILY_RS480)

View File

@ -579,7 +579,6 @@ failed:
if (fbdev->info.cmap.len != 0) { if (fbdev->info.cmap.len != 0) {
fb_dealloc_cmap(&fbdev->info.cmap); fb_dealloc_cmap(&fbdev->info.cmap);
} }
platform_set_drvdata(dev, NULL);
return -ENODEV; return -ENODEV;
} }

View File

@ -681,7 +681,6 @@ out3:
out2: out2:
free_dma(CH_EPPI0); free_dma(CH_EPPI0);
out1: out1:
platform_set_drvdata(pdev, NULL);
return ret; return ret;
} }

View File

@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi)
return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state) 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); 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); struct spi_control *ctl = spi_get_drvdata(spi);
int ret;
ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode); ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode);
if (ret) if (ret)
@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi)
return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON); 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 #else
# define lq035q1_spidev_suspend NULL #define LQ035Q1_SPIDEV_PM_OPS NULL
# define lq035q1_spidev_resume NULL
#endif #endif
/* Power down all displays on reboot, poweroff or halt */ /* 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.probe = lq035q1_spidev_probe;
info->spidrv.remove = lq035q1_spidev_remove; info->spidrv.remove = lq035q1_spidev_remove;
info->spidrv.shutdown = lq035q1_spidev_shutdown; info->spidrv.shutdown = lq035q1_spidev_shutdown;
info->spidrv.suspend = lq035q1_spidev_suspend; info->spidrv.driver.pm = LQ035Q1_SPIDEV_PM_OPS;
info->spidrv.resume = lq035q1_spidev_resume;
ret = spi_register_driver(&info->spidrv); ret = spi_register_driver(&info->spidrv);
if (ret < 0) { if (ret < 0) {
@ -759,7 +765,6 @@ static int bfin_lq035q1_probe(struct platform_device *pdev)
out2: out2:
free_dma(CH_PPI); free_dma(CH_PPI);
out1: out1:
platform_set_drvdata(pdev, NULL);
return ret; return ret;
} }
@ -788,7 +793,6 @@ static int bfin_lq035q1_remove(struct platform_device *pdev)
bfin_lq035q1_free_ports(info->disp_info->ppi_mode == bfin_lq035q1_free_ports(info->disp_info->ppi_mode ==
USE_RGB565_16_BIT_PPI); USE_RGB565_16_BIT_PPI);
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
dev_info(&pdev->dev, "unregistered LCD driver\n"); dev_info(&pdev->dev, "unregistered LCD driver\n");

View File

@ -578,7 +578,6 @@ out3:
out2: out2:
free_dma(CH_PPI); free_dma(CH_PPI);
out1: out1:
platform_set_drvdata(pdev, NULL);
return ret; return ret;
} }
@ -608,7 +607,6 @@ static int bfin_t350mcqb_remove(struct platform_device *pdev)
bfin_t350mcqb_request_ports(0); bfin_t350mcqb_request_ports(0);
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
printk(KERN_INFO DRIVER_NAME ": Unregister LCD driver.\n"); printk(KERN_INFO DRIVER_NAME ": Unregister LCD driver.\n");

View File

@ -595,7 +595,6 @@ failed_videomem:
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
failed_cmap: failed_cmap:
kfree(info); kfree(info);
platform_set_drvdata(pdev, NULL);
return err; return err;
} }
@ -614,7 +613,6 @@ static int ep93xxfb_remove(struct platform_device *pdev)
fbi->mach_info->teardown(pdev); fbi->mach_info->teardown(pdev);
kfree(info); kfree(info);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }

View File

@ -1305,7 +1305,9 @@ static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix,
err |= copy_to_user(fix32->reserved, fix->reserved, err |= copy_to_user(fix32->reserved, fix->reserved,
sizeof(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, static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd,

View File

@ -469,7 +469,7 @@ static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s)
unsigned long val; unsigned long val;
if (s) { if (s) {
if (!strict_strtoul(s, 10, &val) && (val <= 2)) if (!kstrtoul(s, 10, &val) && (val <= 2))
port = (enum fsl_diu_monitor_port) val; port = (enum fsl_diu_monitor_port) val;
else if (strncmp(s, "lvds", 4) == 0) else if (strncmp(s, "lvds", 4) == 0)
port = FSL_DIU_PORT_LVDS; port = FSL_DIU_PORT_LVDS;
@ -1853,7 +1853,7 @@ static int __init fsl_diu_setup(char *options)
if (!strncmp(opt, "monitor=", 8)) { if (!strncmp(opt, "monitor=", 8)) {
monitor_port = fsl_diu_name_to_port(opt + 8); monitor_port = fsl_diu_name_to_port(opt + 8);
} else if (!strncmp(opt, "bpp=", 4)) { } else if (!strncmp(opt, "bpp=", 4)) {
if (!strict_strtoul(opt + 4, 10, &val)) if (!kstrtoul(opt + 4, 10, &val))
default_bpp = val; default_bpp = val;
} else } else
fb_mode = opt; fb_mode = opt;

View File

@ -1302,7 +1302,7 @@ static int __init i740fb_setup(char *options)
} }
#endif #endif
int __init i740fb_init(void) static int __init i740fb_init(void)
{ {
#ifndef MODULE #ifndef MODULE
char *option = NULL; char *option = NULL;

View File

@ -923,7 +923,6 @@ failed_getclock:
failed_req: failed_req:
kfree(info->pseudo_palette); kfree(info->pseudo_palette);
failed_init: failed_init:
platform_set_drvdata(pdev, NULL);
framebuffer_release(info); framebuffer_release(info);
return ret; return ret;
} }
@ -955,12 +954,10 @@ static int imxfb_remove(struct platform_device *pdev)
iounmap(fbi->regs); iounmap(fbi->regs);
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
platform_set_drvdata(pdev, NULL);
return 0; 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 fb_info *info = platform_get_drvdata(dev);
struct imxfb_info *fbi = info->par; struct imxfb_info *fbi = info->par;
@ -999,7 +996,7 @@ static int imxfb_setup(void)
return 0; return 0;
} }
int __init imxfb_init(void) static int __init imxfb_init(void)
{ {
int ret = imxfb_setup(); int ret = imxfb_setup();

View File

@ -737,8 +737,6 @@ static int jzfb_remove(struct platform_device *pdev)
fb_dealloc_cmap(&jzfb->fb->cmap); fb_dealloc_cmap(&jzfb->fb->cmap);
jzfb_free_devmem(jzfb); jzfb_free_devmem(jzfb);
platform_set_drvdata(pdev, NULL);
framebuffer_release(jzfb->fb); framebuffer_release(jzfb->fb);
return 0; return 0;

View File

@ -659,7 +659,6 @@ failed_destroy_mutex:
mutex_destroy(&fbi->access_ok); mutex_destroy(&fbi->access_ok);
failed: failed:
dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n"); dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n");
platform_set_drvdata(pdev, NULL);
framebuffer_release(info); framebuffer_release(info);

View File

@ -566,7 +566,6 @@ failed:
devm_kfree(ctrl->dev, ctrl); devm_kfree(ctrl->dev, ctrl);
} }
platform_set_drvdata(pdev, NULL);
dev_err(&pdev->dev, "device init failed\n"); dev_err(&pdev->dev, "device init failed\n");
return ret; return ret;

View File

@ -899,7 +899,6 @@ static int mxsfb_probe(struct platform_device *pdev)
host->base = devm_ioremap_resource(&pdev->dev, res); host->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(host->base)) { if (IS_ERR(host->base)) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = PTR_ERR(host->base); ret = PTR_ERR(host->base);
goto fb_release; goto fb_release;
} }
@ -986,8 +985,6 @@ static int mxsfb_remove(struct platform_device *pdev)
framebuffer_release(fb_info); framebuffer_release(fb_info);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }

View File

@ -707,7 +707,6 @@ static int nuc900fb_remove(struct platform_device *pdev)
release_resource(fbi->mem); release_resource(fbi->mem);
kfree(fbi->mem); kfree(fbi->mem);
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
return 0; return 0;

View File

@ -573,7 +573,7 @@ static ssize_t taal_store_esd_interval(struct device *dev,
unsigned long t; unsigned long t;
int r; int r;
r = strict_strtoul(buf, 10, &t); r = kstrtoul(buf, 10, &t);
if (r) if (r)
return r; return r;
@ -611,7 +611,7 @@ static ssize_t taal_store_ulps(struct device *dev,
unsigned long t; unsigned long t;
int r; int r;
r = strict_strtoul(buf, 10, &t); r = kstrtoul(buf, 10, &t);
if (r) if (r)
return r; return r;
@ -660,7 +660,7 @@ static ssize_t taal_store_ulps_timeout(struct device *dev,
unsigned long t; unsigned long t;
int r; int r;
r = strict_strtoul(buf, 10, &t); r = kstrtoul(buf, 10, &t);
if (r) if (r)
return r; return r;

View 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 * shifted. So skip all odd dividers when the pixel clock is on the
* higher side. * higher side.
*/ */
if (ctx->pck_min >= 1000000) { if (ctx->pck_min >= 100000000) {
if (lckd > 1 && lckd % 2 != 0) if (lckd > 1 && lckd % 2 != 0)
return false; 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 * shifted. So skip all odd dividers when the pixel clock is on the
* higher side. * 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; return false;
ctx->dsi_cinfo.regm_dispc = regm_dispc; ctx->dsi_cinfo.regm_dispc = regm_dispc;

View File

@ -711,7 +711,6 @@ err_misc_deregister:
misc_deregister(&priv->misc_dev); misc_deregister(&priv->misc_dev);
err_free_priv: err_free_priv:
platform_set_drvdata(dev, NULL);
free_buffers(dev, priv); free_buffers(dev, priv);
kfree(priv); kfree(priv);
return ret; return ret;
@ -729,7 +728,6 @@ static int pxa3xx_gcu_remove(struct platform_device *dev)
priv->shared, priv->shared_phys); priv->shared, priv->shared_phys);
iounmap(priv->mmio_base); iounmap(priv->mmio_base);
release_mem_region(r->start, resource_size(r)); release_mem_region(r->start, resource_size(r));
platform_set_drvdata(dev, NULL);
clk_disable(priv->clk); clk_disable(priv->clk);
free_buffers(dev, priv); free_buffers(dev, priv);
kfree(priv); kfree(priv);

View File

@ -2256,7 +2256,6 @@ failed_free_res:
release_mem_region(r->start, resource_size(r)); release_mem_region(r->start, resource_size(r));
failed_fbi: failed_fbi:
clk_put(fbi->clk); clk_put(fbi->clk);
platform_set_drvdata(dev, NULL);
kfree(fbi); kfree(fbi);
failed: failed:
return ret; return ret;

View File

@ -1005,7 +1005,6 @@ release_regs:
release_mem: release_mem:
release_mem_region(res->start, size); release_mem_region(res->start, size);
dealloc_fb: dealloc_fb:
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
return ret; return ret;
} }
@ -1051,7 +1050,6 @@ static int s3c2410fb_remove(struct platform_device *pdev)
release_mem_region(info->mem->start, resource_size(info->mem)); release_mem_region(info->mem->start, resource_size(info->mem));
platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
return 0; return 0;

View File

@ -1271,7 +1271,6 @@ static int sa1100fb_probe(struct platform_device *pdev)
failed: failed:
if (fbi) if (fbi)
iounmap(fbi->base); iounmap(fbi->base);
platform_set_drvdata(pdev, NULL);
kfree(fbi); kfree(fbi);
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
return ret; return ret;

View File

@ -571,7 +571,6 @@ static int sh7760fb_remove(struct platform_device *dev)
iounmap(par->base); iounmap(par->base);
release_mem_region(par->ioarea->start, resource_size(par->ioarea)); release_mem_region(par->ioarea->start, resource_size(par->ioarea));
framebuffer_release(info); framebuffer_release(info);
platform_set_drvdata(dev, NULL);
return 0; return 0;
} }

View File

@ -567,7 +567,6 @@ static int sh_mipi_remove(struct platform_device *pdev)
iounmap(mipi->base); iounmap(mipi->base);
if (res) if (res)
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
platform_set_drvdata(pdev, NULL);
kfree(mipi); kfree(mipi);
return 0; return 0;

View File

@ -1622,7 +1622,7 @@ static int ufx_usb_probe(struct usb_interface *interface,
{ {
struct usb_device *usbdev; struct usb_device *usbdev;
struct ufx_data *dev; struct ufx_data *dev;
struct fb_info *info = 0; struct fb_info *info = NULL;
int retval = -ENOMEM; int retval = -ENOMEM;
u32 id_rev, fpga_rev; u32 id_rev, fpga_rev;

View File

@ -794,7 +794,6 @@ err_hw_init:
cell->disable(dev); cell->disable(dev);
err_enable: err_enable:
err_find_mode: err_find_mode:
platform_set_drvdata(dev, NULL);
free_irq(irq, info); free_irq(irq, info);
err_request_irq: err_request_irq:
iounmap(info->screen_base); iounmap(info->screen_base);
@ -823,8 +822,6 @@ static int tmiofb_remove(struct platform_device *dev)
if (cell->disable) if (cell->disable)
cell->disable(dev); cell->disable(dev);
platform_set_drvdata(dev, NULL);
free_irq(irq, info); free_irq(irq, info);
iounmap(info->screen_base); iounmap(info->screen_base);

View File

@ -434,10 +434,10 @@ static void dlfb_compress_hline(
while ((pixel_end > pixel) && while ((pixel_end > pixel) &&
(cmd_buffer_end - MIN_RLX_CMD_BYTES > cmd)) { (cmd_buffer_end - MIN_RLX_CMD_BYTES > cmd)) {
uint8_t *raw_pixels_count_byte = 0; uint8_t *raw_pixels_count_byte = NULL;
uint8_t *cmd_pixels_count_byte = 0; uint8_t *cmd_pixels_count_byte = NULL;
const uint16_t *raw_pixel_start = 0; const uint16_t *raw_pixel_start = NULL;
const uint16_t *cmd_pixel_start, *cmd_pixel_end = 0; const uint16_t *cmd_pixel_start, *cmd_pixel_end = NULL;
prefetchw((void *) cmd); /* pull in one cache line at least */ 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; 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 width, int height, char *data)
{ {
int i, ret; int i, ret;
@ -1588,7 +1588,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
struct usb_device *usbdev; struct usb_device *usbdev;
struct dlfb_data *dev = 0; struct dlfb_data *dev = NULL;
int retval = -ENOMEM; int retval = -ENOMEM;
/* usb initialization */ /* usb initialization */

View File

@ -819,8 +819,8 @@ static int uvesafb_vbe_init(struct fb_info *info)
if (par->pmi_setpal || par->ypan) { if (par->pmi_setpal || par->ypan) {
if (__supported_pte_mask & _PAGE_NX) { if (__supported_pte_mask & _PAGE_NX) {
par->pmi_setpal = par->ypan = 0; par->pmi_setpal = par->ypan = 0;
printk(KERN_WARNING "uvesafb: NX protection is actively." printk(KERN_WARNING "uvesafb: NX protection is active, "
"We have better not to use the PMI.\n"); "better not use the PMI.\n");
} else { } else {
uvesafb_vbe_getpmi(task, par); uvesafb_vbe_getpmi(task, par);
} }

View File

@ -1269,7 +1269,6 @@ static void vga16fb_destroy(struct fb_info *info)
iounmap(info->screen_base); iounmap(info->screen_base);
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
/* XXX unshare VGA regions */ /* XXX unshare VGA regions */
platform_set_drvdata(dev, NULL);
framebuffer_release(info); framebuffer_release(info);
} }

View File

@ -448,7 +448,6 @@ failed_free_io:
failed_free_res: failed_free_res:
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
failed_fbi: failed_fbi:
platform_set_drvdata(pdev, NULL);
kfree(fbi); kfree(fbi);
failed: failed:
return ret; return ret;

View File

@ -173,7 +173,7 @@ static ssize_t contrast_store(struct device *dev,
struct wm8505fb_info *fbi = to_wm8505fb_info(info); struct wm8505fb_info *fbi = to_wm8505fb_info(info);
unsigned long tmp; unsigned long tmp;
if (strict_strtoul(buf, 10, &tmp) || (tmp > 0xff)) if (kstrtoul(buf, 10, &tmp) || (tmp > 0xff))
return -EINVAL; return -EINVAL;
fbi->contrast = tmp; fbi->contrast = tmp;

View 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 * the VGA port on the Xilinx ML40x board. This is a hardware display
* controller for a 640x480 resolution TFT or VGA screen. * controller for a 640x480 resolution TFT or VGA screen.
* *
@ -54,11 +54,11 @@
* don't start thinking about scrolling). The second allows the LCD to * don't start thinking about scrolling). The second allows the LCD to
* be turned on or off as well as rotated 180 degrees. * 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 * 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 * 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 * xilinx_fb_out32 where it left shifts the offset 2 times in case of
* direct PLB access. * direct BUS access.
*/ */
#define NUM_REGS 2 #define NUM_REGS 2
#define REG_FB_ADDR 0 #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 { struct xilinxfb_drvdata {
@ -146,21 +147,40 @@ struct xilinxfb_drvdata {
container_of(_info, struct xilinxfb_drvdata, info) 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 * To perform the read/write on the registers we need to check on
* which bus its connected and call the appropriate write API. * 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) u32 val)
{ {
if (drvdata->flags & PLB_ACCESS_FLAG) if (drvdata->flags & BUS_ACCESS_FLAG) {
out_be32(drvdata->regs + (offset << 2), val); if (drvdata->flags & LITTLE_ENDIAN_ACCESS)
iowrite32(val, drvdata->regs + (offset << 2));
else
iowrite32be(val, drvdata->regs + (offset << 2));
}
#ifdef CONFIG_PPC_DCR #ifdef CONFIG_PPC_DCR
else else
dcr_write(drvdata->dcr_host, offset, val); dcr_write(drvdata->dcr_host, offset, val);
#endif #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 static int
xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
unsigned transp, struct fb_info *fbi) unsigned transp, struct fb_info *fbi)
@ -197,7 +217,7 @@ xilinx_fb_blank(int blank_mode, struct fb_info *fbi)
switch (blank_mode) { switch (blank_mode) {
case FB_BLANK_UNBLANK: case FB_BLANK_UNBLANK:
/* turn on panel */ /* 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; break;
case FB_BLANK_NORMAL: 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_HSYNC_SUSPEND:
case FB_BLANK_POWERDOWN: case FB_BLANK_POWERDOWN:
/* turn off panel */ /* turn off panel */
xilinx_fb_out_be32(drvdata, REG_CTRL, 0); xilinx_fb_out32(drvdata, REG_CTRL, 0);
default: default:
break; break;
@ -227,33 +247,23 @@ static struct fb_ops xilinxfb_ops =
* Bus independent setup/teardown * Bus independent setup/teardown
*/ */
static int xilinxfb_assign(struct device *dev, static int xilinxfb_assign(struct platform_device *pdev,
struct xilinxfb_drvdata *drvdata, struct xilinxfb_drvdata *drvdata,
unsigned long physaddr,
struct xilinxfb_platform_data *pdata) struct xilinxfb_platform_data *pdata)
{ {
int rc; int rc;
struct device *dev = &pdev->dev;
int fbsize = pdata->xvirt * pdata->yvirt * BYTES_PER_PIXEL; int fbsize = pdata->xvirt * pdata->yvirt * BYTES_PER_PIXEL;
if (drvdata->flags & PLB_ACCESS_FLAG) { if (drvdata->flags & BUS_ACCESS_FLAG) {
/* struct resource *res;
* 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;
}
drvdata->regs_phys = physaddr; res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
drvdata->regs = ioremap(physaddr, 8); drvdata->regs_phys = res->start;
drvdata->regs = devm_request_and_ioremap(&pdev->dev, res);
if (!drvdata->regs) { if (!drvdata->regs) {
dev_err(dev, "Couldn't lock memory region at 0x%08lX\n", rc = -EADDRNOTAVAIL;
physaddr); goto err_region;
rc = -ENODEV;
goto err_map;
} }
} }
@ -270,7 +280,7 @@ static int xilinxfb_assign(struct device *dev,
if (!drvdata->fb_virt) { if (!drvdata->fb_virt) {
dev_err(dev, "Could not allocate frame buffer memory\n"); dev_err(dev, "Could not allocate frame buffer memory\n");
rc = -ENOMEM; rc = -ENOMEM;
if (drvdata->flags & PLB_ACCESS_FLAG) if (drvdata->flags & BUS_ACCESS_FLAG)
goto err_fbmem; goto err_fbmem;
else else
goto err_region; goto err_region;
@ -280,13 +290,19 @@ static int xilinxfb_assign(struct device *dev,
memset_io((void __iomem *)drvdata->fb_virt, 0, fbsize); memset_io((void __iomem *)drvdata->fb_virt, 0, fbsize);
/* Tell the hardware where the frame buffer is */ /* 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 */ /* Turn on the display */
drvdata->reg_ctrl_default = REG_CTRL_ENABLE; drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
if (pdata->rotate_screen) if (pdata->rotate_screen)
drvdata->reg_ctrl_default |= REG_CTRL_ROTATE; drvdata->reg_ctrl_default |= REG_CTRL_ROTATE;
xilinx_fb_out_be32(drvdata, REG_CTRL, xilinx_fb_out32(drvdata, REG_CTRL,
drvdata->reg_ctrl_default); drvdata->reg_ctrl_default);
/* Fill struct fb_info */ /* Fill struct fb_info */
@ -323,9 +339,9 @@ static int xilinxfb_assign(struct device *dev,
goto err_regfb; goto err_regfb;
} }
if (drvdata->flags & PLB_ACCESS_FLAG) { if (drvdata->flags & BUS_ACCESS_FLAG) {
/* Put a banner in the log (for DEBUG) */ /* 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); drvdata->regs);
} }
/* Put a banner in the log (for DEBUG) */ /* Put a banner in the log (for DEBUG) */
@ -345,15 +361,11 @@ err_cmap:
iounmap(drvdata->fb_virt); iounmap(drvdata->fb_virt);
/* Turn off the display */ /* Turn off the display */
xilinx_fb_out_be32(drvdata, REG_CTRL, 0); xilinx_fb_out32(drvdata, REG_CTRL, 0);
err_fbmem: err_fbmem:
if (drvdata->flags & PLB_ACCESS_FLAG) if (drvdata->flags & BUS_ACCESS_FLAG)
iounmap(drvdata->regs); devm_iounmap(dev, drvdata->regs);
err_map:
if (drvdata->flags & PLB_ACCESS_FLAG)
release_mem_region(physaddr, 8);
err_region: err_region:
kfree(drvdata); kfree(drvdata);
@ -381,13 +393,11 @@ static int xilinxfb_release(struct device *dev)
iounmap(drvdata->fb_virt); iounmap(drvdata->fb_virt);
/* Turn off the display */ /* 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 */ /* Release the resources, as allocated based on interface */
if (drvdata->flags & PLB_ACCESS_FLAG) { if (drvdata->flags & BUS_ACCESS_FLAG)
iounmap(drvdata->regs); devm_iounmap(dev, drvdata->regs);
release_mem_region(drvdata->regs_phys, 8);
}
#ifdef CONFIG_PPC_DCR #ifdef CONFIG_PPC_DCR
else else
dcr_unmap(drvdata->dcr_host, drvdata->dcr_len); 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) static int xilinxfb_of_probe(struct platform_device *op)
{ {
const u32 *prop; const u32 *prop;
u32 *p; u32 tft_access = 0;
u32 tft_access;
struct xilinxfb_platform_data pdata; struct xilinxfb_platform_data pdata;
struct resource res; int size;
int size, rc;
struct xilinxfb_drvdata *drvdata; struct xilinxfb_drvdata *drvdata;
/* Copy with the default pdata (not a ptr reference!) */ /* 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. * interface and initialize the tft_access accordingly.
*/ */
p = (u32 *)of_get_property(op->dev.of_node, "xlnx,dcr-splb-slave-if", NULL); of_property_read_u32(op->dev.of_node, "xlnx,dcr-splb-slave-if",
tft_access = p ? *p : 0; &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. * otherwise fill the dcr_host structure.
*/ */
if (tft_access) { if (tft_access) {
drvdata->flags |= PLB_ACCESS_FLAG; drvdata->flags |= BUS_ACCESS_FLAG;
rc = of_address_to_resource(op->dev.of_node, 0, &res);
if (rc) {
dev_err(&op->dev, "invalid address\n");
goto err;
}
} }
#ifdef CONFIG_PPC_DCR #ifdef CONFIG_PPC_DCR
else { else {
int start; int start;
res.start = 0;
start = dcr_resource_start(op->dev.of_node, 0); start = dcr_resource_start(op->dev.of_node, 0);
drvdata->dcr_len = dcr_resource_len(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); drvdata->dcr_host = dcr_map(op->dev.of_node, start, drvdata->dcr_len);
if (!DCR_MAP_OK(drvdata->dcr_host)) { if (!DCR_MAP_OK(drvdata->dcr_host)) {
dev_err(&op->dev, "invalid DCR address\n"); dev_err(&op->dev, "invalid DCR address\n");
goto err; kfree(drvdata);
return -ENODEV;
} }
} }
#endif #endif
@ -478,11 +481,7 @@ static int xilinxfb_of_probe(struct platform_device *op)
pdata.rotate_screen = 1; pdata.rotate_screen = 1;
dev_set_drvdata(&op->dev, drvdata); dev_set_drvdata(&op->dev, drvdata);
return xilinxfb_assign(&op->dev, drvdata, res.start, &pdata); return xilinxfb_assign(op, drvdata, &pdata);
err:
kfree(drvdata);
return -ENODEV;
} }
static int xilinxfb_of_remove(struct platform_device *op) static int xilinxfb_of_remove(struct platform_device *op)

View File

@ -10,6 +10,7 @@
#define __LINUX_OF_DISPLAY_TIMING_H #define __LINUX_OF_DISPLAY_TIMING_H
struct device_node; struct device_node;
struct display_timing;
struct display_timings; struct display_timings;
#define OF_USE_NATIVE_MODE -1 #define OF_USE_NATIVE_MODE -1