* Re: [PATCH 49/55] video: irq: Remove IRQF_DISABLED
From: Florian Tobias Schandinat @ 2011-10-04 20:20 UTC (permalink / raw)
To: Yong Zhang
Cc: linux-fbdev, Paul Gortmaker, Laurent Pinchart, Daniel Walker,
linux-arch, Kukjin Kim, Tomi Valkeinen, Archit Taneja,
David Brown, Anatolij Gustschin, cbe-oss-dev, Wan ZongShun,
linux-arm-msm, Ben Dooks, tglx, linux-omap, linux-arm-kernel,
Geoff Levand, Jiri Kosina, linux-kernel, Bryan Huntsman,
Andrew Morton, linuxppc-dev
In-Reply-To: <1316681962-8217-50-git-send-email-yong.zhang0@gmail.com>
On 09/22/2011 08:59 AM, Yong Zhang wrote:
> Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
> We run all interrupt handlers with interrupts disabled
> and we even check and yell when an interrupt handler
> returns with interrupts enabled (see commit [b738a50a:
> genirq: Warn when handler enables interrupts]).
>
> So now this flag is a NOOP and can be removed.
>
> Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
> Acked-by: David Brown <davidb@codeaurora.org>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> drivers/video/au1200fb.c | 2 +-
> drivers/video/bf54x-lq043fb.c | 2 +-
> drivers/video/bfin-lq035q1-fb.c | 2 +-
> drivers/video/bfin-t350mcqb-fb.c | 2 +-
> drivers/video/bfin_adv7393fb.c | 2 +-
> drivers/video/mb862xx/mb862xxfbdrv.c | 4 ++--
> drivers/video/msm/mddi.c | 2 +-
> drivers/video/msm/mdp.c | 2 +-
> drivers/video/nuc900fb.c | 2 +-
> drivers/video/omap2/displays/panel-taal.c | 2 +-
> drivers/video/ps3fb.c | 2 +-
> drivers/video/pxa3xx-gcu.c | 2 +-
> drivers/video/pxafb.c | 2 +-
> drivers/video/s3c2410fb.c | 2 +-
> drivers/video/sa1100fb.c | 3 +--
> drivers/video/sh_mobile_lcdcfb.c | 2 +-
> drivers/video/tmiofb.c | 2 +-
> drivers/video/vt8500lcdfb.c | 2 +-
> 18 files changed, 19 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
> index a19a40e..7200559 100644
> --- a/drivers/video/au1200fb.c
> +++ b/drivers/video/au1200fb.c
> @@ -1673,7 +1673,7 @@ static int __devinit au1200fb_drv_probe(struct platform_device *dev)
> /* Now hook interrupt too */
> irq = platform_get_irq(dev, 0);
> ret = request_irq(irq, au1200fb_handle_irq,
> - IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev);
> + IRQF_SHARED, "lcd", (void *)dev);
> if (ret) {
> print_err("fail to request interrupt line %d (err: %d)",
> irq, ret);
> diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c
> index 2464b91..56720fb 100644
> --- a/drivers/video/bf54x-lq043fb.c
> +++ b/drivers/video/bf54x-lq043fb.c
> @@ -633,7 +633,7 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
> goto out7;
> }
>
> - if (request_irq(info->irq, bfin_bf54x_irq_error, IRQF_DISABLED,
> + if (request_irq(info->irq, bfin_bf54x_irq_error, 0,
> "PPI ERROR", info) < 0) {
> printk(KERN_ERR DRIVER_NAME
> ": unable to request PPI ERROR IRQ\n");
> diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
> index 23b6c4b..c633068 100644
> --- a/drivers/video/bfin-lq035q1-fb.c
> +++ b/drivers/video/bfin-lq035q1-fb.c
> @@ -695,7 +695,7 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
> goto out7;
> }
>
> - ret = request_irq(info->irq, bfin_lq035q1_irq_error, IRQF_DISABLED,
> + ret = request_irq(info->irq, bfin_lq035q1_irq_error, 0,
> DRIVER_NAME" PPI ERROR", info);
> if (ret < 0) {
> dev_err(&pdev->dev, "unable to request PPI ERROR IRQ\n");
> diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c
> index d8de29f..d5e1267 100644
> --- a/drivers/video/bfin-t350mcqb-fb.c
> +++ b/drivers/video/bfin-t350mcqb-fb.c
> @@ -529,7 +529,7 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
> goto out7;
> }
>
> - ret = request_irq(info->irq, bfin_t350mcqb_irq_error, IRQF_DISABLED,
> + ret = request_irq(info->irq, bfin_t350mcqb_irq_error, 0,
> "PPI ERROR", info);
> if (ret < 0) {
> printk(KERN_ERR DRIVER_NAME
> diff --git a/drivers/video/bfin_adv7393fb.c b/drivers/video/bfin_adv7393fb.c
> index 8486f54..811dd7f 100644
> --- a/drivers/video/bfin_adv7393fb.c
> +++ b/drivers/video/bfin_adv7393fb.c
> @@ -481,7 +481,7 @@ static int __devinit bfin_adv7393_fb_probe(struct i2c_client *client,
> goto out_4;
> }
>
> - if (request_irq(IRQ_PPI_ERROR, ppi_irq_error, IRQF_DISABLED,
> + if (request_irq(IRQ_PPI_ERROR, ppi_irq_error, 0,
> "PPI ERROR", fbdev) < 0) {
> dev_err(&client->dev, "unable to request PPI ERROR IRQ\n");
> ret = -EFAULT;
> diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c
> index 12a634a..11a7a33 100644
> --- a/drivers/video/mb862xx/mb862xxfbdrv.c
> +++ b/drivers/video/mb862xx/mb862xxfbdrv.c
> @@ -738,7 +738,7 @@ static int __devinit of_platform_mb862xx_probe(struct platform_device *ofdev)
> if (mb862xx_gdc_init(par))
> goto io_unmap;
>
> - if (request_irq(par->irq, mb862xx_intr, IRQF_DISABLED,
> + if (request_irq(par->irq, mb862xx_intr, 0,
> DRV_NAME, (void *)par)) {
> dev_err(dev, "Cannot request irq\n");
> goto io_unmap;
> @@ -1074,7 +1074,7 @@ static int __devinit mb862xx_pci_probe(struct pci_dev *pdev,
> if (mb862xx_pci_gdc_init(par))
> goto io_unmap;
>
> - if (request_irq(par->irq, mb862xx_intr, IRQF_DISABLED | IRQF_SHARED,
> + if (request_irq(par->irq, mb862xx_intr, IRQF_SHARED,
> DRV_NAME, (void *)par)) {
> dev_err(dev, "Cannot request irq\n");
> goto io_unmap;
> diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
> index 178b072..4527cbf 100644
> --- a/drivers/video/msm/mddi.c
> +++ b/drivers/video/msm/mddi.c
> @@ -715,7 +715,7 @@ static int __devinit mddi_probe(struct platform_device *pdev)
>
> mddi->int_enable = 0;
> mddi_writel(mddi->int_enable, INTEN);
> - ret = request_irq(mddi->irq, mddi_isr, IRQF_DISABLED, "mddi",
> + ret = request_irq(mddi->irq, mddi_isr, 0, "mddi",
> &mddi->client_data);
> if (ret) {
> printk(KERN_ERR "mddi: failed to request enable irq!\n");
> diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c
> index 2750ed2..cb2ddf1 100644
> --- a/drivers/video/msm/mdp.c
> +++ b/drivers/video/msm/mdp.c
> @@ -426,7 +426,7 @@ int mdp_probe(struct platform_device *pdev)
> goto error_get_clk;
> }
>
> - ret = request_irq(mdp->irq, mdp_isr, IRQF_DISABLED, "msm_mdp", mdp);
> + ret = request_irq(mdp->irq, mdp_isr, 0, "msm_mdp", mdp);
> if (ret)
> goto error_request_irq;
> disable_irq(mdp->irq);
> diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
> index 37dd850..d1fbbd8 100644
> --- a/drivers/video/nuc900fb.c
> +++ b/drivers/video/nuc900fb.c
> @@ -587,7 +587,7 @@ static int __devinit nuc900fb_probe(struct platform_device *pdev)
> fbinfo->flags = FBINFO_FLAG_DEFAULT;
> fbinfo->pseudo_palette = &fbi->pseudo_pal;
>
> - ret = request_irq(irq, nuc900fb_irqhandler, IRQF_DISABLED,
> + ret = request_irq(irq, nuc900fb_irqhandler, 0,
> pdev->name, fbinfo);
> if (ret) {
> dev_err(&pdev->dev, "cannot register irq handler %d -err %d\n",
> diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
> index 7f91002..80c3f6a 100644
> --- a/drivers/video/omap2/displays/panel-taal.c
> +++ b/drivers/video/omap2/displays/panel-taal.c
> @@ -1034,7 +1034,7 @@ static int taal_probe(struct omap_dss_device *dssdev)
> gpio_direction_input(gpio);
>
> r = request_irq(gpio_to_irq(gpio), taal_te_isr,
> - IRQF_DISABLED | IRQF_TRIGGER_RISING,
> + IRQF_TRIGGER_RISING,
> "taal vsync", dssdev);
>
> if (r) {
> diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
> index 65560a1..213fbbc 100644
> --- a/drivers/video/ps3fb.c
> +++ b/drivers/video/ps3fb.c
> @@ -1082,7 +1082,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
> }
>
> retval = request_irq(ps3fb.irq_no, ps3fb_vsync_interrupt,
> - IRQF_DISABLED, DEVICE_NAME, &dev->core);
> + 0, DEVICE_NAME, &dev->core);
> if (retval) {
> dev_err(&dev->core, "%s: request_irq failed %d\n", __func__,
> retval);
> diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c
> index d8de557..1ed8b36 100644
> --- a/drivers/video/pxa3xx-gcu.c
> +++ b/drivers/video/pxa3xx-gcu.c
> @@ -676,7 +676,7 @@ pxa3xx_gcu_probe(struct platform_device *dev)
> }
>
> ret = request_irq(irq, pxa3xx_gcu_handle_irq,
> - IRQF_DISABLED, DRV_NAME, priv);
> + 0, DRV_NAME, priv);
> if (ret) {
> dev_err(&dev->dev, "request_irq failed\n");
> ret = -EBUSY;
> diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
> index 0f4e8c9..e89778f 100644
> --- a/drivers/video/pxafb.c
> +++ b/drivers/video/pxafb.c
> @@ -2191,7 +2191,7 @@ static int __devinit pxafb_probe(struct platform_device *dev)
> goto failed_free_mem;
> }
>
> - ret = request_irq(irq, pxafb_handle_irq, IRQF_DISABLED, "LCD", fbi);
> + ret = request_irq(irq, pxafb_handle_irq, 0, "LCD", fbi);
> if (ret) {
> dev_err(&dev->dev, "request_irq failed: %d\n", ret);
> ret = -EBUSY;
> diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
> index 798144a..ee4c0df 100644
> --- a/drivers/video/s3c2410fb.c
> +++ b/drivers/video/s3c2410fb.c
> @@ -910,7 +910,7 @@ static int __devinit s3c24xxfb_probe(struct platform_device *pdev,
> for (i = 0; i < 256; i++)
> info->palette_buffer[i] = PALETTE_BUFF_CLEAR;
>
> - ret = request_irq(irq, s3c2410fb_irq, IRQF_DISABLED, pdev->name, info);
> + ret = request_irq(irq, s3c2410fb_irq, 0, pdev->name, info);
> if (ret) {
> dev_err(&pdev->dev, "cannot get irq %d - err %d\n", irq, ret);
> ret = -EBUSY;
> diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
> index e8b76d6..98d55d0 100644
> --- a/drivers/video/sa1100fb.c
> +++ b/drivers/video/sa1100fb.c
> @@ -1457,8 +1457,7 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev)
> if (ret)
> goto failed;
>
> - ret = request_irq(irq, sa1100fb_handle_irq, IRQF_DISABLED,
> - "LCD", fbi);
> + ret = request_irq(irq, sa1100fb_handle_irq, 0, "LCD", fbi);
> if (ret) {
> printk(KERN_ERR "sa1100fb: request_irq failed: %d\n", ret);
> goto failed;
> diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
> index 4636f9d..facffc2 100644
> --- a/drivers/video/sh_mobile_lcdcfb.c
> +++ b/drivers/video/sh_mobile_lcdcfb.c
> @@ -1577,7 +1577,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, priv);
>
> - error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED,
> + error = request_irq(i, sh_mobile_lcdc_irq, 0,
> dev_name(&pdev->dev), priv);
> if (error) {
> dev_err(&pdev->dev, "unable to request irq\n");
> diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c
> index cd1c4dc..8e4a446 100644
> --- a/drivers/video/tmiofb.c
> +++ b/drivers/video/tmiofb.c
> @@ -744,7 +744,7 @@ static int __devinit tmiofb_probe(struct platform_device *dev)
> goto err_ioremap_vram;
> }
>
> - retval = request_irq(irq, &tmiofb_irq, IRQF_DISABLED,
> + retval = request_irq(irq, &tmiofb_irq, 0,
> dev_name(&dev->dev), info);
>
> if (retval)
> diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
> index c13c246..777c21d 100644
> --- a/drivers/video/vt8500lcdfb.c
> +++ b/drivers/video/vt8500lcdfb.c
> @@ -355,7 +355,7 @@ static int __devinit vt8500lcd_probe(struct platform_device *pdev)
> goto failed_free_palette;
> }
>
> - ret = request_irq(irq, vt8500lcd_handle_irq, IRQF_DISABLED, "LCD", fbi);
> + ret = request_irq(irq, vt8500lcd_handle_irq, 0, "LCD", fbi);
> if (ret) {
> dev_err(&pdev->dev, "request_irq failed: %d\n", ret);
> ret = -EBUSY;
^ permalink raw reply
* Re: [PATCH] mx3fb: fix NULL pointer dereference in screen blanking.
From: Florian Tobias Schandinat @ 2011-10-04 20:22 UTC (permalink / raw)
To: Michael Thalmeier; +Cc: linux-fbdev, linux-kernel
In-Reply-To: <1316779775-12730-1-git-send-email-michael.thalmeier@hale.at>
On 09/23/2011 12:09 PM, Michael Thalmeier wrote:
> From: Wolfram Stering <wolfram.stering@hale.at>
>
> When blanking an already blanked framebuffer, a kernel NULL pointer
> dereference occurred, because mx3fb driver handles all kinds of screen
> blanking (normal, vsync suspend, powerdown) in the same way.
> Certain programs (Xorg X11 server) first do a normal blank, followed by
> a powerdown blank, which triggered the bug.
>
> Add an additional safeguard and make sdc_disable_channel() safe against
> multiple calls independent of other logic.
>
> Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> drivers/video/mx3fb.c | 13 +++++++++++++
> 1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
> index 7e3a490..286be99 100644
> --- a/drivers/video/mx3fb.c
> +++ b/drivers/video/mx3fb.c
> @@ -382,6 +382,9 @@ static void sdc_disable_channel(struct mx3fb_info *mx3_fbi)
> uint32_t enabled;
> unsigned long flags;
>
> + if (mx3_fbi->txd = NULL)
> + return;
> +
> spin_lock_irqsave(&mx3fb->lock, flags);
>
> enabled = sdc_fb_uninit(mx3_fbi);
> @@ -986,9 +989,19 @@ static void __blank(int blank, struct fb_info *fbi)
> {
> struct mx3fb_info *mx3_fbi = fbi->par;
> struct mx3fb_data *mx3fb = mx3_fbi->mx3fb;
> + int was_blank = mx3_fbi->blank;
>
> mx3_fbi->blank = blank;
>
> + /* Attention!
> + * Do not call sdc_disable_channel() for a channel that is disabled
> + * already! This will result in a kernel NULL pointer dereference
> + * (mx3_fbi->txd is NULL). Hide the fact, that all blank modes are
> + * handled equally by this driver.
> + */
> + if (blank > FB_BLANK_UNBLANK && was_blank > FB_BLANK_UNBLANK)
> + return;
> +
> switch (blank) {
> case FB_BLANK_POWERDOWN:
> case FB_BLANK_VSYNC_SUSPEND:
^ permalink raw reply
* Re: [PATCH] fb: fix au1100fb bitrot.
From: Florian Tobias Schandinat @ 2011-10-04 20:23 UTC (permalink / raw)
To: linux-fbdev
On 09/30/2011 06:49 PM, Manuel Lauss wrote:
> Removes some bitrot from the au1100fb driver and fix it up so it works again.
>
> Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> Tested on a DB1100 board.
>
> drivers/video/au1100fb.c | 181 +++++++++++++++-------------------------------
> drivers/video/au1100fb.h | 6 +--
> 2 files changed, 61 insertions(+), 126 deletions(-)
>
> diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
> index 93b98bb..de9da67 100644
> --- a/drivers/video/au1100fb.c
> +++ b/drivers/video/au1100fb.c
> @@ -98,12 +98,6 @@ static struct fb_var_screeninfo au1100fb_var __devinitdata = {
> .vmode = FB_VMODE_NONINTERLACED,
> };
>
> -static struct au1100fb_drv_info drv_info;
> -
> -static int nocursor = 0;
> -module_param(nocursor, int, 0644);
> -MODULE_PARM_DESC(nocursor, "cursor enable/disable");
> -
> /* fb_blank
> * Blank the screen. Depending on the mode, the screen will be
> * activated with the backlight color, or desactivated
> @@ -120,7 +114,7 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
> /* Turn on panel */
> fbdev->regs->lcd_control |= LCD_CONTROL_GO;
> #ifdef CONFIG_MIPS_PB1100
> - if (drv_info.panel_idx = 1) {
> + if (fbdev->panel_idx = 1) {
> au_writew(au_readw(PB1100_G_CONTROL)
> | (PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
> PB1100_G_CONTROL);
> @@ -135,7 +129,7 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
> /* Turn off panel */
> fbdev->regs->lcd_control &= ~LCD_CONTROL_GO;
> #ifdef CONFIG_MIPS_PB1100
> - if (drv_info.panel_idx = 1) {
> + if (fbdev->panel_idx = 1) {
> au_writew(au_readw(PB1100_G_CONTROL)
> & ~(PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
> PB1100_G_CONTROL);
> @@ -416,17 +410,6 @@ int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
> return 0;
> }
>
> -/* fb_cursor
> - * Used to disable cursor drawing...
> - */
> -int au1100fb_fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
> -{
> - if (nocursor)
> - return 0;
> - else
> - return -EINVAL; /* just to force soft_cursor() call */
> -}
> -
> static struct fb_ops au1100fb_ops > {
> .owner = THIS_MODULE,
> @@ -438,13 +421,53 @@ static struct fb_ops au1100fb_ops > .fb_imageblit = cfb_imageblit,
> .fb_rotate = au1100fb_fb_rotate,
> .fb_mmap = au1100fb_fb_mmap,
> - .fb_cursor = au1100fb_fb_cursor,
> };
>
>
> /*-------------------------------------------------------------------------*/
>
> -/* AU1100 LCD controller device driver */
> +static int au1100fb_setup(struct au1100fb_device *fbdev)
> +{
> + char *this_opt, *options;
> + int num_panels = ARRAY_SIZE(known_lcd_panels);
> +
> + if (num_panels <= 0) {
> + print_err("No LCD panels supported by driver!");
> + return -ENODEV;
> + }
> +
> + if (fb_get_options(DRIVER_NAME, &options))
> + return -ENODEV;
> + if (!options)
> + return -ENODEV;
> +
> + while ((this_opt = strsep(&options, ",")) != NULL) {
> + /* Panel option */
> + if (!strncmp(this_opt, "panel:", 6)) {
> + int i;
> + this_opt += 6;
> + for (i = 0; i < num_panels; i++) {
> + if (!strncmp(this_opt, known_lcd_panels[i].name,
> + strlen(this_opt))) {
> + fbdev->panel = &known_lcd_panels[i];
> + fbdev->panel_idx = i;
> + break;
> + }
> + }
> + if (i >= num_panels) {
> + print_warn("Panel '%s' not supported!", this_opt);
> + return -ENODEV;
> + }
> + }
> + /* Unsupported option */
> + else
> + print_warn("Unsupported option \"%s\"", this_opt);
> + }
> +
> + print_info("Panel=%s", fbdev->panel->name);
> +
> + return 0;
> +}
>
> static int __devinit au1100fb_drv_probe(struct platform_device *dev)
> {
> @@ -453,22 +476,21 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
> unsigned long page;
> u32 sys_clksrc;
>
> - if (!dev)
> - return -EINVAL;
> -
> /* Allocate new device private */
> - if (!(fbdev = kzalloc(sizeof(struct au1100fb_device), GFP_KERNEL))) {
> + fbdev = kzalloc(sizeof(struct au1100fb_device), GFP_KERNEL);
> + if (!fbdev) {
> print_err("fail to allocate device private record");
> return -ENOMEM;
> }
>
> - fbdev->panel = &known_lcd_panels[drv_info.panel_idx];
> + if (au1100fb_setup(fbdev))
> + goto failed;
>
> platform_set_drvdata(dev, (void *)fbdev);
>
> /* Allocate region for our registers and map them */
> - if (!(regs_res = platform_get_resource(to_platform_device(dev),
> - IORESOURCE_MEM, 0))) {
> + regs_res = platform_get_resource(dev, IORESOURCE_MEM, 0);
> + if (!regs_res) {
> print_err("fail to retrieve registers resource");
> return -EFAULT;
> }
> @@ -488,13 +510,11 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
> print_dbg("Register memory map at %p", fbdev->regs);
> print_dbg("phys=0x%08x, size=%d", fbdev->regs_phys, fbdev->regs_len);
>
> -
> -
> /* Allocate the framebuffer to the maximum screen size * nbr of video buffers */
> fbdev->fb_len = fbdev->panel->xres * fbdev->panel->yres *
> (fbdev->panel->bpp >> 3) * AU1100FB_NBR_VIDEO_BUFFERS;
>
> - fbdev->fb_mem = dma_alloc_coherent(dev, PAGE_ALIGN(fbdev->fb_len),
> + fbdev->fb_mem = dma_alloc_coherent(&dev->dev, PAGE_ALIGN(fbdev->fb_len),
> &fbdev->fb_phys, GFP_KERNEL);
> if (!fbdev->fb_mem) {
> print_err("fail to allocate frambuffer (size: %dK))",
> @@ -513,7 +533,7 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
> page < PAGE_ALIGN((unsigned long)fbdev->fb_mem + fbdev->fb_len);
> page += PAGE_SIZE) {
> #if CONFIG_DMA_NONCOHERENT
> - SetPageReserved(virt_to_page(CAC_ADDR(page)));
> + SetPageReserved(virt_to_page(CAC_ADDR((void *)page)));
> #else
> SetPageReserved(virt_to_page(page));
> #endif
> @@ -566,7 +586,8 @@ failed:
> release_mem_region(fbdev->regs_phys, fbdev->regs_len);
> }
> if (fbdev->fb_mem) {
> - dma_free_noncoherent(dev, fbdev->fb_len, fbdev->fb_mem, fbdev->fb_phys);
> + dma_free_noncoherent(&dev->dev, fbdev->fb_len, fbdev->fb_mem,
> + fbdev->fb_phys);
> }
> if (fbdev->info.cmap.len != 0) {
> fb_dealloc_cmap(&fbdev->info.cmap);
> @@ -596,7 +617,8 @@ int au1100fb_drv_remove(struct platform_device *dev)
>
> release_mem_region(fbdev->regs_phys, fbdev->regs_len);
>
> - dma_free_coherent(dev, PAGE_ALIGN(fbdev->fb_len), fbdev->fb_mem, fbdev->fb_phys);
> + dma_free_coherent(&dev->dev, PAGE_ALIGN(fbdev->fb_len), fbdev->fb_mem,
> + fbdev->fb_phys);
>
> fb_dealloc_cmap(&fbdev->info.cmap);
> kfree(fbdev->info.pseudo_palette);
> @@ -663,101 +685,18 @@ static struct platform_driver au1100fb_driver = {
> .resume = au1100fb_drv_resume,
> };
>
> -/*-------------------------------------------------------------------------*/
> -
> -/* Kernel driver */
> -
> -int au1100fb_setup(char *options)
> -{
> - char* this_opt;
> - int num_panels = ARRAY_SIZE(known_lcd_panels);
> - char* mode = NULL;
> - int panel_idx = 0;
> -
> - if (num_panels <= 0) {
> - print_err("No LCD panels supported by driver!");
> - return -EFAULT;
> - }
> -
> - if (options) {
> - while ((this_opt = strsep(&options,",")) != NULL) {
> - /* Panel option */
> - if (!strncmp(this_opt, "panel:", 6)) {
> - int i;
> - this_opt += 6;
> - for (i = 0; i < num_panels; i++) {
> - if (!strncmp(this_opt,
> - known_lcd_panels[i].name,
> - strlen(this_opt))) {
> - panel_idx = i;
> - break;
> - }
> - }
> - if (i >= num_panels) {
> - print_warn("Panel %s not supported!", this_opt);
> - }
> - }
> - if (!strncmp(this_opt, "nocursor", 8)) {
> - this_opt += 8;
> - nocursor = 1;
> - print_info("Cursor disabled");
> - }
> - /* Mode option (only option that start with digit) */
> - else if (isdigit(this_opt[0])) {
> - mode = kstrdup(this_opt, GFP_KERNEL);
> - if (!mode) {
> - print_err("memory allocation failed");
> - return -ENOMEM;
> - }
> - }
> - /* Unsupported option */
> - else {
> - print_warn("Unsupported option \"%s\"", this_opt);
> - }
> - }
> - }
> -
> - drv_info.panel_idx = panel_idx;
> - drv_info.opt_mode = mode;
> -
> - print_info("Panel=%s Mode=%s",
> - known_lcd_panels[drv_info.panel_idx].name,
> - drv_info.opt_mode ? drv_info.opt_mode : "default");
> -
> - return 0;
> -}
> -
> -int __init au1100fb_init(void)
> +static int __init au1100fb_load(void)
> {
> - char* options;
> - int ret;
> -
> - print_info("" DRIVER_DESC "");
> -
> - memset(&drv_info, 0, sizeof(drv_info));
> -
> - if (fb_get_options(DRIVER_NAME, &options))
> - return -ENODEV;
> -
> - /* Setup driver with options */
> - ret = au1100fb_setup(options);
> - if (ret < 0) {
> - print_err("Fail to setup driver");
> - return ret;
> - }
> -
> return platform_driver_register(&au1100fb_driver);
> }
>
> -void __exit au1100fb_cleanup(void)
> +static void __exit au1100fb_unload(void)
> {
> platform_driver_unregister(&au1100fb_driver);
> -
> - kfree(drv_info.opt_mode);
> }
>
> -module_init(au1100fb_init);
> -module_exit(au1100fb_cleanup);
> +module_init(au1100fb_load);
> +module_exit(au1100fb_unload);
>
> MODULE_DESCRIPTION(DRIVER_DESC);
> MODULE_LICENSE("GPL");
> diff --git a/drivers/video/au1100fb.h b/drivers/video/au1100fb.h
> index 164fe2f..12d9642 100644
> --- a/drivers/video/au1100fb.h
> +++ b/drivers/video/au1100fb.h
> @@ -108,6 +108,7 @@ struct au1100fb_device {
> unsigned char* fb_mem; /* FrameBuffer memory map */
> size_t fb_len;
> dma_addr_t fb_phys;
> + int panel_idx;
> };
>
> /********************************************************************/
> @@ -364,11 +365,6 @@ static struct au1100fb_panel known_lcd_panels[] > },
> };
>
> -struct au1100fb_drv_info {
> - int panel_idx;
> - char *opt_mode;
> -};
> -
> /********************************************************************/
>
> /* Inline helpers */
^ permalink raw reply
* Re: [PATCH v3] video: da8xx-fb: Increased resolution configuration
From: Florian Tobias Schandinat @ 2011-10-04 20:26 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1310963333-29806-1-git-send-email-prakash.pm@ti.com>
On 10/04/2011 07:00 AM, Manjunathappa, Prakash wrote:
> Hi Florian Tobias Schandinat,
>
> Can you please accept below patch? It depends on my earlier patch "video: da8xx-fb: Interrupt configuration of revised LCDC IP" accepted by Paul, but I don't see it main line yet. Please let me know if I have submit both patches again?
>
> Thanks,
> Prakash
Applied this patch. I already got the dependency when I merged Paul latest tree.
You can see the result under
git://github.com/schandinat/linux-2.6.git fbdev-next
or in the next linux-next build.
Thanks,
Florian Tobias Schandinat
>
> On Tue, Jul 26, 2011 at 09:50:12, Manjunathappa, Prakash wrote:
>> Hi Paul,
>>
>> Could you please accept this patch as there are no comments?
>>
>> Thanks,
>> Prakash
>> On Mon, Jul 18, 2011 at 09:58:53, Manjunathappa, Prakash wrote:
>>> Revised LCD controller in upcoming TI SoC which is an updated version of
>>> LCDC IP that was found on TI's DA850 SoC supports 2048*2048 resolution.
>>> Below are the encoding details:
>>> Width:
>>> Pixels Per Line = {pplmsb, ppllsb, 4'b1111} + 1
>>> Where pplmsb:1bit=>Raster Timing0[3], ppllsb:6bits=>Raster Timing0[9:4].
>>> And encoded value can range from 16 to 2048 in multiples of 16.
>>>
>>> Height:
>>> Lines Per Panel = {lpp_b10, lpp}
>>> Where lpp:10bits=>Raster Timing1[9:0], lpp_b10:1bit=>Raster Timing2[26].
>>> And encoded value can range from 1 to 2048, programmable range is 0 to
>>> 2047.
>>>
>>> Patch is verified on emulation platform of upcoming SoC for updated
>>> feature and on DA850 platform to make sure nothing existing breaks.
>>>
>>> Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
>>> ---
>>> Since v2:
>>> Corrected comment describing horizontal resolution bits and removed unnecessary
>>> outer parenthesis.
>>> Since v1:
>>> 1)Fixed the bug in configuration of lpp_b10 in Raster Timing2[26] register.
>>> 2)Reframed commit message.
>>>
>>> drivers/video/da8xx-fb.c | 31 ++++++++++++++++++++++++++++---
>>> 1 files changed, 28 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
>>> index 620f1c3..94b611a 100644
>>> --- a/drivers/video/da8xx-fb.c
>>> +++ b/drivers/video/da8xx-fb.c
>>> @@ -460,18 +460,43 @@ static int lcd_cfg_frame_buffer(struct da8xx_fb_par *par, u32 width, u32 height,
>>>
>>> /* Set the Panel Width */
>>> /* Pixels per line = (PPL + 1)*16 */
>>> - /*0x3F in bits 4..9 gives max horisontal resolution = 1024 pixels*/
>>> - width &= 0x3f0;
>>> + if (lcd_revision = LCD_VERSION_1) {
>>> + /*
>>> + * 0x3F in bits 4..9 gives max horizontal resolution = 1024
>>> + * pixels.
>>> + */
>>> + width &= 0x3f0;
>>> + } else {
>>> + /*
>>> + * 0x7F in bits 4..10 gives max horizontal resolution = 2048
>>> + * pixels.
>>> + */
>>> + width &= 0x7f0;
>>> + }
>>> +
>>> reg = lcdc_read(LCD_RASTER_TIMING_0_REG);
>>> reg &= 0xfffffc00;
>>> - reg |= ((width >> 4) - 1) << 4;
>>> + if (lcd_revision = LCD_VERSION_1) {
>>> + reg |= ((width >> 4) - 1) << 4;
>>> + } else {
>>> + width = (width >> 4) - 1;
>>> + reg |= ((width & 0x3f) << 4) | ((width & 0x40) >> 3);
>>> + }
>>> lcdc_write(reg, LCD_RASTER_TIMING_0_REG);
>>>
>>> /* Set the Panel Height */
>>> + /* Set bits 9:0 of Lines Per Pixel */
>>> reg = lcdc_read(LCD_RASTER_TIMING_1_REG);
>>> reg = ((height - 1) & 0x3ff) | (reg & 0xfffffc00);
>>> lcdc_write(reg, LCD_RASTER_TIMING_1_REG);
>>>
>>> + /* Set bit 10 of Lines Per Pixel */
>>> + if (lcd_revision = LCD_VERSION_2) {
>>> + reg = lcdc_read(LCD_RASTER_TIMING_2_REG);
>>> + reg |= ((height - 1) & 0x400) << 16;
>>> + lcdc_write(reg, LCD_RASTER_TIMING_2_REG);
>>> + }
>>> +
>>> /* Set the Raster Order of the Frame Buffer */
>>> reg = lcdc_read(LCD_RASTER_CTRL_REG) & ~(1 << 8);
>>> if (raster_order)
>>> --
>>> 1.7.1
>>>
>>>
>>
>> _______________________________________________
>> Davinci-linux-open-source mailing list
>> Davinci-linux-open-source@linux.davincidsp.com
>> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
>>
>
>
^ permalink raw reply
* [PATCH 1/9] [v2] drivers/video: fsl-diu-fb: fix some ioctls
From: Timur Tabi @ 2011-10-05 0:36 UTC (permalink / raw)
To: linux-fbdev
Use the _IOx macros to define the ioctl commands, instead of hard-coded
numbers. Unfortunately, the original definitions of MFB_SET_PIXFMT and
MFB_GET_PIXFMT used the wrong value for the size, so these macros have
new values now. To avoid breaking binary compatibility with older
applications, we retain support for the original values, but the driver
displays a warning message if they're used.
Also remove the FBIOGET_GWINFO and FBIOPUT_GWINFO ioctls. FBIOPUT_GWINFO
was never implemented, and FBIOGET_GWINFO was never used by any
application.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 16 ++++++++--------
include/linux/fsl-diu-fb.h | 27 ++++++++++++++++-----------
2 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 5137fbb..9a1f6d2 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -966,11 +966,19 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
if (!arg)
return -EINVAL;
switch (cmd) {
+ case MFB_SET_PIXFMT_OLD:
+ dev_warn(info->dev,
+ "MFB_SET_PIXFMT value of 0x%08x is deprecated.\n",
+ MFB_SET_PIXFMT_OLD);
case MFB_SET_PIXFMT:
if (copy_from_user(&pix_fmt, buf, sizeof(pix_fmt)))
return -EFAULT;
ad->pix_fmt = pix_fmt;
break;
+ case MFB_GET_PIXFMT_OLD:
+ dev_warn(info->dev,
+ "MFB_GET_PIXFMT value of 0x%08x is deprecated.\n",
+ MFB_GET_PIXFMT_OLD);
case MFB_GET_PIXFMT:
pix_fmt = ad->pix_fmt;
if (copy_to_user(buf, &pix_fmt, sizeof(pix_fmt)))
@@ -1030,14 +1038,6 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
ad->ckmin_b = ck.blue_min;
}
break;
- case FBIOGET_GWINFO:
- if (mfbi->type = MFB_TYPE_OFF)
- return -ENODEV;
- /* get graphic window information */
- if (copy_to_user(buf, ad, sizeof(*ad)))
- return -EFAULT;
- break;
-
default:
dev_err(info->dev, "unknown ioctl command (0x%08X)\n", cmd);
return -ENOIOCTLCMD;
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index df23f59..e19c531 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -33,22 +33,27 @@ struct mfb_chroma_key {
};
struct aoi_display_offset {
- int x_aoi_d;
- int y_aoi_d;
+ __s32 x_aoi_d;
+ __s32 y_aoi_d;
};
#define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key)
#define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8)
+#define MFB_SET_ALPHA _IOW('M', 0, __u8)
+#define MFB_GET_ALPHA _IOR('M', 0, __u8)
+#define MFB_SET_AOID _IOW('M', 4, struct aoi_display_offset)
+#define MFB_GET_AOID _IOR('M', 4, struct aoi_display_offset)
+#define MFB_SET_PIXFMT _IOW('M', 8, __u32)
+#define MFB_GET_PIXFMT _IOR('M', 8, __u32)
-#define MFB_SET_ALPHA 0x80014d00
-#define MFB_GET_ALPHA 0x40014d00
-#define MFB_SET_AOID 0x80084d04
-#define MFB_GET_AOID 0x40084d04
-#define MFB_SET_PIXFMT 0x80014d08
-#define MFB_GET_PIXFMT 0x40014d08
-
-#define FBIOGET_GWINFO 0x46E0
-#define FBIOPUT_GWINFO 0x46E1
+/*
+ * The original definitions of MFB_SET_PIXFMT and MFB_GET_PIXFMT used the
+ * wrong value for 'size' field of the ioctl. The current macros above use the
+ * right size, but we still need to provide backwards compatibility, at least
+ * for a while.
+*/
+#define MFB_SET_PIXFMT_OLD 0x80014d08
+#define MFB_GET_PIXFMT_OLD 0x40014d08
#ifdef __KERNEL__
#include <linux/spinlock.h>
--
1.7.4.4
^ permalink raw reply related
* [PATCH 2/9] drivers/video: fsl-diu-fb: move some definitions out of the header file
From: Timur Tabi @ 2011-10-05 0:36 UTC (permalink / raw)
To: linux-fbdev
Move several macros and structures from the Freescale DIU driver's header
file into the source file, because they're only used by that file. Also
delete a few unused macros.
The diu and diu_ad structures cannot be moved because they're being used
by the MPC5121 platform file. A future patch eliminate the need for
the platform file to access these structs, so they'll be moved also.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 39 ++++++++++++++++++++++++++++++++++++
include/linux/fsl-diu-fb.h | 47 --------------------------------------------
2 files changed, 39 insertions(+), 47 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 9a1f6d2..9b3891a 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -30,11 +30,50 @@
#include <linux/clk.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
+#include <linux/spinlock.h>
#include <sysdev/fsl_soc.h>
#include <linux/fsl-diu-fb.h>
#include "edid.h"
+#define FSL_AOI_NUM 6 /* 5 AOIs and one dummy AOI */
+ /* 1 for plane 0, 2 for plane 1&2 each */
+
+/* HW cursor parameters */
+#define MAX_CURS 32
+
+/* INT_STATUS/INT_MASK field descriptions */
+#define INT_VSYNC 0x01 /* Vsync interrupt */
+#define INT_VSYNC_WB 0x02 /* Vsync interrupt for write back operation */
+#define INT_UNDRUN 0x04 /* Under run exception interrupt */
+#define INT_PARERR 0x08 /* Display parameters error interrupt */
+#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
+
+/* Panels'operation modes */
+#define MFB_TYPE_OUTPUT 0 /* Panel output to display */
+#define MFB_TYPE_OFF 1 /* Panel off */
+#define MFB_TYPE_WB 2 /* Panel written back to memory */
+#define MFB_TYPE_TEST 3 /* Panel generate color bar */
+
+struct diu_hw {
+ struct diu __iomem *diu_reg;
+ spinlock_t reg_lock;
+ unsigned int mode; /* DIU operation mode */
+};
+
+struct diu_addr {
+ void *vaddr; /* Virtual address */
+ dma_addr_t paddr; /* Physical address */
+ __u32 offset;
+};
+
+struct diu_pool {
+ struct diu_addr ad;
+ struct diu_addr gamma;
+ struct diu_addr pallete;
+ struct diu_addr cursor;
+};
+
/*
* List of supported video modes
*
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index e19c531..363d5e2 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -56,7 +56,6 @@ struct aoi_display_offset {
#define MFB_GET_PIXFMT_OLD 0x40014d08
#ifdef __KERNEL__
-#include <linux/spinlock.h>
/*
* These are the fields of area descriptor(in DDR memory) for every plane
@@ -154,39 +153,6 @@ struct diu {
__be32 plut;
} __attribute__ ((packed));
-struct diu_hw {
- struct diu *diu_reg;
- spinlock_t reg_lock;
-
- __u32 mode; /* DIU operation mode */
-};
-
-struct diu_addr {
- void *vaddr; /* Virtual address */
- dma_addr_t paddr; /* Physical address */
- __u32 offset;
-};
-
-struct diu_pool {
- struct diu_addr ad;
- struct diu_addr gamma;
- struct diu_addr pallete;
- struct diu_addr cursor;
-};
-
-#define FSL_DIU_BASE_OFFSET 0x2C000 /* Offset of DIU */
-#define INT_LCDC 64 /* DIU interrupt number */
-
-#define FSL_AOI_NUM 6 /* 5 AOIs and one dummy AOI */
- /* 1 for plane 0, 2 for plane 1&2 each */
-
-/* Minimum X and Y resolutions */
-#define MIN_XRES 64
-#define MIN_YRES 64
-
-/* HW cursor parameters */
-#define MAX_CURS 32
-
/* Modes of operation of DIU */
#define MFB_MODE0 0 /* DIU off */
#define MFB_MODE1 1 /* All three planes output to display */
@@ -194,18 +160,5 @@ struct diu_pool {
#define MFB_MODE3 3 /* All three planes written back to memory */
#define MFB_MODE4 4 /* Color bar generation */
-/* INT_STATUS/INT_MASK field descriptions */
-#define INT_VSYNC 0x01 /* Vsync interrupt */
-#define INT_VSYNC_WB 0x02 /* Vsync interrupt for write back operation */
-#define INT_UNDRUN 0x04 /* Under run exception interrupt */
-#define INT_PARERR 0x08 /* Display parameters error interrupt */
-#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
-
-/* Panels'operation modes */
-#define MFB_TYPE_OUTPUT 0 /* Panel output to display */
-#define MFB_TYPE_OFF 1 /* Panel off */
-#define MFB_TYPE_WB 2 /* Panel written back to memory */
-#define MFB_TYPE_TEST 3 /* Panel generate color bar */
-
#endif /* __KERNEL__ */
#endif /* __FSL_DIU_FB_H__ */
--
1.7.4.4
^ permalink raw reply related
* [PATCH 3/9] drivers/video: fsl-diu-fb: remove broken screen blanking support
From: Timur Tabi @ 2011-10-05 0:36 UTC (permalink / raw)
To: linux-fbdev
The function which is supposed to provide screen blanking support doesn't
actually do anything, so the framebuffer layer thinks the screen has
been blanked when it really isn't. Remove the code completely for now.
A side-effect of this change is that the framebuffer console blanking now
works correctly. Presumably this is because the console now receives -EINVAL
instead of '0' when it asks the driver to blank the screen, so the console
does it manually now.
A signficant refactoring of the driver is planned, and proper hardware
blanking support will added afterwards.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 38 --------------------------------------
1 files changed, 0 insertions(+), 38 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 9b3891a..4dc65c9 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -231,7 +231,6 @@ struct mfb_info {
int type;
char *id;
int registered;
- int blank;
unsigned long pseudo_palette[16];
struct diu_ad *ad;
int cursor_reset;
@@ -960,37 +959,6 @@ static int fsl_diu_pan_display(struct fb_var_screeninfo *var,
return 0;
}
-/*
- * Blank the screen if blank_mode != 0, else unblank. Return 0 if blanking
- * succeeded, != 0 if un-/blanking failed.
- * blank_mode = 2: suspend vsync
- * blank_mode = 3: suspend hsync
- * blank_mode = 4: powerdown
- */
-static int fsl_diu_blank(int blank_mode, struct fb_info *info)
-{
- struct mfb_info *mfbi = info->par;
-
- mfbi->blank = blank_mode;
-
- switch (blank_mode) {
- case FB_BLANK_VSYNC_SUSPEND:
- case FB_BLANK_HSYNC_SUSPEND:
- /* FIXME: fixes to enable_panel and enable lcdc needed */
- case FB_BLANK_NORMAL:
- /* fsl_diu_disable_panel(info);*/
- break;
- case FB_BLANK_POWERDOWN:
- /* disable_lcdc(info); */
- break;
- case FB_BLANK_UNBLANK:
- /* fsl_diu_enable_panel(info);*/
- break;
- }
-
- return 0;
-}
-
static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
unsigned long arg)
{
@@ -1137,7 +1105,6 @@ static struct fb_ops fsl_diu_ops = {
.fb_check_var = fsl_diu_check_var,
.fb_set_par = fsl_diu_set_par,
.fb_setcolreg = fsl_diu_setcolreg,
- .fb_blank = fsl_diu_blank,
.fb_pan_display = fsl_diu_pan_display,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
@@ -1232,11 +1199,6 @@ static int __devinit install_fb(struct fb_info *info)
fb_videomode_to_var(&info->var, modedb);
}
- if (mfbi->type = MFB_TYPE_OFF)
- mfbi->blank = FB_BLANK_NORMAL;
- else
- mfbi->blank = FB_BLANK_UNBLANK;
-
if (fsl_diu_check_var(&info->var, info)) {
dev_err(info->dev, "fsl_diu_check_var failed\n");
unmap_video_memory(info);
--
1.7.4.4
^ permalink raw reply related
* [PATCH 4/9] drivers/video: fsl-diu-fb: add several new video modes
From: Timur Tabi @ 2011-10-05 0:36 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1317244795-24671-4-git-send-email-timur@freescale.com>
Add the following new video modes to the Freescale DIU framebuffer driver:
640x480x60
640x480x72
640x480x75
640x480x90
640x480x100
800x480x60
800x600x60
854x480x60
1280x480x60
1280x720x60
1920x1080x60
Also add margin data to the 320x240 video mode. This mode was originally
intended only for the AOIs (overlays) used on planes two and three, but with
real margin data, it can now be used as an actual video mode.
Video mode data is from earlier work done by Jerry Huang
<Chang-Ming.Huang@freescale.com>.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 200 ++++++++++++++++++++++++++++++++++++-------
1 files changed, 167 insertions(+), 33 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 4dc65c9..29652ab 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -77,11 +77,12 @@ struct diu_pool {
/*
* List of supported video modes
*
- * The first entry is the default video mode
+ * The first entry is the default video mode. The remain entries are in
+ * order if increasing resolution and frequency. The 320x240-60 mode is
+ * the initial AOI for the second and third planes.
*/
static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
{
- .name = "1024x768-60",
.refresh = 60,
.xres = 1024,
.yres = 768,
@@ -96,7 +97,132 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "1024x768-70",
+ .refresh = 60,
+ .xres = 320,
+ .yres = 240,
+ .pixclock = 79440,
+ .left_margin = 16,
+ .right_margin = 16,
+ .upper_margin = 16,
+ .lower_margin = 5,
+ .hsync_len = 48,
+ .vsync_len = 1,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 60,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 39722,
+ .left_margin = 48,
+ .right_margin = 16,
+ .upper_margin = 33,
+ .lower_margin = 10,
+ .hsync_len = 96,
+ .vsync_len = 2,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 72,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 32052,
+ .left_margin = 128,
+ .right_margin = 24,
+ .upper_margin = 28,
+ .lower_margin = 9,
+ .hsync_len = 40,
+ .vsync_len = 3,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 75,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 31747,
+ .left_margin = 120,
+ .right_margin = 16,
+ .upper_margin = 16,
+ .lower_margin = 1,
+ .hsync_len = 64,
+ .vsync_len = 3,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 90,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 25057,
+ .left_margin = 120,
+ .right_margin = 32,
+ .upper_margin = 14,
+ .lower_margin = 25,
+ .hsync_len = 40,
+ .vsync_len = 14,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 100,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 22272,
+ .left_margin = 48,
+ .right_margin = 32,
+ .upper_margin = 17,
+ .lower_margin = 22,
+ .hsync_len = 128,
+ .vsync_len = 12,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 60,
+ .xres = 800,
+ .yres = 480,
+ .pixclock = 33805,
+ .left_margin = 96,
+ .right_margin = 24,
+ .upper_margin = 10,
+ .lower_margin = 3,
+ .hsync_len = 72,
+ .vsync_len = 7,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 60,
+ .xres = 800,
+ .yres = 600,
+ .pixclock = 25000,
+ .left_margin = 88,
+ .right_margin = 40,
+ .upper_margin = 23,
+ .lower_margin = 1,
+ .hsync_len = 128,
+ .vsync_len = 4,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 60,
+ .xres = 854,
+ .yres = 480,
+ .pixclock = 31518,
+ .left_margin = 104,
+ .right_margin = 16,
+ .upper_margin = 13,
+ .lower_margin = 1,
+ .hsync_len = 88,
+ .vsync_len = 3,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
.refresh = 70,
.xres = 1024,
.yres = 768,
@@ -111,7 +237,6 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "1024x768-75",
.refresh = 75,
.xres = 1024,
.yres = 768,
@@ -126,7 +251,34 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "1280x1024-60",
+ .refresh = 60,
+ .xres = 1280,
+ .yres = 480,
+ .pixclock = 18939,
+ .left_margin = 353,
+ .right_margin = 47,
+ .upper_margin = 39,
+ .lower_margin = 4,
+ .hsync_len = 8,
+ .vsync_len = 2,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 60,
+ .xres = 1280,
+ .yres = 720,
+ .pixclock = 13426,
+ .left_margin = 192,
+ .right_margin = 64,
+ .upper_margin = 22,
+ .lower_margin = 1,
+ .hsync_len = 136,
+ .vsync_len = 3,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
.refresh = 60,
.xres = 1280,
.yres = 1024,
@@ -141,7 +293,6 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "1280x1024-70",
.refresh = 70,
.xres = 1280,
.yres = 1024,
@@ -156,7 +307,6 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "1280x1024-75",
.refresh = 75,
.xres = 1280,
.yres = 1024,
@@ -171,38 +321,22 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "320x240", /* for AOI only */
.refresh = 60,
- .xres = 320,
- .yres = 240,
- .pixclock = 15385,
- .left_margin = 0,
- .right_margin = 0,
- .upper_margin = 0,
- .lower_margin = 0,
- .hsync_len = 0,
- .vsync_len = 0,
- .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- .vmode = FB_VMODE_NONINTERLACED
- },
- {
- .name = "1280x480-60",
- .refresh = 60,
- .xres = 1280,
- .yres = 480,
- .pixclock = 18939,
- .left_margin = 353,
- .right_margin = 47,
- .upper_margin = 39,
- .lower_margin = 4,
- .hsync_len = 8,
- .vsync_len = 2,
+ .xres = 1920,
+ .yres = 1080,
+ .pixclock = 5787,
+ .left_margin = 328,
+ .right_margin = 120,
+ .upper_margin = 34,
+ .lower_margin = 1,
+ .hsync_len = 208,
+ .vsync_len = 3,
.sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
.vmode = FB_VMODE_NONINTERLACED
},
};
-static char *fb_mode = "1024x768-32@60";
+static char *fb_mode;
static unsigned long default_bpp = 32;
static enum fsl_diu_monitor_port monitor_port;
static char *monitor_string;
--
1.7.4.4
^ permalink raw reply related
* [PATCH 5/9] drivers/video: fsl-diu-fb: use an enum for the AOI index
From: Timur Tabi @ 2011-10-05 0:36 UTC (permalink / raw)
To: linux-fbdev
Each of the five AOIs created by the DIU driver has a special purpose, and
they're not treated equally. It makes sense to identify them with an enum
instead of a hard-coded number.
Since the 'index' is now an enum, it can only contain allowed values, so
there's no need to check for an invalid value. This simplifies some other
code, such as fsl_diu_disable_panel(), which no longer needs to return an
error code.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 94 +++++++++++++++++++++----------------------
1 files changed, 46 insertions(+), 48 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 29652ab..c5f9731 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -360,8 +360,16 @@ struct fsl_diu_data {
enum fsl_diu_monitor_port monitor_port;
};
+enum mfb_index {
+ PLANE0 = 0, /* Plane 0, only one AOI that fills the screen */
+ PLANE1_AOI0, /* Plane 1, first AOI */
+ PLANE1_AOI1, /* Plane 1, second AOI */
+ PLANE2_AOI0, /* Plane 2, first AOI */
+ PLANE2_AOI1, /* Plane 2, second AOI */
+};
+
struct mfb_info {
- int index;
+ enum mfb_index index;
int type;
char *id;
int registered;
@@ -378,8 +386,8 @@ struct mfb_info {
static struct mfb_info mfb_template[] = {
- { /* AOI 0 for plane 0 */
- .index = 0,
+ {
+ .index = PLANE0,
.type = MFB_TYPE_OUTPUT,
.id = "Panel0",
.registered = 0,
@@ -387,8 +395,8 @@ static struct mfb_info mfb_template[] = {
.x_aoi_d = 0,
.y_aoi_d = 0,
},
- { /* AOI 0 for plane 1 */
- .index = 1,
+ {
+ .index = PLANE1_AOI0,
.type = MFB_TYPE_OUTPUT,
.id = "Panel1 AOI0",
.registered = 0,
@@ -397,8 +405,8 @@ static struct mfb_info mfb_template[] = {
.x_aoi_d = 0,
.y_aoi_d = 0,
},
- { /* AOI 1 for plane 1 */
- .index = 2,
+ {
+ .index = PLANE1_AOI1,
.type = MFB_TYPE_OUTPUT,
.id = "Panel1 AOI1",
.registered = 0,
@@ -407,8 +415,8 @@ static struct mfb_info mfb_template[] = {
.x_aoi_d = 0,
.y_aoi_d = 480,
},
- { /* AOI 0 for plane 2 */
- .index = 3,
+ {
+ .index = PLANE2_AOI0,
.type = MFB_TYPE_OUTPUT,
.id = "Panel2 AOI0",
.registered = 0,
@@ -417,8 +425,8 @@ static struct mfb_info mfb_template[] = {
.x_aoi_d = 640,
.y_aoi_d = 0,
},
- { /* AOI 1 for plane 2 */
- .index = 4,
+ {
+ .index = PLANE2_AOI1,
.type = MFB_TYPE_OUTPUT,
.id = "Panel2 AOI1",
.registered = 0,
@@ -519,11 +527,11 @@ static int fsl_diu_enable_panel(struct fb_info *info)
if (mfbi->type != MFB_TYPE_OFF) {
switch (mfbi->index) {
- case 0: /* plane 0 */
+ case PLANE0:
if (hw->desc[0] != ad->paddr)
wr_reg_wa(&hw->desc[0], ad->paddr);
break;
- case 1: /* plane 1 AOI 0 */
+ case PLANE1_AOI0:
cmfbi = machine_data->fsl_diu_info[2]->par;
if (hw->desc[1] != ad->paddr) { /* AOI0 closed */
if (cmfbi->count > 0) /* AOI1 open */
@@ -534,7 +542,7 @@ static int fsl_diu_enable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[1], ad->paddr);
}
break;
- case 3: /* plane 2 AOI 0 */
+ case PLANE2_AOI0:
cmfbi = machine_data->fsl_diu_info[4]->par;
if (hw->desc[2] != ad->paddr) { /* AOI0 closed */
if (cmfbi->count > 0) /* AOI1 open */
@@ -545,7 +553,7 @@ static int fsl_diu_enable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[2], ad->paddr);
}
break;
- case 2: /* plane 1 AOI 1 */
+ case PLANE1_AOI1:
pmfbi = machine_data->fsl_diu_info[1]->par;
ad->next_ad = 0;
if (hw->desc[1] = machine_data->dummy_ad->paddr)
@@ -553,7 +561,7 @@ static int fsl_diu_enable_panel(struct fb_info *info)
else /* AOI0 open */
pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
break;
- case 4: /* plane 2 AOI 1 */
+ case PLANE2_AOI1:
pmfbi = machine_data->fsl_diu_info[3]->par;
ad->next_ad = 0;
if (hw->desc[2] = machine_data->dummy_ad->paddr)
@@ -561,29 +569,25 @@ static int fsl_diu_enable_panel(struct fb_info *info)
else /* AOI0 was open */
pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
break;
- default:
- res = -EINVAL;
- break;
}
} else
res = -EINVAL;
return res;
}
-static int fsl_diu_disable_panel(struct fb_info *info)
+static void fsl_diu_disable_panel(struct fb_info *info)
{
struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
struct diu *hw = dr.diu_reg;
struct diu_ad *ad = mfbi->ad;
struct fsl_diu_data *machine_data = mfbi->parent;
- int res = 0;
switch (mfbi->index) {
- case 0: /* plane 0 */
+ case PLANE0:
if (hw->desc[0] != machine_data->dummy_ad->paddr)
wr_reg_wa(&hw->desc[0], machine_data->dummy_ad->paddr);
break;
- case 1: /* plane 1 AOI 0 */
+ case PLANE1_AOI0:
cmfbi = machine_data->fsl_diu_info[2]->par;
if (cmfbi->count > 0) /* AOI1 is open */
wr_reg_wa(&hw->desc[1], cmfbi->ad->paddr);
@@ -592,7 +596,7 @@ static int fsl_diu_disable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[1], machine_data->dummy_ad->paddr);
/* close AOI 0 */
break;
- case 3: /* plane 2 AOI 0 */
+ case PLANE2_AOI0:
cmfbi = machine_data->fsl_diu_info[4]->par;
if (cmfbi->count > 0) /* AOI1 is open */
wr_reg_wa(&hw->desc[2], cmfbi->ad->paddr);
@@ -601,7 +605,7 @@ static int fsl_diu_disable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[2], machine_data->dummy_ad->paddr);
/* close AOI 0 */
break;
- case 2: /* plane 1 AOI 1 */
+ case PLANE1_AOI1:
pmfbi = machine_data->fsl_diu_info[1]->par;
if (hw->desc[1] != ad->paddr) {
/* AOI1 is not the first in the chain */
@@ -612,7 +616,7 @@ static int fsl_diu_disable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[1], machine_data->dummy_ad->paddr);
/* close AOI 1 */
break;
- case 4: /* plane 2 AOI 1 */
+ case PLANE2_AOI1:
pmfbi = machine_data->fsl_diu_info[3]->par;
if (hw->desc[2] != ad->paddr) {
/* AOI1 is not the first in the chain */
@@ -623,12 +627,7 @@ static int fsl_diu_disable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[2], machine_data->dummy_ad->paddr);
/* close AOI 1 */
break;
- default:
- res = -EINVAL;
- break;
}
-
- return res;
}
static void enable_lcdc(struct fb_info *info)
@@ -660,7 +659,8 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var,
{
struct mfb_info *lower_aoi_mfbi, *upper_aoi_mfbi, *mfbi = info->par;
struct fsl_diu_data *machine_data = mfbi->parent;
- int available_height, upper_aoi_bottom, index = mfbi->index;
+ int available_height, upper_aoi_bottom;
+ enum mfb_index index = mfbi->index;
int lower_aoi_is_open, upper_aoi_is_open;
__u32 base_plane_width, base_plane_height, upper_aoi_height;
@@ -672,14 +672,14 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var,
if (mfbi->y_aoi_d < 0)
mfbi->y_aoi_d = 0;
switch (index) {
- case 0:
+ case PLANE0:
if (mfbi->x_aoi_d != 0)
mfbi->x_aoi_d = 0;
if (mfbi->y_aoi_d != 0)
mfbi->y_aoi_d = 0;
break;
- case 1: /* AOI 0 */
- case 3:
+ case PLANE1_AOI0:
+ case PLANE2_AOI0:
lower_aoi_mfbi = machine_data->fsl_diu_info[index+1]->par;
lower_aoi_is_open = lower_aoi_mfbi->count > 0 ? 1 : 0;
if (var->xres > base_plane_width)
@@ -696,8 +696,8 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var,
if ((mfbi->y_aoi_d + var->yres) > available_height)
mfbi->y_aoi_d = available_height - var->yres;
break;
- case 2: /* AOI 1 */
- case 4:
+ case PLANE1_AOI1:
+ case PLANE2_AOI1:
upper_aoi_mfbi = machine_data->fsl_diu_info[index-1]->par;
upper_aoi_height machine_data->fsl_diu_info[index-1]->var.yres;
@@ -1002,7 +1002,7 @@ static int fsl_diu_set_par(struct fb_info *info)
ad->ckmin_g = 255;
ad->ckmin_b = 255;
- if (mfbi->index = 0)
+ if (mfbi->index = PLANE0)
update_lcdc(info);
return 0;
}
@@ -1195,7 +1195,7 @@ static int fsl_diu_open(struct fb_info *info, int user)
int res = 0;
/* free boot splash memory on first /dev/fb0 open */
- if (!mfbi->index && diu_ops.release_bootmem)
+ if ((mfbi->index = PLANE0) && diu_ops.release_bootmem)
diu_ops.release_bootmem();
spin_lock(&diu_lock);
@@ -1225,11 +1225,9 @@ static int fsl_diu_release(struct fb_info *info, int user)
spin_lock(&diu_lock);
mfbi->count--;
- if (mfbi->count = 0) {
- res = fsl_diu_disable_panel(info);
- if (res < 0)
- mfbi->count++;
- }
+ if (mfbi->count = 0)
+ fsl_diu_disable_panel(info);
+
spin_unlock(&diu_lock);
return res;
}
@@ -1275,7 +1273,7 @@ static int __devinit install_fb(struct fb_info *info)
if (init_fbinfo(info))
return -EINVAL;
- if (mfbi->index = 0) { /* plane 0 */
+ if (mfbi->index = PLANE0) {
if (mfbi->edid_data) {
/* Now build modedb from EDID */
fb_edid_to_monspecs(mfbi->edid_data, &info->monspecs);
@@ -1296,7 +1294,7 @@ static int __devinit install_fb(struct fb_info *info)
* For plane 0 we continue and look into
* driver's internal modedb.
*/
- if (mfbi->index = 0 && mfbi->edid_data)
+ if ((mfbi->index = PLANE0) && mfbi->edid_data)
has_default_mode = 0;
else
return -EINVAL;
@@ -1360,7 +1358,7 @@ static void uninstall_fb(struct fb_info *info)
if (!mfbi->registered)
return;
- if (mfbi->index = 0)
+ if (mfbi->index = PLANE0)
kfree(mfbi->edid_data);
unregister_framebuffer(info);
@@ -1565,7 +1563,7 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
memcpy(mfbi, &mfb_template[i], sizeof(struct mfb_info));
mfbi->parent = machine_data;
- if (mfbi->index = 0) {
+ if (mfbi->index = PLANE0) {
const u8 *prop;
int len;
--
1.7.4.4
^ permalink raw reply related
* [PATCH 6/9] drivers/video: fsl-diu-fb: remove unused panel operating mode support
From: Timur Tabi @ 2011-10-05 0:36 UTC (permalink / raw)
To: linux-fbdev
The MFB_TYPE_xxx macros indicate different "operating modes" of each AOI,
but this feature is not actually used in the driver. The mfb_index.type
field is always set to MFB_TYPE_OUTPUT, so just delete it and any code
that references it.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 117 +++++++++++++++++--------------------------
1 files changed, 46 insertions(+), 71 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index c5f9731..0fd4c784 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -49,12 +49,6 @@
#define INT_PARERR 0x08 /* Display parameters error interrupt */
#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
-/* Panels'operation modes */
-#define MFB_TYPE_OUTPUT 0 /* Panel output to display */
-#define MFB_TYPE_OFF 1 /* Panel off */
-#define MFB_TYPE_WB 2 /* Panel written back to memory */
-#define MFB_TYPE_TEST 3 /* Panel generate color bar */
-
struct diu_hw {
struct diu __iomem *diu_reg;
spinlock_t reg_lock;
@@ -370,7 +364,6 @@ enum mfb_index {
struct mfb_info {
enum mfb_index index;
- int type;
char *id;
int registered;
unsigned long pseudo_palette[16];
@@ -388,7 +381,6 @@ struct mfb_info {
static struct mfb_info mfb_template[] = {
{
.index = PLANE0,
- .type = MFB_TYPE_OUTPUT,
.id = "Panel0",
.registered = 0,
.count = 0,
@@ -397,7 +389,6 @@ static struct mfb_info mfb_template[] = {
},
{
.index = PLANE1_AOI0,
- .type = MFB_TYPE_OUTPUT,
.id = "Panel1 AOI0",
.registered = 0,
.g_alpha = 0xff,
@@ -407,7 +398,6 @@ static struct mfb_info mfb_template[] = {
},
{
.index = PLANE1_AOI1,
- .type = MFB_TYPE_OUTPUT,
.id = "Panel1 AOI1",
.registered = 0,
.g_alpha = 0xff,
@@ -417,7 +407,6 @@ static struct mfb_info mfb_template[] = {
},
{
.index = PLANE2_AOI0,
- .type = MFB_TYPE_OUTPUT,
.id = "Panel2 AOI0",
.registered = 0,
.g_alpha = 0xff,
@@ -427,7 +416,6 @@ static struct mfb_info mfb_template[] = {
},
{
.index = PLANE2_AOI1,
- .type = MFB_TYPE_OUTPUT,
.id = "Panel2 AOI1",
.registered = 0,
.g_alpha = 0xff,
@@ -517,62 +505,57 @@ void wr_reg_wa(u32 *reg, u32 val)
} while (in_be32(reg) != val);
}
-static int fsl_diu_enable_panel(struct fb_info *info)
+static void fsl_diu_enable_panel(struct fb_info *info)
{
struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
struct diu *hw = dr.diu_reg;
struct diu_ad *ad = mfbi->ad;
struct fsl_diu_data *machine_data = mfbi->parent;
- int res = 0;
- if (mfbi->type != MFB_TYPE_OFF) {
- switch (mfbi->index) {
- case PLANE0:
- if (hw->desc[0] != ad->paddr)
- wr_reg_wa(&hw->desc[0], ad->paddr);
- break;
- case PLANE1_AOI0:
- cmfbi = machine_data->fsl_diu_info[2]->par;
- if (hw->desc[1] != ad->paddr) { /* AOI0 closed */
- if (cmfbi->count > 0) /* AOI1 open */
- ad->next_ad - cpu_to_le32(cmfbi->ad->paddr);
- else
- ad->next_ad = 0;
- wr_reg_wa(&hw->desc[1], ad->paddr);
- }
- break;
- case PLANE2_AOI0:
- cmfbi = machine_data->fsl_diu_info[4]->par;
- if (hw->desc[2] != ad->paddr) { /* AOI0 closed */
- if (cmfbi->count > 0) /* AOI1 open */
- ad->next_ad - cpu_to_le32(cmfbi->ad->paddr);
- else
- ad->next_ad = 0;
- wr_reg_wa(&hw->desc[2], ad->paddr);
- }
- break;
- case PLANE1_AOI1:
- pmfbi = machine_data->fsl_diu_info[1]->par;
- ad->next_ad = 0;
- if (hw->desc[1] = machine_data->dummy_ad->paddr)
- wr_reg_wa(&hw->desc[1], ad->paddr);
- else /* AOI0 open */
- pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
- break;
- case PLANE2_AOI1:
- pmfbi = machine_data->fsl_diu_info[3]->par;
- ad->next_ad = 0;
- if (hw->desc[2] = machine_data->dummy_ad->paddr)
- wr_reg_wa(&hw->desc[2], ad->paddr);
- else /* AOI0 was open */
- pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
- break;
+ switch (mfbi->index) {
+ case PLANE0:
+ if (hw->desc[0] != ad->paddr)
+ wr_reg_wa(&hw->desc[0], ad->paddr);
+ break;
+ case PLANE1_AOI0:
+ cmfbi = machine_data->fsl_diu_info[2]->par;
+ if (hw->desc[1] != ad->paddr) { /* AOI0 closed */
+ if (cmfbi->count > 0) /* AOI1 open */
+ ad->next_ad + cpu_to_le32(cmfbi->ad->paddr);
+ else
+ ad->next_ad = 0;
+ wr_reg_wa(&hw->desc[1], ad->paddr);
}
- } else
- res = -EINVAL;
- return res;
+ break;
+ case PLANE2_AOI0:
+ cmfbi = machine_data->fsl_diu_info[4]->par;
+ if (hw->desc[2] != ad->paddr) { /* AOI0 closed */
+ if (cmfbi->count > 0) /* AOI1 open */
+ ad->next_ad + cpu_to_le32(cmfbi->ad->paddr);
+ else
+ ad->next_ad = 0;
+ wr_reg_wa(&hw->desc[2], ad->paddr);
+ }
+ break;
+ case PLANE1_AOI1:
+ pmfbi = machine_data->fsl_diu_info[1]->par;
+ ad->next_ad = 0;
+ if (hw->desc[1] = machine_data->dummy_ad->paddr)
+ wr_reg_wa(&hw->desc[1], ad->paddr);
+ else /* AOI0 open */
+ pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
+ break;
+ case PLANE2_AOI1:
+ pmfbi = machine_data->fsl_diu_info[3]->par;
+ ad->next_ad = 0;
+ if (hw->desc[2] = machine_data->dummy_ad->paddr)
+ wr_reg_wa(&hw->desc[2], ad->paddr);
+ else /* AOI0 was open */
+ pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
+ break;
+ }
}
static void fsl_diu_disable_panel(struct fb_info *info)
@@ -849,11 +832,6 @@ static void update_lcdc(struct fb_info *info)
hw = dr.diu_reg;
- if (mfbi->type = MFB_TYPE_OFF) {
- fsl_diu_disable_panel(info);
- return;
- }
-
diu_ops.set_monitor_port(machine_data->monitor_port);
gamma_table_base = pool.gamma.vaddr;
cursor_base = pool.cursor.vaddr;
@@ -1205,11 +1183,8 @@ static int fsl_diu_open(struct fb_info *info, int user)
res = fsl_diu_set_par(info);
if (res < 0)
mfbi->count--;
- else {
- res = fsl_diu_enable_panel(info);
- if (res < 0)
- mfbi->count--;
- }
+ else
+ fsl_diu_enable_panel(info);
}
spin_unlock(&diu_lock);
--
1.7.4.4
^ permalink raw reply related
* [PATCH 7/9] drivers/video: fsl-diu-fb: only DIU modes 0 and 1 are supported
From: Timur Tabi @ 2011-10-05 0:36 UTC (permalink / raw)
To: linux-fbdev
The Freescale DIU video controller supports five video "modes", but only
the first two are used by the driver. The other three are special modes
that don't make sense for a framebuffer driver. Therefore, there's no
point in keeping a global variable that indicates which mode we're
supposed to use.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
arch/powerpc/platforms/512x/mpc512x_shared.c | 2 +-
drivers/video/fsl-diu-fb.c | 11 +++--------
include/linux/fsl-diu-fb.h | 8 ++++----
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index 3dc62f9..cfe958e 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -253,7 +253,7 @@ void __init mpc512x_init_diu(void)
}
mode = in_be32(&diu_reg->diu_mode);
- if (mode != MFB_MODE1) {
+ if (mode = MFB_MODE0) {
pr_info("%s: DIU OFF\n", __func__);
goto out;
}
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 0fd4c784..6539e70 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -52,7 +52,6 @@
struct diu_hw {
struct diu __iomem *diu_reg;
spinlock_t reg_lock;
- unsigned int mode; /* DIU operation mode */
};
struct diu_addr {
@@ -426,7 +425,6 @@ static struct mfb_info mfb_template[] = {
};
static struct diu_hw dr = {
- .mode = MFB_MODE1,
.reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock),
};
@@ -620,7 +618,7 @@ static void enable_lcdc(struct fb_info *info)
struct fsl_diu_data *machine_data = mfbi->parent;
if (!machine_data->fb_enabled) {
- out_be32(&hw->diu_mode, dr.mode);
+ out_be32(&hw->diu_mode, MFB_MODE1);
machine_data->fb_enabled++;
}
}
@@ -1390,9 +1388,6 @@ static int request_irq_local(int irq)
ints |= INT_VSYNC;
#endif
- if (dr.mode = MFB_MODE2 || dr.mode = MFB_MODE3)
- ints |= INT_VSYNC_WB;
-
/* Read to clear the status */
in_be32(&hw->int_status);
out_be32(&hw->int_mask, ints);
@@ -1558,7 +1553,7 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
}
diu_mode = in_be32(&dr.diu_reg->diu_mode);
- if (diu_mode != MFB_MODE1)
+ if (diu_mode = MFB_MODE0)
out_be32(&dr.diu_reg->diu_mode, 0); /* disable DIU */
/* Get the IRQ of the DIU */
@@ -1611,7 +1606,7 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
* Let DIU display splash screen if it was pre-initialized
* by the bootloader, set dummy area descriptor otherwise.
*/
- if (diu_mode != MFB_MODE1)
+ if (diu_mode = MFB_MODE0)
out_be32(&dr.diu_reg->desc[0], machine_data->dummy_ad->paddr);
out_be32(&dr.diu_reg->desc[1], machine_data->dummy_ad->paddr);
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index 363d5e2..11c16a1 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -153,12 +153,12 @@ struct diu {
__be32 plut;
} __attribute__ ((packed));
-/* Modes of operation of DIU */
+/*
+ * Modes of operation of DIU. The DIU supports five different modes, but
+ * the driver only supports modes 0 and 1.
+ */
#define MFB_MODE0 0 /* DIU off */
#define MFB_MODE1 1 /* All three planes output to display */
-#define MFB_MODE2 2 /* Plane 1 to display, planes 2+3 written back*/
-#define MFB_MODE3 3 /* All three planes written back to memory */
-#define MFB_MODE4 4 /* Color bar generation */
#endif /* __KERNEL__ */
#endif /* __FSL_DIU_FB_H__ */
--
1.7.4.4
^ permalink raw reply related
* [PATCH 8/9] [v2] drivers/video: fsl-diu-fb: merge diu_hw into fsl_diu_data
From: Timur Tabi @ 2011-10-05 0:36 UTC (permalink / raw)
To: linux-fbdev
The diu_hw structure contains two fields used to access the DIU registers,
but the only instance of this structure is a global variable, 'dr'.
Eliminate 'dr' by merging its fields into the fsl_diu_data structure,
which is instantiated on the heap for each DIU controller found.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 69 +++++++++++++++++++------------------------
1 files changed, 31 insertions(+), 38 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 6539e70..f9a95ab 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -49,11 +49,6 @@
#define INT_PARERR 0x08 /* Display parameters error interrupt */
#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
-struct diu_hw {
- struct diu __iomem *diu_reg;
- spinlock_t reg_lock;
-};
-
struct diu_addr {
void *vaddr; /* Virtual address */
dma_addr_t paddr; /* Physical address */
@@ -351,6 +346,8 @@ struct fsl_diu_data {
unsigned int irq;
int fb_enabled;
enum fsl_diu_monitor_port monitor_port;
+ struct diu __iomem *diu_reg;
+ spinlock_t reg_lock;
};
enum mfb_index {
@@ -424,10 +421,6 @@ static struct mfb_info mfb_template[] = {
},
};
-static struct diu_hw dr = {
- .reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock),
-};
-
static struct diu_pool pool;
/**
@@ -506,9 +499,9 @@ void wr_reg_wa(u32 *reg, u32 val)
static void fsl_diu_enable_panel(struct fb_info *info)
{
struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
- struct diu *hw = dr.diu_reg;
struct diu_ad *ad = mfbi->ad;
struct fsl_diu_data *machine_data = mfbi->parent;
+ struct diu __iomem *hw = machine_data->diu_reg;
switch (mfbi->index) {
case PLANE0:
@@ -559,9 +552,9 @@ static void fsl_diu_enable_panel(struct fb_info *info)
static void fsl_diu_disable_panel(struct fb_info *info)
{
struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
- struct diu *hw = dr.diu_reg;
struct diu_ad *ad = mfbi->ad;
struct fsl_diu_data *machine_data = mfbi->parent;
+ struct diu __iomem *hw = machine_data->diu_reg;
switch (mfbi->index) {
case PLANE0:
@@ -613,9 +606,9 @@ static void fsl_diu_disable_panel(struct fb_info *info)
static void enable_lcdc(struct fb_info *info)
{
- struct diu *hw = dr.diu_reg;
struct mfb_info *mfbi = info->par;
struct fsl_diu_data *machine_data = mfbi->parent;
+ struct diu __iomem *hw = machine_data->diu_reg;
if (!machine_data->fb_enabled) {
out_be32(&hw->diu_mode, MFB_MODE1);
@@ -625,9 +618,9 @@ static void enable_lcdc(struct fb_info *info)
static void disable_lcdc(struct fb_info *info)
{
- struct diu *hw = dr.diu_reg;
struct mfb_info *mfbi = info->par;
struct fsl_diu_data *machine_data = mfbi->parent;
+ struct diu __iomem *hw = machine_data->diu_reg;
if (machine_data->fb_enabled) {
out_be32(&hw->diu_mode, 0);
@@ -822,13 +815,13 @@ static void update_lcdc(struct fb_info *info)
struct fb_var_screeninfo *var = &info->var;
struct mfb_info *mfbi = info->par;
struct fsl_diu_data *machine_data = mfbi->parent;
- struct diu *hw;
+ struct diu __iomem *hw;
int i, j;
char __iomem *cursor_base, *gamma_table_base;
u32 temp;
- hw = dr.diu_reg;
+ hw = machine_data->diu_reg;
diu_ops.set_monitor_port(machine_data->monitor_port);
gamma_table_base = pool.gamma.vaddr;
@@ -939,9 +932,9 @@ static int fsl_diu_set_par(struct fb_info *info)
struct mfb_info *mfbi = info->par;
struct fsl_diu_data *machine_data = mfbi->parent;
struct diu_ad *ad = mfbi->ad;
- struct diu *hw;
+ struct diu __iomem *hw;
- hw = dr.diu_reg;
+ hw = machine_data->diu_reg;
set_fix(info);
mfbi->cursor_reset = 1;
@@ -1344,7 +1337,7 @@ static void uninstall_fb(struct fb_info *info)
static irqreturn_t fsl_diu_isr(int irq, void *dev_id)
{
- struct diu *hw = dr.diu_reg;
+ struct diu __iomem *hw = dev_id;
unsigned int status = in_be32(&hw->int_status);
if (status) {
@@ -1370,18 +1363,16 @@ static irqreturn_t fsl_diu_isr(int irq, void *dev_id)
return IRQ_NONE;
}
-static int request_irq_local(int irq)
+static int request_irq_local(struct fsl_diu_data *machine_data)
{
+ struct diu __iomem *hw = machine_data->diu_reg;
u32 ints;
- struct diu *hw;
int ret;
- hw = dr.diu_reg;
-
/* Read to clear the status */
in_be32(&hw->int_status);
- ret = request_irq(irq, fsl_diu_isr, 0, "fsl-diu-fb", NULL);
+ ret = request_irq(machine_data->irq, fsl_diu_isr, 0, "fsl-diu-fb", hw);
if (!ret) {
ints = INT_PARERR | INT_LS_BF_VS;
#if !defined(CONFIG_NOT_COHERENT_CACHE)
@@ -1396,14 +1387,14 @@ static int request_irq_local(int irq)
return ret;
}
-static void free_irq_local(int irq)
+static void free_irq_local(struct fsl_diu_data *machine_data)
{
- struct diu *hw = dr.diu_reg;
+ struct diu __iomem *hw = machine_data->diu_reg;
/* Disable all LCDC interrupt */
out_be32(&hw->int_mask, 0x1f);
- free_irq(irq, NULL);
+ free_irq(machine_data->irq, NULL);
}
#ifdef CONFIG_PM
@@ -1521,6 +1512,8 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
if (!machine_data)
return -ENOMEM;
+ spin_lock_init(&machine_data->reg_lock);
+
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++) {
machine_data->fsl_diu_info[i] framebuffer_alloc(sizeof(struct mfb_info), &pdev->dev);
@@ -1545,16 +1538,16 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
}
}
- dr.diu_reg = of_iomap(np, 0);
- if (!dr.diu_reg) {
+ machine_data->diu_reg = of_iomap(np, 0);
+ if (!machine_data->diu_reg) {
dev_err(&pdev->dev, "cannot map DIU registers\n");
ret = -EFAULT;
goto error2;
}
- diu_mode = in_be32(&dr.diu_reg->diu_mode);
+ diu_mode = in_be32(&machine_data->diu_reg->diu_mode);
if (diu_mode = MFB_MODE0)
- out_be32(&dr.diu_reg->diu_mode, 0); /* disable DIU */
+ out_be32(&machine_data->diu_reg->diu_mode, 0); /* disable DIU */
/* Get the IRQ of the DIU */
machine_data->irq = irq_of_parse_and_map(np, 0);
@@ -1607,10 +1600,11 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
* by the bootloader, set dummy area descriptor otherwise.
*/
if (diu_mode = MFB_MODE0)
- out_be32(&dr.diu_reg->desc[0], machine_data->dummy_ad->paddr);
+ out_be32(&machine_data->diu_reg->desc[0],
+ machine_data->dummy_ad->paddr);
- out_be32(&dr.diu_reg->desc[1], machine_data->dummy_ad->paddr);
- out_be32(&dr.diu_reg->desc[2], machine_data->dummy_ad->paddr);
+ out_be32(&machine_data->diu_reg->desc[1], machine_data->dummy_ad->paddr);
+ out_be32(&machine_data->diu_reg->desc[2], machine_data->dummy_ad->paddr);
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++) {
machine_data->fsl_diu_info[i]->fix.smem_start = 0;
@@ -1625,7 +1619,7 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
}
}
- if (request_irq_local(machine_data->irq)) {
+ if (request_irq_local(machine_data)) {
dev_err(&pdev->dev, "could not claim irq\n");
goto error;
}
@@ -1659,7 +1653,7 @@ error:
32);
if (machine_data->dummy_aoi_virt)
fsl_diu_free(machine_data->dummy_aoi_virt, 64);
- iounmap(dr.diu_reg);
+ iounmap(machine_data->diu_reg);
error2:
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
@@ -1677,7 +1671,7 @@ static int fsl_diu_remove(struct platform_device *pdev)
machine_data = dev_get_drvdata(&pdev->dev);
disable_lcdc(machine_data->fsl_diu_info[0]);
- free_irq_local(machine_data->irq);
+ free_irq_local(machine_data);
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
uninstall_fb(machine_data->fsl_diu_info[i]);
if (pool.ad.vaddr)
@@ -1689,7 +1683,7 @@ static int fsl_diu_remove(struct platform_device *pdev)
free_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2, 32);
if (machine_data->dummy_aoi_virt)
fsl_diu_free(machine_data->dummy_aoi_virt, 64);
- iounmap(dr.diu_reg);
+ iounmap(machine_data->diu_reg);
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
if (machine_data->fsl_diu_info[i])
framebuffer_release(machine_data->fsl_diu_info[i]);
@@ -1812,7 +1806,6 @@ static int __init fsl_diu_init(void)
#if defined(CONFIG_NOT_COHERENT_CACHE)
vfree(coherence_data);
#endif
- iounmap(dr.diu_reg);
}
return ret;
}
--
1.7.4.4
^ permalink raw reply related
* [PATCH 9/9] drivers/video: fsl-diu-fb: merge diu_pool into fsl_diu_data
From: Timur Tabi @ 2011-10-05 0:36 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1317244795-24671-9-git-send-email-timur@freescale.com>
The diu_pool structure contains diu_addr objects for various objects
allocated in DMA space that are used by the DIU, but the only instance
of this structure is a global variable, 'pool'. Eliminate 'pool' by
merging its fields into the fsl_diu_data structure, which is instantiated
on the heap for each DIU controller found.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 73 +++++++++++++++++++++----------------------
1 files changed, 36 insertions(+), 37 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index f9a95ab..3a5f547 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -55,13 +55,6 @@ struct diu_addr {
__u32 offset;
};
-struct diu_pool {
- struct diu_addr ad;
- struct diu_addr gamma;
- struct diu_addr pallete;
- struct diu_addr cursor;
-};
-
/*
* List of supported video modes
*
@@ -348,6 +341,11 @@ struct fsl_diu_data {
enum fsl_diu_monitor_port monitor_port;
struct diu __iomem *diu_reg;
spinlock_t reg_lock;
+ unsigned int mode; /* DIU operation mode */
+ struct diu_addr ad;
+ struct diu_addr gamma;
+ struct diu_addr pallete;
+ struct diu_addr cursor;
};
enum mfb_index {
@@ -421,8 +419,6 @@ static struct mfb_info mfb_template[] = {
},
};
-static struct diu_pool pool;
-
/**
* fsl_diu_name_to_port - convert a port name to a monitor port enum
*
@@ -824,22 +820,23 @@ static void update_lcdc(struct fb_info *info)
hw = machine_data->diu_reg;
diu_ops.set_monitor_port(machine_data->monitor_port);
- gamma_table_base = pool.gamma.vaddr;
- cursor_base = pool.cursor.vaddr;
+ gamma_table_base = machine_data->gamma.vaddr;
+ cursor_base = machine_data->cursor.vaddr;
/* Prep for DIU init - gamma table, cursor table */
for (i = 0; i <= 2; i++)
for (j = 0; j <= 255; j++)
*gamma_table_base++ = j;
- diu_ops.set_gamma_table(machine_data->monitor_port, pool.gamma.vaddr);
+ diu_ops.set_gamma_table(machine_data->monitor_port,
+ machine_data->gamma.vaddr);
disable_lcdc(info);
/* Program DIU registers */
- out_be32(&hw->gamma, pool.gamma.paddr);
- out_be32(&hw->cursor, pool.cursor.paddr);
+ out_be32(&hw->gamma, machine_data->gamma.paddr);
+ out_be32(&hw->cursor, machine_data->cursor.paddr);
out_be32(&hw->bgnd, 0x007F7F7F); /* BGND */
out_be32(&hw->bgnd_wb, 0); /* BGND_WB */
@@ -1560,27 +1557,27 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
machine_data->monitor_port = monitor_port;
/* Area descriptor memory pool aligns to 64-bit boundary */
- if (allocate_buf(&pdev->dev, &pool.ad,
+ if (allocate_buf(&pdev->dev, &machine_data->ad,
sizeof(struct diu_ad) * FSL_AOI_NUM, 8))
return -ENOMEM;
/* Get memory for Gamma Table - 32-byte aligned memory */
- if (allocate_buf(&pdev->dev, &pool.gamma, 768, 32)) {
+ if (allocate_buf(&pdev->dev, &machine_data->gamma, 768, 32)) {
ret = -ENOMEM;
goto error;
}
/* For performance, cursor bitmap buffer aligns to 32-byte boundary */
- if (allocate_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2,
- 32)) {
+ if (allocate_buf(&pdev->dev, &machine_data->cursor,
+ MAX_CURS * MAX_CURS * 2, 32)) {
ret = -ENOMEM;
goto error;
}
i = ARRAY_SIZE(machine_data->fsl_diu_info);
- machine_data->dummy_ad = (struct diu_ad *)
- ((u32)pool.ad.vaddr + pool.ad.offset) + i;
- machine_data->dummy_ad->paddr = pool.ad.paddr +
+ machine_data->dummy_ad = (struct diu_ad *)((u32)machine_data->ad.vaddr +
+ machine_data->ad.offset) + i;
+ machine_data->dummy_ad->paddr = machine_data->ad.paddr +
i * sizeof(struct diu_ad);
machine_data->dummy_aoi_virt = fsl_diu_alloc(64, &dummy_ad_addr);
if (!machine_data->dummy_aoi_virt) {
@@ -1609,9 +1606,10 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++) {
machine_data->fsl_diu_info[i]->fix.smem_start = 0;
mfbi = machine_data->fsl_diu_info[i]->par;
- mfbi->ad = (struct diu_ad *)((u32)pool.ad.vaddr
- + pool.ad.offset) + i;
- mfbi->ad->paddr = pool.ad.paddr + i * sizeof(struct diu_ad);
+ mfbi->ad = (struct diu_ad *)((u32)machine_data->ad.vaddr
+ + machine_data->ad.offset) + i;
+ mfbi->ad->paddr + machine_data->ad.paddr + i * sizeof(struct diu_ad);
ret = install_fb(machine_data->fsl_diu_info[i]);
if (ret) {
dev_err(&pdev->dev, "could not register fb %d\n", i);
@@ -1643,14 +1641,14 @@ error:
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
uninstall_fb(machine_data->fsl_diu_info[i]);
- if (pool.ad.vaddr)
- free_buf(&pdev->dev, &pool.ad,
+ if (machine_data->ad.vaddr)
+ free_buf(&pdev->dev, &machine_data->ad,
sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
- if (pool.gamma.vaddr)
- free_buf(&pdev->dev, &pool.gamma, 768, 32);
- if (pool.cursor.vaddr)
- free_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2,
- 32);
+ if (machine_data->gamma.vaddr)
+ free_buf(&pdev->dev, &machine_data->gamma, 768, 32);
+ if (machine_data->cursor.vaddr)
+ free_buf(&pdev->dev, &machine_data->cursor,
+ MAX_CURS * MAX_CURS * 2, 32);
if (machine_data->dummy_aoi_virt)
fsl_diu_free(machine_data->dummy_aoi_virt, 64);
iounmap(machine_data->diu_reg);
@@ -1674,13 +1672,14 @@ static int fsl_diu_remove(struct platform_device *pdev)
free_irq_local(machine_data);
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
uninstall_fb(machine_data->fsl_diu_info[i]);
- if (pool.ad.vaddr)
- free_buf(&pdev->dev, &pool.ad,
+ if (machine_data->ad.vaddr)
+ free_buf(&pdev->dev, &machine_data->ad,
sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
- if (pool.gamma.vaddr)
- free_buf(&pdev->dev, &pool.gamma, 768, 32);
- if (pool.cursor.vaddr)
- free_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2, 32);
+ if (machine_data->gamma.vaddr)
+ free_buf(&pdev->dev, &machine_data->gamma, 768, 32);
+ if (machine_data->cursor.vaddr)
+ free_buf(&pdev->dev, &machine_data->cursor,
+ MAX_CURS * MAX_CURS * 2, 32);
if (machine_data->dummy_aoi_virt)
fsl_diu_free(machine_data->dummy_aoi_virt, 64);
iounmap(machine_data->diu_reg);
--
1.7.4.4
^ permalink raw reply related
* Re: [PATCH 9/9] drivers/video: fsl-diu-fb: merge diu_pool into fsl_diu_data
From: Florian Tobias Schandinat @ 2011-10-05 1:28 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1317244795-24671-9-git-send-email-timur@freescale.com>
On 10/05/2011 12:36 AM, Timur Tabi wrote:
> The diu_pool structure contains diu_addr objects for various objects
> allocated in DMA space that are used by the DIU, but the only instance
> of this structure is a global variable, 'pool'. Eliminate 'pool' by
> merging its fields into the fsl_diu_data structure, which is instantiated
> on the heap for each DIU controller found.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> drivers/video/fsl-diu-fb.c | 73 +++++++++++++++++++++----------------------
> 1 files changed, 36 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
> index f9a95ab..3a5f547 100644
> --- a/drivers/video/fsl-diu-fb.c
> +++ b/drivers/video/fsl-diu-fb.c
> @@ -55,13 +55,6 @@ struct diu_addr {
> __u32 offset;
> };
>
> -struct diu_pool {
> - struct diu_addr ad;
> - struct diu_addr gamma;
> - struct diu_addr pallete;
> - struct diu_addr cursor;
> -};
> -
> /*
> * List of supported video modes
> *
> @@ -348,6 +341,11 @@ struct fsl_diu_data {
> enum fsl_diu_monitor_port monitor_port;
> struct diu __iomem *diu_reg;
> spinlock_t reg_lock;
> + unsigned int mode; /* DIU operation mode */
And here you are introducing mode again....I think that you did not want to do
this, so I only took the v2 of this series and combined them with the other
patches of your old series (with the addition to the commit message in 4/9 as
you wanted). Please verify that the result in
git://github.com/schandinat/linux-2.6.git fbdev-next
is what you want to have there.
Best regards,
Florian Tobias Schandinat
> + struct diu_addr ad;
> + struct diu_addr gamma;
> + struct diu_addr pallete;
> + struct diu_addr cursor;
> };
>
> enum mfb_index {
> @@ -421,8 +419,6 @@ static struct mfb_info mfb_template[] = {
> },
> };
>
> -static struct diu_pool pool;
> -
> /**
> * fsl_diu_name_to_port - convert a port name to a monitor port enum
> *
> @@ -824,22 +820,23 @@ static void update_lcdc(struct fb_info *info)
> hw = machine_data->diu_reg;
>
> diu_ops.set_monitor_port(machine_data->monitor_port);
> - gamma_table_base = pool.gamma.vaddr;
> - cursor_base = pool.cursor.vaddr;
> + gamma_table_base = machine_data->gamma.vaddr;
> + cursor_base = machine_data->cursor.vaddr;
> /* Prep for DIU init - gamma table, cursor table */
>
> for (i = 0; i <= 2; i++)
> for (j = 0; j <= 255; j++)
> *gamma_table_base++ = j;
>
> - diu_ops.set_gamma_table(machine_data->monitor_port, pool.gamma.vaddr);
> + diu_ops.set_gamma_table(machine_data->monitor_port,
> + machine_data->gamma.vaddr);
>
> disable_lcdc(info);
>
> /* Program DIU registers */
>
> - out_be32(&hw->gamma, pool.gamma.paddr);
> - out_be32(&hw->cursor, pool.cursor.paddr);
> + out_be32(&hw->gamma, machine_data->gamma.paddr);
> + out_be32(&hw->cursor, machine_data->cursor.paddr);
>
> out_be32(&hw->bgnd, 0x007F7F7F); /* BGND */
> out_be32(&hw->bgnd_wb, 0); /* BGND_WB */
> @@ -1560,27 +1557,27 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
> machine_data->monitor_port = monitor_port;
>
> /* Area descriptor memory pool aligns to 64-bit boundary */
> - if (allocate_buf(&pdev->dev, &pool.ad,
> + if (allocate_buf(&pdev->dev, &machine_data->ad,
> sizeof(struct diu_ad) * FSL_AOI_NUM, 8))
> return -ENOMEM;
>
> /* Get memory for Gamma Table - 32-byte aligned memory */
> - if (allocate_buf(&pdev->dev, &pool.gamma, 768, 32)) {
> + if (allocate_buf(&pdev->dev, &machine_data->gamma, 768, 32)) {
> ret = -ENOMEM;
> goto error;
> }
>
> /* For performance, cursor bitmap buffer aligns to 32-byte boundary */
> - if (allocate_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2,
> - 32)) {
> + if (allocate_buf(&pdev->dev, &machine_data->cursor,
> + MAX_CURS * MAX_CURS * 2, 32)) {
> ret = -ENOMEM;
> goto error;
> }
>
> i = ARRAY_SIZE(machine_data->fsl_diu_info);
> - machine_data->dummy_ad = (struct diu_ad *)
> - ((u32)pool.ad.vaddr + pool.ad.offset) + i;
> - machine_data->dummy_ad->paddr = pool.ad.paddr +
> + machine_data->dummy_ad = (struct diu_ad *)((u32)machine_data->ad.vaddr +
> + machine_data->ad.offset) + i;
> + machine_data->dummy_ad->paddr = machine_data->ad.paddr +
> i * sizeof(struct diu_ad);
> machine_data->dummy_aoi_virt = fsl_diu_alloc(64, &dummy_ad_addr);
> if (!machine_data->dummy_aoi_virt) {
> @@ -1609,9 +1606,10 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
> for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++) {
> machine_data->fsl_diu_info[i]->fix.smem_start = 0;
> mfbi = machine_data->fsl_diu_info[i]->par;
> - mfbi->ad = (struct diu_ad *)((u32)pool.ad.vaddr
> - + pool.ad.offset) + i;
> - mfbi->ad->paddr = pool.ad.paddr + i * sizeof(struct diu_ad);
> + mfbi->ad = (struct diu_ad *)((u32)machine_data->ad.vaddr
> + + machine_data->ad.offset) + i;
> + mfbi->ad->paddr > + machine_data->ad.paddr + i * sizeof(struct diu_ad);
> ret = install_fb(machine_data->fsl_diu_info[i]);
> if (ret) {
> dev_err(&pdev->dev, "could not register fb %d\n", i);
> @@ -1643,14 +1641,14 @@ error:
> for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
> uninstall_fb(machine_data->fsl_diu_info[i]);
>
> - if (pool.ad.vaddr)
> - free_buf(&pdev->dev, &pool.ad,
> + if (machine_data->ad.vaddr)
> + free_buf(&pdev->dev, &machine_data->ad,
> sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
> - if (pool.gamma.vaddr)
> - free_buf(&pdev->dev, &pool.gamma, 768, 32);
> - if (pool.cursor.vaddr)
> - free_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2,
> - 32);
> + if (machine_data->gamma.vaddr)
> + free_buf(&pdev->dev, &machine_data->gamma, 768, 32);
> + if (machine_data->cursor.vaddr)
> + free_buf(&pdev->dev, &machine_data->cursor,
> + MAX_CURS * MAX_CURS * 2, 32);
> if (machine_data->dummy_aoi_virt)
> fsl_diu_free(machine_data->dummy_aoi_virt, 64);
> iounmap(machine_data->diu_reg);
> @@ -1674,13 +1672,14 @@ static int fsl_diu_remove(struct platform_device *pdev)
> free_irq_local(machine_data);
> for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
> uninstall_fb(machine_data->fsl_diu_info[i]);
> - if (pool.ad.vaddr)
> - free_buf(&pdev->dev, &pool.ad,
> + if (machine_data->ad.vaddr)
> + free_buf(&pdev->dev, &machine_data->ad,
> sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
> - if (pool.gamma.vaddr)
> - free_buf(&pdev->dev, &pool.gamma, 768, 32);
> - if (pool.cursor.vaddr)
> - free_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2, 32);
> + if (machine_data->gamma.vaddr)
> + free_buf(&pdev->dev, &machine_data->gamma, 768, 32);
> + if (machine_data->cursor.vaddr)
> + free_buf(&pdev->dev, &machine_data->cursor,
> + MAX_CURS * MAX_CURS * 2, 32);
> if (machine_data->dummy_aoi_virt)
> fsl_diu_free(machine_data->dummy_aoi_virt, 64);
> iounmap(machine_data->diu_reg);
^ permalink raw reply
* Re: [PATCH 9/9] drivers/video: fsl-diu-fb: merge diu_pool into
From: Tabi Timur-B04825 @ 2011-10-05 3:26 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1317244795-24671-9-git-send-email-timur@freescale.com>
Florian Tobias Schandinat wrote:
>> @@ -348,6 +341,11 @@ struct fsl_diu_data {
>> enum fsl_diu_monitor_port monitor_port;
>> struct diu __iomem *diu_reg;
>> spinlock_t reg_lock;
>> + unsigned int mode; /* DIU operation mode */
>
> And here you are introducing mode again....
I have no idea how that happened. I never touched patch #9 during my
rebase, and I removed that line from patch #8, so I can't explain how it
got added back.
I spent hours verifying the patches to make sure that git-bisect still
works and that each patch is clean. It just never occurred to me to
double-check a commit that I didn't modify.
> I think that you did not want to do
> this, so I only took the v2 of this series and combined them with the other
> patches of your old series (with the addition to the commit message in 4/9 as
> you wanted). Please verify that the result in
> git://github.com/schandinat/linux-2.6.git fbdev-next
> is what you want to have there.
Yes, it looks good. Thanks for taking care of this for me. These are the
last patches for 3.2.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* [PATCH 1/2] atmel_lcdfb: Adjust HFP calculation so it matches the manual.
From: Alexander Stein @ 2011-10-05 7:59 UTC (permalink / raw)
To: linux-arm-kernel
In the AT91SAM9263 Manual the HFP part in LCDTIM2 is described as follows:
* HFP: Horizontal Front Porch
Number of idle LCDDOTCK cycles at the end of the line.
Idle period is (HFP+2) LCDDOTCK cycles.
It is only a minor issue. I also changed all boards using atmel_lcdfb
I found to respect the new calculation.
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
arch/arm/mach-at91/board-cap9adk.c | 2 +-
arch/arm/mach-at91/board-neocore926.c | 2 +-
arch/arm/mach-at91/board-sam9261ek.c | 4 ++--
arch/arm/mach-at91/board-sam9263ek.c | 2 +-
arch/arm/mach-at91/board-sam9m10g45ek.c | 2 +-
arch/arm/mach-at91/board-sam9rlek.c | 2 +-
drivers/video/atmel_lcdfb.c | 4 ++--
7 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
index 679b0b7..ae962bf 100644
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ b/arch/arm/mach-at91/board-cap9adk.c
@@ -304,7 +304,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
.xres = 240, .yres = 320,
.pixclock = KHZ2PICOS(4965),
- .left_margin = 1, .right_margin = 33,
+ .left_margin = 1, .right_margin = 34,
.upper_margin = 1, .lower_margin = 0,
.hsync_len = 5, .vsync_len = 1,
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index 9bc6ab3..583878e 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -235,7 +235,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
.xres = 240, .yres = 320,
.pixclock = KHZ2PICOS(5000),
- .left_margin = 1, .right_margin = 33,
+ .left_margin = 1, .right_margin = 34,
.upper_margin = 1, .lower_margin = 0,
.hsync_len = 5, .vsync_len = 1,
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index 5096a0e..8dda83b 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -370,7 +370,7 @@ static struct fb_videomode at91_stn_modes[] = {
.xres = 320, .yres = 240,
.pixclock = KHZ2PICOS(1440),
- .left_margin = 1, .right_margin = 1,
+ .left_margin = 1, .right_margin = 2,
.upper_margin = 0, .lower_margin = 0,
.hsync_len = 1, .vsync_len = 1,
@@ -431,7 +431,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
.xres = 240, .yres = 320,
.pixclock = KHZ2PICOS(4965),
- .left_margin = 1, .right_margin = 33,
+ .left_margin = 1, .right_margin = 34,
.upper_margin = 1, .lower_margin = 0,
.hsync_len = 5, .vsync_len = 1,
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index ea8f185..e260070 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -258,7 +258,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
.xres = 240, .yres = 320,
.pixclock = KHZ2PICOS(4965),
- .left_margin = 1, .right_margin = 33,
+ .left_margin = 1, .right_margin = 34,
.upper_margin = 1, .lower_margin = 0,
.hsync_len = 5, .vsync_len = 1,
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index ad234cc..5e9a5ca 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -197,7 +197,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
.xres = 480, .yres = 272,
.pixclock = KHZ2PICOS(9000),
- .left_margin = 1, .right_margin = 1,
+ .left_margin = 1, .right_margin = 2,
.upper_margin = 40, .lower_margin = 1,
.hsync_len = 45, .vsync_len = 1,
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index 4f14b54..ad9e5c9 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -154,7 +154,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
.xres = 240, .yres = 320,
.pixclock = KHZ2PICOS(4965),
- .left_margin = 1, .right_margin = 33,
+ .left_margin = 1, .right_margin = 34,
.upper_margin = 1, .lower_margin = 0,
.hsync_len = 5, .vsync_len = 1,
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 817ab60..816d528 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -393,7 +393,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
var->lower_margin = min_t(u32, var->lower_margin,
ATMEL_LCDC_VFP);
var->right_margin = min_t(u32, var->right_margin,
- (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 1);
+ (ATMEL_LCDC_HFP >> ATMEL_LCDC_HFP_OFFSET) + 2);
var->hsync_len = min_t(u32, var->hsync_len,
(ATMEL_LCDC_HPW >> ATMEL_LCDC_HPW_OFFSET) + 1);
var->left_margin = min_t(u32, var->left_margin,
@@ -578,7 +578,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
lcdc_writel(sinfo, ATMEL_LCDC_TIM1, value);
/* Horizontal timing */
- value = (info->var.right_margin - 1) << ATMEL_LCDC_HFP_OFFSET;
+ value = (info->var.right_margin - 2) << ATMEL_LCDC_HFP_OFFSET;
value |= (info->var.hsync_len - 1) << ATMEL_LCDC_HPW_OFFSET;
value |= (info->var.left_margin - 1);
dev_dbg(info->device, " * LCDTIM2 = %08lx\n", value);
--
1.7.3.4
^ permalink raw reply related
* [PATCH 2/2] atmel_lcdfb: Use proper blanking on negative contrast polarity
From: Alexander Stein @ 2011-10-05 7:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1317801598-23757-1-git-send-email-alexander.stein@systec-electronic.com>
If used with negative polarity the PWM unit cannot be disabled. This would
result in a full contrast screen.
Instead let the PWM unit enabled using 0x0 as compare value which darkens
the display.
In result no power saving is possible if inverted contrast polarity
is used.
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
drivers/video/atmel_lcdfb.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 816d528..2bd75b5 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -96,8 +96,11 @@ static int atmel_bl_update_status(struct backlight_device *bl)
brightness = 0;
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness);
- lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR,
+ if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE)
+ lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR,
brightness ? contrast_ctr : 0);
+ else
+ lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
bl->props.fb_blank = bl->props.power = sinfo->bl_power = power;
--
1.7.3.4
^ permalink raw reply related
* [PATCH] video: platinumfb: Add __devexit_p at necessary place
From: Axel Lin @ 2011-10-05 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Florian Tobias Schandinat, linux-fbdev
According to the comments in include/linux/init.h:
"Pointers to __devexit functions must use __devexit_p(function_name), the
wrapper will insert either the function_name or NULL, depending on the config
options."
We have __devexit annotation for platinumfb_remove(), thus add __devexit_p at
necessary place.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/video/platinumfb.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index 6694923..ae3caa6 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -683,7 +683,7 @@ static struct platform_driver platinum_driver .of_match_table = platinumfb_match,
},
.probe = platinumfb_probe,
- .remove = platinumfb_remove,
+ .remove = __devexit_p(platinumfb_remove),
};
static int __init platinumfb_init(void)
--
1.7.4.1
^ permalink raw reply related
* [PATCH 00/16] ARM: amba: Enable module alias autogeneration for AMBA drivers
From: Dave Martin @ 2011-10-05 16:04 UTC (permalink / raw)
To: linux-arm-kernel
Cc: patches, Paweł Moll, Alan Cox, Alessandro Rubini,
Alessandro Zummo, alsa-devel, Chris Ball, Dan Williams,
Dmitry Torokhov, Grant Likely, Jaroslav Kysela, Julia Lawall,
Linus Walleij, linux-fbdev, linux-input, linux-mmc, linux-serial,
linux-watchdog, Paul Mundt, rtc-linux, Russell King,
spi-devel-general, Takashi Iwai, Vinod Koul, Wim Van Sebroeck
There's no special reason why AMBA device drivers should not be
auto-loadable via udev, but udev currently has no way to map AMBA
device IDs to drivers.
As part of the effort to help enable the building of multiple
ARM platforms into a single kernel image in the future, it's desirable
to be able to build any non-critical platform-specific drivers as
modules.
A straightforward solution is to use modaliases to allow udev to
identify the correct driver module to load.
This series enables the general infrastructure for modalias generation
to work for AMBA devices, and enables it in the affected drivers.
Briefly tested on Versatile Express, including aaci, mmci and amba-clcd
(which appears to have the most interesting modalias match pattern).
For me, the appropiate modules now get loaded at udev trigger time.
Any comments and feedback are welcome.
Dave Martin (16):
ARM: amba: Move definition of struct amba_id to mod_devicetable.h
ARM: amba: Auto-generate AMBA driver module aliases during modpost
hwrng: nomadik: Enable module alias autogeneration for AMBA drivers
dmaengine: pl08x: Enable module alias autogeneration for AMBA drivers
dmaengine: pl330: Enable module alias autogeneration for AMBA drivers
gpio: pl061: Enable module alias autogeneration for AMBA drivers
input: ambakmi: Enable module alias autogeneration for AMBA drivers
mmc: mmci: Enable module alias autogeneration for AMBA drivers
rtc: pl030: Enable module alias autogeneration for AMBA drivers
rtc: pl031: Enable module alias autogeneration for AMBA drivers
spi: pl022: Enable module alias autogeneration for AMBA drivers
serial: pl010: Enable module alias autogeneration for AMBA drivers
serial: pl011: Enable module alias autogeneration for AMBA drivers
fbdev: amba: Enable module alias autogeneration for AMBA drivers
watchdog: sp805: Enable module alias autogeneration for AMBA drivers
sound: aaci: Enable module alias autogeneration for AMBA drivers
drivers/amba/bus.c | 9 ++++-
drivers/char/hw_random/nomadik-rng.c | 2 +
drivers/dma/amba-pl08x.c | 2 +
drivers/dma/pl330.c | 2 +
drivers/gpio/gpio-pl061.c | 2 +
drivers/input/serio/ambakmi.c | 2 +
drivers/mmc/host/mmci.c | 2 +
drivers/rtc/rtc-pl030.c | 2 +
drivers/rtc/rtc-pl031.c | 2 +
drivers/spi/spi-pl022.c | 2 +
drivers/tty/serial/amba-pl010.c | 2 +
drivers/tty/serial/amba-pl011.c | 2 +
drivers/video/amba-clcd.c | 2 +
drivers/watchdog/sp805_wdt.c | 2 +
include/linux/amba/bus.h | 7 +---
include/linux/mod_devicetable.h | 18 ++++++++
scripts/mod/file2alias.c | 72 ++++++++++++++++++++++++++++++++++
sound/arm/aaci.c | 2 +
18 files changed, 127 insertions(+), 7 deletions(-)
--
1.7.4.1
^ permalink raw reply
* [PATCH 14/16] fbdev: amba: Enable module alias autogeneration for AMBA drivers
From: Dave Martin @ 2011-10-05 16:05 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1317830707-17517-1-git-send-email-dave.martin@linaro.org>
Signed-off-by: Dave Martin <dave.martin@linaro.org>
---
drivers/video/amba-clcd.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
index 2cda6ba..0a2cce7 100644
--- a/drivers/video/amba-clcd.c
+++ b/drivers/video/amba-clcd.c
@@ -621,6 +621,8 @@ static struct amba_id clcdfb_id_table[] = {
{ 0, 0 },
};
+MODULE_DEVICE_TABLE(amba, clcdfb_id_table);
+
static struct amba_driver clcd_driver = {
.drv = {
.name = "clcd-pl11x",
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCHv2 01/28] OMAP: change get_context_loss_count ret value
From: Paul Walmsley @ 2011-10-06 23:11 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev, b-cousson, khilman
In-Reply-To: <1307627810-3768-2-git-send-email-tomi.valkeinen@ti.com>
On Thu, 9 Jun 2011, Tomi Valkeinen wrote:
> get_context_loss_count functions return context loss count as u32, and
> zero means an error. However, zero is also returned when context has
> never been lost and could also be returned when the context loss count
> has wrapped and goes to zero.
>
> Change the functions to return an int, with negative value meaning an
> error.
>
> OMAP HSMMC code uses omap_pm_get_dev_context_loss_count(), but as the
> hsmmc code handles the returned value as an int, with negative value
> meaning an error, this patch actually fixes hsmmc code also.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Acked-by: Kevin Hilman <khilman@ti.com>
Acked-by: Paul Walmsley <paul@pwsan.com>>
- Paul
^ permalink raw reply
* Re: [PATCHv2 01/28] OMAP: change get_context_loss_count ret value
From: Tony Lindgren @ 2011-10-06 23:14 UTC (permalink / raw)
To: Paul Walmsley; +Cc: Tomi Valkeinen, linux-omap, linux-fbdev, b-cousson, khilman
In-Reply-To: <alpine.DEB.2.00.1110061710510.4611@utopia.booyaka.com>
* Paul Walmsley <paul@pwsan.com> [111006 15:37]:
> On Thu, 9 Jun 2011, Tomi Valkeinen wrote:
>
> > get_context_loss_count functions return context loss count as u32, and
> > zero means an error. However, zero is also returned when context has
> > never been lost and could also be returned when the context loss count
> > has wrapped and goes to zero.
> >
> > Change the functions to return an int, with negative value meaning an
> > error.
> >
> > OMAP HSMMC code uses omap_pm_get_dev_context_loss_count(), but as the
> > hsmmc code handles the returned value as an int, with negative value
> > meaning an error, this patch actually fixes hsmmc code also.
> >
> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > Acked-by: Kevin Hilman <khilman@ti.com>
>
> Acked-by: Paul Walmsley <paul@pwsan.com>>
Thanks, picking this into fixes-part2 branch as requested by Paul.
Tony
^ permalink raw reply
* [GIT PULL] OMAP DSS for v3.2
From: Tomi Valkeinen @ 2011-10-07 7:20 UTC (permalink / raw)
To: Florian Tobias Schandinat; +Cc: linux-omap mailing list, lfbdev-ml
[-- Attachment #1: Type: text/plain, Size: 12624 bytes --]
Hi Florian,
Please pull OMAP DSS patches for v3.2 merge window.
Note that there are some conflicts with other trees. The board file
conflicts are trivial, changes in code which just happen to be next to
each other. The LCD driver conflicts are even simpler, there were
changes to them from some other tree, but I have removed the files.
The conflicts have been solved properly by Stephen in linux-next:
https://github.com/sfrothwell/linux-next/commit/3e31b3042760e3906d0a275d7adedfaf55ee5b0a
I also attached the output from git show, as github seems to show the
full diff for the merge commit.
Are you ok with the conflicts?
Tomi
The following changes since commit b6fd41e29dea9c6753b1843a77e50433e6123bcb:
Linux 3.1-rc6 (2011-09-12 14:02:02 -0700)
are available in the git repository at:
git://gitorious.org/linux-omap-dss2/linux.git for-florian
Andy Doan (1):
OMAPFB: make debug message more useful
Archit Taneja (26):
OMAP: DSS2: DISPC: Prepare dispc_dump_regs() for shortening
OMAP: DSS2: DISPC: Shorten dispc_dump_regs()
OMAP: DSS2: DISPC: dispc_save_context() and dispc_restore_context() cleanup
OMAP: DSS2: DISPC: Shorten _dispc_set_color_conv_coef()
OMAP: DSS2: Use a macro to declare size of the fifo_size array in dispc.c
OMAP: DSS2: Use MIPI DSI enums from include/video/mipi_display.h
OMAP: DSS2: DSI: Represent L4 and VP as sources of VC instead of modes
OMAP: DSS2: Create enum for DSI operation modes
OMAP: DSS2: DSI: Introduce generic write functions
OMAP: DSS2: DSI: Remove functions dsi_vc_dcs_read_1() and dsi_vc_dcs_read_2()
OMAP: DSS2: DSI: Split dsi_vc_dcs_read() into 2 functions
OMAP: DSS2: DSI: Introduce generic read functions
OMAP: DSS2: Clean up stallmode and io pad mode selection
OMAP: DSS2: Create an enum for DSI pixel formats
OMAP: DSS2: DSI: Send zero length packet in dsi_vc_send_null()
OMAP: DSS2: DSI Video mode support
OMAPDSS: DISPC: Reduce the number of arguments in dispc_ovl_setup()
OMAPDSS: DISPC: Pass overlay params as arguments to dispc_ovl_setup()
OMAPDSS: DISPC: Create helper function dispc_mgr_is_lcd()
OMAPDSS: DISPC: Get correct pixel clock for TV manager
OMAPDSS: DISPC: Remove hardcoded use of PPL in five tap clock calculation
OMAPDSS: DISPC: Clean up scaling related clock and five tap calculations
OMAPDSS: FEATURES: Create a range param to get max downscaling
OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting
OMAPDSS: DISPC: VIDEO3 pipeline support
OMAPDSS: DISPC: zorder support for DSS overlays
Arnd Bergmann (1):
video/omap: fix build dependencies
Daniel Morsing (1):
OMAP: DSS2: Don't allow moving managers away from enabled displays
Dima Zavin (1):
OMAP: DSS: dispc: enable/disable clocks in error handler
Mayuresh Janorkar (1):
OMAP: DSS2: Add picodlp panel driver
Mythri P K (14):
OMAP4: DSS2: HDMI: HDMI clean up to pass base_address
OMAP4: DSS2: HDMI: Move pll and video configuration
OMAP4: DSS2: HDMI: Use specific HDMI timings structure
OMAP4: DSS2: HDMI: Move HDMI IP independent generic header
OMAP4: DSS2: HDMI: Move the EDID definition from HDMI
OMAP4: DSS2: HDMI: Split the current HDMI driver to move
OMAP4: DSS2: HDMI: Move the HDMI IP dependent audio
OMAP4: DSS2: HDMI: Rename the functions in HDMI IP library
OMAP4: DSS2: HDMI: Function pointer approach to call
OMAP4: DSS2: Rename hdmi_omap4_panel.c to hdmi_panel.c
OMAPDSS: HDMI: Move the comments in avi infoframe
OMAPDSS: HDMI: Replace hdmi_reg struct with u16
OMAPDSS: HDMI: Add missing register definitions
OMAPDSS: HDMI: Add support to dump registers through debugfs
Thomas Weber (2):
OMAP: DSS2: Support for Innolux AT070TN83
OMAP: Devkit8000: Change lcd driver to AT070TN83
Tomi Valkeinen (63):
OMAP: DSS2: PicoDLP: fix error handling in power_on
OMAP: DSS2: check for manager when enabling display
Revert "HACK: OMAP: DSS2: clk hack for OMAP2/3"
Revert "OMAP: DSS2: HDMI: fix hdmi clock name"
OMAP: DSS2: remove unneeded fck enable/disables
OMAP: DSS2: Change DSI device naming
OMAP4: TWL: Add common omapdss supplies
OMAP: DSS2: DSI: Improve dsi_mux_pads parameters
OMAP: DSS2: Implement dsi_mux_pads for OMAP4
OMAP: OMAPFB: make omapfb start even when a display is missing a driver
OMAP: DSS2: fix clock sources on error and uninit
OMAP: DSS2: Handle manager change in apply
OMAP: DSS2: Remove "EXPERIMENTAL" from Kconfig
OMAP: DSS2: Remove support for non-DISPC overlays
OMAP: DSS2: DISPC: use lookup tables for bit shifts
OMAP: DSS2: Add overlay caps to DSS features
OMAP: DSS2: Add GLOBAL_ALPHA & PRE_MULT_ALPHA to ovl caps
OMAP: DSS2: string parsing cleanups
OMAP: OMAPFB: string parsing cleanups
OMAP: DSS2: DISPC: remove non-existing func prototypes
OMAP: DSS2: DISPC: rename overlay related funcs
OMAP: DSS2: DISPC: rename manager related funcs
OMAP: DSS2: reorganize functions in dss.h
OMAP: DSS2: DISPC: Fix minimum PCD value
OMAP: DSS2: HDMI: use default dividers
OMAP: DSS2: HDMI: change regn definition
OMAP: DSS2: DSI: Add comment about regn
OMAP: DSS2: DISPC: Add missing IRQ definitions
OMAP: DSS2: add dss_get_hdmi_venc_clk_source()
OMAP: DSS2: DISPC: improve dispc_mgr_enable_digit_out()
OMAP: DSS2: HDMI: improve hdmi output enable
OMAP: DSS2: add read_edid() to omap_dss_driver struct
OMAP: DSS2: add detect() to omap_dss_driver struct
OMAP: DSS2: HDMI: make set_timing saner
OMAP: DSS2: HDMI: implement read_edid()
OMAP: DSS2: HDMI: remove edid parsing
OMAP: DSS2: HDMI: split hdmi_core_ddc_edid
OMAP: DSS2: HDMI: clean up edid reading & fix checksum
OMAP: DSS2: HDMI: remove error prints in check_timings
OMAP: DSS2: HDMI: implement detect()
OMAP: DSS2: add panel-dvi driver
OMAP: use dvi panel driver instead of generic-dpi
OMAP: stalker: Remove LCD device from board file
OMAP: DSS2: panel-generic-dpi: remove "generic" panel
OMAP: Add DDC i2c_bus_num to board files
OMAPFB: find best mode from edid
OMAPDSS: Taal: remove external backlight support
OMAPFB: Remove unused lcd drivers
OMAPDSS: Port 2430sdp display driver to DSS2
OMAPDSS: Port the H4 display driver to DSS2
OMAPDSS: Port the Apollon display driver to DSS2
OMAPDSS: Add N800 panel driver
OMAPDSS: remove vaddr from overlay info
OMAP: 4430SDP: Remove unneeded lcd config
OMAP4: 4430SDP: Add panel support to board file
OMAP4: 4430SDP: Add picodlp support to board file
OMAP: RX51: Remove unused old omapfb stuff
OMAP: omap3touchbook: Remove unused lcd stuff
OMAP: 2420SDP: Port the display driver to new DSS2
OMAP: LDP: Port the display driver to new DSS2
OMAP: H4: Port the display driver to new DSS2
OMAP: Apollon: Port the display driver to new DSS2
OMAPDSS: picodlp: add missing #include <linux/module.h>
arch/arm/mach-omap2/board-2430sdp.c | 78 +-
arch/arm/mach-omap2/board-3430sdp.c | 7 +-
arch/arm/mach-omap2/board-4430sdp.c | 208 +++-
arch/arm/mach-omap2/board-am3517evm.c | 6 +-
arch/arm/mach-omap2/board-apollon.c | 35 +-
arch/arm/mach-omap2/board-cm-t35.c | 6 +-
arch/arm/mach-omap2/board-devkit8000.c | 10 +-
arch/arm/mach-omap2/board-h4.c | 42 +-
arch/arm/mach-omap2/board-igep0020.c | 8 +-
arch/arm/mach-omap2/board-ldp.c | 123 ++-
arch/arm/mach-omap2/board-omap3beagle.c | 8 +-
arch/arm/mach-omap2/board-omap3evm.c | 7 +-
arch/arm/mach-omap2/board-omap3pandora.c | 2 +-
arch/arm/mach-omap2/board-omap3stalker.c | 40 +-
arch/arm/mach-omap2/board-omap3touchbook.c | 18 -
arch/arm/mach-omap2/board-omap4panda.c | 8 +-
arch/arm/mach-omap2/board-overo.c | 7 +-
arch/arm/mach-omap2/board-rx51.c | 25 -
arch/arm/mach-omap2/display.c | 60 +-
arch/arm/mach-omap2/twl-common.c | 11 +-
drivers/media/video/omap/omap_vout.c | 18 +-
drivers/video/omap/Kconfig | 29 -
drivers/video/omap/Makefile | 8 -
drivers/video/omap/lcd_2430sdp.c | 203 ---
drivers/video/omap/lcd_apollon.c | 136 --
drivers/video/omap/lcd_h4.c | 117 --
drivers/video/omap/lcd_ldp.c | 201 ---
drivers/video/omap/lcd_omap3beagle.c | 130 --
drivers/video/omap/lcd_omap3evm.c | 193 ---
drivers/video/omap/lcd_overo.c | 180 ---
drivers/video/omap2/displays/Kconfig | 28 +-
drivers/video/omap2/displays/Makefile | 3 +
drivers/video/omap2/displays/panel-dvi.c | 363 +++++
drivers/video/omap2/displays/panel-generic-dpi.c | 113 +-
drivers/video/omap2/displays/panel-n8x0.c | 747 +++++++++
drivers/video/omap2/displays/panel-picodlp.c | 594 +++++++
drivers/video/omap2/displays/panel-picodlp.h | 288 ++++
drivers/video/omap2/displays/panel-taal.c | 123 +-
drivers/video/omap2/dss/Kconfig | 2 +-
drivers/video/omap2/dss/Makefile | 2 +-
drivers/video/omap2/dss/core.c | 4 +
drivers/video/omap2/dss/dispc.c | 1700 ++++++++------------
drivers/video/omap2/dss/dispc.h | 57 +
drivers/video/omap2/dss/display.c | 31 +-
drivers/video/omap2/dss/dpi.c | 28 +-
drivers/video/omap2/dss/dsi.c | 929 +++++++-----
drivers/video/omap2/dss/dss.c | 18 +-
drivers/video/omap2/dss/dss.h | 156 +-
drivers/video/omap2/dss/dss_features.c | 130 ++-
drivers/video/omap2/dss/dss_features.h | 17 +-
drivers/video/omap2/dss/hdmi.c | 1260 ++-------------
.../omap2/dss/{hdmi_omap4_panel.c => hdmi_panel.c} | 68 +-
drivers/video/omap2/dss/manager.c | 191 +--
drivers/video/omap2/dss/overlay.c | 122 +-
drivers/video/omap2/dss/rfbi.c | 45 +-
drivers/video/omap2/dss/sdi.c | 19 +-
drivers/video/omap2/dss/ti_hdmi.h | 138 ++
drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 1239 ++++++++++++++
.../video/omap2/dss/{hdmi.h => ti_hdmi_4xxx_ip.h} | 400 +++---
drivers/video/omap2/dss/venc.c | 27 +-
drivers/video/omap2/omapfb/Kconfig | 2 +-
drivers/video/omap2/omapfb/omapfb-main.c | 134 ++-
drivers/video/omap2/omapfb/omapfb-sysfs.c | 6 +-
include/video/omap-panel-dvi.h | 37 +
include/video/omap-panel-n8x0.h | 15 +
include/video/omap-panel-nokia-dsi.h | 8 +-
include/video/omap-panel-picodlp.h | 23 +
include/video/omapdss.h | 100 +-
68 files changed, 6495 insertions(+), 4596 deletions(-)
delete mode 100644 drivers/video/omap/lcd_2430sdp.c
delete mode 100644 drivers/video/omap/lcd_apollon.c
delete mode 100644 drivers/video/omap/lcd_h4.c
delete mode 100644 drivers/video/omap/lcd_ldp.c
delete mode 100644 drivers/video/omap/lcd_omap3beagle.c
delete mode 100644 drivers/video/omap/lcd_omap3evm.c
delete mode 100644 drivers/video/omap/lcd_overo.c
create mode 100644 drivers/video/omap2/displays/panel-dvi.c
create mode 100644 drivers/video/omap2/displays/panel-n8x0.c
create mode 100644 drivers/video/omap2/displays/panel-picodlp.c
create mode 100644 drivers/video/omap2/displays/panel-picodlp.h
rename drivers/video/omap2/dss/{hdmi_omap4_panel.c => hdmi_panel.c} (79%)
create mode 100644 drivers/video/omap2/dss/ti_hdmi.h
create mode 100644 drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
rename drivers/video/omap2/dss/{hdmi.h => ti_hdmi_4xxx_ip.h} (54%)
create mode 100644 include/video/omap-panel-dvi.h
create mode 100644 include/video/omap-panel-n8x0.h
create mode 100644 include/video/omap-panel-picodlp.h
[-- Attachment #2: merge.txt --]
[-- Type: text/plain, Size: 9437 bytes --]
commit 3e31b3042760e3906d0a275d7adedfaf55ee5b0a
Merge: 49d6b1b 3e28189
Author: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri Oct 7 14:12:41 2011 +1100
Merge remote-tracking branch 'omap_dss2/for-next'
Conflicts:
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-rx51.c
drivers/video/omap/lcd_apollon.c
drivers/video/omap/lcd_ldp.c
drivers/video/omap/lcd_overo.c
diff --cc arch/arm/mach-omap2/board-2430sdp.c
index 4191743,6ab6350..ba7d92b
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@@ -137,10 -192,12 +192,6 @@@ static inline void board_smc91x_init(vo
#endif
- static struct omap_board_config_kernel sdp2430_config[] __initdata = {
- {OMAP_TAG_LCD, &sdp2430_lcd_config},
- };
-
-static void __init omap_2430sdp_init_early(void)
-{
- omap2_init_common_infrastructure();
- omap2_init_common_devices(NULL, NULL);
-}
-
static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = {
REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
};
diff --cc arch/arm/mach-omap2/board-4430sdp.c
index f3917b3,d3874a6..4d0c8b9
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@@ -381,14 -379,12 +379,6 @@@ static struct platform_device *sdp4430_
&sdp4430_vbat,
};
- static struct omap_lcd_config sdp4430_lcd_config __initdata = {
- .ctrl_name = "internal",
- };
-
- static struct omap_board_config_kernel sdp4430_config[] __initdata = {
- { OMAP_TAG_LCD, &sdp4430_lcd_config },
- };
-
-static void __init omap_4430sdp_init_early(void)
-{
- omap2_init_common_infrastructure();
- omap2_init_common_devices(NULL, NULL);
-}
-
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_UTMI,
.mode = MUSB_OTG,
diff --cc arch/arm/mach-omap2/board-apollon.c
index 868d5f0,d8eb81e..66f3842
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@@ -265,14 -262,34 +262,28 @@@ static struct omap_usb_config apollon_u
.pins[0] = 6,
};
- static struct omap_lcd_config apollon_lcd_config __initdata = {
- .ctrl_name = "internal",
+ static struct panel_generic_dpi_data apollon_panel_data = {
+ .name = "apollon",
};
- static struct omap_board_config_kernel apollon_config[] __initdata = {
- { OMAP_TAG_LCD, &apollon_lcd_config },
+ static struct omap_dss_device apollon_lcd_device = {
+ .name = "lcd",
+ .driver_name = "generic_dpi_panel",
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .phy.dpi.data_lines = 18,
+ .data = &apollon_panel_data,
+ };
+
+ static struct omap_dss_device *apollon_dss_devices[] = {
+ &apollon_lcd_device,
+ };
+
+ static struct omap_dss_board_info apollon_dss_data = {
+ .num_devices = ARRAY_SIZE(apollon_dss_devices),
+ .devices = apollon_dss_devices,
+ .default_device = &apollon_lcd_device,
};
-static void __init omap_apollon_init_early(void)
-{
- omap2_init_common_infrastructure();
- omap2_init_common_devices(NULL, NULL);
-}
-
static struct gpio apollon_gpio_leds[] __initdata = {
{ LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0" }, /* LED0 - AA10 */
{ LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1" }, /* LED1 - AA6 */
@@@ -334,7 -349,8 +343,9 @@@ static void __init omap_apollon_init(vo
*/
platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices));
omap_serial_init();
+ omap_sdrc_init(NULL, NULL);
+
+ omap_display_init(&apollon_dss_data);
}
static void __init omap_apollon_map_io(void)
diff --cc arch/arm/mach-omap2/board-h4.c
index f0ddc27,f7c09de..ba81484
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@@ -285,10 -301,12 +300,6 @@@ static struct omap_usb_config h4_usb_co
.hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */
};
- static struct omap_board_config_kernel h4_config[] __initdata = {
- { OMAP_TAG_LCD, &h4_lcd_config },
- };
-
-static void __init omap_h4_init_early(void)
-{
- omap2_init_common_infrastructure();
- omap2_init_common_devices(NULL, NULL);
-}
-
static void __init omap_h4_init_irq(void)
{
omap2_init_irq();
@@@ -364,8 -379,9 +372,10 @@@ static void __init omap_h4_init(void
platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
omap2_usbfs_init(&h4_usb_config);
omap_serial_init();
+ omap_sdrc_init(NULL, NULL);
h4_init_flash();
+
+ omap_display_init(&h4_dss_data);
}
static void __init omap_h4_map_io(void)
diff --cc arch/arm/mach-omap2/board-ldp.c
index 5797917,689ed49..e179da0
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@@ -179,19 -183,103 +183,97 @@@ static inline void __init ldp_init_smsc
gpmc_smsc911x_init(&smsc911x_cfg);
}
- static struct platform_device ldp_lcd_device = {
- .name = "ldp_lcd",
- .id = -1,
+ /* LCD */
+
+ static int ldp_backlight_gpio;
+ static int ldp_lcd_enable_gpio;
+
+ #define LCD_PANEL_RESET_GPIO 55
+ #define LCD_PANEL_QVGA_GPIO 56
+
+ static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
+ {
+ if (gpio_is_valid(ldp_lcd_enable_gpio))
+ gpio_direction_output(ldp_lcd_enable_gpio, 1);
+ if (gpio_is_valid(ldp_backlight_gpio))
+ gpio_direction_output(ldp_backlight_gpio, 1);
+
+ return 0;
+ }
+
+ static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
+ {
+ if (gpio_is_valid(ldp_lcd_enable_gpio))
+ gpio_direction_output(ldp_lcd_enable_gpio, 0);
+ if (gpio_is_valid(ldp_backlight_gpio))
+ gpio_direction_output(ldp_backlight_gpio, 0);
+ }
+
+ static struct panel_generic_dpi_data ldp_panel_data = {
+ .name = "nec_nl2432dr22-11b",
+ .platform_enable = ldp_panel_enable_lcd,
+ .platform_disable = ldp_panel_disable_lcd,
};
- static struct omap_lcd_config ldp_lcd_config __initdata = {
- .ctrl_name = "internal",
+ static struct omap_dss_device ldp_lcd_device = {
+ .name = "lcd",
+ .driver_name = "generic_dpi_panel",
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .phy.dpi.data_lines = 18,
+ .data = &ldp_panel_data,
+ };
+
+ static struct omap_dss_device *ldp_dss_devices[] = {
+ &ldp_lcd_device,
};
- static struct omap_board_config_kernel ldp_config[] __initdata = {
- { OMAP_TAG_LCD, &ldp_lcd_config },
+ static struct omap_dss_board_info ldp_dss_data = {
+ .num_devices = ARRAY_SIZE(ldp_dss_devices),
+ .devices = ldp_dss_devices,
+ .default_device = &ldp_lcd_device,
};
+ static void __init ldp_display_init(void)
+ {
+ int r;
+
+ static struct gpio gpios[] __initdata = {
+ {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
+ {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
+ };
+
+ r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
+ if (r) {
+ pr_err("Cannot request LCD GPIOs, error %d\n", r);
+ return;
+ }
+
+ omap_display_init(&ldp_dss_data);
+ }
+
-static void __init omap_ldp_init_early(void)
-{
- omap2_init_common_infrastructure();
- omap2_init_common_devices(NULL, NULL);
-}
-
+ static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
+ {
+ int r;
+
+ struct gpio gpios[] = {
+ {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
+ {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
+ };
+
+ r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
+ if (r) {
+ pr_err("Cannot request LCD GPIOs, error %d\n", r);
+ ldp_backlight_gpio = -EINVAL;
+ ldp_lcd_enable_gpio = -EINVAL;
+ return r;
+ }
+
+ ldp_backlight_gpio = gpio + 15;
+ ldp_lcd_enable_gpio = gpio + 7;
+
+ return 0;
+ }
+
static struct twl4030_gpio_platform_data ldp_gpio_data = {
.gpio_base = OMAP_MAX_GPIO_LINES,
.irq_base = TWL4030_GPIO_IRQ_BASE,
diff --cc arch/arm/mach-omap2/board-rx51.c
index e2e958a,9e7dde6..34858c8
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@@ -79,29 -79,15 +79,6 @@@ static struct cpuidle_params rx51_cpuid
{7505 + 15274, 484329, 1},
};
- static struct omap_lcd_config rx51_lcd_config = {
- .ctrl_name = "internal",
- };
-
- static struct omap_fbmem_config rx51_fbmem0_config = {
- .size = 752 * 1024,
- };
-
- static struct omap_fbmem_config rx51_fbmem1_config = {
- .size = 752 * 1024,
- };
-
- static struct omap_fbmem_config rx51_fbmem2_config = {
- .size = 752 * 1024,
- };
-
- static struct omap_board_config_kernel rx51_config[] = {
- { OMAP_TAG_FBMEM, &rx51_fbmem0_config },
- { OMAP_TAG_FBMEM, &rx51_fbmem1_config },
- { OMAP_TAG_FBMEM, &rx51_fbmem2_config },
- { OMAP_TAG_LCD, &rx51_lcd_config },
- };
-
-static void __init rx51_init_early(void)
-{
- struct omap_sdrc_params *sdrc_params;
-
- omap2_init_common_infrastructure();
- sdrc_params = nokia_get_sdram_timings();
- omap2_init_common_devices(sdrc_params, sdrc_params);
-}
-
extern void __init rx51_peripherals_init(void);
#ifdef CONFIG_OMAP_MUX
@@@ -118,17 -104,9 +95,15 @@@ static struct omap_musb_board_data musb
static void __init rx51_init(void)
{
+ struct omap_sdrc_params *sdrc_params;
+
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
- omap_board_config = rx51_config;
- omap_board_config_size = ARRAY_SIZE(rx51_config);
omap3_pm_init_cpuidle(rx51_cpuidle_params);
omap_serial_init();
+
+ sdrc_params = nokia_get_sdram_timings();
+ omap_sdrc_init(sdrc_params, sdrc_params);
+
usb_musb_init(&musb_board_data);
rx51_peripherals_init();
^ permalink raw reply
* linux-next: manual merge of the staging tree with the fbdev tree
From: Stephen Rothwell @ 2011-10-13 6:02 UTC (permalink / raw)
To: Greg KH
Cc: linux-next, linux-kernel, Laurent Pinchart,
Florian Tobias Schandinat, linux-fbdev, Aaro Koskinen
[-- Attachment #1: Type: text/plain, Size: 1351 bytes --]
Hi Greg,
Today's linux-next merge of the staging tree got a conflict in
drivers/staging/xgifb/XGI_main_26.c between commit 0d5c6ca30bb0
("staging: xgifb: use display information in info not in var for
panning") from the fbdev tree and commit fd26d42019cb ("staging: xgifb:
avoid direct references xgi_video_info") from the staging tree.
I fixed it up (I think - see below) and can carry the fix as necessary.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc drivers/staging/xgifb/XGI_main_26.c
index f8b88ad,36db231..0000000
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@@ -1363,8 -1300,8 +1300,8 @@@ static int XGIfb_do_set_var(struct fb_v
return 0;
}
- #ifdef XGIFB_PAN
- static int XGIfb_pan_var(struct fb_var_screeninfo *var, struct fb_info *info)
+ static int XGIfb_pan_var(struct xgifb_video_info *xgifb_info,
- struct fb_var_screeninfo *var)
++ struct fb_var_screeninfo *var, struct fb_info *info)
{
unsigned int base;
@@@ -1686,7 -1634,7 +1624,7 @@@ static int XGIfb_pan_display(struct fb_
> info->var.yres_virtual)
return -EINVAL;
}
- err = XGIfb_pan_var(var, info);
- err = XGIfb_pan_var(xgifb_info, var);
++ err = XGIfb_pan_var(xgifb_info, var, info);
if (err < 0)
return err;
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH] atmel_lcdfb: support new-style palette format
From: Peter Korsgaard @ 2011-10-13 12:03 UTC (permalink / raw)
To: linux-arm-kernel
The newer Atmel SoCs use normal 16bit 565 BGR/RGB for the palette data,
rather than the special intensity + 555 format.
Fill out palette data correctly on these devices, and at the same time
respect the RGB/BGR wiring mode.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
drivers/video/atmel_lcdfb.c | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 63409c1..0e8c38e 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -682,14 +682,30 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,
case FB_VISUAL_PSEUDOCOLOR:
if (regno < 256) {
- val = ((red >> 11) & 0x001f);
- val |= ((green >> 6) & 0x03e0);
- val |= ((blue >> 1) & 0x7c00);
-
- /*
- * TODO: intensity bit. Maybe something like
- * ~(red[10] ^ green[10] ^ blue[10]) & 1
- */
+ if (cpu_is_at91sam9261() || cpu_is_at91sam9263()
+ || cpu_is_at91sam9rl()) {
+ /* old style I+BGR:555 */
+ val = ((red >> 11) & 0x001f);
+ val |= ((green >> 6) & 0x03e0);
+ val |= ((blue >> 1) & 0x7c00);
+
+ /*
+ * TODO: intensity bit. Maybe something like
+ * ~(red[10] ^ green[10] ^ blue[10]) & 1
+ */
+ } else {
+ /* new style BGR:565 / RGB:565 */
+ if (sinfo->lcd_wiring_mode =
+ ATMEL_LCDC_WIRING_RGB) {
+ val = ((red >> 11) & 0x001f);
+ val |= ((blue >> 0) & 0xf800);
+ } else {
+ val = ((blue >> 11) & 0x001f);
+ val |= ((red >> 0) & 0xf800);
+ }
+
+ val |= ((green >> 5) & 0x07e0);
+ }
lcdc_writel(sinfo, ATMEL_LCDC_LUT(regno), val);
ret = 0;
--
1.7.6.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox