From: Afzal Mohammed <hidden> Date: 2013-01-07 05:09:38
Hi,
This series adds DT support to da8xx-fb driver (device found on
DaVinci and AM335x SoC's). It does certain cleanup's in the process.
This makes use of Steffen Trumtrar's v16 of display timing DT support.
Testing has been done on AM335x SoC based boards like AM335x EVM and
AM335x EVM-SK. It has also been verified that display on DA850 EVM
(non-DT boot) works as earlier.
Another series that adds DT nodes for AM335x SoC/board would follow
this.
This series is based on v3.8-rc2,
and is dependent on,
1. Series v16 "of: add display helper" by,
Steffen Trumtrar [off-list ref]
2. Patch "da8xx: Allow use by am33xx based devices" by,
Pantelis Antoniou [off-list ref]
3. Series v2 "video: da8xx-fb: runtime timing configuration" by,
me (Afzal Mohammed [off-list ref])
To test this series on AM335x based boards,
1. Series "ARM: dts: AM33XX: lcdc support" by,
me (Afzal Mohammed [off-list ref]),
as well as,
2. Series "HWMOD fixes for AM33xx PWM submodules and device tree nodes" by,
Philip, Avinash [off-list ref]
would be needed.
A tree with all above dependencies (and below mentioned hack) is available
@git://gitorious.org/x0148406-public/linux-kernel.git da8xx-fb-dt
In the case of AM335x, in addition to this series, display PLL has to
be locked to required frequency. Unless bootloader configures it
properly, a hack would required in the Kernel. This is also present in
the above mentioned branch of the tree. A solution in the Kernel
is being worked upon and would be posted at the earliest.
Regards
Afzal
Afzal Mohammed (9):
video: da8xx-fb: enable sync lost intr for v2 ip
video: da8xx-fb: use devres
video: da8xx-fb: ensure non-null cfg in pdata
video: da8xx-fb: reorganize panel detection
video: da8xx-fb: minimal dt support
video: da8xx-fb: invoke platform callback safely
video: da8xx-fb: obtain fb_videomode info from dt
video: da8xx-fb: ensure pdata only for non-dt
video: da8xx-fb: setup struct lcd_ctrl_config for dt
Manjunathappa, Prakash (1):
video: da8xx-fb: fix 24bpp raster configuration
.../devicetree/bindings/video/fb-da8xx.txt | 36 +++++
drivers/video/da8xx-fb.c | 145 +++++++++++++-------
2 files changed, 132 insertions(+), 49 deletions(-)
create mode 100644 Documentation/devicetree/bindings/video/fb-da8xx.txt
--
1.7.9.5
From: Afzal Mohammed <hidden> Date: 2013-01-07 05:09:59
interrupt handler is checking for sync lost interrupt, but it was not
enabled, enable it.
Signed-off-by: Afzal Mohammed <redacted>
---
drivers/video/da8xx-fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Afzal Mohammed <hidden> Date: 2013-01-07 05:10:09
From: "Manjunathappa, Prakash" <redacted>
Set only LCD_V2_TFT_24BPP_MODE bit for 24bpp and LCD_V2_TFT_24BPP_UNPACK
bit along with LCD_V2_TFT_24BPP_MODE for 32bpp configuration.
Patch is tested on am335x-evm for 24bpp and da850-evm for 16bpp
configurations.
Signed-off-by: Manjunathappa, Prakash <redacted>
Signed-off-by: Afzal Mohammed <redacted>
---
drivers/video/da8xx-fb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -1040,12 +1040,9 @@ static int __devexit fb_remove(struct platform_device *dev)par->p_palette_base);dma_free_coherent(NULL,par->vram_size,par->vram_virt,par->vram_phys);-free_irq(par->irq,par);pm_runtime_put_sync(&dev->dev);pm_runtime_disable(&dev->dev);framebuffer_release(info);-iounmap(da8xx_fb_reg_base);-release_mem_region(lcdc_regs->start,resource_size(lcdc_regs));}return0;
@@ -1269,7 +1266,6 @@ static int __devinit fb_probe(struct platform_device *device)structfb_info*da8xx_fb_info;structclk*fb_clk=NULL;structda8xx_fb_par*par;-resource_size_tlen;intret,i;unsignedlongulcm;
@@ -1279,29 +1275,16 @@ static int __devinit fb_probe(struct platform_device *device)}lcdc_regs=platform_get_resource(device,IORESOURCE_MEM,0);-if(!lcdc_regs){-dev_err(&device->dev,-"Can not get memory resource for LCD controller\n");-return-ENOENT;-}--len=resource_size(lcdc_regs);--lcdc_regs=request_mem_region(lcdc_regs->start,len,lcdc_regs->name);-if(!lcdc_regs)-return-EBUSY;--da8xx_fb_reg_base=ioremap(lcdc_regs->start,len);+da8xx_fb_reg_base=devm_request_and_ioremap(&device->dev,lcdc_regs);if(!da8xx_fb_reg_base){-ret=-EBUSY;-gotoerr_request_mem;+dev_err(&device->dev,"memory resource setup failed\n");+return-EADDRNOTAVAIL;}-fb_clk=clk_get(&device->dev,"fck");+fb_clk=devm_clk_get(&device->dev,"fck");if(IS_ERR(fb_clk)){dev_err(&device->dev,"Can not get device clock\n");-ret=-ENODEV;-gotoerr_ioremap;+return-ENODEV;}pm_runtime_enable(&device->dev);
@@ -1462,7 +1445,7 @@ static int __devinit fb_probe(struct platform_device *device)lcdc_irq_handler=lcdc_irq_handler_rev02;}-ret=request_irq(par->irq,lcdc_irq_handler,0,+ret=devm_request_irq(&device->dev,par->irq,lcdc_irq_handler,0,DRIVER_NAME,par);if(ret)gotoirq_freq;
From: Afzal Mohammed <hidden> Date: 2013-01-07 05:10:35
Driver is provided a means to have the probe triggered by DT.
Signed-off-by: Afzal Mohammed <redacted>
---
.../devicetree/bindings/video/fb-da8xx.txt | 16 ++++++++++++++++
drivers/video/da8xx-fb.c | 7 +++++++
2 files changed, 23 insertions(+)
create mode 100644 Documentation/devicetree/bindings/video/fb-da8xx.txt
From: Afzal Mohammed <hidden> Date: 2013-01-07 05:10:39
Move panel detection to a separate function, this helps in readability
as well as makes DT support cleaner.
Signed-off-by: Afzal Mohammed <redacted>
---
drivers/video/da8xx-fb.c | 42 ++++++++++++++++++++++++++----------------
1 file changed, 26 insertions(+), 16 deletions(-)
@@ -6,6 +6,11 @@ Required properties: AM335x SoC's - "ti,am3352-lcdc", "ti,da830-lcdc" - reg: Address range of lcdc register set - interrupts: lcdc interrupt+- display-timings: list of different videomodes supported by the lcd+ panel, represented as childs, can have multiple modes supported, if+ only one, then it is considered native mode, if multiple modes are+ provided, native mode can be set explicitly, more details available+ @Documentation/devicetree/bindings/video/display-timing.txt Example:
From: Afzal Mohammed <hidden> Date: 2013-01-07 05:11:12
strcut lcd_ctrl_config information required for driver is currently
obtained via platform data. To handle DT probing, create
lcd_ctrl_config and populate it with default values, these values are
sufficient for the panels so far used with this controller to work.
Signed-off-by: Afzal Mohammed <redacted>
---
drivers/video/da8xx-fb.c | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
From: Afzal Mohammed <hidden> Date: 2013-01-07 05:11:35
This driver is DT probe-able, hence ensure presence of platform data
only for non-DT boot.
Signed-off-by: Afzal Mohammed <redacted>
---
drivers/video/da8xx-fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1306,7 +1306,7 @@ static int __devinit fb_probe(struct platform_device *device)intret;unsignedlongulcm;-if(fb_pdata=NULL){+if(fb_pdata=NULL&&!device->dev.of_node){dev_err(&device->dev,"Can not get platform data\n");return-ENOENT;}
From: Afzal Mohammed <hidden> Date: 2013-01-07 05:11:54
Ensure that platform data is present before checking whether platform
callback is present (the one used to control backlight). So far this
was not an issue as driver was purely non-DT triggered, but now DT
support has been added.
Signed-off-by: Afzal Mohammed <redacted>
---
drivers/video/da8xx-fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -6,6 +6,11 @@ Required properties: AM335x SoC's - "ti,am3352-lcdc", "ti,da830-lcdc" - reg: Address range of lcdc register set - interrupts: lcdc interrupt+- display-timings: list of different videomodes supported by the lcd+ panel, represented as childs, can have multiple modes supported, if+ only one, then it is considered native mode, if multiple modes are+ provided, native mode can be set explicitly, more details available+ @Documentation/devicetree/bindings/video/display-timing.txt
@@ -1261,8 +1261,24 @@ static struct fb_videomode *da8xx_fb_get_videomode(struct platform_device *dev){structda8xx_lcdc_platform_data*fb_pdata=dev->dev.platform_data;structfb_videomode*lcdc_info;+structdevice_node*np=dev->dev.of_node;inti;+if(np){+lcdc_info=devm_kzalloc(&dev->dev,+sizeof(structfb_videomode),+GFP_KERNEL);+if(!lcdc_info){+dev_err(&dev->dev,"memory allocation failed\n");+returnNULL;+}+if(of_get_fb_videomode(np,lcdc_info,0)){+dev_err(&dev->dev,"timings not available in DT\n");+returnNULL;+}+returnlcdc_info;+}
... this is not correct. You are just supporting the first display-timings
subnode (of_get_fb_videomode(..., 0)).
Regards,
Steffen
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |