From f3410474826898f7cba5d986f99819ab11f3a7d9 Mon Sep 17 00:00:00 2001 From: Torben Hohn Date: Mon, 27 May 2013 20:10:09 +0200 Subject: [PATCH 25/51] da8xx-fb: Add support to configure bpp via devicetree --- drivers/video/da8xx-fb.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) Index: linux-3.12.36-rt50-r4s2/drivers/video/da8xx-fb.c =================================================================== --- linux-3.12.36-rt50-r4s2.orig/drivers/video/da8xx-fb.c +++ linux-3.12.36-rt50-r4s2/drivers/video/da8xx-fb.c @@ -1315,6 +1315,7 @@ static struct fb_ops da8xx_fb_ops = { static struct lcd_ctrl_config *da8xx_fb_create_cfg(struct platform_device *dev) { struct lcd_ctrl_config *cfg; + struct device_node *np = dev->dev.of_node; cfg = devm_kzalloc(&dev->dev, sizeof(struct fb_videomode), GFP_KERNEL); if (!cfg) { @@ -1326,8 +1327,13 @@ static struct lcd_ctrl_config *da8xx_fb_ if (lcd_revision == LCD_VERSION_1) cfg->bpp = 16; - else - cfg->bpp = 16; + else { + u32 val; + if (!of_property_read_u32(np, "bpp", &val)) + cfg->bpp = val; + else + cfg->bpp = 16; + } /* * For panels so far used with this LCDC, below statement is sufficient. @@ -1337,6 +1343,9 @@ static struct lcd_ctrl_config *da8xx_fb_ */ cfg->panel_shade = COLOR_ACTIVE; + cfg->dma_burst_sz = 16; + cfg->fifo_th = 6; + return cfg; }