From 5a7bbe86b0b99b1075b97d812946a84ed5fda9ff Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 9 Sep 2013 14:49:14 +0900 Subject: [PATCH 001/143] video: au1100fb: Remove casting the return value which is a void pointer Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/au1100fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index a54ccdc4d661..248abd50ca25 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c @@ -588,7 +588,7 @@ int au1100fb_drv_remove(struct platform_device *dev) if (!dev) return -ENODEV; - fbdev = (struct au1100fb_device *) platform_get_drvdata(dev); + fbdev = platform_get_drvdata(dev); #if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO) au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info); From 8d0c03dd2d1e8fd0f7ac3d43e90ed99dd748ed7a Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Wed, 11 Sep 2013 14:35:05 -0700 Subject: [PATCH 002/143] aty128fb: Use pci_dev pm_cap Use the already existing pm_cap variable in struct pci_dev for determining the power management offset. This saves the driver from having to keep track of an extra variable. Signed-off-by: Jon Mason Cc: Paul Mackerras Cc: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen Signed-off-by: Tomi Valkeinen --- drivers/video/aty/aty128fb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index a4dfe8cb0a0a..b5edb6f08b84 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -413,7 +413,6 @@ struct aty128fb_par { int blitter_may_be_busy; int fifo_slots; /* free slots in FIFO (64 max) */ - int pm_reg; int crt_on, lcd_on; struct pci_dev *pdev; struct fb_info *next; @@ -2016,7 +2015,6 @@ static int aty128_init(struct pci_dev *pdev, const struct pci_device_id *ent) aty128_init_engine(par); - par->pm_reg = pdev->pm_cap; par->pdev = pdev; par->asleep = 0; par->lock_blank = 0; @@ -2397,7 +2395,7 @@ static void aty128_set_suspend(struct aty128fb_par *par, int suspend) u32 pmgt; struct pci_dev *pdev = par->pdev; - if (!par->pm_reg) + if (!par->pdev->pm_cap) return; /* Set the chip into the appropriate suspend mode (we use D2, From 65122f7e80b5a4aaec76c21369c798975c3eedac Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Wed, 11 Sep 2013 14:35:06 -0700 Subject: [PATCH 003/143] radeonfb: Use pci_dev pm_cap Use the already existing pm_cap variable in struct pci_dev for determining the power management offset. This saves the driver from having to keep track of an extra variable. Also, use the pci_power_t value instead of always using the raw value for PCI_D2. Signed-off-by: Jon Mason Cc: Benjamin Herrenschmidt Cc: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen Signed-off-by: Tomi Valkeinen --- drivers/video/aty/radeon_pm.c | 15 ++++++--------- drivers/video/aty/radeonfb.h | 1 - 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index f7091ece580d..f2662247363e 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c @@ -2515,13 +2515,13 @@ static void radeonfb_whack_power_state(struct radeonfb_info *rinfo, pci_power_t for (;;) { pci_read_config_word(rinfo->pdev, - rinfo->pm_reg+PCI_PM_CTRL, + rinfo->pdev->pm_cap + PCI_PM_CTRL, &pwr_cmd); - if (pwr_cmd & 2) + if (pwr_cmd & state) break; - pwr_cmd = (pwr_cmd & ~PCI_PM_CTRL_STATE_MASK) | 2; + pwr_cmd = (pwr_cmd & ~PCI_PM_CTRL_STATE_MASK) | state; pci_write_config_word(rinfo->pdev, - rinfo->pm_reg+PCI_PM_CTRL, + rinfo->pdev->pm_cap + PCI_PM_CTRL, pwr_cmd); msleep(500); } @@ -2532,7 +2532,7 @@ static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend) { u32 tmp; - if (!rinfo->pm_reg) + if (!rinfo->pdev->pm_cap) return; /* Set the chip into appropriate suspend mode (we use D2, @@ -2804,9 +2804,6 @@ 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 = rinfo->pdev->pm_cap; - /* Enable/Disable dynamic clocks: TODO add sysfs access */ if (rinfo->family == CHIP_FAMILY_RS480) rinfo->dynclk = -1; @@ -2830,7 +2827,7 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlis * reason. --BenH */ if (machine_is(powermac) && rinfo->of_node) { - if (rinfo->is_mobility && rinfo->pm_reg && + if (rinfo->is_mobility && rinfo->pdev->pm_cap && rinfo->family <= CHIP_FAMILY_RV250) rinfo->pm_mode |= radeon_pm_d2; diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h index 7351e66c7f54..cb846044f57c 100644 --- a/drivers/video/aty/radeonfb.h +++ b/drivers/video/aty/radeonfb.h @@ -342,7 +342,6 @@ struct radeonfb_info { int mtrr_hdl; - int pm_reg; u32 save_regs[100]; int asleep; int lock_blank; From 8e6947764f4b69d612519e9202f6e9ae982b6cd4 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:50:40 +0900 Subject: [PATCH 004/143] video: arkfb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/arkfb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c index 94a51f1ef904..ff6e304b225f 100644 --- a/drivers/video/arkfb.c +++ b/drivers/video/arkfb.c @@ -1108,7 +1108,6 @@ static void ark_pci_remove(struct pci_dev *dev) pci_release_regions(dev); /* pci_disable_device(dev); */ - pci_set_drvdata(dev, NULL); framebuffer_release(info); } } From 4a70324640e100f375e55e9b502d18c610a8432d Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:51:25 +0900 Subject: [PATCH 005/143] video: carminefb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/carminefb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/carminefb.c b/drivers/video/carminefb.c index 153dd65b0ae8..b98f709abf52 100644 --- a/drivers/video/carminefb.c +++ b/drivers/video/carminefb.c @@ -746,7 +746,6 @@ static void carminefb_remove(struct pci_dev *dev) iounmap(hw->v_regs); release_mem_region(fix.mmio_start, fix.mmio_len); - pci_set_drvdata(dev, NULL); pci_disable_device(dev); kfree(hw); } From d5ddbb00b85486c458854b61f6002a6c8edee0c3 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:51:57 +0900 Subject: [PATCH 006/143] video: cirrusfb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/cirrusfb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index 97db3ba8f237..b0167468f5c4 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c @@ -2159,7 +2159,6 @@ static int cirrusfb_pci_register(struct pci_dev *pdev, if (!ret) return 0; - pci_set_drvdata(pdev, NULL); iounmap(info->screen_base); err_release_legacy: if (release_io_ports) From 1df6af41bd6118681a18445c1b7f94f6893a28b6 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:52:30 +0900 Subject: [PATCH 007/143] video: cyber2000fb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/cyber2000fb.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index 57886787ead0..c824b4223b83 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c @@ -1871,11 +1871,6 @@ static void cyberpro_pci_remove(struct pci_dev *dev) iounmap(cfb->region); cyberpro_free_fb_info(cfb); - /* - * Ensure that the driver data is no longer - * valid. - */ - pci_set_drvdata(dev, NULL); if (cfb == int_cfb_info) int_cfb_info = NULL; From 72411db379e14411e15d8f75993deb52de13ac56 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:53:11 +0900 Subject: [PATCH 008/143] video: lxfb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/geode/lxfb_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c index 4dd7b5566962..10de31b21d0a 100644 --- a/drivers/video/geode/lxfb_core.c +++ b/drivers/video/geode/lxfb_core.c @@ -606,7 +606,6 @@ static void lxfb_remove(struct pci_dev *pdev) pci_release_region(pdev, 3); fb_dealloc_cmap(&info->cmap); - pci_set_drvdata(pdev, NULL); framebuffer_release(info); } From 90def2c31247ff195ce52089405a400a0209ca64 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:53:49 +0900 Subject: [PATCH 009/143] video: gx1fb: remove unnecessary pci_set_drvdata() From fbb1885952efb15a46d03aac050c38fc9179594e Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 14:42:45 +0900 Subject: [PATCH 06/21] video: gx1fb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/geode/gx1fb_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/geode/gx1fb_core.c b/drivers/video/geode/gx1fb_core.c index ebbaada7b941..7551a04f5c31 100644 --- a/drivers/video/geode/gx1fb_core.c +++ b/drivers/video/geode/gx1fb_core.c @@ -399,7 +399,6 @@ static void gx1fb_remove(struct pci_dev *pdev) release_mem_region(gx1_gx_base() + 0x8300, 0x100); fb_dealloc_cmap(&info->cmap); - pci_set_drvdata(pdev, NULL); framebuffer_release(info); } From 44f75bfdbea0a2364dda7d733b5a2e4e31de5482 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:54:28 +0900 Subject: [PATCH 010/143] video: gxfb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/geode/gxfb_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c index 19f0c1add747..a42d74d6eded 100644 --- a/drivers/video/geode/gxfb_core.c +++ b/drivers/video/geode/gxfb_core.c @@ -471,7 +471,6 @@ static void gxfb_remove(struct pci_dev *pdev) pci_release_region(pdev, 1); fb_dealloc_cmap(&info->cmap); - pci_set_drvdata(pdev, NULL); framebuffer_release(info); } From 6a20807905b6cf84026f78f25aee2ccc0e4d0d3e Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:54:53 +0900 Subject: [PATCH 011/143] video: i740fb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/i740fb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/i740fb.c b/drivers/video/i740fb.c index 6c4838818950..6501ac1dba0f 100644 --- a/drivers/video/i740fb.c +++ b/drivers/video/i740fb.c @@ -1194,7 +1194,6 @@ static void i740fb_remove(struct pci_dev *dev) pci_iounmap(dev, info->screen_base); pci_release_regions(dev); /* pci_disable_device(dev); */ - pci_set_drvdata(dev, NULL); framebuffer_release(info); } } From 17a7a1989aed7294f27b204fd93ee6842a47488f Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:55:29 +0900 Subject: [PATCH 012/143] video: i810fb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/i810/i810_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index 4ce3438ade6f..038192ac7369 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c @@ -2129,7 +2129,6 @@ static void __exit i810fb_remove_pci(struct pci_dev *dev) unregister_framebuffer(info); i810fb_release_resource(info, par); - pci_set_drvdata(dev, NULL); printk("cleanup_module: unloaded i810 framebuffer device\n"); } From 07af229af68efd6220b301be6561ca19ce26c40e Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:56:00 +0900 Subject: [PATCH 013/143] video: intelfb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/intelfb/intelfbdrv.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 8209e46c5d28..b847d530471a 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c @@ -931,8 +931,6 @@ static void intelfb_pci_unregister(struct pci_dev *pdev) return; cleanup(dinfo); - - pci_set_drvdata(pdev, NULL); } /*************************************************************** From 443e3fbcd034218c97f0970ceeb42ca3c982c9a2 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:56:32 +0900 Subject: [PATCH 014/143] video: kyrofb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/kyro/fbdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c index 6157f74ac600..c82f0400d7d2 100644 --- a/drivers/video/kyro/fbdev.c +++ b/drivers/video/kyro/fbdev.c @@ -779,7 +779,6 @@ static void kyrofb_remove(struct pci_dev *pdev) #endif unregister_framebuffer(info); - pci_set_drvdata(pdev, NULL); framebuffer_release(info); } From 3a1300ef9e3c25b206e0932655ab67996b3743e2 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:57:09 +0900 Subject: [PATCH 015/143] video: mb862xxfb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/mb862xx/mb862xxfbdrv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c index 91c59c9fb082..98d2f8c2ed75 100644 --- a/drivers/video/mb862xx/mb862xxfbdrv.c +++ b/drivers/video/mb862xx/mb862xxfbdrv.c @@ -1157,7 +1157,6 @@ static void mb862xx_pci_remove(struct pci_dev *pdev) device_remove_file(&pdev->dev, &dev_attr_dispregs); - pci_set_drvdata(pdev, NULL); unregister_framebuffer(fbi); fb_dealloc_cmap(&fbi->cmap); From 0ab49846c82c31c7729c127b05ac8a3b927cd36a Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:57:54 +0900 Subject: [PATCH 016/143] video: neofb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/neofb.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c index 7ef079c146e7..891b0bf841e3 100644 --- a/drivers/video/neofb.c +++ b/drivers/video/neofb.c @@ -2146,12 +2146,6 @@ static void neofb_remove(struct pci_dev *dev) fb_destroy_modedb(info->monspecs.modedb); neo_unmap_mmio(info); neo_free_fb_info(info); - - /* - * Ensure that the driver data is no longer - * valid. - */ - pci_set_drvdata(dev, NULL); } } From fe2cc238932a28de11110e78bc807712fdc96158 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:58:11 +0900 Subject: [PATCH 017/143] video: pm2fb: remove unnecessary pci_set_drvdata() From 9e2c37ee1d5c2145fac113c483c9e6dd408f10fe Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:11:07 +0900 Subject: [PATCH 14/21] video: pm2fb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/pm2fb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c index 81354eeab021..45d9a3fe35e7 100644 --- a/drivers/video/pm2fb.c +++ b/drivers/video/pm2fb.c @@ -1744,7 +1744,6 @@ static void pm2fb_remove(struct pci_dev *pdev) iounmap(par->v_regs); release_mem_region(fix->mmio_start, fix->mmio_len); - pci_set_drvdata(pdev, NULL); fb_dealloc_cmap(&info->cmap); kfree(info->pixmap.addr); framebuffer_release(info); From 76347609ae082a0d4bad223f0b076c51bb006b16 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:58:44 +0900 Subject: [PATCH 018/143] video: pm3fb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/pm3fb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c index 7718faa4a73b..9c17474340cd 100644 --- a/drivers/video/pm3fb.c +++ b/drivers/video/pm3fb.c @@ -1489,7 +1489,6 @@ static void pm3fb_remove(struct pci_dev *dev) iounmap(par->v_regs); release_mem_region(fix->mmio_start, fix->mmio_len); - pci_set_drvdata(dev, NULL); kfree(info->pixmap.addr); framebuffer_release(info); } From 354b40c4a2f99461f86a5dc8a62e59acd18b08ea Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:59:13 +0900 Subject: [PATCH 019/143] video: s3fb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/s3fb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c index 47ca86c5c6c0..d158d2c0460f 100644 --- a/drivers/video/s3fb.c +++ b/drivers/video/s3fb.c @@ -1431,7 +1431,6 @@ static void s3_pci_remove(struct pci_dev *dev) pci_release_regions(dev); /* pci_disable_device(dev); */ - pci_set_drvdata(dev, NULL); framebuffer_release(info); } } From f1260e3ec4c4abaadf2a68cf1378a613fb885bbe Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 15:59:43 +0900 Subject: [PATCH 020/143] video: savagefb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/savage/savagefb_driver.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 741b2395d01e..4dbf45f3b21a 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c @@ -2362,12 +2362,6 @@ static void savagefb_remove(struct pci_dev *dev) kfree(info->pixmap.addr); pci_release_regions(dev); framebuffer_release(info); - - /* - * Ensure that the driver data is no longer - * valid. - */ - pci_set_drvdata(dev, NULL); } } From f9af73c6f688630fbf84aa2361772613b36021ee Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 16:00:31 +0900 Subject: [PATCH 021/143] video: sisfb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/sis/sis_main.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c index 977e27927a21..793b40238fca 100644 --- a/drivers/video/sis/sis_main.c +++ b/drivers/video/sis/sis_main.c @@ -5994,7 +5994,6 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if(!ivideo->sisvga_enabled) { if(pci_enable_device(pdev)) { if(ivideo->nbridge) pci_dev_put(ivideo->nbridge); - pci_set_drvdata(pdev, NULL); framebuffer_release(sis_fb_info); return -EIO; } @@ -6211,7 +6210,6 @@ error_3: vfree(ivideo->bios_abase); pci_dev_put(ivideo->lpcdev); if(ivideo->nbridge) pci_dev_put(ivideo->nbridge); - pci_set_drvdata(pdev, NULL); if(!ivideo->sisvga_enabled) pci_disable_device(pdev); framebuffer_release(sis_fb_info); @@ -6523,8 +6521,6 @@ static void sisfb_remove(struct pci_dev *pdev) mtrr_del(ivideo->mtrr, ivideo->video_base, ivideo->video_size); #endif - pci_set_drvdata(pdev, NULL); - /* If device was disabled when starting, disable * it when quitting. */ From e09335a6fe88efb5db5c7e13ea58a5793f023c26 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 16:00:58 +0900 Subject: [PATCH 022/143] video: tdfxfb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/tdfxfb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c index 64bc28ba4037..f761fe375f5b 100644 --- a/drivers/video/tdfxfb.c +++ b/drivers/video/tdfxfb.c @@ -1646,7 +1646,6 @@ static void tdfxfb_remove(struct pci_dev *pdev) pci_resource_len(pdev, 1)); release_mem_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); - pci_set_drvdata(pdev, NULL); fb_dealloc_cmap(&info->cmap); framebuffer_release(info); } From e8473074924112d2f075be011f35db5bc9405577 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 16:01:18 +0900 Subject: [PATCH 023/143] video: tridentfb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/tridentfb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c index ab57d387d6b5..7ed9a227f5ea 100644 --- a/drivers/video/tridentfb.c +++ b/drivers/video/tridentfb.c @@ -1553,7 +1553,6 @@ static void trident_pci_remove(struct pci_dev *dev) iounmap(info->screen_base); release_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len); release_mem_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len); - pci_set_drvdata(dev, NULL); kfree(info->pixmap.addr); fb_dealloc_cmap(&info->cmap); framebuffer_release(info); From fc0b01930e50074f66ab1a7fe6d6a9e1e1ef9e41 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 12 Sep 2013 16:01:53 +0900 Subject: [PATCH 024/143] video: vt8623fb: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/vt8623fb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c index e9557fa014ee..6b424ddd6793 100644 --- a/drivers/video/vt8623fb.c +++ b/drivers/video/vt8623fb.c @@ -829,7 +829,6 @@ static void vt8623_pci_remove(struct pci_dev *dev) pci_release_regions(dev); /* pci_disable_device(dev); */ - pci_set_drvdata(dev, NULL); framebuffer_release(info); } } From 93f571728f236dfaad1755f781898febb55d1d63 Mon Sep 17 00:00:00 2001 From: Peter Huewe Date: Fri, 13 Sep 2013 21:51:50 +0200 Subject: [PATCH 025/143] video/matrox/matroxfb_maven: Use module_i2c_driver to register driver Removing some boilerplate by using module_i2c_driver instead of calling register and unregister in the otherwise empty init/exit functions. Also removed a useless comment as suggested by Jean Delvare. Signed-off-by: Peter Huewe Signed-off-by: Jean Delvare Cc: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen Signed-off-by: Tomi Valkeinen --- drivers/video/matrox/matroxfb_maven.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/video/matrox/matroxfb_maven.c b/drivers/video/matrox/matroxfb_maven.c index fd2897455696..ee41a0f276b2 100644 --- a/drivers/video/matrox/matroxfb_maven.c +++ b/drivers/video/matrox/matroxfb_maven.c @@ -1295,19 +1295,7 @@ static struct i2c_driver maven_driver={ .id_table = maven_id, }; -static int __init matroxfb_maven_init(void) -{ - return i2c_add_driver(&maven_driver); -} - -static void __exit matroxfb_maven_exit(void) -{ - i2c_del_driver(&maven_driver); -} - +module_i2c_driver(maven_driver); MODULE_AUTHOR("(c) 1999-2002 Petr Vandrovec "); MODULE_DESCRIPTION("Matrox G200/G400 Matrox MGA-TVO driver"); MODULE_LICENSE("GPL"); -module_init(matroxfb_maven_init); -module_exit(matroxfb_maven_exit); -/* we do not have __setup() yet */ From 350d72f0edd8bbc56d3018112316e1f05a273a20 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:05:38 +0530 Subject: [PATCH 026/143] video: grvga: Use module_platform_driver module_platform_driver removes some boilerplate code and makes it simple. Signed-off-by: Sachin Kamat Cc: Kristoffer Glembo Signed-off-by: Tomi Valkeinen --- drivers/video/grvga.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/video/grvga.c b/drivers/video/grvga.c index 861109e7de1b..b95eee7d901e 100644 --- a/drivers/video/grvga.c +++ b/drivers/video/grvga.c @@ -557,19 +557,7 @@ static struct platform_driver grvga_driver = { .remove = grvga_remove, }; - -static int __init grvga_init(void) -{ - return platform_driver_register(&grvga_driver); -} - -static void __exit grvga_exit(void) -{ - platform_driver_unregister(&grvga_driver); -} - -module_init(grvga_init); -module_exit(grvga_exit); +module_platform_driver(grvga_driver); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Aeroflex Gaisler"); From 42ddb453a0cd07569e728dbf3e9109cf3ae03e26 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 18 Sep 2013 14:48:32 +0200 Subject: [PATCH 027/143] radeon: Conditionally compile PM code The power management code is only used on X86 and PowerMac. To prevent the compiler from warning about unused code, only build when PM and one of X86 or PowerMac is selected. Signed-off-by: Thierry Reding Signed-off-by: Tomi Valkeinen --- drivers/video/aty/radeon_pm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index f2662247363e..46a12f1a93c3 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c @@ -1427,6 +1427,8 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo) mdelay( 15); } +#if defined(CONFIG_PM) +#if defined(CONFIG_X86) || defined(CONFIG_PPC_PMAC) static void radeon_pm_reset_pad_ctlr_strength(struct radeonfb_info *rinfo) { u32 tmp, tmp2; @@ -1939,9 +1941,10 @@ static void radeon_reinitialize_M10(struct radeonfb_info *rinfo) */ radeon_pm_m10_enable_lvds_spread_spectrum(rinfo); } +#endif #ifdef CONFIG_PPC_OF - +#ifdef CONFIG_PPC_PMAC static void radeon_pm_m9p_reconfigure_mc(struct radeonfb_info *rinfo) { OUTREG(MC_CNTL, rinfo->save_regs[46]); @@ -2202,6 +2205,8 @@ static void radeon_reinitialize_M9P(struct radeonfb_info *rinfo) radeon_pm_restore_pixel_pll(rinfo); radeon_pm_m10_enable_lvds_spread_spectrum(rinfo); } +#endif +#endif #if 0 /* Not ready yet */ static void radeon_reinitialize_QW(struct radeonfb_info *rinfo) From a5d58be0796ac93d18a6dde5a14fafee0b73eb0d Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:06:39 +0900 Subject: [PATCH 028/143] video: atmel_lcdfb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Also, unnecessary casting from return value that is a void pointer is removed. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/atmel_lcdfb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 088511a58a26..df05550b82e6 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -935,8 +935,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) sinfo = info->par; - if (dev->platform_data) { - pdata_sinfo = (struct atmel_lcdfb_info *)dev->platform_data; + if (dev_get_platdata(dev)) { + pdata_sinfo = dev_get_platdata(dev); sinfo->default_bpp = pdata_sinfo->default_bpp; sinfo->default_dmacon = pdata_sinfo->default_dmacon; sinfo->default_lcdcon2 = pdata_sinfo->default_lcdcon2; From 521fdb7c4d05ab48fcbfe3d7eac169e305c88118 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 13:57:22 +0900 Subject: [PATCH 029/143] video: mx3fb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/mx3fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c index cfdb380ec81e..804f874d32d3 100644 --- a/drivers/video/mx3fb.c +++ b/drivers/video/mx3fb.c @@ -1354,7 +1354,7 @@ static struct fb_info *mx3fb_init_fbinfo(struct device *dev, struct fb_ops *ops) static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan) { struct device *dev = mx3fb->dev; - struct mx3fb_platform_data *mx3fb_pdata = dev->platform_data; + struct mx3fb_platform_data *mx3fb_pdata = dev_get_platdata(dev); const char *name = mx3fb_pdata->name; unsigned int irq; struct fb_info *fbi; @@ -1462,7 +1462,7 @@ static bool chan_filter(struct dma_chan *chan, void *arg) return false; dev = rq->mx3fb->dev; - mx3fb_pdata = dev->platform_data; + mx3fb_pdata = dev_get_platdata(dev); return rq->id == chan->chan_id && mx3fb_pdata->dma_dev == chan->device->dev; From cd7c7f6c3c6d0800e1096aa6d1bf36271c48f8ff Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 13:58:33 +0900 Subject: [PATCH 030/143] video: nuc900fb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/nuc900fb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c index 796e5112ceee..ec32f675466d 100644 --- a/drivers/video/nuc900fb.c +++ b/drivers/video/nuc900fb.c @@ -91,7 +91,7 @@ static int nuc900fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { struct nuc900fb_info *fbi = info->par; - struct nuc900fb_mach_info *mach_info = fbi->dev->platform_data; + struct nuc900fb_mach_info *mach_info = dev_get_platdata(fbi->dev); struct nuc900fb_display *display = NULL; struct nuc900fb_display *default_display = mach_info->displays + mach_info->default_display; @@ -358,7 +358,7 @@ static inline void modify_gpio(void __iomem *reg, static int nuc900fb_init_registers(struct fb_info *info) { struct nuc900fb_info *fbi = info->par; - struct nuc900fb_mach_info *mach_info = fbi->dev->platform_data; + struct nuc900fb_mach_info *mach_info = dev_get_platdata(fbi->dev); void __iomem *regs = fbi->io; /*reset the display engine*/ @@ -512,7 +512,7 @@ static int nuc900fb_probe(struct platform_device *pdev) int size; dev_dbg(&pdev->dev, "devinit\n"); - mach_info = pdev->dev.platform_data; + mach_info = dev_get_platdata(&pdev->dev); if (mach_info == NULL) { dev_err(&pdev->dev, "no platform data for lcd, cannot attach\n"); From dffb3b47baf472c538c85c22fdce78cbed786536 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 13:58:58 +0900 Subject: [PATCH 031/143] video: omapfb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/omap/hwa742.c | 2 +- drivers/video/omap/omapfb_main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/omap/hwa742.c b/drivers/video/omap/hwa742.c index f349ee6f0cea..a4ee65b8f918 100644 --- a/drivers/video/omap/hwa742.c +++ b/drivers/video/omap/hwa742.c @@ -947,7 +947,7 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode, hwa742.extif = fbdev->ext_if; hwa742.int_ctrl = fbdev->int_ctrl; - omapfb_conf = fbdev->dev->platform_data; + omapfb_conf = dev_get_platdata(fbdev->dev); hwa742.sys_ck = clk_get(NULL, "hwa_sys_ck"); diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c index d40612c31a98..e4fc6d9b5371 100644 --- a/drivers/video/omap/omapfb_main.c +++ b/drivers/video/omap/omapfb_main.c @@ -1602,7 +1602,7 @@ static int omapfb_find_ctrl(struct omapfb_device *fbdev) char name[17]; int i; - conf = fbdev->dev->platform_data; + conf = dev_get_platdata(fbdev->dev); fbdev->ctrl = NULL; @@ -1674,7 +1674,7 @@ static int omapfb_do_probe(struct platform_device *pdev, goto cleanup; } - if (pdev->dev.platform_data == NULL) { + if (dev_get_platdata(&pdev->dev) == NULL) { dev_err(&pdev->dev, "missing platform data\n"); r = -ENOENT; goto cleanup; From 006ac4d4f7d40d2ef0a059721630c7d2f1b3858e Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 13:59:59 +0900 Subject: [PATCH 032/143] video: pxa168fb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/pxa168fb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c index aa9bd1f76d60..c95b9e46d48f 100644 --- a/drivers/video/pxa168fb.c +++ b/drivers/video/pxa168fb.c @@ -364,7 +364,7 @@ static void set_graphics_start(struct fb_info *info, int xoffset, int yoffset) static void set_dumb_panel_control(struct fb_info *info) { struct pxa168fb_info *fbi = info->par; - struct pxa168fb_mach_info *mi = fbi->dev->platform_data; + struct pxa168fb_mach_info *mi = dev_get_platdata(fbi->dev); u32 x; /* @@ -407,7 +407,7 @@ static int pxa168fb_set_par(struct fb_info *info) u32 x; struct pxa168fb_mach_info *mi; - mi = fbi->dev->platform_data; + mi = dev_get_platdata(fbi->dev); /* * Set additional mode info. @@ -609,7 +609,7 @@ static int pxa168fb_probe(struct platform_device *pdev) struct clk *clk; int irq, ret; - mi = pdev->dev.platform_data; + mi = dev_get_platdata(&pdev->dev); if (mi == NULL) { dev_err(&pdev->dev, "no platform data defined\n"); return -EINVAL; From 22313679b86c2073b0a570f6e5685b2e0edbf9df Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:01:01 +0900 Subject: [PATCH 033/143] video: pxafb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/pxafb.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index eca2de45f7a6..1ecd9cec2921 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c @@ -457,7 +457,7 @@ static int pxafb_adjust_timing(struct pxafb_info *fbi, static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { struct pxafb_info *fbi = (struct pxafb_info *)info; - struct pxafb_mach_info *inf = fbi->dev->platform_data; + struct pxafb_mach_info *inf = dev_get_platdata(fbi->dev); int err; if (inf->fixed_modes) { @@ -1230,7 +1230,7 @@ static unsigned int __smart_timing(unsigned time_ns, unsigned long lcd_clk) static void setup_smart_timing(struct pxafb_info *fbi, struct fb_var_screeninfo *var) { - struct pxafb_mach_info *inf = fbi->dev->platform_data; + struct pxafb_mach_info *inf = dev_get_platdata(fbi->dev); struct pxafb_mode_info *mode = &inf->modes[0]; unsigned long lclk = clk_get_rate(fbi->clk); unsigned t1, t2, t3, t4; @@ -1258,14 +1258,14 @@ static void setup_smart_timing(struct pxafb_info *fbi, static int pxafb_smart_thread(void *arg) { struct pxafb_info *fbi = arg; - struct pxafb_mach_info *inf = fbi->dev->platform_data; + struct pxafb_mach_info *inf = dev_get_platdata(fbi->dev); if (!inf->smart_update) { pr_err("%s: not properly initialized, thread terminated\n", __func__); return -EINVAL; } - inf = fbi->dev->platform_data; + inf = dev_get_platdata(fbi->dev); pr_debug("%s(): task starting\n", __func__); @@ -1793,7 +1793,7 @@ static struct pxafb_info *pxafb_init_fbinfo(struct device *dev) { struct pxafb_info *fbi; void *addr; - struct pxafb_mach_info *inf = dev->platform_data; + struct pxafb_mach_info *inf = dev_get_platdata(dev); /* Alloc the pxafb_info and pseudo_palette in one step */ fbi = kmalloc(sizeof(struct pxafb_info) + sizeof(u32) * 16, GFP_KERNEL); @@ -1855,7 +1855,7 @@ static struct pxafb_info *pxafb_init_fbinfo(struct device *dev) #ifdef CONFIG_FB_PXA_PARAMETERS static int parse_opt_mode(struct device *dev, const char *this_opt) { - struct pxafb_mach_info *inf = dev->platform_data; + struct pxafb_mach_info *inf = dev_get_platdata(dev); const char *name = this_opt+5; unsigned int namelen = strlen(name); @@ -1914,7 +1914,7 @@ static int parse_opt_mode(struct device *dev, const char *this_opt) static int parse_opt(struct device *dev, char *this_opt) { - struct pxafb_mach_info *inf = dev->platform_data; + struct pxafb_mach_info *inf = dev_get_platdata(dev); struct pxafb_mode_info *mode = &inf->modes[0]; char s[64]; @@ -2102,7 +2102,7 @@ static int pxafb_probe(struct platform_device *dev) dev_dbg(&dev->dev, "pxafb_probe\n"); - inf = dev->dev.platform_data; + inf = dev_get_platdata(&dev->dev); ret = -ENOMEM; fbi = NULL; if (!inf) From 1df86cdaee3acc9b7e72855870eccaecbff336e6 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:01:38 +0900 Subject: [PATCH 034/143] video: s3c2410: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/s3c2410fb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c index 21a32adbb8ea..81af5a63e9e1 100644 --- a/drivers/video/s3c2410fb.c +++ b/drivers/video/s3c2410fb.c @@ -123,7 +123,7 @@ static int s3c2410fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { struct s3c2410fb_info *fbi = info->par; - struct s3c2410fb_mach_info *mach_info = fbi->dev->platform_data; + struct s3c2410fb_mach_info *mach_info = dev_get_platdata(fbi->dev); struct s3c2410fb_display *display = NULL; struct s3c2410fb_display *default_display = mach_info->displays + mach_info->default_display; @@ -686,7 +686,7 @@ static inline void modify_gpio(void __iomem *reg, static int s3c2410fb_init_registers(struct fb_info *info) { struct s3c2410fb_info *fbi = info->par; - struct s3c2410fb_mach_info *mach_info = fbi->dev->platform_data; + struct s3c2410fb_mach_info *mach_info = dev_get_platdata(fbi->dev); unsigned long flags; void __iomem *regs = fbi->io; void __iomem *tpal; @@ -833,7 +833,7 @@ static int s3c24xxfb_probe(struct platform_device *pdev, int size; u32 lcdcon1; - mach_info = pdev->dev.platform_data; + mach_info = dev_get_platdata(&pdev->dev); if (mach_info == NULL) { dev_err(&pdev->dev, "no platform data for lcd, cannot attach\n"); From 50144243c264cdb98f340856fa2e0bbd859ed320 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:02:24 +0900 Subject: [PATCH 035/143] video: sa1100fb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/sa1100fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index de76da0c6429..580c444ec301 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c @@ -1116,7 +1116,7 @@ static struct fb_monspecs monspecs = { static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev) { - struct sa1100fb_mach_info *inf = dev->platform_data; + struct sa1100fb_mach_info *inf = dev_get_platdata(dev); struct sa1100fb_info *fbi; unsigned i; @@ -1201,7 +1201,7 @@ static int sa1100fb_probe(struct platform_device *pdev) struct resource *res; int ret, irq; - if (!pdev->dev.platform_data) { + if (!dev_get_platdata(&pdev->dev)) { dev_err(&pdev->dev, "no platform LCD data\n"); return -EINVAL; } From ad86abd81eb92afb978e093940bf731b948d7836 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:03:19 +0900 Subject: [PATCH 036/143] video: sh_mobile_hdmi: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/sh_mobile_hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index bfe4728480fd..45417fa9749b 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c @@ -498,7 +498,7 @@ static void sh_hdmi_video_config(struct sh_hdmi *hdmi) static void sh_hdmi_audio_config(struct sh_hdmi *hdmi) { u8 data; - struct sh_mobile_hdmi_info *pdata = hdmi->dev->platform_data; + struct sh_mobile_hdmi_info *pdata = dev_get_platdata(hdmi->dev); /* * [7:4] L/R data swap control @@ -815,7 +815,7 @@ static unsigned long sh_hdmi_rate_error(struct sh_hdmi *hdmi, unsigned long *hdmi_rate, unsigned long *parent_rate) { unsigned long target = PICOS2KHZ(mode->pixclock) * 1000, rate_error; - struct sh_mobile_hdmi_info *pdata = hdmi->dev->platform_data; + struct sh_mobile_hdmi_info *pdata = dev_get_platdata(hdmi->dev); *hdmi_rate = clk_round_rate(hdmi->hdmi_clk, target); if ((long)*hdmi_rate < 0) @@ -1271,7 +1271,7 @@ static void sh_hdmi_htop1_init(struct sh_hdmi *hdmi) static int __init sh_hdmi_probe(struct platform_device *pdev) { - struct sh_mobile_hdmi_info *pdata = pdev->dev.platform_data; + struct sh_mobile_hdmi_info *pdata = dev_get_platdata(&pdev->dev); struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct resource *htop1_res; int irq = platform_get_irq(pdev, 0), ret; From 46d2db824575add49edf53b835674a8d905b2390 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:03:53 +0900 Subject: [PATCH 037/143] video: amba-clcd: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/amba-clcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index 0a2cce7285be..b7aa68b3eeff 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -544,7 +544,7 @@ static int clcdfb_register(struct clcd_fb *fb) static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id) { - struct clcd_board *board = dev->dev.platform_data; + struct clcd_board *board = dev_get_platdata(&dev->dev); struct clcd_fb *fb; int ret; From 700601d28039bd01d26cb2328d11140ae8c53fd2 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:04:50 +0900 Subject: [PATCH 038/143] video: da8xx-fb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/da8xx-fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index e030e17a83f2..70fc8e89cf19 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -1314,7 +1314,7 @@ static struct fb_ops da8xx_fb_ops = { static struct fb_videomode *da8xx_fb_get_videomode(struct platform_device *dev) { - struct da8xx_lcdc_platform_data *fb_pdata = dev->dev.platform_data; + struct da8xx_lcdc_platform_data *fb_pdata = dev_get_platdata(&dev->dev); struct fb_videomode *lcdc_info; int i; @@ -1336,7 +1336,7 @@ static struct fb_videomode *da8xx_fb_get_videomode(struct platform_device *dev) static int fb_probe(struct platform_device *device) { struct da8xx_lcdc_platform_data *fb_pdata = - device->dev.platform_data; + dev_get_platdata(&device->dev); static struct resource *lcdc_regs; struct lcd_ctrl_config *lcd_cfg; struct fb_videomode *lcdc_info; From e09f398e534944146245a7fab7f642e9247b104a Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:08:14 +0900 Subject: [PATCH 039/143] video: ep93xx-fb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/ep93xx-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/ep93xx-fb.c b/drivers/video/ep93xx-fb.c index 28a837dfddd1..35a0f533f1a2 100644 --- a/drivers/video/ep93xx-fb.c +++ b/drivers/video/ep93xx-fb.c @@ -487,7 +487,7 @@ static void ep93xxfb_dealloc_videomem(struct fb_info *info) static int ep93xxfb_probe(struct platform_device *pdev) { - struct ep93xxfb_mach_info *mach_info = pdev->dev.platform_data; + struct ep93xxfb_mach_info *mach_info = dev_get_platdata(&pdev->dev); struct fb_info *info; struct ep93xx_fbi *fbi; struct resource *res; From 1c8034c7f0a3b53bb27b0faa9a6e3f88da0322ea Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:08:58 +0900 Subject: [PATCH 040/143] video: imxfb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/imxfb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index 38733ac2b698..44ee678481d5 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c @@ -755,7 +755,7 @@ static int imxfb_resume(struct platform_device *dev) static int imxfb_init_fbinfo(struct platform_device *pdev) { - struct imx_fb_platform_data *pdata = pdev->dev.platform_data; + struct imx_fb_platform_data *pdata = dev_get_platdata(&pdev->dev); struct fb_info *info = dev_get_drvdata(&pdev->dev); struct imxfb_info *fbi = info->par; struct device_node *np; @@ -877,7 +877,7 @@ static int imxfb_probe(struct platform_device *pdev) if (!res) return -ENODEV; - pdata = pdev->dev.platform_data; + pdata = dev_get_platdata(&pdev->dev); info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev); if (!info) @@ -1066,7 +1066,7 @@ static int imxfb_remove(struct platform_device *pdev) #endif unregister_framebuffer(info); - pdata = pdev->dev.platform_data; + pdata = dev_get_platdata(&pdev->dev); if (pdata && pdata->exit) pdata->exit(fbi->pdev); From 3b2633fb1b8da59f0a160da7110a666b3e44b500 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:09:37 +0900 Subject: [PATCH 041/143] video: mbxfb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/mbx/mbxfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c index 0c1a874ffd2b..f87c4ef10b78 100644 --- a/drivers/video/mbx/mbxfb.c +++ b/drivers/video/mbx/mbxfb.c @@ -890,7 +890,7 @@ static int mbxfb_probe(struct platform_device *dev) dev_dbg(&dev->dev, "mbxfb_probe\n"); - pdata = dev->dev.platform_data; + pdata = dev_get_platdata(&dev->dev); if (!pdata) { dev_err(&dev->dev, "platform data is required\n"); return -EINVAL; From 772ee6daf19554e72a2ac268b36a9abc9e3bff0f Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:10:19 +0900 Subject: [PATCH 042/143] video: s1d13xxxfb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Acked-by: Kristoffer Ericson Signed-off-by: Tomi Valkeinen --- drivers/video/s1d13xxxfb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c index 05c2dc3d4bc0..1399a469f8b0 100644 --- a/drivers/video/s1d13xxxfb.c +++ b/drivers/video/s1d13xxxfb.c @@ -777,8 +777,8 @@ static int s1d13xxxfb_probe(struct platform_device *pdev) printk(KERN_INFO "Epson S1D13XXX FB Driver\n"); /* enable platform-dependent hardware glue, if any */ - if (pdev->dev.platform_data) - pdata = pdev->dev.platform_data; + if (dev_get_platdata(&pdev->dev)) + pdata = dev_get_platdata(&pdev->dev); if (pdata && pdata->platform_init_video) pdata->platform_init_video(); @@ -923,8 +923,8 @@ static int s1d13xxxfb_suspend(struct platform_device *dev, pm_message_t state) lcd_enable(s1dfb, 0); crt_enable(s1dfb, 0); - if (dev->dev.platform_data) - pdata = dev->dev.platform_data; + if (dev_get_platdata(&dev->dev)) + pdata = dev_get_platdata(&dev->dev); #if 0 if (!s1dfb->disp_save) @@ -973,8 +973,8 @@ static int s1d13xxxfb_resume(struct platform_device *dev) while ((s1d13xxxfb_readreg(s1dfb, S1DREG_PS_STATUS) & 0x01)) udelay(10); - if (dev->dev.platform_data) - pdata = dev->dev.platform_data; + if (dev_get_platdata(&dev->dev)) + pdata = dev_get_platdata(&dev->dev); if (s1dfb->regs_save) { /* will write RO regs, *should* get away with it :) */ From 8b4c7e5da29b48381d3855a7b5cd656a58c6154c Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:10:37 +0900 Subject: [PATCH 043/143] video: s3c-fb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/s3c-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 2e7991c7ca08..62acae2694a9 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -1378,7 +1378,7 @@ static int s3c_fb_probe(struct platform_device *pdev) return -EINVAL; } - pd = pdev->dev.platform_data; + pd = dev_get_platdata(&pdev->dev); if (!pd) { dev_err(dev, "no platform data specified\n"); return -EINVAL; From 129f1be4b9357aec87cbc6d25a75a04b1d8c3a72 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:11:04 +0900 Subject: [PATCH 044/143] video: simplefb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/simplefb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/simplefb.c b/drivers/video/simplefb.c index 8d7810613058..ad46d2dd55a2 100644 --- a/drivers/video/simplefb.c +++ b/drivers/video/simplefb.c @@ -132,7 +132,7 @@ static int simplefb_parse_dt(struct platform_device *pdev, static int simplefb_parse_pd(struct platform_device *pdev, struct simplefb_params *params) { - struct simplefb_platform_data *pd = pdev->dev.platform_data; + struct simplefb_platform_data *pd = dev_get_platdata(&pdev->dev); int i; params->width = pd->width; @@ -167,7 +167,7 @@ static int simplefb_probe(struct platform_device *pdev) return -ENODEV; ret = -ENODEV; - if (pdev->dev.platform_data) + if (dev_get_platdata(&pdev->dev)) ret = simplefb_parse_pd(pdev, ¶ms); else if (pdev->dev.of_node) ret = simplefb_parse_dt(pdev, ¶ms); From 0442f762b08bfd1ec929ec8768c8046db4a0e8d7 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:11:34 +0900 Subject: [PATCH 045/143] video: tmiofb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/tmiofb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c index deb8733f3c70..b5b69a6b9dd8 100644 --- a/drivers/video/tmiofb.c +++ b/drivers/video/tmiofb.c @@ -250,7 +250,7 @@ static irqreturn_t tmiofb_irq(int irq, void *__info) */ static int tmiofb_hw_stop(struct platform_device *dev) { - struct tmio_fb_data *data = dev->dev.platform_data; + struct tmio_fb_data *data = dev_get_platdata(&dev->dev); struct fb_info *info = platform_get_drvdata(dev); struct tmiofb_par *par = info->par; @@ -311,7 +311,7 @@ static int tmiofb_hw_init(struct platform_device *dev) */ static void tmiofb_hw_mode(struct platform_device *dev) { - struct tmio_fb_data *data = dev->dev.platform_data; + struct tmio_fb_data *data = dev_get_platdata(&dev->dev); struct fb_info *info = platform_get_drvdata(dev); struct fb_videomode *mode = info->mode; struct tmiofb_par *par = info->par; @@ -557,7 +557,7 @@ static int tmiofb_ioctl(struct fb_info *fbi, static struct fb_videomode * tmiofb_find_mode(struct fb_info *info, struct fb_var_screeninfo *var) { - struct tmio_fb_data *data = info->device->platform_data; + struct tmio_fb_data *data = dev_get_platdata(info->device); struct fb_videomode *best = NULL; int i; @@ -577,7 +577,7 @@ static int tmiofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { struct fb_videomode *mode; - struct tmio_fb_data *data = info->device->platform_data; + struct tmio_fb_data *data = dev_get_platdata(info->device); mode = tmiofb_find_mode(info, var); if (!mode || var->bits_per_pixel > 16) @@ -678,7 +678,7 @@ static struct fb_ops tmiofb_ops = { static int tmiofb_probe(struct platform_device *dev) { const struct mfd_cell *cell = mfd_get_cell(dev); - struct tmio_fb_data *data = dev->dev.platform_data; + struct tmio_fb_data *data = dev_get_platdata(&dev->dev); struct resource *ccr = platform_get_resource(dev, IORESOURCE_MEM, 1); struct resource *lcr = platform_get_resource(dev, IORESOURCE_MEM, 0); struct resource *vram = platform_get_resource(dev, IORESOURCE_MEM, 2); From 91f8628b7f7fe82af389ca99fffa1f132cb6afbf Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 17 Sep 2013 14:11:55 +0900 Subject: [PATCH 046/143] video: w100fb: use dev_get_platdata() Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/w100fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c index 7a299e951f75..2a0437a6d838 100644 --- a/drivers/video/w100fb.c +++ b/drivers/video/w100fb.c @@ -680,7 +680,7 @@ int w100fb_probe(struct platform_device *pdev) par = info->par; platform_set_drvdata(pdev, info); - inf = pdev->dev.platform_data; + inf = dev_get_platdata(&pdev->dev); par->chip_id = chip_id; par->mach = inf; par->fastpll_mode = 0; From 9a27d5916b1d0338f76a4a8cb6fabc5320664453 Mon Sep 17 00:00:00 2001 From: Guoqing Li Date: Fri, 13 Sep 2013 14:59:45 +0800 Subject: [PATCH 047/143] video: mmp: rb swap setting update for mmp display We could set rb swap in two modules: DMA controler input part and dsi interface output part. DMA input part is based on pix_fmt to set rbswap, dsi output interface part will set rbswap based on platform dsi_rbswap configuration. This patch include below change and enhancement: 1) The input format which support rbswap is based on RGB format, eg. RGB565 indicates the source data in memory is that Red is [15~11], Green is [10~5], Blue is [4:0], Red is MSB, Blue is LSB, but for the display dma input default setting(rbswap = 0), it only support Blue is [15~11], Green is [10~5], Red is [4:0], Red is LSB, Blue is MSB, so for this format(RGB565), display controller need to set rbswap = 1 and it can support the MSB/LSB correctly. BGR/YUV format will not set it in mmp display driver. 2) The dsi output part of rbswap is depend on dsi_rbswap which is defined in specific platfrom. For output dsi interface, it has this feature to do rbswap again if it needs specifc byte sequence of RGB byte for DSI panel. eg. If display content is set RGB565 in memory and DMA input part set rbswap in driver to support Red as MSB , Blue LSB, but dsi panel only support Red as LSB, Blue as MSB, then it can use this feature. If there is no this requirement of panel, this dsi output part is not needed. Signed-off-by: Guoqing Li Signed-off-by: Jett.Zhou Signed-off-by: Zhou Zhu Reviewed-by: Daniel Drake Signed-off-by: Tomi Valkeinen --- drivers/video/mmp/hw/mmp_ctrl.c | 19 +++++++++++-------- drivers/video/mmp/hw/mmp_ctrl.h | 5 +++++ include/video/mmp_disp.h | 1 + 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/video/mmp/hw/mmp_ctrl.c b/drivers/video/mmp/hw/mmp_ctrl.c index 75dca19bf214..a40d95a54eec 100644 --- a/drivers/video/mmp/hw/mmp_ctrl.c +++ b/drivers/video/mmp/hw/mmp_ctrl.c @@ -60,8 +60,7 @@ static irqreturn_t ctrl_handle_irq(int irq, void *dev_id) static u32 fmt_to_reg(struct mmp_overlay *overlay, int pix_fmt) { - u32 link_config = path_to_path_plat(overlay->path)->link_config; - u32 rbswap, uvswap = 0, yuvswap = 0, + u32 rbswap = 0, uvswap = 0, yuvswap = 0, csc_en = 0, val = 0, vid = overlay_is_vid(overlay); @@ -71,27 +70,23 @@ static u32 fmt_to_reg(struct mmp_overlay *overlay, int pix_fmt) case PIXFMT_RGB888PACK: case PIXFMT_RGB888UNPACK: case PIXFMT_RGBA888: - rbswap = !(link_config & 0x1); + rbswap = 1; break; case PIXFMT_VYUY: case PIXFMT_YVU422P: case PIXFMT_YVU420P: - rbswap = link_config & 0x1; uvswap = 1; break; case PIXFMT_YUYV: - rbswap = link_config & 0x1; yuvswap = 1; break; default: - rbswap = link_config & 0x1; break; } switch (pix_fmt) { case PIXFMT_RGB565: case PIXFMT_BGR565: - val = 0; break; case PIXFMT_RGB1555: case PIXFMT_BGR1555: @@ -248,7 +243,8 @@ static void path_set_mode(struct mmp_path *path, struct mmp_mode *mode) { struct lcd_regs *regs = path_regs(path); u32 total_x, total_y, vsync_ctrl, tmp, sclk_src, sclk_div, - link_config = path_to_path_plat(path)->link_config; + link_config = path_to_path_plat(path)->link_config, + dsi_rbswap = path_to_path_plat(path)->link_config; /* FIXME: assert videomode supported */ memcpy(&path->mode, mode, sizeof(struct mmp_mode)); @@ -263,6 +259,12 @@ static void path_set_mode(struct mmp_path *path, struct mmp_mode *mode) tmp |= CFG_DUMB_ENA(1); writel_relaxed(tmp, ctrl_regs(path) + intf_ctrl(path->id)); + /* interface rb_swap setting */ + tmp = readl_relaxed(ctrl_regs(path) + intf_rbswap_ctrl(path->id)) & + (~(CFG_INTFRBSWAP_MASK)); + tmp |= dsi_rbswap & CFG_INTFRBSWAP_MASK; + writel_relaxed(tmp, ctrl_regs(path) + intf_rbswap_ctrl(path->id)); + writel_relaxed((mode->yres << 16) | mode->xres, ®s->screen_active); writel_relaxed((mode->left_margin << 16) | mode->right_margin, ®s->screen_h_porch); @@ -419,6 +421,7 @@ static int path_init(struct mmphw_path_plat *path_plat, path_plat->path = path; path_plat->path_config = config->path_config; path_plat->link_config = config->link_config; + path_plat->dsi_rbswap = config->dsi_rbswap; path_set_default(path); kfree(path_info); diff --git a/drivers/video/mmp/hw/mmp_ctrl.h b/drivers/video/mmp/hw/mmp_ctrl.h index edd2002b0e99..53301cfdb1ae 100644 --- a/drivers/video/mmp/hw/mmp_ctrl.h +++ b/drivers/video/mmp/hw/mmp_ctrl.h @@ -163,6 +163,8 @@ struct lcd_regs { #define LCD_SCLK(path) ((PATH_PN == path->id) ? LCD_CFG_SCLK_DIV :\ ((PATH_TV == path->id) ? LCD_TCLK_DIV : LCD_PN2_SCLK_DIV)) +#define intf_rbswap_ctrl(id) ((id) ? (((id) & 1) ? LCD_TVIF_CTRL : \ + PN2_IOPAD_CONTROL) : LCD_TOP_CTRL) /* dither configure */ #ifdef CONFIG_CPU_PXA988 @@ -615,6 +617,8 @@ struct lcd_regs { #define LCD_SPU_DUMB_CTRL 0x01B8 #define CFG_DUMBMODE(mode) ((mode)<<28) #define CFG_DUMBMODE_MASK 0xF0000000 +#define CFG_INTFRBSWAP(mode) ((mode)<<24) +#define CFG_INTFRBSWAP_MASK 0x0F000000 #define CFG_LCDGPIO_O(data) ((data)<<20) #define CFG_LCDGPIO_O_MASK 0x0FF00000 #define CFG_LCDGPIO_ENA(gpio) ((gpio)<<12) @@ -1427,6 +1431,7 @@ struct mmphw_path_plat { struct mmp_path *path; u32 path_config; u32 link_config; + u32 dsi_rbswap; }; /* mmp ctrl describes mmp controller related info */ diff --git a/include/video/mmp_disp.h b/include/video/mmp_disp.h index b9dd1fbb0082..32094c052deb 100644 --- a/include/video/mmp_disp.h +++ b/include/video/mmp_disp.h @@ -334,6 +334,7 @@ struct mmp_mach_path_config { int output_type; u32 path_config; u32 link_config; + u32 dsi_rbswap; }; struct mmp_mach_plat_info { From 7ebdc78af2e310129a8b6eaffd8fbe637e18bd50 Mon Sep 17 00:00:00 2001 From: "Jett.Zhou" Date: Fri, 13 Sep 2013 14:59:46 +0800 Subject: [PATCH 048/143] ARM: mmp: remove the legacy rbswap setting for ttc_dkb platform According to new rbswap scheme of mmp_display, it support appropriate rbswap setting based on specific pix_fmt, then we can remove the legacy rbswap setting for ttc_dkb platform. Signed-off-by: Jett.Zhou Signed-off-by: Zhou Zhu Reviewed-by: Daniel Drake Acked-by: Haojian Zhuang Signed-off-by: Tomi Valkeinen --- arch/arm/mach-mmp/ttc_dkb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c index 702232996c8c..cfadd974f5ce 100644 --- a/arch/arm/mach-mmp/ttc_dkb.c +++ b/arch/arm/mach-mmp/ttc_dkb.c @@ -191,7 +191,6 @@ static struct pxa3xx_nand_platform_data dkb_nand_info = { #define SCLK_SOURCE_SELECT(x) (x << 30) /* 0x0 ~ 0x3 */ /* link config */ #define CFG_DUMBMODE(mode) (mode << 28) /* 0x0 ~ 0x6*/ -#define CFG_GRA_SWAPRB(x) (x << 0) /* 1: rbswap enabled */ static struct mmp_mach_path_config dkb_disp_config[] = { [0] = { .name = "mmp-parallel", @@ -199,8 +198,7 @@ static struct mmp_mach_path_config dkb_disp_config[] = { .output_type = PATH_OUT_PARALLEL, .path_config = CFG_IOPADMODE(0x1) | SCLK_SOURCE_SELECT(0x1), - .link_config = CFG_DUMBMODE(0x2) - | CFG_GRA_SWAPRB(0x1), + .link_config = CFG_DUMBMODE(0x2), }, }; From 1f2e42c6c3cdf1b62772f27e1de6033691839cfb Mon Sep 17 00:00:00 2001 From: Guoqing Li Date: Fri, 13 Sep 2013 14:59:47 +0800 Subject: [PATCH 049/143] video: mmp: optimize some register setting code There are dumplicate code of the smooth setting based on different path, optimized the routine and use readl_relaxed instead. Signed-off-by: Jett.Zhou Signed-off-by: Jing Xiang Signed-off-by: Guoqing Li Signed-off-by: Zhou Zhu Reviewed-by: Daniel Drake Signed-off-by: Tomi Valkeinen --- drivers/video/mmp/hw/mmp_ctrl.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/video/mmp/hw/mmp_ctrl.c b/drivers/video/mmp/hw/mmp_ctrl.c index a40d95a54eec..c0eb8bccfb87 100644 --- a/drivers/video/mmp/hw/mmp_ctrl.c +++ b/drivers/video/mmp/hw/mmp_ctrl.c @@ -53,7 +53,7 @@ static irqreturn_t ctrl_handle_irq(int irq, void *dev_id) tmp = readl_relaxed(ctrl->reg_base + SPU_IRQ_ISR); if (tmp & isr) writel_relaxed(~isr, ctrl->reg_base + SPU_IRQ_ISR); - } while ((isr = readl(ctrl->reg_base + SPU_IRQ_ISR)) & imask); + } while ((isr = readl_relaxed(ctrl->reg_base + SPU_IRQ_ISR)) & imask); return IRQ_HANDLED; } @@ -372,20 +372,12 @@ static void path_set_default(struct mmp_path *path) * bus arbiter for faster read if not tv path; * 2.enable horizontal smooth filter; */ - if (PATH_PN == path->id) { - mask = CFG_GRA_HSMOOTH_MASK | CFG_DMA_HSMOOTH_MASK - | CFG_ARBFAST_ENA(1); - tmp = readl_relaxed(ctrl_regs(path) + dma_ctrl(0, path->id)); - tmp |= mask; - writel_relaxed(tmp, ctrl_regs(path) + dma_ctrl(0, path->id)); - } else if (PATH_TV == path->id) { - mask = CFG_GRA_HSMOOTH_MASK | CFG_DMA_HSMOOTH_MASK - | CFG_ARBFAST_ENA(1); - tmp = readl_relaxed(ctrl_regs(path) + dma_ctrl(0, path->id)); - tmp &= ~mask; - tmp |= CFG_GRA_HSMOOTH_MASK | CFG_DMA_HSMOOTH_MASK; - writel_relaxed(tmp, ctrl_regs(path) + dma_ctrl(0, path->id)); - } + mask = CFG_GRA_HSMOOTH_MASK | CFG_DMA_HSMOOTH_MASK | CFG_ARBFAST_ENA(1); + tmp = readl_relaxed(ctrl_regs(path) + dma_ctrl(0, path->id)); + tmp |= mask; + if (PATH_TV == path->id) + tmp &= ~CFG_ARBFAST_ENA(1); + writel_relaxed(tmp, ctrl_regs(path) + dma_ctrl(0, path->id)); } static int path_init(struct mmphw_path_plat *path_plat, From cc50bc5bb29a9b4f71913d0b36ab45c6055eafc0 Mon Sep 17 00:00:00 2001 From: Jing Xiang Date: Fri, 13 Sep 2013 14:59:48 +0800 Subject: [PATCH 050/143] video: mmp: calculate pitch value when fb set win Add new func mmpfb_set_win to make code clean, it will do resolution and fmt setting of win in mmpfb_set_win. Signed-off-by: Jing Xiang Signed-off-by: Jett.Zhou Signed-off-by: Zhou Zhu Reviewed-by: Daniel Drake Signed-off-by: Tomi Valkeinen --- drivers/video/mmp/fb/mmpfb.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/video/mmp/fb/mmpfb.c b/drivers/video/mmp/fb/mmpfb.c index 4ab95b8daed3..19fd913f462d 100644 --- a/drivers/video/mmp/fb/mmpfb.c +++ b/drivers/video/mmp/fb/mmpfb.c @@ -392,12 +392,23 @@ static int var_update(struct fb_info *info) return 0; } +static void mmpfb_set_win(struct fb_info *info) +{ + struct mmpfb_info *fbi = info->par; + struct mmp_win win; + + memset(&win, 0, sizeof(win)); + win.xsrc = win.xdst = fbi->mode.xres; + win.ysrc = win.ydst = fbi->mode.yres; + win.pix_fmt = fbi->pix_fmt; + mmp_overlay_set_win(fbi->overlay, &win); +} + static int mmpfb_set_par(struct fb_info *info) { struct mmpfb_info *fbi = info->par; struct fb_var_screeninfo *var = &info->var; struct mmp_addr addr; - struct mmp_win win; struct mmp_mode mode; int ret; @@ -409,11 +420,8 @@ static int mmpfb_set_par(struct fb_info *info) fbmode_to_mmpmode(&mode, &fbi->mode, fbi->output_fmt); mmp_path_set_mode(fbi->path, &mode); - memset(&win, 0, sizeof(win)); - win.xsrc = win.xdst = fbi->mode.xres; - win.ysrc = win.ydst = fbi->mode.yres; - win.pix_fmt = fbi->pix_fmt; - mmp_overlay_set_win(fbi->overlay, &win); + /* set window related info */ + mmpfb_set_win(info); /* set address always */ memset(&addr, 0, sizeof(addr)); @@ -427,16 +435,12 @@ static int mmpfb_set_par(struct fb_info *info) static void mmpfb_power(struct mmpfb_info *fbi, int power) { struct mmp_addr addr; - struct mmp_win win; struct fb_var_screeninfo *var = &fbi->fb_info->var; /* for power on, always set address/window again */ if (power) { - memset(&win, 0, sizeof(win)); - win.xsrc = win.xdst = fbi->mode.xres; - win.ysrc = win.ydst = fbi->mode.yres; - win.pix_fmt = fbi->pix_fmt; - mmp_overlay_set_win(fbi->overlay, &win); + /* set window related info */ + mmpfb_set_win(fbi->fb_info); /* set address always */ memset(&addr, 0, sizeof(addr)); From 24586d8342ab27bc75e4560d71e98f3e5dc67d8e Mon Sep 17 00:00:00 2001 From: Jing Xiang Date: Fri, 13 Sep 2013 14:59:49 +0800 Subject: [PATCH 051/143] video: mmp: add pitch info in mmp_win structure Add pitch length info of graphics/video layer, pitch is used to represent line length in byte, the usage depends on pix_fmt. If the fmt is YUV, the pitch[0] will be Y length,pitch[1] will be U length, pitch[2] will be V lenth. If the fmt is RGB, the picth[0] will be line lenth, and pitch[1]/pitch[2] will be 0 and not be used. Signed-off-by: Jing Xiang Signed-off-by: Jett.Zhou Signed-off-by: Zhou Zhu Reviewed-by: Daniel Drake Signed-off-by: Tomi Valkeinen --- drivers/video/mmp/fb/mmpfb.c | 6 ++++++ drivers/video/mmp/hw/mmp_ctrl.c | 30 +++++++++++++++++++++++------- include/video/mmp_disp.h | 5 +++++ 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/drivers/video/mmp/fb/mmpfb.c b/drivers/video/mmp/fb/mmpfb.c index 19fd913f462d..7ab31eb76a8c 100644 --- a/drivers/video/mmp/fb/mmpfb.c +++ b/drivers/video/mmp/fb/mmpfb.c @@ -395,12 +395,18 @@ static int var_update(struct fb_info *info) static void mmpfb_set_win(struct fb_info *info) { struct mmpfb_info *fbi = info->par; + struct fb_var_screeninfo *var = &info->var; struct mmp_win win; + u32 stride; memset(&win, 0, sizeof(win)); win.xsrc = win.xdst = fbi->mode.xres; win.ysrc = win.ydst = fbi->mode.yres; win.pix_fmt = fbi->pix_fmt; + stride = pixfmt_to_stride(win.pix_fmt); + win.pitch[0] = var->xres_virtual * stride; + win.pitch[1] = win.pitch[2] = + (stride == 1) ? (var->xres_virtual >> 1) : 0; mmp_overlay_set_win(fbi->overlay, &win); } diff --git a/drivers/video/mmp/hw/mmp_ctrl.c b/drivers/video/mmp/hw/mmp_ctrl.c index c0eb8bccfb87..ae724aaaad47 100644 --- a/drivers/video/mmp/hw/mmp_ctrl.c +++ b/drivers/video/mmp/hw/mmp_ctrl.c @@ -142,17 +142,27 @@ static void dmafetch_set_fmt(struct mmp_overlay *overlay) static void overlay_set_win(struct mmp_overlay *overlay, struct mmp_win *win) { struct lcd_regs *regs = path_regs(overlay->path); - u32 pitch; /* assert win supported */ memcpy(&overlay->win, win, sizeof(struct mmp_win)); mutex_lock(&overlay->access_ok); - pitch = win->xsrc * pixfmt_to_stride(win->pix_fmt); - writel_relaxed(pitch, ®s->g_pitch); - writel_relaxed((win->ysrc << 16) | win->xsrc, ®s->g_size); - writel_relaxed((win->ydst << 16) | win->xdst, ®s->g_size_z); - writel_relaxed(0, ®s->g_start); + + if (overlay_is_vid(overlay)) { + writel_relaxed(win->pitch[0], ®s->v_pitch_yc); + writel_relaxed(win->pitch[2] << 16 | + win->pitch[1], ®s->v_pitch_uv); + + writel_relaxed((win->ysrc << 16) | win->xsrc, ®s->v_size); + writel_relaxed((win->ydst << 16) | win->xdst, ®s->v_size_z); + writel_relaxed(win->ypos << 16 | win->xpos, ®s->v_start); + } else { + writel_relaxed(win->pitch[0], ®s->g_pitch); + + writel_relaxed((win->ysrc << 16) | win->xsrc, ®s->g_size); + writel_relaxed((win->ydst << 16) | win->xdst, ®s->g_size_z); + writel_relaxed(win->ypos << 16 | win->xpos, ®s->g_start); + } dmafetch_set_fmt(overlay); mutex_unlock(&overlay->access_ok); @@ -234,7 +244,13 @@ static int overlay_set_addr(struct mmp_overlay *overlay, struct mmp_addr *addr) /* FIXME: assert addr supported */ memcpy(&overlay->addr, addr, sizeof(struct mmp_addr)); - writel(addr->phys[0], ®s->g_0); + + if (overlay_is_vid(overlay)) { + writel_relaxed(addr->phys[0], ®s->v_y0); + writel_relaxed(addr->phys[1], ®s->v_u0); + writel_relaxed(addr->phys[2], ®s->v_v0); + } else + writel_relaxed(addr->phys[0], ®s->g_0); return overlay->addr.phys[0]; } diff --git a/include/video/mmp_disp.h b/include/video/mmp_disp.h index 32094c052deb..9fd9398368d5 100644 --- a/include/video/mmp_disp.h +++ b/include/video/mmp_disp.h @@ -91,6 +91,11 @@ struct mmp_win { u16 up_crop; u16 bottom_crop; int pix_fmt; + /* + * pitch[0]: graphics/video layer line length or y pitch + * pitch[1]/pitch[2]: video u/v pitch if non-zero + */ + u32 pitch[3]; }; struct mmp_addr { From 62a83183c477759363b2228e6b64c17593d9e4be Mon Sep 17 00:00:00 2001 From: Peter Senna Tschudin Date: Sun, 22 Sep 2013 20:44:11 +0200 Subject: [PATCH 052/143] OMAPDSS: DISPC: Fix assignment of 0/1 to bool variables Convert 0 to false and 1 to true when assigning values to bool variables. Inspired by commit 3db1cd5c05f35fb43eb134df6f321de4e63141f2. The simplified semantic patch that find this problem is as follows (http://coccinelle.lip6.fr/): @@ bool b; @@ ( -b = 0 +b = false | -b = 1 +b = true ) Signed-off-by: Peter Senna Tschudin Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dispc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 02a7340111df..8fbeb299fac3 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -2352,7 +2352,7 @@ int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel, { enum omap_overlay_caps caps = dss_feat_get_overlay_caps(plane); bool five_taps = true; - bool fieldmode = 0; + bool fieldmode = false; u16 in_height = oi->height; u16 in_width = oi->width; bool ilace = timings->interlace; @@ -2365,7 +2365,7 @@ int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel, out_height = oi->out_height == 0 ? oi->height : oi->out_height; if (ilace && oi->height == out_height) - fieldmode = 1; + fieldmode = true; if (ilace) { if (fieldmode) @@ -2396,7 +2396,7 @@ static int dispc_ovl_setup_common(enum omap_plane plane, bool mem_to_mem) { bool five_taps = true; - bool fieldmode = 0; + bool fieldmode = false; int r, cconv = 0; unsigned offset0, offset1; s32 row_inc; @@ -2417,7 +2417,7 @@ static int dispc_ovl_setup_common(enum omap_plane plane, out_height = out_height == 0 ? height : out_height; if (ilace && height == out_height) - fieldmode = 1; + fieldmode = true; if (ilace) { if (fieldmode) From f767f7acee328933be4e7936a2115560f44846d5 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:08:52 +0530 Subject: [PATCH 053/143] backlight: l4f00242t03: Remove redundant spi_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Acked-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/backlight/l4f00242t03.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index a35a38c709cf..59eebe0b3846 100644 --- a/drivers/video/backlight/l4f00242t03.c +++ b/drivers/video/backlight/l4f00242t03.c @@ -244,7 +244,6 @@ static int l4f00242t03_remove(struct spi_device *spi) l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN); lcd_device_unregister(priv->ld); - spi_set_drvdata(spi, NULL); return 0; } From d24c815b74ec5cdb57f01068f5977f2aebe9f168 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:08:53 +0530 Subject: [PATCH 054/143] backlight: tosa: Remove redundant spi_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Acked-by: Jingoo Han Signed-off-by: Tomi Valkeinen --- drivers/video/backlight/tosa_lcd.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/video/backlight/tosa_lcd.c b/drivers/video/backlight/tosa_lcd.c index bf081573e5b5..be5d636764bf 100644 --- a/drivers/video/backlight/tosa_lcd.c +++ b/drivers/video/backlight/tosa_lcd.c @@ -198,7 +198,7 @@ static int tosa_lcd_probe(struct spi_device *spi) ret = devm_gpio_request_one(&spi->dev, TOSA_GPIO_TG_ON, GPIOF_OUT_INIT_LOW, "tg #pwr"); if (ret < 0) - goto err_gpio_tg; + return ret; mdelay(60); @@ -219,8 +219,6 @@ static int tosa_lcd_probe(struct spi_device *spi) err_register: tosa_lcd_tg_off(data); -err_gpio_tg: - spi_set_drvdata(spi, NULL); return ret; } @@ -235,8 +233,6 @@ static int tosa_lcd_remove(struct spi_device *spi) tosa_lcd_tg_off(data); - spi_set_drvdata(spi, NULL); - return 0; } From ceeddb4e69b2010b0f4f88c9e06dc83d80b49db6 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Wed, 25 Sep 2013 16:59:49 +0530 Subject: [PATCH 055/143] video: udlfb: Use NULL instead of 0 new_back is a pointer. Use NULL instead of 0. Signed-off-by: Sachin Kamat Cc: Bernie Thompson Signed-off-by: Tomi Valkeinen --- drivers/video/udlfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index d2e5bc3cf969..025f14e30eed 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -1166,7 +1166,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) int new_len; unsigned char *old_fb = info->screen_base; unsigned char *new_fb; - unsigned char *new_back = 0; + unsigned char *new_back = NULL; pr_warn("Reallocating framebuffer. Addresses will change!\n"); From 9aae307c6a484b373892d5bec153a7be7e050868 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Wed, 25 Sep 2013 16:59:50 +0530 Subject: [PATCH 056/143] video: smscufx: Use NULL instead of 0 'info' is a pointer. Use NULL instead of 0. Signed-off-by: Sachin Kamat Cc: Steve Glendinning Signed-off-by: Tomi Valkeinen --- drivers/video/smscufx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c index e188ada2ffd1..d513ed6a49f2 100644 --- a/drivers/video/smscufx.c +++ b/drivers/video/smscufx.c @@ -1147,7 +1147,7 @@ static void ufx_free_framebuffer_work(struct work_struct *work) fb_destroy_modelist(&info->modelist); - dev->info = 0; + dev->info = NULL; /* Assume info structure is freed after this point */ framebuffer_release(info); From 58f3853af969d54170a2935d159f3f788845ae79 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Wed, 25 Sep 2013 16:59:51 +0530 Subject: [PATCH 057/143] video: da8xx-fb: Staticize reg_context 'reg_context' is local to this file. Make it static. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/da8xx-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index 70fc8e89cf19..0670c85bef44 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -1548,7 +1548,7 @@ static int fb_probe(struct platform_device *device) } #ifdef CONFIG_PM -struct lcdc_context { +static struct lcdc_context { u32 clk_enable; u32 ctrl; u32 dma_ctrl; From e72d649cf8fcde95580045233c0ee0cb488d389a Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Wed, 25 Sep 2013 16:59:52 +0530 Subject: [PATCH 058/143] video: aty: Remove redundant break 'break' after return statement is redundant. Remove it. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/aty/atyfb_base.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 9b0f12c5c284..28fafbf864a5 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -1848,7 +1848,6 @@ static int atyfb_ioctl(struct fb_info *info, u_int cmd, u_long arg) return aty_waitforvblank(par, crtc); } - break; #if defined(DEBUG) && defined(CONFIG_FB_ATY_CT) case ATYIO_CLKR: From a13afa4923a02499ff6295dcf5ef700e4baa755a Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Wed, 25 Sep 2013 16:59:53 +0530 Subject: [PATCH 059/143] video: kyro: Remove redundant break 'break' after return statement is redundant. Remove it. Signed-off-by: Sachin Kamat Cc: Paul Mundt Signed-off-by: Tomi Valkeinen --- drivers/video/kyro/fbdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c index c82f0400d7d2..79bfb5c38409 100644 --- a/drivers/video/kyro/fbdev.c +++ b/drivers/video/kyro/fbdev.c @@ -623,7 +623,6 @@ static int kyrofb_ioctl(struct fb_info *info, "command instead.\n"); return -EINVAL; } - break; case KYRO_IOCTL_UVSTRIDE: if (copy_to_user(argp, &deviceInfo.ulOverlayUVStride, sizeof(unsigned long))) return -EFAULT; From b1dfee60c8eb35ba74f94d493864f3a55836b603 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Wed, 25 Sep 2013 16:59:54 +0530 Subject: [PATCH 060/143] video: uvesafb: Remove redundant NULL check kfree on a NULL pointer is a no-op. Signed-off-by: Sachin Kamat Cc: Michal Januszewski Signed-off-by: Tomi Valkeinen --- drivers/video/uvesafb.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index 7aec6f39fdd5..676a4b9379d9 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -233,8 +233,7 @@ static int uvesafb_exec(struct uvesafb_ktask *task) static void uvesafb_free(struct uvesafb_ktask *task) { if (task) { - if (task->done) - kfree(task->done); + kfree(task->done); kfree(task); } } @@ -1332,8 +1331,8 @@ static int uvesafb_set_par(struct fb_info *info) FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; info->fix.line_length = mode->bytes_per_scan_line; -out: if (crtc != NULL) - kfree(crtc); +out: + kfree(crtc); uvesafb_free(task); return err; @@ -1793,8 +1792,7 @@ static int uvesafb_probe(struct platform_device *dev) fb_destroy_modedb(info->monspecs.modedb); fb_dealloc_cmap(&info->cmap); out: - if (par->vbe_modes) - kfree(par->vbe_modes); + kfree(par->vbe_modes); framebuffer_release(info); return err; @@ -1817,12 +1815,9 @@ static int uvesafb_remove(struct platform_device *dev) fb_dealloc_cmap(&info->cmap); if (par) { - if (par->vbe_modes) - kfree(par->vbe_modes); - if (par->vbe_state_orig) - kfree(par->vbe_state_orig); - if (par->vbe_state_saved) - kfree(par->vbe_state_saved); + kfree(par->vbe_modes); + kfree(par->vbe_state_orig); + kfree(par->vbe_state_saved); } framebuffer_release(info); From 1ca3bc11aac3c53424e04f542ffc3bc87ebd339b Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Wed, 25 Sep 2013 17:32:56 +0530 Subject: [PATCH 061/143] video: vfb: Remove incorrect check 'yoffset' is unsigned and hence cannot be less than 0. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/vfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c index ee5985efa15c..ea2b523f804f 100644 --- a/drivers/video/vfb.c +++ b/drivers/video/vfb.c @@ -390,9 +390,8 @@ static int vfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { if (var->vmode & FB_VMODE_YWRAP) { - if (var->yoffset < 0 - || var->yoffset >= info->var.yres_virtual - || var->xoffset) + if (var->yoffset >= info->var.yres_virtual || + var->xoffset) return -EINVAL; } else { if (var->xoffset + info->var.xres > info->var.xres_virtual || From 8639fac5dae12c76e41456ceb5b72fc22f6888f6 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Wed, 25 Sep 2013 17:32:57 +0530 Subject: [PATCH 062/143] video: cirrusfb: Remove incorrect checks 'xoffset' and 'yoffset' are unsigned and hence cannot be less than 0. Signed-off-by: Sachin Kamat Cc: Jeff Garzik Signed-off-by: Tomi Valkeinen --- drivers/video/cirrusfb.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index b0167468f5c4..5aab9b9dc210 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c @@ -595,11 +595,6 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var, return -EINVAL; } - if (var->xoffset < 0) - var->xoffset = 0; - if (var->yoffset < 0) - var->yoffset = 0; - /* truncate xoffset and yoffset to maximum if too high */ if (var->xoffset > var->xres_virtual - var->xres) var->xoffset = var->xres_virtual - var->xres - 1; From cd1979b670fafed0130e0a3d0eddd7bc6a143f79 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Wed, 25 Sep 2013 17:32:58 +0530 Subject: [PATCH 063/143] video: aty: Remove incorrect checks 'xoffset' and 'yoffset' are unsigned and hence cannot be less than 0. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/aty/radeon_base.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index 1e30b2b3e79f..26d80a4486fb 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c @@ -819,11 +819,6 @@ static int radeonfb_check_var (struct fb_var_screeninfo *var, struct fb_info *in if (v.xres_virtual < v.xres) v.xres = v.xres_virtual; - if (v.xoffset < 0) - v.xoffset = 0; - if (v.yoffset < 0) - v.yoffset = 0; - if (v.xoffset > v.xres_virtual - v.xres) v.xoffset = v.xres_virtual - v.xres - 1; From bb1d2da7db7fcb25407618d9078091b575490d89 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Wed, 25 Sep 2013 17:32:59 +0530 Subject: [PATCH 064/143] video: riva: Remove incorrect checks 'xoffset' and 'yoffset' are unsigned and hence cannot be less than 0. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/riva/fbdev.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c index 9536715b5a1b..a5514acd2ac6 100644 --- a/drivers/video/riva/fbdev.c +++ b/drivers/video/riva/fbdev.c @@ -1185,11 +1185,6 @@ static int rivafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) if (rivafb_do_maximize(info, var, nom, den) < 0) return -EINVAL; - if (var->xoffset < 0) - var->xoffset = 0; - if (var->yoffset < 0) - var->yoffset = 0; - /* truncate xoffset and yoffset to maximum if too high */ if (var->xoffset > var->xres_virtual - var->xres) var->xoffset = var->xres_virtual - var->xres - 1; From 224b93c5b12a8221e3718101ca730f3d4da6286f Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Thu, 19 Sep 2013 18:53:13 -0700 Subject: [PATCH 065/143] framebuffer: arkfb: Fix framebugger typo s/framebugger/framebuffer/ Signed-off-by: Joe Perches Signed-off-by: Tomi Valkeinen --- drivers/video/arkfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c index ff6e304b225f..15dd5423d64a 100644 --- a/drivers/video/arkfb.c +++ b/drivers/video/arkfb.c @@ -1048,7 +1048,7 @@ static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) rc = register_framebuffer(info); if (rc < 0) { - dev_err(info->device, "cannot register framebugger\n"); + dev_err(info->device, "cannot register framebuffer\n"); goto err_reg_fb; } From 8a519c437a1cfd06a5302d4c5b5c9d2df9447609 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 22 Sep 2013 12:01:48 +0200 Subject: [PATCH 066/143] video: jz4740-fb: Fix LCD_CMD bit definitions Fix the bit offsets for the LCD_CMD definitions. Signed-off-by: Paul Cercueil Signed-off-by: Lars-Peter Clausen Signed-off-by: Tomi Valkeinen --- drivers/video/jz4740_fb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c index 2c49112fdd6c..23aa47504709 100644 --- a/drivers/video/jz4740_fb.c +++ b/drivers/video/jz4740_fb.c @@ -99,9 +99,9 @@ #define JZ_LCD_CTRL_BPP_15_16 0x4 #define JZ_LCD_CTRL_BPP_18_24 0x5 -#define JZ_LCD_CMD_SOF_IRQ BIT(15) -#define JZ_LCD_CMD_EOF_IRQ BIT(16) -#define JZ_LCD_CMD_ENABLE_PAL BIT(12) +#define JZ_LCD_CMD_SOF_IRQ BIT(31) +#define JZ_LCD_CMD_EOF_IRQ BIT(30) +#define JZ_LCD_CMD_ENABLE_PAL BIT(28) #define JZ_LCD_SYNC_MASK 0x3ff From aeac9e3f8919cecabca5eed080bb28634ab4d3ce Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 22 Sep 2013 12:01:49 +0200 Subject: [PATCH 067/143] video: jz4740-fb: Use clk_prepare_enable/clk_disable_unprepare In preparation to switching the jz4740 clk driver to the common clk framework update the clk enable/disable calls to clk_prepare_enable/clk_disable_unprepare. Signed-off-by: Lars-Peter Clausen Signed-off-by: Tomi Valkeinen --- drivers/video/jz4740_fb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c index 23aa47504709..3f99dcb28b09 100644 --- a/drivers/video/jz4740_fb.c +++ b/drivers/video/jz4740_fb.c @@ -471,7 +471,7 @@ static int jzfb_set_par(struct fb_info *info) writel(ctrl, jzfb->base + JZ_REG_LCD_CTRL); if (!jzfb->is_enabled) - clk_disable(jzfb->ldclk); + clk_disable_unprepare(jzfb->ldclk); mutex_unlock(&jzfb->lock); @@ -485,7 +485,7 @@ static void jzfb_enable(struct jzfb *jzfb) { uint32_t ctrl; - clk_enable(jzfb->ldclk); + clk_prepare_enable(jzfb->ldclk); jz_gpio_bulk_resume(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb)); jz_gpio_bulk_resume(jz_lcd_data_pins, jzfb_num_data_pins(jzfb)); @@ -514,7 +514,7 @@ static void jzfb_disable(struct jzfb *jzfb) jz_gpio_bulk_suspend(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb)); jz_gpio_bulk_suspend(jz_lcd_data_pins, jzfb_num_data_pins(jzfb)); - clk_disable(jzfb->ldclk); + clk_disable_unprepare(jzfb->ldclk); } static int jzfb_blank(int blank_mode, struct fb_info *info) @@ -693,7 +693,7 @@ static int jzfb_probe(struct platform_device *pdev) fb_alloc_cmap(&fb->cmap, 256, 0); - clk_enable(jzfb->ldclk); + clk_prepare_enable(jzfb->ldclk); jzfb->is_enabled = 1; writel(jzfb->framedesc->next, jzfb->base + JZ_REG_LCD_DA0); @@ -763,7 +763,7 @@ static int jzfb_suspend(struct device *dev) static int jzfb_resume(struct device *dev) { struct jzfb *jzfb = dev_get_drvdata(dev); - clk_enable(jzfb->ldclk); + clk_prepare_enable(jzfb->ldclk); mutex_lock(&jzfb->lock); if (jzfb->is_enabled) From a36bf192553912dc28230fb852ad13ef078e28a9 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:10 +0530 Subject: [PATCH 068/143] video: atmel_lcdfb: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Acked-by: Nicolas Ferre Signed-off-by: Tomi Valkeinen --- drivers/video/atmel_lcdfb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index df05550b82e6..3f7d6dc3408d 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -1089,7 +1089,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) ret = register_framebuffer(info); if (ret < 0) { dev_err(dev, "failed to register framebuffer device: %d\n", ret); - goto reset_drvdata; + goto free_cmap; } /* add selected videomode to modelist */ @@ -1105,8 +1105,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) return 0; -reset_drvdata: - dev_set_drvdata(dev, NULL); free_cmap: fb_dealloc_cmap(&info->cmap); unregister_irqs: @@ -1167,7 +1165,6 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev) atmel_lcdfb_free_video_memory(sinfo); } - dev_set_drvdata(dev, NULL); framebuffer_release(info); return 0; From 22b67c0ab2e7480cc4b5ad1ca59ab0e4e0967556 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:11 +0530 Subject: [PATCH 069/143] video: grvga: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Cc: Kristoffer Glembo Signed-off-by: Tomi Valkeinen --- drivers/video/grvga.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/grvga.c b/drivers/video/grvga.c index b95eee7d901e..c078701f15f6 100644 --- a/drivers/video/grvga.c +++ b/drivers/video/grvga.c @@ -496,7 +496,6 @@ static int grvga_probe(struct platform_device *dev) return 0; free_mem: - dev_set_drvdata(&dev->dev, NULL); if (grvga_fix_addr) iounmap((void *)virtual_start); else @@ -530,7 +529,6 @@ static int grvga_remove(struct platform_device *device) kfree((void *)info->screen_base); framebuffer_release(info); - dev_set_drvdata(&device->dev, NULL); } return 0; From 064f29e00ab17ee75ffe7bd60721284b5a3d5f35 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:12 +0530 Subject: [PATCH 070/143] video: leo: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/leo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/leo.c b/drivers/video/leo.c index b17f5009a436..c0f61aa37696 100644 --- a/drivers/video/leo.c +++ b/drivers/video/leo.c @@ -648,8 +648,6 @@ static int leo_remove(struct platform_device *op) framebuffer_release(info); - dev_set_drvdata(&op->dev, NULL); - return 0; } From 74a7b36259fe00d98db6ca4c779960d08c397f4a Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:13 +0530 Subject: [PATCH 071/143] video: mb862xx: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Acked-by: Anatolij Gustschin Signed-off-by: Tomi Valkeinen --- drivers/video/mb862xx/mb862xxfbdrv.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c index 98d2f8c2ed75..0cd4c3318511 100644 --- a/drivers/video/mb862xx/mb862xxfbdrv.c +++ b/drivers/video/mb862xx/mb862xxfbdrv.c @@ -781,7 +781,6 @@ static int of_platform_mb862xx_probe(struct platform_device *ofdev) irqdisp: irq_dispose_mapping(par->irq); fbrel: - dev_set_drvdata(dev, NULL); framebuffer_release(info); return ret; } @@ -814,7 +813,6 @@ static int of_platform_mb862xx_remove(struct platform_device *ofdev) iounmap(par->mmio_base); iounmap(par->fb_base); - dev_set_drvdata(&ofdev->dev, NULL); release_mem_region(par->res->start, res_size); framebuffer_release(fbi); return 0; From bc4626fc87dcc53fc4e0880f818eb269326ac4fb Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:14 +0530 Subject: [PATCH 072/143] video: amifb: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/amifb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index a6780eecff0e..8ab304d1c855 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c @@ -3748,7 +3748,6 @@ static int __init amifb_probe(struct platform_device *pdev) return 0; unset_drvdata: - dev_set_drvdata(&pdev->dev, NULL); fb_dealloc_cmap(&info->cmap); free_irq: free_irq(IRQ_AMIGA_COPPER, info->par); @@ -3768,7 +3767,6 @@ static int __exit amifb_remove(struct platform_device *pdev) struct fb_info *info = dev_get_drvdata(&pdev->dev); unregister_framebuffer(info); - dev_set_drvdata(&pdev->dev, NULL); fb_dealloc_cmap(&info->cmap); free_irq(IRQ_AMIGA_COPPER, info->par); custom.dmacon = DMAF_ALL | DMAF_MASTER; From 5fb4baeab614a97d656d1049829a05cc4ae95875 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:15 +0530 Subject: [PATCH 073/143] video: bw2: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/bw2.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c index 60017fc634b5..bc123d6947a4 100644 --- a/drivers/video/bw2.c +++ b/drivers/video/bw2.c @@ -363,8 +363,6 @@ static int bw2_remove(struct platform_device *op) framebuffer_release(info); - dev_set_drvdata(&op->dev, NULL); - return 0; } From b3a4f58dbdcf51587d6a5429066a8d2e7582380d Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:16 +0530 Subject: [PATCH 074/143] video: cg14: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/cg14.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c index ed3b8891e006..9626488a69c5 100644 --- a/drivers/video/cg14.c +++ b/drivers/video/cg14.c @@ -583,8 +583,6 @@ static int cg14_remove(struct platform_device *op) framebuffer_release(info); - dev_set_drvdata(&op->dev, NULL); - return 0; } From 3d2ae2dc9e58abd9a92e686231b17476a3ace2ce Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:17 +0530 Subject: [PATCH 075/143] video: cg3: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/cg3.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c index 9f63507ded37..64a89d5747ed 100644 --- a/drivers/video/cg3.c +++ b/drivers/video/cg3.c @@ -446,8 +446,6 @@ static int cg3_remove(struct platform_device *op) framebuffer_release(info); - dev_set_drvdata(&op->dev, NULL); - return 0; } From d2b800c0c99e9fbeabdf8b14adfcf6db2e6e0784 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:18 +0530 Subject: [PATCH 076/143] video: cg6: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/cg6.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c index 3545decc7485..f070ec3b0f0a 100644 --- a/drivers/video/cg6.c +++ b/drivers/video/cg6.c @@ -839,8 +839,6 @@ static int cg6_remove(struct platform_device *op) framebuffer_release(info); - dev_set_drvdata(&op->dev, NULL); - return 0; } From 38710d409b30730df7e2614e959b0061a7412250 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:19 +0530 Subject: [PATCH 077/143] video: ffb: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/ffb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c index 6d2744794dd1..4c4ffa61ae26 100644 --- a/drivers/video/ffb.c +++ b/drivers/video/ffb.c @@ -1035,8 +1035,6 @@ static int ffb_remove(struct platform_device *op) framebuffer_release(info); - dev_set_drvdata(&op->dev, NULL); - return 0; } From 391962f6188849917028debfd6e5bd3a3bdf0f49 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:20 +0530 Subject: [PATCH 078/143] video: p9100: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/p9100.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c index 4b23af6e5c28..367cea8f43f3 100644 --- a/drivers/video/p9100.c +++ b/drivers/video/p9100.c @@ -339,8 +339,6 @@ static int p9100_remove(struct platform_device *op) framebuffer_release(info); - dev_set_drvdata(&op->dev, NULL); - return 0; } From cacb41361708ddf4c8cb8995c9f35f24ce28620f Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:21 +0530 Subject: [PATCH 079/143] video: platinumfb: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/platinumfb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c index 3d86bac62d3e..b644037dd5bc 100644 --- a/drivers/video/platinumfb.c +++ b/drivers/video/platinumfb.c @@ -639,7 +639,6 @@ static int platinumfb_probe(struct platform_device* odev) iounmap(pinfo->frame_buffer); iounmap(pinfo->platinum_regs); iounmap(pinfo->cmap_regs); - dev_set_drvdata(&odev->dev, NULL); framebuffer_release(info); } From cb643dfbbd1273886442e4a7465d06b7746b24fb Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:22 +0530 Subject: [PATCH 080/143] video: sunxvr1000: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/sunxvr1000.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/sunxvr1000.c b/drivers/video/sunxvr1000.c index cc6f48bba36b..58241b47a96d 100644 --- a/drivers/video/sunxvr1000.c +++ b/drivers/video/sunxvr1000.c @@ -186,8 +186,6 @@ static int gfb_remove(struct platform_device *op) framebuffer_release(info); - dev_set_drvdata(&op->dev, NULL); - return 0; } From 3e3d2225aef52112de7ecffd9ce611eac8a9766d Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:23 +0530 Subject: [PATCH 081/143] video: tcx: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/tcx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/tcx.c b/drivers/video/tcx.c index c000852500aa..1f3a3271f3dd 100644 --- a/drivers/video/tcx.c +++ b/drivers/video/tcx.c @@ -498,8 +498,6 @@ static int tcx_remove(struct platform_device *op) framebuffer_release(info); - dev_set_drvdata(&op->dev, NULL); - return 0; } From 090fd59308c9d50b8eabf71cd28b5513250a7b79 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 20 Sep 2013 12:02:24 +0530 Subject: [PATCH 082/143] video: xilinxfb: Remove redundant dev_set_drvdata Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat Signed-off-by: Tomi Valkeinen --- drivers/video/xilinxfb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c index 84c664ea8eb9..0e1dd3380a1e 100644 --- a/drivers/video/xilinxfb.c +++ b/drivers/video/xilinxfb.c @@ -369,7 +369,6 @@ static int xilinxfb_assign(struct platform_device *pdev, err_region: kfree(drvdata); - dev_set_drvdata(dev, NULL); return rc; } @@ -404,7 +403,6 @@ static int xilinxfb_release(struct device *dev) #endif kfree(drvdata); - dev_set_drvdata(dev, NULL); return 0; } From 8af2c2869fd129bce0d0dfd86c6364c1096f9eff Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Thu, 28 Mar 2013 22:53:42 +0800 Subject: [PATCH 083/143] video: atmel_lcdfb: fix platform data struct Today we mix pdata and drivers data in the struct atmel_lcdfb_info Fix it and introduce a new struct atmel_lcdfb_pdata for platform data only Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Tomi Valkeinen --- arch/arm/mach-at91/at91sam9261_devices.c | 6 +- arch/arm/mach-at91/at91sam9263_devices.c | 6 +- arch/arm/mach-at91/at91sam9g45_devices.c | 6 +- arch/arm/mach-at91/at91sam9rl_devices.c | 6 +- arch/arm/mach-at91/board-sam9261ek.c | 6 +- arch/arm/mach-at91/board-sam9263ek.c | 4 +- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +- arch/arm/mach-at91/board-sam9rlek.c | 4 +- arch/arm/mach-at91/board.h | 4 +- arch/avr32/boards/atngw100/evklcd10x.c | 6 +- arch/avr32/boards/atngw100/mrmt.c | 4 +- arch/avr32/boards/atstk1000/atstk1000.h | 2 +- arch/avr32/boards/atstk1000/setup.c | 2 +- arch/avr32/boards/favr-32/setup.c | 2 +- arch/avr32/boards/hammerhead/setup.c | 2 +- arch/avr32/boards/merisc/display.c | 2 +- arch/avr32/boards/mimc200/setup.c | 4 +- arch/avr32/mach-at32ap/at32ap700x.c | 8 +- arch/avr32/mach-at32ap/include/mach/board.h | 4 +- drivers/video/atmel_lcdfb.c | 105 +++++++++++++------- include/video/atmel_lcdc.h | 23 +---- 21 files changed, 109 insertions(+), 101 deletions(-) diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 629ea5fc95cf..b2a34740146a 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c @@ -465,7 +465,7 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = { @@ -498,7 +498,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) { if (!data) { return; @@ -559,7 +559,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); } #else -void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) {} #endif diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index 858c8aac2daf..4aeadddbc181 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c @@ -832,7 +832,7 @@ void __init at91_add_device_can(struct at91_can_data *data) {} #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = { @@ -859,7 +859,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) { if (!data) return; @@ -891,7 +891,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); } #else -void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) {} #endif diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index acb703e13331..cb36fa872d30 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c @@ -965,7 +965,7 @@ void __init at91_add_device_isi(struct isi_platform_data *data, #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = { @@ -991,7 +991,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) { if (!data) return; @@ -1037,7 +1037,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); } #else -void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) {} #endif diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 352468f265a9..a698bdab2cce 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c @@ -498,7 +498,7 @@ void __init at91_add_device_ac97(struct ac97c_platform_data *data) {} #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) static u64 lcdc_dmamask = DMA_BIT_MASK(32); -static struct atmel_lcdfb_info lcdc_data; +static struct atmel_lcdfb_pdata lcdc_data; static struct resource lcdc_resources[] = { [0] = { @@ -525,7 +525,7 @@ static struct platform_device at91_lcdc_device = { .num_resources = ARRAY_SIZE(lcdc_resources), }; -void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) +void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) { if (!data) { return; @@ -557,7 +557,7 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) platform_device_register(&at91_lcdc_device); } #else -void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} +void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data) {} #endif diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index d3437624ca4e..4ab1ba7557e4 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c @@ -401,7 +401,7 @@ static void at91_lcdc_stn_power_control(int on) } } -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .default_bpp = 1, .default_dmacon = ATMEL_LCDC_DMAEN, .default_lcdcon2 = AT91SAM9261_DEFAULT_STN_LCDCON2, @@ -453,7 +453,7 @@ static void at91_lcdc_tft_power_control(int on) at91_set_gpio_value(AT91_PIN_PA12, 1); /* power down */ } -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp = 16, .default_dmacon = ATMEL_LCDC_DMAEN, @@ -465,7 +465,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { #endif #else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data; #endif diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index 3284df05df14..0fdae3f1541d 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c @@ -281,7 +281,7 @@ static void at91_lcdc_power_control(int on) } /* Driver datas */ -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp = 16, .default_dmacon = ATMEL_LCDC_DMAEN, @@ -292,7 +292,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { }; #else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data; #endif diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c index 2a94896a1375..ef39078c8ce2 100644 --- a/arch/arm/mach-at91/board-sam9m10g45ek.c +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c @@ -284,7 +284,7 @@ static struct fb_monspecs at91fb_default_monspecs = { | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) /* Driver datas */ -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp = 32, .default_dmacon = ATMEL_LCDC_DMAEN, @@ -295,7 +295,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { }; #else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data; #endif diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c index aa265dcf2128..b77d7a9febd8 100644 --- a/arch/arm/mach-at91/board-sam9rlek.c +++ b/arch/arm/mach-at91/board-sam9rlek.c @@ -179,7 +179,7 @@ static void at91_lcdc_power_control(int on) } /* Driver datas */ -static struct atmel_lcdfb_info __initdata ek_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data = { .lcdcon_is_backlight = true, .default_bpp = 16, .default_dmacon = ATMEL_LCDC_DMAEN, @@ -191,7 +191,7 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data = { }; #else -static struct atmel_lcdfb_info __initdata ek_lcdc_data; +static struct atmel_lcdfb_pdata __initdata ek_lcdc_data; #endif diff --git a/arch/arm/mach-at91/board.h b/arch/arm/mach-at91/board.h index 4a234fb2ab3b..6c08b341167d 100644 --- a/arch/arm/mach-at91/board.h +++ b/arch/arm/mach-at91/board.h @@ -107,8 +107,8 @@ extern void __init at91_add_device_pwm(u32 mask); extern void __init at91_add_device_ssc(unsigned id, unsigned pins); /* LCD Controller */ -struct atmel_lcdfb_info; -extern void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data); +struct atmel_lcdfb_pdata; +extern void __init at91_add_device_lcdc(struct atmel_lcdfb_pdata *data); /* AC97 */ extern void __init at91_add_device_ac97(struct ac97c_platform_data *data); diff --git a/arch/avr32/boards/atngw100/evklcd10x.c b/arch/avr32/boards/atngw100/evklcd10x.c index 20388750d564..dc4280413e9d 100644 --- a/arch/avr32/boards/atngw100/evklcd10x.c +++ b/arch/avr32/boards/atngw100/evklcd10x.c @@ -58,7 +58,7 @@ static struct fb_monspecs __initdata atevklcd10x_default_monspecs = { .dclkmax = 28330000, }; -static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata atevklcd10x_lcdc_data = { .default_bpp = 16, .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT @@ -96,7 +96,7 @@ static struct fb_monspecs __initdata atevklcd10x_default_monspecs = { .dclkmax = 7000000, }; -static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata atevklcd10x_lcdc_data = { .default_bpp = 16, .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT @@ -134,7 +134,7 @@ static struct fb_monspecs __initdata atevklcd10x_default_monspecs = { .dclkmax = 6400000, }; -static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata atevklcd10x_lcdc_data = { .default_bpp = 16, .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT diff --git a/arch/avr32/boards/atngw100/mrmt.c b/arch/avr32/boards/atngw100/mrmt.c index 7de083d19b7e..1ba09e4c02b1 100644 --- a/arch/avr32/boards/atngw100/mrmt.c +++ b/arch/avr32/boards/atngw100/mrmt.c @@ -83,7 +83,7 @@ static struct fb_monspecs __initdata lcd_fb_default_monspecs = { .dclkmax = 9260000, }; -static struct atmel_lcdfb_info __initdata rmt_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata rmt_lcdc_data = { .default_bpp = 24, .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT @@ -126,7 +126,7 @@ static struct fb_monspecs __initdata lcd_fb_default_monspecs = { .dclkmax = 9260000, }; -static struct atmel_lcdfb_info __initdata rmt_lcdc_data = { +static struct atmel_lcdfb_pdata __initdata rmt_lcdc_data = { .default_bpp = 24, .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT diff --git a/arch/avr32/boards/atstk1000/atstk1000.h b/arch/avr32/boards/atstk1000/atstk1000.h index 9392d3252865..653cc09e536c 100644 --- a/arch/avr32/boards/atstk1000/atstk1000.h +++ b/arch/avr32/boards/atstk1000/atstk1000.h @@ -10,7 +10,7 @@ #ifndef __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H #define __ARCH_AVR32_BOARDS_ATSTK1000_ATSTK1000_H -extern struct atmel_lcdfb_info atstk1000_lcdc_data; +extern struct atmel_lcdfb_pdata atstk1000_lcdc_data; void atstk1000_setup_j2_leds(void); diff --git a/arch/avr32/boards/atstk1000/setup.c b/arch/avr32/boards/atstk1000/setup.c index 2d6b560115d9..b6b88f5e0b43 100644 --- a/arch/avr32/boards/atstk1000/setup.c +++ b/arch/avr32/boards/atstk1000/setup.c @@ -55,7 +55,7 @@ static struct fb_monspecs __initdata atstk1000_default_monspecs = { .dclkmax = 30000000, }; -struct atmel_lcdfb_info __initdata atstk1000_lcdc_data = { +struct atmel_lcdfb_pdata __initdata atstk1000_lcdc_data = { .default_bpp = 24, .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT diff --git a/arch/avr32/boards/favr-32/setup.c b/arch/avr32/boards/favr-32/setup.c index 27bd6fbe21cb..7b1f2cd85400 100644 --- a/arch/avr32/boards/favr-32/setup.c +++ b/arch/avr32/boards/favr-32/setup.c @@ -125,7 +125,7 @@ static struct fb_monspecs __initdata favr32_default_monspecs = { .dclkmax = 28000000, }; -struct atmel_lcdfb_info __initdata favr32_lcdc_data = { +struct atmel_lcdfb_pdata __initdata favr32_lcdc_data = { .default_bpp = 16, .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT diff --git a/arch/avr32/boards/hammerhead/setup.c b/arch/avr32/boards/hammerhead/setup.c index 9d1efd1cd425..dc0e317f2ecd 100644 --- a/arch/avr32/boards/hammerhead/setup.c +++ b/arch/avr32/boards/hammerhead/setup.c @@ -77,7 +77,7 @@ static struct fb_monspecs __initdata hammerhead_hda350t_monspecs = { .dclkmax = 10000000, }; -struct atmel_lcdfb_info __initdata hammerhead_lcdc_data = { +struct atmel_lcdfb_pdata __initdata hammerhead_lcdc_data = { .default_bpp = 24, .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT diff --git a/arch/avr32/boards/merisc/display.c b/arch/avr32/boards/merisc/display.c index 85a543cd4abc..e7683ee7ed40 100644 --- a/arch/avr32/boards/merisc/display.c +++ b/arch/avr32/boards/merisc/display.c @@ -45,7 +45,7 @@ static struct fb_monspecs merisc_fb_monspecs = { .dclkmax = 30000000, }; -struct atmel_lcdfb_info merisc_lcdc_data = { +struct atmel_lcdfb_pdata merisc_lcdc_data = { .default_bpp = 24, .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT diff --git a/arch/avr32/boards/mimc200/setup.c b/arch/avr32/boards/mimc200/setup.c index 05358aa5ef7d..1cb8e9cc5cfa 100644 --- a/arch/avr32/boards/mimc200/setup.c +++ b/arch/avr32/boards/mimc200/setup.c @@ -8,7 +8,7 @@ * published by the Free Software Foundation. */ -extern struct atmel_lcdfb_info mimc200_lcdc_data; +extern struct atmel_lcdfb_pdata mimc200_lcdc_data; #include #include @@ -71,7 +71,7 @@ static struct fb_monspecs __initdata mimc200_default_monspecs = { .dclkmax = 25200000, }; -struct atmel_lcdfb_info __initdata mimc200_lcdc_data = { +struct atmel_lcdfb_pdata __initdata mimc200_lcdc_data = { .default_bpp = 16, .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN, .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index a68f3cf7c3c1..a1f4d1e91b52 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c @@ -1439,7 +1439,7 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data) * LCDC * -------------------------------------------------------------------- */ #if defined(CONFIG_CPU_AT32AP7000) || defined(CONFIG_CPU_AT32AP7002) -static struct atmel_lcdfb_info atmel_lcdfb0_data; +static struct atmel_lcdfb_pdata atmel_lcdfb0_data; static struct resource atmel_lcdfb0_resource[] = { { .start = 0xff000000, @@ -1467,12 +1467,12 @@ static struct clk atmel_lcdfb0_pixclk = { }; struct platform_device *__init -at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, +at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_pdata *data, unsigned long fbmem_start, unsigned long fbmem_len, u64 pin_mask) { struct platform_device *pdev; - struct atmel_lcdfb_info *info; + struct atmel_lcdfb_pdata *info; struct fb_monspecs *monspecs; struct fb_videomode *modedb; unsigned int modedb_size; @@ -1529,7 +1529,7 @@ at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, } info = pdev->dev.platform_data; - memcpy(info, data, sizeof(struct atmel_lcdfb_info)); + memcpy(info, data, sizeof(struct atmel_lcdfb_pdata)); info->default_monspecs = monspecs; pdev->name = "at32ap-lcdfb"; diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h index d485b0391357..f1a316d52c73 100644 --- a/arch/avr32/mach-at32ap/include/mach/board.h +++ b/arch/avr32/mach-at32ap/include/mach/board.h @@ -44,9 +44,9 @@ struct platform_device * at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n); void at32_spi_setup_slaves(unsigned int bus_num, struct spi_board_info *b, unsigned int n); -struct atmel_lcdfb_info; +struct atmel_lcdfb_pdata; struct platform_device * -at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, +at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_pdata *data, unsigned long fbmem_start, unsigned long fbmem_len, u64 pin_mask); diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 3f7d6dc3408d..0d7214df1237 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -20,12 +20,44 @@ #include #include #include +#include