* [patch] intelfb: remove some dead code
From: Dan Carpenter @ 2012-01-27 12:45 UTC (permalink / raw)
To: linux-fbdev
The goto on the line before means the return is unreachable. The goto
also returns -ENOMEM so no changes are needed there.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index c6afa33..02fd226 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -529,7 +529,6 @@ static int __devinit intelfb_pci_register(struct pci_dev *pdev,
if (fb_alloc_cmap(&info->cmap, 256, 1) < 0) {
ERR_MSG("Could not allocate cmap for intelfb_info.\n");
goto err_out_cmap;
- return -ENODEV;
}
dinfo = info->par;
^ permalink raw reply related
* Re: [patch] intelfb: remove some dead code
From: Dan Carpenter @ 2012-01-27 12:55 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20120127124536.GA14136@elgon.mountain>
[-- Attachment #1: Type: text/plain, Size: 260 bytes --]
On Fri, Jan 27, 2012 at 03:45:36PM +0300, Dan Carpenter wrote:
> The goto on the line before means the return is unreachable. The goto
> also returns -ENOMEM so no changes are needed there.
I meant ENODEV there. Let me resend this.
regards,
dan carpenter
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [patch v2] intelfb: remove some dead code
From: Dan Carpenter @ 2012-01-27 12:58 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 702 bytes --]
The goto on the line before means the return is unreachable. The goto
also returns -ENODEV so no changes are needed there.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: fixed a typo in the commit message
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index c6afa33..02fd226 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -529,7 +529,6 @@ static int __devinit intelfb_pci_register(struct pci_dev *pdev,
if (fb_alloc_cmap(&info->cmap, 256, 1) < 0) {
ERR_MSG("Could not allocate cmap for intelfb_info.\n");
goto err_out_cmap;
- return -ENODEV;
}
dinfo = info->par;
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related
* Re: udlfb: remove sysfs framebuffer device with USB .disconnect()
From: Kay Sievers @ 2012-01-27 16:32 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1327090686.1555.2.camel@mop>
On Sat, Jan 21, 2012 at 15:32, Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Sat, 2012-01-21 at 14:13 +0000, Florian Tobias Schandinat wrote:
>> On 01/21/2012 01:57 PM, Kay Sievers wrote:
>
>> > That's true. If one calls the current _unregister() *before* calling
>> > _unlink(), the _unlink() is a NOP. But that's intentional.
>>
>> I don't think you got me right. My complaint was that after your patch
>> do_unregister_framebuffer itself calls unlink_framebuffer _after_ it set
>> registered_fb[i] = NULL;
>> So for any framebuffer that does not call unlink_framebuffer directly the line
>> device_destroy(fb_class, MKDEV(FB_MAJOR, i));
>> will no longer be executed. Do you agree?
>
> Yes, I absolutely agree. :)
Hey Florian,
any updates?
We like to get that into the Fedora kernel, as we promised
out-of-the-box multi-seat hotplug support, but the framebuffer events
are broken at the moment.
It would be nice if it would show up in -next somehow, and gets
testing, so I don't need to convince anybody at the Fedora kernel
side, that this will land upstream ...
Thanks,
Kay
^ permalink raw reply
* Re: [PATCH] atmel_lcdfb: support 16bit BGR:565 mode, remove unsupported 15bit modes
From: Florian Tobias Schandinat @ 2012-01-30 5:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1318517570-28459-1-git-send-email-jacmet@sunsite.dk>
On 10/13/2011 02:52 PM, Peter Korsgaard wrote:
> Allow framebuffer to be configured in 16bit mode when panel is wired in
> (the default) BGR configuration, and don't claim to support 15bit input
> modes, which the LCD controller cannot handle.
>
> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> drivers/video/atmel_lcdfb.c | 12 +++---------
> 1 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index 7ca3eaf..143f6d9 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -418,24 +418,18 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
> var->red.length = var->green.length = var->blue.length
> = var->bits_per_pixel;
> break;
> - case 15:
> case 16:
> if (sinfo->lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB) {
> /* RGB:565 mode */
> var->red.offset = 11;
> var->blue.offset = 0;
> - var->green.length = 6;
> - } else if (sinfo->lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB555) {
> - var->red.offset = 10;
> - var->blue.offset = 0;
> - var->green.length = 5;
> } else {
> - /* BGR:555 mode */
> + /* BGR:565 mode */
> var->red.offset = 0;
> - var->blue.offset = 10;
> - var->green.length = 5;
> + var->blue.offset = 11;
> }
> var->green.offset = 5;
> + var->green.length = 6;
> var->red.length = var->blue.length = 5;
> break;
> case 32:
^ permalink raw reply
* Re: [PATCH v3] video: da8xx-fb: reset LCDC only if functional clock changes with DVFS
From: Florian Tobias Schandinat @ 2012-01-30 5:12 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1325594451-11963-1-git-send-email-prakash.pm@ti.com>
On 01/03/2012 12:40 PM, Manjunathappa, Prakash wrote:
> LCDC functional clock may or may not be derived from CPU/MPU DPLL,
> For example,
> AM335x => Separate independent DPLL for LCDC
> Davinci => Same DPLL as MPU
>
> So, on platforms where LCDC functional clock is not derived from CPU/MPU
> PLL it is not required to reset LCDC module as its functional clock does
> not change with DVFS.
>
> This patch adds check to do reset only if functional clock changes
> between pre and post notifier callbacks with DVFS.
>
> Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> Since v2:
> Fix, update lcd_fck_rate with current LCD functional clock rate.
> Since v1:
> Fixed the commit message.
>
> drivers/video/da8xx-fb.c | 16 +++++++++++-----
> 1 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> index 6b27751..dee1918 100644
> --- a/drivers/video/da8xx-fb.c
> +++ b/drivers/video/da8xx-fb.c
> @@ -163,6 +163,7 @@ struct da8xx_fb_par {
> int vsync_timeout;
> #ifdef CONFIG_CPU_FREQ
> struct notifier_block freq_transition;
> + unsigned int lcd_fck_rate;
> #endif
> void (*panel_power_ctrl)(int);
> };
> @@ -895,11 +896,13 @@ static int lcd_da8xx_cpufreq_transition(struct notifier_block *nb,
> struct da8xx_fb_par *par;
>
> par = container_of(nb, struct da8xx_fb_par, freq_transition);
> - if (val = CPUFREQ_PRECHANGE) {
> - lcd_disable_raster();
> - } else if (val = CPUFREQ_POSTCHANGE) {
> - lcd_calc_clk_divider(par);
> - lcd_enable_raster();
> + if (val = CPUFREQ_POSTCHANGE) {
> + if (par->lcd_fck_rate != clk_get_rate(par->lcdc_clk)) {
> + par->lcd_fck_rate = clk_get_rate(par->lcdc_clk);
> + lcd_disable_raster();
> + lcd_calc_clk_divider(par);
> + lcd_enable_raster();
> + }
> }
>
> return 0;
> @@ -1192,6 +1195,9 @@ static int __devinit fb_probe(struct platform_device *device)
>
> par = da8xx_fb_info->par;
> par->lcdc_clk = fb_clk;
> +#ifdef CONFIG_CPU_FREQ
> + par->lcd_fck_rate = clk_get_rate(fb_clk);
> +#endif
> par->pxl_clk = lcdc_info->pxl_clk;
> if (fb_pdata->panel_power_ctrl) {
> par->panel_power_ctrl = fb_pdata->panel_power_ctrl;
^ permalink raw reply
* Re: [PATCH v2] atmel_lcdfb: fix usage of CONTRAST_CTR in suspend/resume
From: Florian Tobias Schandinat @ 2012-01-30 5:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1326126237-4355-1-git-send-email-nicolas.ferre@atmel.com>
On 01/09/2012 04:23 PM, Nicolas Ferre wrote:
> From: Hubert Feurstein <h.feurstein@gmail.com>
>
> An error was existing in the saving of CONTRAST_CTR register
> across suspend/resume.
>
> Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: stable <stable@vger.kernel.org>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> drivers/video/atmel_lcdfb.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index d7e3712..d99505b 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -1102,7 +1102,7 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
> */
> lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL);
>
> - sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
> + sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_CTR);
> lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0);
> if (sinfo->atmel_lcdfb_power_control)
> sinfo->atmel_lcdfb_power_control(0);
^ permalink raw reply
* Re: [PATCH] drivers/video: compile fixes for fsl-diu-fb.c
From: Florian Tobias Schandinat @ 2012-01-30 5:14 UTC (permalink / raw)
To: Michael Neuling
Cc: linuxppc-dev@ozlabs.org, linux-fbdev@vger.kernel.org,
Tabi Timur-B04825
In-Reply-To: <21370.1326683320@neuling.org>
On 01/16/2012 03:08 AM, Michael Neuling wrote:
[...]
> From: Michael Neuling <mikey@neuling.org>
>
> [PATCH] drivers/video: compile fixes for fsl-diu-fb.c
>
> Fix a compiler errors introduced in:
> commit ddd3d905436b572ebadc09dcf2d12ca5b37020a0
> Author: Timur Tabi <timur@freescale.com>
> drivers/video: fsl-diu-fb: merge all allocated data into one block
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
Applied.
Thanks,
Florian Tobias Schandinat
>
> diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
> index acf292b..6af3f16 100644
> --- a/drivers/video/fsl-diu-fb.c
> +++ b/drivers/video/fsl-diu-fb.c
> @@ -1432,7 +1432,7 @@ static int fsl_diu_suspend(struct platform_device *ofdev, pm_message_t state)
> struct fsl_diu_data *data;
>
> data = dev_get_drvdata(&ofdev->dev);
> - disable_lcdc(data->fsl_diu_info[0]);
> + disable_lcdc(data->fsl_diu_info);
>
> return 0;
> }
> @@ -1442,7 +1442,7 @@ static int fsl_diu_resume(struct platform_device *ofdev)
> struct fsl_diu_data *data;
>
> data = dev_get_drvdata(&ofdev->dev);
> - enable_lcdc(data->fsl_diu_info[0]);
> + enable_lcdc(data->fsl_diu_info);
>
> return 0;
> }
>
^ permalink raw reply
* Re: [PATCH] video: s3c-fb: Convert to devm style allocation
From: Florian Tobias Schandinat @ 2012-01-30 5:15 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1327151509-10408-1-git-send-email-broonie@opensource.wolfsonmicro.com>
On 01/21/2012 01:11 PM, Mark Brown wrote:
> Saves some code, especially useful as the code saved is mostly in the
> infrequently tested error paths.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Acked-by: Jingoo Han <jg1.han@samsung.com>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
>
> devm_request_and_ioremap() is now in Linus' tree.
>
> drivers/video/s3c-fb.c | 32 +++++---------------------------
> 1 files changed, 5 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 0c63b69..7c5158d 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -186,7 +186,6 @@ struct s3c_fb_vsync {
> * struct s3c_fb - overall hardware state of the hardware
> * @slock: The spinlock protection for this data sturcture.
> * @dev: The device that we bound to, for printing, etc.
> - * @regs_res: The resource we claimed for the IO registers.
> * @bus_clk: The clk (hclk) feeding our interface and possibly pixclk.
> * @lcd_clk: The clk (sclk) feeding pixclk.
> * @regs: The mapped hardware registers.
> @@ -202,7 +201,6 @@ struct s3c_fb_vsync {
> struct s3c_fb {
> spinlock_t slock;
> struct device *dev;
> - struct resource *regs_res;
> struct clk *bus_clk;
> struct clk *lcd_clk;
> void __iomem *regs;
> @@ -1361,7 +1359,7 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
> return -EINVAL;
> }
>
> - sfb = kzalloc(sizeof(struct s3c_fb), GFP_KERNEL);
> + sfb = devm_kzalloc(dev, sizeof(struct s3c_fb), GFP_KERNEL);
> if (!sfb) {
> dev_err(dev, "no memory for framebuffers\n");
> return -ENOMEM;
> @@ -1404,33 +1402,25 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
> goto err_lcd_clk;
> }
>
> - sfb->regs_res = request_mem_region(res->start, resource_size(res),
> - dev_name(dev));
> - if (!sfb->regs_res) {
> - dev_err(dev, "failed to claim register region\n");
> - ret = -ENOENT;
> - goto err_lcd_clk;
> - }
> -
> - sfb->regs = ioremap(res->start, resource_size(res));
> + sfb->regs = devm_request_and_ioremap(dev, res);
> if (!sfb->regs) {
> dev_err(dev, "failed to map registers\n");
> ret = -ENXIO;
> - goto err_req_region;
> + goto err_lcd_clk;
> }
>
> res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> if (!res) {
> dev_err(dev, "failed to acquire irq resource\n");
> ret = -ENOENT;
> - goto err_ioremap;
> + goto err_lcd_clk;
> }
> sfb->irq_no = res->start;
> ret = request_irq(sfb->irq_no, s3c_fb_irq,
> 0, "s3c_fb", sfb);
> if (ret) {
> dev_err(dev, "irq request failed\n");
> - goto err_ioremap;
> + goto err_lcd_clk;
> }
>
> dev_dbg(dev, "got resources (regs %p), probing windows\n", sfb->regs);
> @@ -1486,12 +1476,6 @@ err_pm_runtime:
> pm_runtime_put_sync(sfb->dev);
> free_irq(sfb->irq_no, sfb);
>
> -err_ioremap:
> - iounmap(sfb->regs);
> -
> -err_req_region:
> - release_mem_region(sfb->regs_res->start, resource_size(sfb->regs_res));
> -
> err_lcd_clk:
> pm_runtime_disable(sfb->dev);
>
> @@ -1505,7 +1489,6 @@ err_bus_clk:
> clk_put(sfb->bus_clk);
>
> err_sfb:
> - kfree(sfb);
> return ret;
> }
>
> @@ -1529,8 +1512,6 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
>
> free_irq(sfb->irq_no, sfb);
>
> - iounmap(sfb->regs);
> -
> if (!sfb->variant.has_clksel) {
> clk_disable(sfb->lcd_clk);
> clk_put(sfb->lcd_clk);
> @@ -1539,12 +1520,9 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
> clk_disable(sfb->bus_clk);
> clk_put(sfb->bus_clk);
>
> - release_mem_region(sfb->regs_res->start, resource_size(sfb->regs_res));
> -
> pm_runtime_put_sync(sfb->dev);
> pm_runtime_disable(sfb->dev);
>
> - kfree(sfb);
> return 0;
> }
>
^ permalink raw reply
* Re: udlfb: remove sysfs framebuffer device with USB .disconnect()
From: Florian Tobias Schandinat @ 2012-01-30 5:16 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1327090686.1555.2.camel@mop>
On 01/21/2012 02:32 PM, Kay Sievers wrote:
[...]
> From: Kay Sievers <kay.sievers@vrfy.org>
> Subject: udlfb: remove sysfs framebuffer device with USB .disconnect()
>
> The USB graphics card driver delays the unregistering of the framebuffer
> device to a workqueue, which breaks the userspace visible remove uevent
> sequence. Recent userspace tools started to support USB graphics card
> hotplug out-of-the-box and rely on proper events sent by the kernel.
>
> The framebuffer device is a direct child of the USB interface which is
> removed immediately after the USB .disconnect() callback. But the fb device
> in /sys stays around until its final cleanup, at a time where all the parent
> devices have been removed already.
>
> To work around that, we remove the sysfs fb device directly in the USB
> .disconnect() callback and leave only the cleanup of the internal fb
> data to the delayed work.
>
> Before:
> add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
> add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
> add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb0 (graphics)
> remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
> remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
> remove /2-1.2:1.0/graphics/fb0 (graphics)
>
> After:
> add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
> add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
> add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb1 (graphics)
> remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb1 (graphics)
> remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
> remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
>
> Cc: stable@vger.kernel.org
> Tested-By: Bernie Thompson <bernie@plugable.com>
> Acked-By: Bernie Thompson <bernie@plugable.com>
> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> drivers/video/fbmem.c | 18 +++++++++++++++++-
> drivers/video/udlfb.c | 2 +-
> include/linux/fb.h | 1 +
> 3 files changed, 19 insertions(+), 2 deletions(-)
>
> --- a/drivers/video/fbmem.c
> +++ b/drivers/video/fbmem.c
> @@ -1665,6 +1665,7 @@ static int do_unregister_framebuffer(str
> if (ret)
> return -EINVAL;
>
> + unlink_framebuffer(fb_info);
> if (fb_info->pixmap.addr &&
> (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT))
> kfree(fb_info->pixmap.addr);
> @@ -1672,7 +1673,6 @@ static int do_unregister_framebuffer(str
> registered_fb[i] = NULL;
> num_registered_fb--;
> fb_cleanup_device(fb_info);
> - device_destroy(fb_class, MKDEV(FB_MAJOR, i));
> event.info = fb_info;
> fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);
>
> @@ -1681,6 +1681,22 @@ static int do_unregister_framebuffer(str
> return 0;
> }
>
> +int unlink_framebuffer(struct fb_info *fb_info)
> +{
> + int i;
> +
> + i = fb_info->node;
> + if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)
> + return -EINVAL;
> +
> + if (fb_info->dev) {
> + device_destroy(fb_class, MKDEV(FB_MAJOR, i));
> + fb_info->dev = NULL;
> + }
> + return 0;
> +}
> +EXPORT_SYMBOL(unlink_framebuffer);
> +
> void remove_conflicting_framebuffers(struct apertures_struct *a,
> const char *name, bool primary)
> {
> --- a/drivers/video/udlfb.c
> +++ b/drivers/video/udlfb.c
> @@ -1739,7 +1739,7 @@ static void dlfb_usb_disconnect(struct u
> for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
> device_remove_file(info->dev, &fb_device_attrs[i]);
> device_remove_bin_file(info->dev, &edid_attr);
> -
> + unlink_framebuffer(info);
> usb_set_intfdata(interface, NULL);
>
> /* if clients still have us open, will be freed on last close */
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -1003,6 +1003,7 @@ extern ssize_t fb_sys_write(struct fb_in
> /* drivers/video/fbmem.c */
> extern int register_framebuffer(struct fb_info *fb_info);
> extern int unregister_framebuffer(struct fb_info *fb_info);
> +extern int unlink_framebuffer(struct fb_info *fb_info);
> extern void remove_conflicting_framebuffers(struct apertures_struct *a,
> const char *name, bool primary);
> extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
>
>
>
^ permalink raw reply
* Re: [PATCH 2/4] drivers/video/au*fb.c: use devm_ functions
From: Florian Tobias Schandinat @ 2012-01-30 5:17 UTC (permalink / raw)
To: Julia Lawall; +Cc: Manuel Lauss, kernel-janitors, linux-fbdev, LKML
In-Reply-To: <alpine.DEB.2.02.1201211600580.1939@hadrien>
On 01/21/2012 03:01 PM, Julia Lawall wrote:
> The various devm_ functions allocate memory that is released when a driver
> detaches. This patch uses these functions for data that is allocated in
> the probe function of a platform device and is only freed in the remove
> function.
>
> In au1100fb.c, the probe function now returns -ENODEV on failure.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Applied.
Thanks,
Florian Tobias Schandinat
>
> ---
> In the case of au1200fb.c, should the error-handling code under the new
> call to dma_alloc_noncoherent jump to failed, like the other error handling
> code? I was not sure that there was actually anything for failed to do at
> this point in the function.
>
> Added return of -ENODEV.
>
> drivers/video/au1100fb.c | 32 ++++++++++++--------------------
> drivers/video/au1200fb.c | 9 +--------
> 2 files changed, 13 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
> index 04e4479..3e9a773 100644
> --- a/drivers/video/au1200fb.c
> +++ b/drivers/video/au1200fb.c
> @@ -1724,7 +1724,7 @@ static int __devinit au1200fb_drv_probe(struct
> platform_device *dev)
> /* Allocate the framebuffer to the maximum screen size */
> fbdev->fb_len = (win->w[plane].xres * win->w[plane].yres * bpp)
> / 8;
>
> - fbdev->fb_mem = dma_alloc_noncoherent(&dev->dev,
> + fbdev->fb_mem = dmam_alloc_noncoherent(&dev->dev, &dev->dev,
> PAGE_ALIGN(fbdev->fb_len),
> &fbdev->fb_phys, GFP_KERNEL);
> if (!fbdev->fb_mem) {
> @@ -1788,9 +1788,6 @@ static int __devinit au1200fb_drv_probe(struct
> platform_device *dev)
>
> failed:
> /* NOTE: This only does the current plane/window that failed;
> others are still active */
> - if (fbdev->fb_mem)
> - dma_free_noncoherent(&dev->dev, PAGE_ALIGN(fbdev->fb_len),
> - fbdev->fb_mem, fbdev->fb_phys);
> if (fbi) {
> if (fbi->cmap.len != 0)
> fb_dealloc_cmap(&fbi->cmap);
> @@ -1817,10 +1814,6 @@ static int __devexit au1200fb_drv_remove(struct
> platform_device *dev)
>
> /* Clean up all probe data */
> unregister_framebuffer(fbi);
> - if (fbdev->fb_mem)
> - dma_free_noncoherent(&dev->dev,
> - PAGE_ALIGN(fbdev->fb_len),
> - fbdev->fb_mem, fbdev->fb_phys);
> if (fbi->cmap.len != 0)
> fb_dealloc_cmap(&fbi->cmap);
> kfree(fbi->pseudo_palette);
> diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
> index de9da67..befcbd8 100644
> --- a/drivers/video/au1100fb.c
> +++ b/drivers/video/au1100fb.c
> @@ -477,7 +477,8 @@ static int __devinit au1100fb_drv_probe(struct
> platform_device *dev)
> u32 sys_clksrc;
>
> /* Allocate new device private */
> - fbdev = kzalloc(sizeof(struct au1100fb_device), GFP_KERNEL);
> + fbdev = devm_kzalloc(&dev->dev, sizeof(struct au1100fb_device),
> + GFP_KERNEL);
> if (!fbdev) {
> print_err("fail to allocate device private record");
> return -ENOMEM;
> @@ -498,8 +499,9 @@ static int __devinit au1100fb_drv_probe(struct
> platform_device *dev)
> au1100fb_fix.mmio_start = regs_res->start;
> au1100fb_fix.mmio_len = resource_size(regs_res);
>
> - if (!request_mem_region(au1100fb_fix.mmio_start,
> au1100fb_fix.mmio_len,
> - DRIVER_NAME)) {
> + if (!devm_request_mem_region(au1100fb_fix.mmio_start,
> + au1100fb_fix.mmio_len,
> + DRIVER_NAME)) {
> print_err("fail to lock memory region at 0x%08lx",
> au1100fb_fix.mmio_start);
> return -EBUSY;
> @@ -514,8 +516,9 @@ static int __devinit au1100fb_drv_probe(struct
> platform_device *dev)
> fbdev->fb_len = fbdev->panel->xres * fbdev->panel->yres *
> (fbdev->panel->bpp >> 3) * AU1100FB_NBR_VIDEO_BUFFERS;
>
> - fbdev->fb_mem = dma_alloc_coherent(&dev->dev,
> PAGE_ALIGN(fbdev->fb_len),
> - &fbdev->fb_phys, GFP_KERNEL);
> + fbdev->fb_mem = dmam_alloc_coherent(&dev->dev, &dev->dev,
> + PAGE_ALIGN(fbdev->fb_len),
> + &fbdev->fb_phys, GFP_KERNEL);
> if (!fbdev->fb_mem) {
> print_err("fail to allocate frambuffer (size: %dK))",
> fbdev->fb_len / 1024);
> @@ -557,14 +560,14 @@ static int __devinit au1100fb_drv_probe(struct
> platform_device *dev)
> fbdev->info.fbops = &au1100fb_ops;
> fbdev->info.fix = au1100fb_fix;
>
> - if (!(fbdev->info.pseudo_palette = kzalloc(sizeof(u32) * 16,
> GFP_KERNEL))) {
> + fbdev->info.pseudo_palette > + devm_kzalloc(&dev->dev, sizeof(u32) * 16, GFP_KERNEL);
> + if (!fbdev->info.pseudo_palette)
> return -ENOMEM;
> - }
>
> if (fb_alloc_cmap(&fbdev->info.cmap,
> AU1100_LCD_NBR_PALETTE_ENTRIES, 0) < 0) {
> print_err("Fail to allocate colormap (%d entries)",
> AU1100_LCD_NBR_PALETTE_ENTRIES);
> - kfree(fbdev->info.pseudo_palette);
> return -EFAULT;
> }
>
> @@ -582,9 +585,6 @@ static int __devinit au1100fb_drv_probe(struct
> platform_device *dev)
> return 0;
>
> failed:
> - if (fbdev->regs) {
> - release_mem_region(fbdev->regs_phys, fbdev->regs_len);
> - }
> if (fbdev->fb_mem) {
> dma_free_noncoherent(&dev->dev, fbdev->fb_len, fbdev->fb_mem,
> fbdev->fb_phys);
> @@ -592,10 +592,9 @@ failed:
> if (fbdev->info.cmap.len != 0) {
> fb_dealloc_cmap(&fbdev->info.cmap);
> }
> - kfree(fbdev);
> platform_set_drvdata(dev, NULL);
>
> - return 0;
> + return -ENODEV;
> }
>
> int au1100fb_drv_remove(struct platform_device *dev)
> @@ -615,14 +614,7 @@ int au1100fb_drv_remove(struct platform_device *dev)
> /* Clean up all probe data */
> unregister_framebuffer(&fbdev->info);
>
> - release_mem_region(fbdev->regs_phys, fbdev->regs_len);
> -
> - 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);
> - kfree((void*)fbdev);
>
> return 0;
> }
>
^ permalink raw reply
* Re: [PATCH] video: use gpio_request_one
From: Florian Tobias Schandinat @ 2012-01-30 5:17 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <000d01ccdc15$d0e2a500$72a7ef00$%han@samsung.com>
On 01/26/2012 10:32 AM, Jingoo Han wrote:
> Using gpio_request_one can make the code simpler because it can
> set the direction and initial value in one shot.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> Cc: Michael Hennerich <michael.hennerich@analog.com>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> drivers/video/bf537-lq035.c | 12 +++---------
> drivers/video/bf54x-lq043fb.c | 4 +---
> drivers/video/bfin-lq035q1-fb.c | 8 ++++----
> drivers/video/bfin_adv7393fb.c | 5 +++--
> drivers/video/msm/mddi_client_nt35399.c | 7 +------
> drivers/video/msm/mddi_client_toshiba.c | 7 +------
> drivers/video/omap/lcd_inn1610.c | 10 ++++------
> drivers/video/omap2/displays/panel-taal.c | 4 +---
> .../video/omap2/displays/panel-tpo-td043mtea1.c | 11 ++---------
> 9 files changed, 20 insertions(+), 48 deletions(-)
>
> diff --git a/drivers/video/bf537-lq035.c b/drivers/video/bf537-lq035.c
> index bea53c1..befbc80 100644
> --- a/drivers/video/bf537-lq035.c
> +++ b/drivers/video/bf537-lq035.c
> @@ -383,23 +383,19 @@ static int __devinit request_ports(void)
> }
>
> #if (defined(UD) && defined(LBR))
> - if (gpio_request(UD, KBUILD_MODNAME)) {
> + if (gpio_request_one(UD, GPIOF_OUT_INIT_LOW, KBUILD_MODNAME)) {
> pr_err("requesting GPIO %d failed\n", UD);
> return -EBUSY;
> }
>
> - if (gpio_request(LBR, KBUILD_MODNAME)) {
> + if (gpio_request_one(LBR, GPIOF_OUT_INIT_HIGH, KBUILD_MODNAME)) {
> pr_err("requesting GPIO %d failed\n", LBR);
> gpio_free(UD);
> return -EBUSY;
> }
> -
> - gpio_direction_output(UD, 0);
> - gpio_direction_output(LBR, 1);
> -
> #endif
>
> - if (gpio_request(MOD, KBUILD_MODNAME)) {
> + if (gpio_request_one(MOD, GPIOF_OUT_INIT_HIGH, KBUILD_MODNAME)) {
> pr_err("requesting GPIO %d failed\n", MOD);
> #if (defined(UD) && defined(LBR))
> gpio_free(LBR);
> @@ -408,8 +404,6 @@ static int __devinit request_ports(void)
> return -EBUSY;
> }
>
> - gpio_direction_output(MOD, 1);
> -
> SSYNC();
> return 0;
> }
> diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c
> index 46b03f5..dc2f004 100644
> --- a/drivers/video/bf54x-lq043fb.c
> +++ b/drivers/video/bf54x-lq043fb.c
> @@ -240,7 +240,7 @@ static int request_ports(struct bfin_bf54xfb_info *fbi)
> u16 eppi_req_18[] = EPPI0_18;
> u16 disp = fbi->mach_info->disp;
>
> - if (gpio_request(disp, DRIVER_NAME)) {
> + if (gpio_request_one(disp, GPIOF_OUT_INIT_HIGH, DRIVER_NAME)) {
> printk(KERN_ERR "Requesting GPIO %d failed\n", disp);
> return -EFAULT;
> }
> @@ -263,8 +263,6 @@ static int request_ports(struct bfin_bf54xfb_info *fbi)
> }
> }
>
> - gpio_direction_output(disp, 1);
> -
> return 0;
> }
>
> diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
> index c633068..86922ac 100644
> --- a/drivers/video/bfin-lq035q1-fb.c
> +++ b/drivers/video/bfin-lq035q1-fb.c
> @@ -365,10 +365,10 @@ static int __devinit bfin_lq035q1_request_ports(struct platform_device *pdev,
> * Drive PPI_FS3 Low
> */
> if (ANOMALY_05000400) {
> - int ret = gpio_request(P_IDENT(P_PPI0_FS3), "PPI_FS3");
> + int ret = gpio_request_one(P_IDENT(P_PPI0_FS3),
> + GPIOF_OUT_INIT_LOW, "PPI_FS3");
> if (ret)
> return ret;
> - gpio_direction_output(P_IDENT(P_PPI0_FS3), 0);
> }
>
> if (ppi16)
> @@ -716,14 +716,14 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
> }
>
> if (info->disp_info->use_bl) {
> - ret = gpio_request(info->disp_info->gpio_bl, "LQ035 Backlight");
> + ret = gpio_request_one(info->disp_info->gpio_bl,
> + GPIOF_OUT_INIT_LOW, "LQ035 Backlight");
>
> if (ret) {
> dev_err(&pdev->dev, "failed to request GPIO %d\n",
> info->disp_info->gpio_bl);
> goto out9;
> }
> - gpio_direction_output(info->disp_info->gpio_bl, 0);
> }
>
> ret = register_framebuffer(fbinfo);
> diff --git a/drivers/video/bfin_adv7393fb.c b/drivers/video/bfin_adv7393fb.c
> index 811dd7f..c992814 100644
> --- a/drivers/video/bfin_adv7393fb.c
> +++ b/drivers/video/bfin_adv7393fb.c
> @@ -411,12 +411,13 @@ static int __devinit bfin_adv7393_fb_probe(struct i2c_client *client,
>
> /* Workaround "PPI Does Not Start Properly In Specific Mode" */
> if (ANOMALY_05000400) {
> - if (gpio_request(P_IDENT(P_PPI0_FS3), "PPI0_FS3")) {
> + ret = gpio_request_one(P_IDENT(P_PPI0_FS3), GPIOF_OUT_INIT_LOW,
> + "PPI0_FS3")
> + if (ret) {
> dev_err(&client->dev, "PPI0_FS3 GPIO request failed\n");
> ret = -EBUSY;
> goto out_8;
> }
> - gpio_direction_output(P_IDENT(P_PPI0_FS3), 0);
> }
>
> if (peripheral_request_list(ppi_pins, DRIVER_NAME)) {
> diff --git a/drivers/video/msm/mddi_client_nt35399.c b/drivers/video/msm/mddi_client_nt35399.c
> index f239f4a..7fcd67e 100644
> --- a/drivers/video/msm/mddi_client_nt35399.c
> +++ b/drivers/video/msm/mddi_client_nt35399.c
> @@ -155,14 +155,10 @@ static int setup_vsync(struct panel_info *panel, int init)
> ret = 0;
> goto uninit;
> }
> - ret = gpio_request(gpio, "vsync");
> + ret = gpio_request_one(gpio, GPIOF_IN, "vsync");
> if (ret)
> goto err_request_gpio_failed;
>
> - ret = gpio_direction_input(gpio);
> - if (ret)
> - goto err_gpio_direction_input_failed;
> -
> ret = irq = gpio_to_irq(gpio);
> if (ret < 0)
> goto err_get_irq_num_failed;
> @@ -180,7 +176,6 @@ uninit:
> free_irq(gpio_to_irq(gpio), panel->client_data);
> err_request_irq_failed:
> err_get_irq_num_failed:
> -err_gpio_direction_input_failed:
> gpio_free(gpio);
> err_request_gpio_failed:
> return ret;
> diff --git a/drivers/video/msm/mddi_client_toshiba.c b/drivers/video/msm/mddi_client_toshiba.c
> index f9bc932..053eb68 100644
> --- a/drivers/video/msm/mddi_client_toshiba.c
> +++ b/drivers/video/msm/mddi_client_toshiba.c
> @@ -186,14 +186,10 @@ static int setup_vsync(struct panel_info *panel,
> ret = 0;
> goto uninit;
> }
> - ret = gpio_request(gpio, "vsync");
> + ret = gpio_request_one(gpio, GPIOF_IN, "vsync");
> if (ret)
> goto err_request_gpio_failed;
>
> - ret = gpio_direction_input(gpio);
> - if (ret)
> - goto err_gpio_direction_input_failed;
> -
> ret = irq = gpio_to_irq(gpio);
> if (ret < 0)
> goto err_get_irq_num_failed;
> @@ -210,7 +206,6 @@ uninit:
> free_irq(gpio_to_irq(gpio), panel);
> err_request_irq_failed:
> err_get_irq_num_failed:
> -err_gpio_direction_input_failed:
> gpio_free(gpio);
> err_request_gpio_failed:
> return ret;
> diff --git a/drivers/video/omap/lcd_inn1610.c b/drivers/video/omap/lcd_inn1610.c
> index 7e8bd8e..e3d3d13 100644
> --- a/drivers/video/omap/lcd_inn1610.c
> +++ b/drivers/video/omap/lcd_inn1610.c
> @@ -22,7 +22,7 @@
> #include <linux/module.h>
> #include <linux/platform_device.h>
>
> -#include <asm/gpio.h>
> +#include <linux/gpio.h>
> #include "omapfb.h"
>
> #define MODULE_NAME "omapfb-lcd_h3"
> @@ -32,20 +32,18 @@ static int innovator1610_panel_init(struct lcd_panel *panel,
> {
> int r = 0;
>
> - if (gpio_request(14, "lcd_en0")) {
> + /* configure GPIO(14, 15) as outputs */
> + if (gpio_request_one(14, GPIOF_OUT_INIT_LOW, "lcd_en0")) {
> pr_err(MODULE_NAME ": can't request GPIO 14\n");
> r = -1;
> goto exit;
> }
> - if (gpio_request(15, "lcd_en1")) {
> + if (gpio_request_one(15, GPIOF_OUT_INIT_LOW, "lcd_en1")) {
> pr_err(MODULE_NAME ": can't request GPIO 15\n");
> gpio_free(14);
> r = -1;
> goto exit;
> }
> - /* configure GPIO(14, 15) as outputs */
> - gpio_direction_output(14, 0);
> - gpio_direction_output(15, 0);
> exit:
> return r;
> }
> diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
> index 00c5c61..0f21fa5 100644
> --- a/drivers/video/omap2/displays/panel-taal.c
> +++ b/drivers/video/omap2/displays/panel-taal.c
> @@ -1019,14 +1019,12 @@ static int taal_probe(struct omap_dss_device *dssdev)
> if (panel_data->use_ext_te) {
> int gpio = panel_data->ext_te_gpio;
>
> - r = gpio_request(gpio, "taal irq");
> + r = gpio_request_one(gpio, GPIOF_IN, "taal irq");
> if (r) {
> dev_err(&dssdev->dev, "GPIO request failed\n");
> goto err_gpio;
> }
>
> - gpio_direction_input(gpio);
> -
> r = request_irq(gpio_to_irq(gpio), taal_te_isr,
> IRQF_TRIGGER_RISING,
> "taal vsync", dssdev);
> diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
> index e6649aa..880c313 100644
> --- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
> +++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
> @@ -408,17 +408,12 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev)
> }
>
> if (gpio_is_valid(nreset_gpio)) {
> - ret = gpio_request(nreset_gpio, "lcd reset");
> + ret = gpio_request_one(nreset_gpio, GPIOF_OUT_INIT_LOW,
> + "lcd reset");
> if (ret < 0) {
> dev_err(&dssdev->dev, "couldn't request reset GPIO\n");
> goto fail_gpio_req;
> }
> -
> - ret = gpio_direction_output(nreset_gpio, 0);
> - if (ret < 0) {
> - dev_err(&dssdev->dev, "couldn't set GPIO direction\n");
> - goto fail_gpio_direction;
> - }
> }
>
> ret = sysfs_create_group(&dssdev->dev.kobj, &tpo_td043_attr_group);
> @@ -427,8 +422,6 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev)
>
> return 0;
>
> -fail_gpio_direction:
> - gpio_free(nreset_gpio);
> fail_gpio_req:
> regulator_put(tpo_td043->vcc_reg);
> fail_regulator:
^ permalink raw reply
* Re: [PATCH] video: s3c-fb: fix checkpatch error
From: Florian Tobias Schandinat @ 2012-01-30 5:18 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1301642247-20926-1-git-send-email-jg1.han@samsung.com>
On 01/26/2012 10:38 AM, Jingoo Han wrote:
> This patch fixes the checkpatch error listed below:
>
> ERROR: trailing statements should be on next line
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> drivers/video/s3c-fb.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 7c5158d..389189a 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -48,7 +48,8 @@
> #undef writel
> #define writel(v, r) do { \
> printk(KERN_DEBUG "%s: %08x => %p\n", __func__, (unsigned int)v, r); \
> - __raw_writel(v, r); } while (0)
> + __raw_writel(v, r); \
> +} while (0)
> #endif /* FB_S3C_DEBUG_REGWRITE */
>
> /* irq_flags bits */
^ permalink raw reply
* Re: [GIT PULL] OMAP DSS fixes for 3.3-rc
From: Florian Tobias Schandinat @ 2012-01-30 5:22 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-fbdev@vger.kernel.org, linux-omap mailing list
In-Reply-To: <1327579651.1895.34.camel@deskari>
Hi Tomi,
On 01/26/2012 12:07 PM, Tomi Valkeinen wrote:
> Hi Florian,
>
> Here are two major fixes for OMAP DSS driver.
>
> The first (OMAPDSS: use sync versions...) fixes problem with system
> suspend, which causes omapdss power management to give WARNs and
> generally malfunction on system suspend/resume.
>
> The second (the rest of the patches) implements a workaround for HW bug,
> which causes physical damage to the board if the HDMI cable is
> disconnected at a "wrong" time. The actual fix is in the last patch, but
> the board files needed some cleanups and a new GPIO, which is what the
> smaller patches do.
>
> The branch is based on fbdev/fbdev-next. Is that ok?
Yes, that worked well, as I didn't start to collect 3.4 material there. Merged.
Thanks,
Florian Tobias Schandinat
>
> Tomi
>
>
> The following changes since commit f787f32e67e00b072f46b2ae3c454d2c0a1fcdb7:
>
> module_param: make bool parameters really bool (drivers/video/i810) (2012-01-12 23:28:59 +0000)
>
> are available in the git repository at:
> git://gitorious.org/linux-omap-dss2/linux.git for-3.3-rc
>
> Tomi Valkeinen (7):
> OMAPDSS: use sync versions of pm_runtime_put
> OMAP: 4430SDP/Panda: use gpio_free_array to free HDMI gpios
> OMAP: 4430SDP/Panda: rename HPD GPIO to CT_CP_HPD
> OMAPDSS: remove wrong HDMI HPD muxing
> OMAP: 4430SDP/Panda: setup HDMI GPIO muxes
> OMAP: 4430SDP/Panda: add HDMI HPD gpio
> OMAPDSS: HDMI: PHY burnout fix
>
> arch/arm/mach-omap2/board-4430sdp.c | 18 ++++++--
> arch/arm/mach-omap2/board-omap4panda.c | 18 ++++++--
> arch/arm/mach-omap2/display.c | 4 --
> drivers/video/omap2/dss/dispc.c | 2 +-
> drivers/video/omap2/dss/dsi.c | 2 +-
> drivers/video/omap2/dss/dss.c | 2 +-
> drivers/video/omap2/dss/hdmi.c | 5 ++-
> drivers/video/omap2/dss/rfbi.c | 2 +-
> drivers/video/omap2/dss/ti_hdmi.h | 4 ++
> drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 68 +++++++++++++++++++++++++++--
> drivers/video/omap2/dss/venc.c | 2 +-
> include/video/omapdss.h | 5 ++
> 12 files changed, 110 insertions(+), 22 deletions(-)
>
^ permalink raw reply
* Re: [PATCH 1/2] video: s3c-fb: add alpha value width setting
From: Florian Tobias Schandinat @ 2012-01-30 5:23 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <007d01ccdcb7$24131ce0$6c3956a0$%han@samsung.com>
On 01/27/2012 05:47 AM, Jingoo Han wrote:
> This patch adds alpha value width setting according to
> transparency value of each window format, using BLENDCON
> register. When alpha value is 8 bits, BLENDCON will set
> alpha value width as 8 bits.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Applied both patches of this series.
Thanks,
Florian Tobias Schandinat
> ---
> arch/arm/plat-samsung/include/plat/regs-fb.h | 6 ++++++
> drivers/video/s3c-fb.c | 18 ++++++++++++++++++
> 2 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-samsung/include/plat/regs-fb.h b/arch/arm/plat-samsung/include/plat/regs-fb.h
> index 8f39aa5..6bf68ed 100644
> --- a/arch/arm/plat-samsung/include/plat/regs-fb.h
> +++ b/arch/arm/plat-samsung/include/plat/regs-fb.h
> @@ -384,3 +384,9 @@
> #define WPALCON_W0PAL_16BPP_A555 (0x5 << 0)
> #define WPALCON_W0PAL_16BPP_565 (0x6 << 0)
>
> +/* Blending equation control */
> +#define BLENDCON (0x260)
> +#define BLENDCON_NEW_MASK (1 << 0)
> +#define BLENDCON_NEW_8BIT_ALPHA_VALUE (1 << 0)
> +#define BLENDCON_NEW_4BIT_ALPHA_VALUE (0 << 0)
> +
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 0c63b69..e92be55 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -81,6 +81,7 @@ struct s3c_fb;
> * @palette: Address of palette memory, or 0 if none.
> * @has_prtcon: Set if has PRTCON register.
> * @has_shadowcon: Set if has SHADOWCON register.
> + * @has_blendcon: Set if has BLENDCON register.
> * @has_clksel: Set if VIDCON0 register has CLKSEL bit.
> */
> struct s3c_fb_variant {
> @@ -99,6 +100,7 @@ struct s3c_fb_variant {
>
> unsigned int has_prtcon:1;
> unsigned int has_shadowcon:1;
> + unsigned int has_blendcon:1;
> unsigned int has_clksel:1;
> };
>
> @@ -692,6 +694,17 @@ static int s3c_fb_set_par(struct fb_info *info)
> writel(data, regs + sfb->variant.wincon + (win_no * 4));
> writel(0x0, regs + sfb->variant.winmap + (win_no * 4));
>
> + /* Set alpha value width */
> + if (sfb->variant.has_blendcon) {
> + data = readl(sfb->regs + BLENDCON);
> + data &= ~BLENDCON_NEW_MASK;
> + if (var->transp.length > 4)
> + data |= BLENDCON_NEW_8BIT_ALPHA_VALUE;
> + else
> + data |= BLENDCON_NEW_4BIT_ALPHA_VALUE;
> + writel(data, sfb->regs + BLENDCON);
> + }
> +
> shadow_protect_win(win, 0);
>
> pm_runtime_put_sync(sfb->dev);
> @@ -1819,6 +1832,7 @@ static struct s3c_fb_driverdata s3c_fb_data_s5pc100 = {
> },
>
> .has_prtcon = 1,
> + .has_blendcon = 1,
> .has_clksel = 1,
> },
> .win[0] = &s3c_fb_data_s5p_wins[0],
> @@ -1850,6 +1864,7 @@ static struct s3c_fb_driverdata s3c_fb_data_s5pv210 = {
> },
>
> .has_shadowcon = 1,
> + .has_blendcon = 1,
> .has_clksel = 1,
> },
> .win[0] = &s3c_fb_data_s5p_wins[0],
> @@ -1881,6 +1896,7 @@ static struct s3c_fb_driverdata s3c_fb_data_exynos4 = {
> },
>
> .has_shadowcon = 1,
> + .has_blendcon = 1,
> },
> .win[0] = &s3c_fb_data_s5p_wins[0],
> .win[1] = &s3c_fb_data_s5p_wins[1],
> @@ -1944,6 +1960,8 @@ static struct s3c_fb_driverdata s3c_fb_data_s5p64x0 = {
> [1] = 0x2800,
> [2] = 0x2c00,
> },
> +
> + .has_blendcon = 1,
> },
> .win[0] = &s3c_fb_data_s5p_wins[0],
> .win[1] = &s3c_fb_data_s5p_wins[1],
^ permalink raw reply
* Re: [PATCH] video: convert drivers/video/* to use module_spi_driver()
From: Florian Tobias Schandinat @ 2012-01-30 5:24 UTC (permalink / raw)
To: Axel Lin
Cc: linux-kernel, Imre Deak, Roger Quadros, Steve Sakoman,
Erik Gilling, Gra Ignotas, Tomi Valkeinen, linux-fbdev,
linux-omap
In-Reply-To: <1327651374.7772.1.camel@phoenix>
On 01/27/2012 08:02 AM, Axel Lin wrote:
> This patch converts the drivers in drivers/video/* to use the
> module_spi_driver() macro which makes the code smaller and a bit simpler.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> Cc: Imre Deak <imre.deak@nokia.com>
> Cc: Roger Quadros <roger.quadros@nokia.com>
> Cc: Steve Sakoman <steve@sakoman.com>
> Cc: Erik Gilling <konkers@android.com>
> Cc: Gražvydas Ignotas <notasas@gmail.com>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> drivers/video/omap/lcd_mipid.c | 14 +-------------
> drivers/video/omap2/displays/panel-acx565akm.c | 13 +------------
> .../omap2/displays/panel-lgphilips-lb035q02.c | 12 +-----------
> .../omap2/displays/panel-nec-nl8048hl11-01b.c | 12 +-----------
> .../video/omap2/displays/panel-tpo-td043mtea1.c | 13 +------------
> 5 files changed, 5 insertions(+), 59 deletions(-)
>
> diff --git a/drivers/video/omap/lcd_mipid.c b/drivers/video/omap/lcd_mipid.c
> index 8d546dd..e3880c4 100644
> --- a/drivers/video/omap/lcd_mipid.c
> +++ b/drivers/video/omap/lcd_mipid.c
> @@ -609,19 +609,7 @@ static struct spi_driver mipid_spi_driver = {
> .remove = __devexit_p(mipid_spi_remove),
> };
>
> -static int __init mipid_drv_init(void)
> -{
> - spi_register_driver(&mipid_spi_driver);
> -
> - return 0;
> -}
> -module_init(mipid_drv_init);
> -
> -static void __exit mipid_drv_cleanup(void)
> -{
> - spi_unregister_driver(&mipid_spi_driver);
> -}
> -module_exit(mipid_drv_cleanup);
> +module_spi_driver(mipid_spi_driver);
>
> MODULE_DESCRIPTION("MIPI display driver");
> MODULE_LICENSE("GPL");
> diff --git a/drivers/video/omap2/displays/panel-acx565akm.c b/drivers/video/omap2/displays/panel-acx565akm.c
> index 51a87e1..d26f37a 100644
> --- a/drivers/video/omap2/displays/panel-acx565akm.c
> +++ b/drivers/video/omap2/displays/panel-acx565akm.c
> @@ -809,18 +809,7 @@ static struct spi_driver acx565akm_spi_driver = {
> .remove = __devexit_p(acx565akm_spi_remove),
> };
>
> -static int __init acx565akm_init(void)
> -{
> - return spi_register_driver(&acx565akm_spi_driver);
> -}
> -
> -static void __exit acx565akm_exit(void)
> -{
> - spi_unregister_driver(&acx565akm_spi_driver);
> -}
> -
> -module_init(acx565akm_init);
> -module_exit(acx565akm_exit);
> +module_spi_driver(acx565akm_spi_driver);
>
> MODULE_AUTHOR("Nokia Corporation");
> MODULE_DESCRIPTION("acx565akm LCD Driver");
> diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
> index e0eb35b..0841cc2 100644
> --- a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
> +++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
> @@ -264,16 +264,6 @@ static struct spi_driver lb035q02_spi_driver = {
> .remove = __devexit_p(lb035q02_panel_spi_remove),
> };
>
> -static int __init lb035q02_panel_drv_init(void)
> -{
> - return spi_register_driver(&lb035q02_spi_driver);
> -}
> -
> -static void __exit lb035q02_panel_drv_exit(void)
> -{
> - spi_unregister_driver(&lb035q02_spi_driver);
> -}
> +module_spi_driver(lb035q02_spi_driver);
>
> -module_init(lb035q02_panel_drv_init);
> -module_exit(lb035q02_panel_drv_exit);
> MODULE_LICENSE("GPL");
> diff --git a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
> index 0eb31ca..8b38b39 100644
> --- a/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
> +++ b/drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
> @@ -350,18 +350,8 @@ static struct spi_driver nec_8048_spi_driver = {
> },
> };
>
> -static int __init nec_8048_lcd_init(void)
> -{
> - return spi_register_driver(&nec_8048_spi_driver);
> -}
> -
> -static void __exit nec_8048_lcd_exit(void)
> -{
> - return spi_unregister_driver(&nec_8048_spi_driver);
> -}
> +module_spi_driver(nec_8048_spi_driver);
>
> -module_init(nec_8048_lcd_init);
> -module_exit(nec_8048_lcd_exit);
> MODULE_AUTHOR("Erik Gilling <konkers@android.com>");
> MODULE_DESCRIPTION("NEC-nl8048hl11-01b Driver");
> MODULE_LICENSE("GPL");
> diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
> index e6649aa..1d6b7fb 100644
> --- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
> +++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
> @@ -518,18 +518,7 @@ static struct spi_driver tpo_td043_spi_driver = {
> .remove = __devexit_p(tpo_td043_spi_remove),
> };
>
> -static int __init tpo_td043_init(void)
> -{
> - return spi_register_driver(&tpo_td043_spi_driver);
> -}
> -
> -static void __exit tpo_td043_exit(void)
> -{
> - spi_unregister_driver(&tpo_td043_spi_driver);
> -}
> -
> -module_init(tpo_td043_init);
> -module_exit(tpo_td043_exit);
> +module_spi_driver(tpo_td043_spi_driver);
>
> MODULE_AUTHOR("Gražvydas Ignotas <notasas@gmail.com>");
> MODULE_DESCRIPTION("TPO TD043MTEA1 LCD Driver");
^ permalink raw reply
* Re: [patch v2] intelfb: remove some dead code
From: Florian Tobias Schandinat @ 2012-01-30 5:25 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20120127125833.GD3356@mwanda>
On 01/27/2012 12:58 PM, Dan Carpenter wrote:
> The goto on the line before means the return is unreachable. The goto
> also returns -ENODEV so no changes are needed there.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> v2: fixed a typo in the commit message
>
> diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
> index c6afa33..02fd226 100644
> --- a/drivers/video/intelfb/intelfbdrv.c
> +++ b/drivers/video/intelfb/intelfbdrv.c
> @@ -529,7 +529,6 @@ static int __devinit intelfb_pci_register(struct pci_dev *pdev,
> if (fb_alloc_cmap(&info->cmap, 256, 1) < 0) {
> ERR_MSG("Could not allocate cmap for intelfb_info.\n");
> goto err_out_cmap;
> - return -ENODEV;
> }
>
> dinfo = info->par;
>
^ permalink raw reply
* [PATCH 1/2] OMAPDSS: Features: Maintain dss_feats as a list
From: Archit Taneja @ 2012-01-30 5:34 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Archit Taneja
The number of dss_feat_id members has increased to a large value, the current
way of assigning a subset of these features (for a particular OMAP) as a mask
is no longer feasible.
Maintain the subset of features supported as lists. Make the function
dss_has_feature() traverse through this list.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/dss_features.c | 140 +++++++++++++++++++++++---------
drivers/video/omap2/dss/dss_features.h | 54 ++++++------
2 files changed, 128 insertions(+), 66 deletions(-)
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 419419a..656cb69 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -41,7 +41,8 @@ struct omap_dss_features {
const struct dss_reg_field *reg_fields;
const int num_reg_fields;
- const u32 has_feature;
+ const enum dss_feat_id *features;
+ const int num_features;
const int num_mgrs;
const int num_ovls;
@@ -337,15 +338,92 @@ static const struct dss_param_range omap4_dss_param_range[] = {
[FEAT_PARAM_LINEWIDTH] = { 1, 2048 },
};
+static const enum dss_feat_id omap2_dss_feat_list[] = {
+ FEAT_LCDENABLEPOL,
+ FEAT_LCDENABLESIGNAL,
+ FEAT_PCKFREEENABLE,
+ FEAT_FUNCGATED,
+ FEAT_ROWREPEATENABLE,
+ FEAT_RESIZECONF,
+};
+
+static const enum dss_feat_id omap3430_dss_feat_list[] = {
+ FEAT_LCDENABLEPOL,
+ FEAT_LCDENABLESIGNAL,
+ FEAT_PCKFREEENABLE,
+ FEAT_FUNCGATED,
+ FEAT_LINEBUFFERSPLIT,
+ FEAT_ROWREPEATENABLE,
+ FEAT_RESIZECONF,
+ FEAT_DSI_PLL_FREQSEL,
+ FEAT_DSI_REVERSE_TXCLKESC,
+ FEAT_VENC_REQUIRES_TV_DAC_CLK,
+ FEAT_CPR,
+ FEAT_PRELOAD,
+ FEAT_FIR_COEF_V,
+ FEAT_ALPHA_FIXED_ZORDER,
+ FEAT_FIFO_MERGE,
+ FEAT_OMAP3_DSI_FIFO_BUG,
+};
+
+static const enum dss_feat_id omap3630_dss_feat_list[] = {
+ FEAT_LCDENABLEPOL,
+ FEAT_LCDENABLESIGNAL,
+ FEAT_PCKFREEENABLE,
+ FEAT_FUNCGATED,
+ FEAT_LINEBUFFERSPLIT,
+ FEAT_ROWREPEATENABLE,
+ FEAT_RESIZECONF,
+ FEAT_DSI_PLL_PWR_BUG,
+ FEAT_DSI_PLL_FREQSEL,
+ FEAT_CPR,
+ FEAT_PRELOAD,
+ FEAT_FIR_COEF_V,
+ FEAT_ALPHA_FIXED_ZORDER,
+ FEAT_FIFO_MERGE,
+ FEAT_OMAP3_DSI_FIFO_BUG,
+};
+
+static const enum dss_feat_id omap4430_es1_0_dss_feat_list[] = {
+ FEAT_MGR_LCD2,
+ FEAT_CORE_CLK_DIV,
+ FEAT_LCD_CLK_SRC,
+ FEAT_DSI_DCS_CMD_CONFIG_VC,
+ FEAT_DSI_VC_OCP_WIDTH,
+ FEAT_DSI_GNQ,
+ FEAT_HANDLE_UV_SEPARATE,
+ FEAT_ATTR2,
+ FEAT_CPR,
+ FEAT_PRELOAD,
+ FEAT_FIR_COEF_V,
+ FEAT_ALPHA_FREE_ZORDER,
+ FEAT_FIFO_MERGE,
+};
+
+static const enum dss_feat_id omap4_dss_feat_list[] = {
+ FEAT_MGR_LCD2,
+ FEAT_CORE_CLK_DIV,
+ FEAT_LCD_CLK_SRC,
+ FEAT_DSI_DCS_CMD_CONFIG_VC,
+ FEAT_DSI_VC_OCP_WIDTH,
+ FEAT_DSI_GNQ,
+ FEAT_HDMI_CTS_SWMODE,
+ FEAT_HANDLE_UV_SEPARATE,
+ FEAT_ATTR2,
+ FEAT_CPR,
+ FEAT_PRELOAD,
+ FEAT_FIR_COEF_V,
+ FEAT_ALPHA_FREE_ZORDER,
+ FEAT_FIFO_MERGE,
+};
+
/* OMAP2 DSS Features */
static const struct omap_dss_features omap2_dss_features = {
.reg_fields = omap2_dss_reg_fields,
.num_reg_fields = ARRAY_SIZE(omap2_dss_reg_fields),
- .has_feature - FEAT_LCDENABLEPOL | FEAT_LCDENABLESIGNAL |
- FEAT_PCKFREEENABLE | FEAT_FUNCGATED |
- FEAT_ROWREPEATENABLE | FEAT_RESIZECONF,
+ .features = omap2_dss_feat_list,
+ .num_features = ARRAY_SIZE(omap2_dss_feat_list),
.num_mgrs = 2,
.num_ovls = 3,
@@ -363,15 +441,8 @@ static const struct omap_dss_features omap3430_dss_features = {
.reg_fields = omap3_dss_reg_fields,
.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
- .has_feature - FEAT_LCDENABLEPOL |
- FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
- FEAT_FUNCGATED | FEAT_ROWREPEATENABLE |
- FEAT_LINEBUFFERSPLIT | FEAT_RESIZECONF |
- FEAT_DSI_PLL_FREQSEL | FEAT_DSI_REVERSE_TXCLKESC |
- FEAT_VENC_REQUIRES_TV_DAC_CLK | FEAT_CPR | FEAT_PRELOAD |
- FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER | FEAT_FIFO_MERGE |
- FEAT_OMAP3_DSI_FIFO_BUG,
+ .features = omap3430_dss_feat_list,
+ .num_features = ARRAY_SIZE(omap3430_dss_feat_list),
.num_mgrs = 2,
.num_ovls = 3,
@@ -388,15 +459,8 @@ static const struct omap_dss_features omap3630_dss_features = {
.reg_fields = omap3_dss_reg_fields,
.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
- .has_feature - FEAT_LCDENABLEPOL |
- FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
- FEAT_FUNCGATED |
- FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT |
- FEAT_RESIZECONF | FEAT_DSI_PLL_PWR_BUG |
- FEAT_DSI_PLL_FREQSEL | FEAT_CPR | FEAT_PRELOAD |
- FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER | FEAT_FIFO_MERGE |
- FEAT_OMAP3_DSI_FIFO_BUG,
+ .features = omap3630_dss_feat_list,
+ .num_features = ARRAY_SIZE(omap3630_dss_feat_list),
.num_mgrs = 2,
.num_ovls = 3,
@@ -415,13 +479,8 @@ static const struct omap_dss_features omap4430_es1_0_dss_features = {
.reg_fields = omap4_dss_reg_fields,
.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
- .has_feature - FEAT_MGR_LCD2 |
- FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC |
- FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH |
- FEAT_DSI_GNQ | FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 |
- FEAT_CPR | FEAT_PRELOAD | FEAT_FIR_COEF_V |
- FEAT_ALPHA_FREE_ZORDER | FEAT_FIFO_MERGE,
+ .features = omap4430_es1_0_dss_feat_list,
+ .num_features = ARRAY_SIZE(omap4430_es1_0_dss_feat_list),
.num_mgrs = 3,
.num_ovls = 4,
@@ -439,14 +498,8 @@ static const struct omap_dss_features omap4_dss_features = {
.reg_fields = omap4_dss_reg_fields,
.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
- .has_feature - FEAT_MGR_LCD2 |
- FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC |
- FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH |
- FEAT_DSI_GNQ | FEAT_HDMI_CTS_SWMODE |
- FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 | FEAT_CPR |
- FEAT_PRELOAD | FEAT_FIR_COEF_V | FEAT_ALPHA_FREE_ZORDER |
- FEAT_FIFO_MERGE,
+ .features = omap4_dss_feat_list,
+ .num_features = ARRAY_SIZE(omap4_dss_feat_list),
.num_mgrs = 3,
.num_ovls = 4,
@@ -550,7 +603,16 @@ u32 dss_feat_get_burst_size_unit(void)
/* DSS has_feature check */
bool dss_has_feature(enum dss_feat_id id)
{
- return omap_current_dss_features->has_feature & id;
+ int i;
+ const enum dss_feat_id *features = omap_current_dss_features->features;
+ const int num_features = omap_current_dss_features->num_features;
+
+ for (i = 0; i < num_features; i++) {
+ if (features[i] = id)
+ return true;
+ }
+
+ return false;
}
void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end)
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index 5f9b821..682f091 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -31,36 +31,36 @@
/* DSS has feature id */
enum dss_feat_id {
- FEAT_LCDENABLEPOL = 1 << 3,
- FEAT_LCDENABLESIGNAL = 1 << 4,
- FEAT_PCKFREEENABLE = 1 << 5,
- FEAT_FUNCGATED = 1 << 6,
- FEAT_MGR_LCD2 = 1 << 7,
- FEAT_LINEBUFFERSPLIT = 1 << 8,
- FEAT_ROWREPEATENABLE = 1 << 9,
- FEAT_RESIZECONF = 1 << 10,
+ FEAT_LCDENABLEPOL,
+ FEAT_LCDENABLESIGNAL,
+ FEAT_PCKFREEENABLE,
+ FEAT_FUNCGATED,
+ FEAT_MGR_LCD2,
+ FEAT_LINEBUFFERSPLIT,
+ FEAT_ROWREPEATENABLE,
+ FEAT_RESIZECONF,
/* Independent core clk divider */
- FEAT_CORE_CLK_DIV = 1 << 11,
- FEAT_LCD_CLK_SRC = 1 << 12,
+ FEAT_CORE_CLK_DIV,
+ FEAT_LCD_CLK_SRC,
/* DSI-PLL power command 0x3 is not working */
- FEAT_DSI_PLL_PWR_BUG = 1 << 13,
- FEAT_DSI_PLL_FREQSEL = 1 << 14,
- FEAT_DSI_DCS_CMD_CONFIG_VC = 1 << 15,
- FEAT_DSI_VC_OCP_WIDTH = 1 << 16,
- FEAT_DSI_REVERSE_TXCLKESC = 1 << 17,
- FEAT_DSI_GNQ = 1 << 18,
- FEAT_HDMI_CTS_SWMODE = 1 << 19,
- FEAT_HANDLE_UV_SEPARATE = 1 << 20,
- FEAT_ATTR2 = 1 << 21,
- FEAT_VENC_REQUIRES_TV_DAC_CLK = 1 << 22,
- FEAT_CPR = 1 << 23,
- FEAT_PRELOAD = 1 << 24,
- FEAT_FIR_COEF_V = 1 << 25,
- FEAT_ALPHA_FIXED_ZORDER = 1 << 26,
- FEAT_ALPHA_FREE_ZORDER = 1 << 27,
- FEAT_FIFO_MERGE = 1 << 28,
+ FEAT_DSI_PLL_PWR_BUG,
+ FEAT_DSI_PLL_FREQSEL,
+ FEAT_DSI_DCS_CMD_CONFIG_VC,
+ FEAT_DSI_VC_OCP_WIDTH,
+ FEAT_DSI_REVERSE_TXCLKESC,
+ FEAT_DSI_GNQ,
+ FEAT_HDMI_CTS_SWMODE,
+ FEAT_HANDLE_UV_SEPARATE,
+ FEAT_ATTR2,
+ FEAT_VENC_REQUIRES_TV_DAC_CLK,
+ FEAT_CPR,
+ FEAT_PRELOAD,
+ FEAT_FIR_COEF_V,
+ FEAT_ALPHA_FIXED_ZORDER,
+ FEAT_ALPHA_FREE_ZORDER,
+ FEAT_FIFO_MERGE,
/* An unknown HW bug causing the normal FIFO thresholds not to work */
- FEAT_OMAP3_DSI_FIFO_BUG = 1 << 29,
+ FEAT_OMAP3_DSI_FIFO_BUG,
};
/* DSS register field id */
--
1.7.4.1
^ permalink raw reply related
* [PATCH 2/2] OMAPDSS: DISPC: Fix scaling constraints for OMAP4
From: Archit Taneja @ 2012-01-30 5:36 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, cmahapatra, Archit Taneja
The calculation of required DISPC_FCLK for downscaling is done by multplying the
pixel clock with an integer factor. This isn't true for OMAP4 where the required
clock is calculated using the exact ratio of downscaling done.
Fix this calculation for OMAP4. Also, do a minor clean up of calc_fclk().
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/dispc.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 3deb982..14b1f54 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1694,6 +1694,7 @@ static unsigned long calc_fclk(enum omap_channel channel, u16 width,
u16 height, u16 out_width, u16 out_height)
{
unsigned int hf, vf;
+ unsigned long pclk = dispc_mgr_pclk_rate(channel);
/*
* FIXME how to determine the 'A' factor
@@ -1716,13 +1717,16 @@ static unsigned long calc_fclk(enum omap_channel channel, u16 width,
if (cpu_is_omap24xx()) {
if (vf > 1 && hf > 1)
- return dispc_mgr_pclk_rate(channel) * 4;
+ return pclk * 4;
else
- return dispc_mgr_pclk_rate(channel) * 2;
+ return pclk * 2;
} else if (cpu_is_omap34xx()) {
- return dispc_mgr_pclk_rate(channel) * vf * hf;
+ return pclk * vf * hf;
} else {
- return dispc_mgr_pclk_rate(channel) * hf;
+ if (hf > 1)
+ return DIV_ROUND_UP(pclk, out_width) * width;
+ else
+ return pclk;
}
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH] MAINTAINERS: add entry for exynos display drivers video/driver/exynos/*
From: Donghwa Lee @ 2012-01-30 9:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <4F262DB6.7060104@samsung.com>
Hi,
I'd like to add Inki Dae, Donghwa Lee and Kyungmin Park as maintainers
who developers for exynos display drivers for video/driver/exynos/*
diff --git a/MAINTAINERS b/MAINTAINERS
index 2a90101..0ffdc9f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2335,6 +2335,15 @@ S: Supported
F: drivers/gpu/drm/exynos
F: include/drm/exynos*
+EXYNOS DISPLAY DRIVERS
+M: Inki Dae <inki.dae@samsung.com>
+M: Donghwa Lee <dh09.lee@samsung.com>
+M: Kyungmin Park <kyungmin.park@samsung.com>
+L: linux-fbdev@vger.kernel.org
+S: Maintained
+F: drivers/video/exynos/*
+F: include/video/exynos*
+
DSCC4 DRIVER
M: Francois Romieu <romieu@fr.zoreil.com>
L: netdev@vger.kernel.org
^ permalink raw reply related
* How to restore frame buffer contents on hibernation restore?
From: vipul kumar samar @ 2012-01-30 11:25 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
How can i restore frame buffer contents in case of hibernation??
FB memory is allocated through fixup calls and that area is not
accessible to kernel. In case of hibernation while preparing kernel
snapshot, FB is not accessible to kernel. That means kernel is not
responsible to save content of FB.
How to restore frame buffer contents after restore??
Regards
Vipul Kumar Samar
^ permalink raw reply
* [PATCH 13/16] riva/fbdev: fix several -Wuninitialized
From: Danny Kukawka @ 2012-01-30 22:00 UTC (permalink / raw)
To: Antonino Daplas; +Cc: Florian Tobias Schandinat, linux-fbdev, linux-kernel
In-Reply-To: <1327960820-11867-1-git-send-email-danny.kukawka@bisect.de>
Fix several -Wuninitialized compiler warnings by changing the
order of getting modedb in riva_update_default_var() to set
first the fallback and then the prefered timing.
Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
drivers/video/riva/fbdev.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 2f58cf9..90df1a6 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -1816,6 +1816,8 @@ static void __devinit riva_update_default_var(struct fb_var_screeninfo *var,
specs->modedb, specs->modedb_len,
NULL, 8);
} else if (specs->modedb != NULL) {
+ /* get first mode in database as fallback */
+ modedb = specs->modedb[0];
/* get preferred timing */
if (info->monspecs.misc & FB_MISC_1ST_DETAIL) {
int i;
@@ -1826,9 +1828,6 @@ static void __devinit riva_update_default_var(struct fb_var_screeninfo *var,
break;
}
}
- } else {
- /* otherwise, get first mode in database */
- modedb = specs->modedb[0];
}
var->bits_per_pixel = 8;
riva_update_var(var, &modedb);
--
1.7.7.3
^ permalink raw reply related
* Re: [PATCH] MAINTAINERS: add entry for exynos display drivers video/driver/exynos/*
From: Andrew Morton @ 2012-01-30 23:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <4F2667EE.2090902@samsung.com>
On Mon, 30 Jan 2012 18:50:38 +0900
Donghwa Lee <dh09.lee@samsung.com> wrote:
> Hi,
> I'd like to add Inki Dae, Donghwa Lee and Kyungmin Park as maintainers
> who developers for exynos display drivers for video/driver/exynos/*
>
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 2a90101..0ffdc9f 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2335,6 +2335,15 @@ S: Supported
> F: drivers/gpu/drm/exynos
> F: include/drm/exynos*
>
> +EXYNOS DISPLAY DRIVERS
> +M: Inki Dae <inki.dae@samsung.com>
> +M: Donghwa Lee <dh09.lee@samsung.com>
> +M: Kyungmin Park <kyungmin.park@samsung.com>
> +L: linux-fbdev@vger.kernel.org
> +S: Maintained
> +F: drivers/video/exynos/*
> +F: include/video/exynos*
The patch is missing your signed-off-by, and rather needs it. Please
send one?
^ permalink raw reply
* [RFC][PATCH] video: add sh_mipi_dsi original driver/device interface for MIPI DSI panel
From: Kuninori Morimoto @ 2012-02-01 5:27 UTC (permalink / raw)
To: linux-fbdev
Linux kernel doesn't have common MIPI DSI interface like i2c/spi
etc at this point.
Therefore, this patch adds very simple sh_mipi_dsi original
driver/device interface for MIPI DSI like ${LINUX}/drivers/video/omap2/.
These should be replaced when common MIPI DSI interface was created.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
This is remake version of
[PATCH] fbdev: sh_mipi_dsi: add extra settings method for platform.
drivers/video/sh_mipi_dsi.c | 97 +++++++++++++++++++++++++++++++++++++++++++
include/video/sh_mipi_dsi.h | 33 +++++++++++++++
2 files changed, 130 insertions(+), 0 deletions(-)
diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
index 05151b8..8c56fb7 100644
--- a/drivers/video/sh_mipi_dsi.c
+++ b/drivers/video/sh_mipi_dsi.c
@@ -49,6 +49,65 @@
/* E.g., sh7372 has 2 MIPI-DSIs - one for each LCDC */
#define MAX_SH_MIPI_DSI 2
+/*
+ * sh_mipi_dsi driver/device register
+ *
+ * FIXME
+ *
+ * sh_mipi_dsi has original driver/device register method here,
+ * since we don't have common MIPI interface at this point.
+ * These should be replaced in the future.
+ */
+static LIST_HEAD(sh_mipi_dsi_driver_list);
+
+static int sh_mipi_dsi_register_device(struct sh_mipi_dsi_device *shdev,
+ const char *driver_name)
+{
+ static int dev_num;
+ struct sh_mipi_dsi_driver *shdrv;
+
+ /* no driver is not error at this point */
+ if (!driver_name)
+ return 0;
+
+ list_for_each_entry(shdrv, &sh_mipi_dsi_driver_list, node) {
+ if (0 = strcmp(driver_name, shdrv->name))
+ goto driver_find;
+ }
+ /* no driver is not error at this point */
+ return 0;
+
+driver_find:
+ dev_set_name(&shdev->dev, "display%d", dev_num++);
+ shdev->driver = shdrv;
+
+ return device_register(&shdev->dev);
+}
+
+static void sh_mipi_dsi_unregister_device(struct sh_mipi_dsi_device *shdev)
+{
+ shdev->driver = NULL;
+ device_unregister(&shdev->dev);
+}
+
+int sh_mipi_dsi_register_driver(struct sh_mipi_dsi_driver *shdriver)
+{
+ INIT_LIST_HEAD(&shdriver->node);
+ list_add_tail(&shdriver->node, &sh_mipi_dsi_driver_list);
+
+ return 0;
+}
+EXPORT_SYMBOL(sh_mipi_dsi_register_driver);
+
+void sh_mipi_dsi_unregister_driver(struct sh_mipi_dsi_driver *shdriver)
+{
+ list_del_init(&shdriver->node);
+}
+EXPORT_SYMBOL(sh_mipi_dsi_unregister_driver);
+
+/*
+ * sh_mipi_dsi
+ */
struct sh_mipi {
void __iomem *base;
void __iomem *linkbase;
@@ -58,8 +117,12 @@ struct sh_mipi {
void *next_board_data;
void (*next_display_on)(void *board_data, struct fb_info *info);
void (*next_display_off)(void *board_data);
+
+ struct sh_mipi_dsi_device device;
};
+#define to_shmipi(x) container_of((x), struct sh_mipi, device)
+
static struct sh_mipi *mipi_dsi[MAX_SH_MIPI_DSI];
/* Protect the above array */
@@ -109,6 +172,27 @@ static int sh_mipi_dcs_param(int handle, u8 cmd, u8 param)
param);
}
+int sh_mipi_dsi_dcs(struct sh_mipi_dsi_device *shdev, u8 cmd)
+{
+ struct sh_mipi *mipi = to_shmipi(shdev);
+ if (!mipi)
+ return -ENODEV;
+
+ return sh_mipi_send_short(mipi, MIPI_DSI_DCS_SHORT_WRITE, cmd, 0);
+}
+EXPORT_SYMBOL(sh_mipi_dsi_dcs);
+
+int sh_mipi_dsi_dcs_param(struct sh_mipi_dsi_device *shdev, u8 cmd, u8 param)
+{
+ struct sh_mipi *mipi = to_shmipi(shdev);
+ if (!mipi)
+ return -ENODEV;
+
+ return sh_mipi_send_short(mipi, MIPI_DSI_DCS_SHORT_WRITE_PARAM, cmd,
+ param);
+}
+EXPORT_SYMBOL(sh_mipi_dsi_dcs_param);
+
static void sh_mipi_dsi_enable(struct sh_mipi *mipi, bool enable)
{
/*
@@ -130,6 +214,8 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
{
void __iomem *base = mipi->base;
struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan;
+ struct sh_mipi_dsi_device *shdev = &mipi->device;
+ struct sh_mipi_dsi_driver *shdrv = shdev->driver;
u32 pctype, datatype, pixfmt, linelength, vmctr2;
u32 tmp, top, bottom, delay, div;
bool yuv;
@@ -386,6 +472,9 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
pixfmt << 4);
sh_mipi_dcs(ch->chan, MIPI_DCS_SET_DISPLAY_ON);
+ if (shdrv && shdrv->setup)
+ shdrv->setup(shdev);
+
/* Enable timeout counters */
iowrite32(0x00000f00, base + DSICTRL);
@@ -534,8 +623,14 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
pdata->lcd_chan->board_cfg.display_off = mipi_display_off;
pdata->lcd_chan->board_cfg.owner = THIS_MODULE;
+ ret = sh_mipi_dsi_register_device(&mipi->device, pdata->driver_name);
+ if (ret < 0)
+ goto eregister;
+
return 0;
+eregister:
+ clk_disable(mipi->dsit_clk);
eclkton:
esettrate:
clk_put(mipi->dsit_clk);
@@ -597,6 +692,8 @@ static int __exit sh_mipi_remove(struct platform_device *pdev)
if (res)
release_mem_region(res->start, resource_size(res));
platform_set_drvdata(pdev, NULL);
+
+ sh_mipi_dsi_unregister_device(&mipi->device);
kfree(mipi);
return 0;
diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h
index 434d56b..066184f 100644
--- a/include/video/sh_mipi_dsi.h
+++ b/include/video/sh_mipi_dsi.h
@@ -10,6 +10,9 @@
#ifndef VIDEO_SH_MIPI_DSI_H
#define VIDEO_SH_MIPI_DSI_H
+#include <linux/platform_device.h>
+#include <linux/device.h>
+
enum sh_mipi_dsi_data_fmt {
MIPI_RGB888,
MIPI_RGB565,
@@ -55,6 +58,36 @@ struct sh_mipi_dsi_info {
int (*set_dot_clock)(struct platform_device *pdev,
void __iomem *base,
int enable);
+ const char *driver_name;
+};
+
+/*
+ * FIXME
+ *
+ * sh_mipi has original MIPI DSI interface here
+ * since we don't have common interface at this point.
+ * These should be removed in the future.
+ */
+#define to_shmipidsi_driver(x)\
+ container_of((x), struct sh_mipi_dsi_driver, driver)
+#define to_shmipidsi_device(x)\
+ container_of((x), struct sh_mipi_dsi_device, dev)
+
+struct sh_mipi_dsi_driver;
+struct sh_mipi_dsi_device {
+ struct device dev;
+ struct sh_mipi_dsi_driver *driver;
};
+struct sh_mipi_dsi_driver {
+ int (*setup)(struct sh_mipi_dsi_device *);
+ const char *name;
+ struct list_head node;
+};
+
+int sh_mipi_dsi_register_driver(struct sh_mipi_dsi_driver *shdriver);
+void sh_mipi_dsi_unregister_driver(struct sh_mipi_dsi_driver *shdriver);
+int sh_mipi_dsi_dcs(struct sh_mipi_dsi_device *shdev, u8 cmd);
+int sh_mipi_dsi_dcs_param(struct sh_mipi_dsi_device *shdev, u8 cmd, u8 param);
+
#endif
--
1.7.5.4
^ permalink raw reply related
* RE: [PATCH v7 2/2] video: backlight: support s6e8ax0 panel driver based on MIPI DSI
From: Tomi Valkeinen @ 2012-02-01 6:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <001901ccdc98$755d4bd0$6017e370$%dae@samsung.com>
[-- Attachment #1: Type: text/plain, Size: 347 bytes --]
On Fri, 2012-01-27 at 11:07 +0900, Inki Dae wrote:
> as you mentioned, we should working on a common DSI framework. do
> you have any plan for this?
I have plans to do plans =). So no. This is related to the low-level
display framework, of which I sent post to fbdev some months ago. I've
been planning to revise that also.
Tomi
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
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