summaryrefslogtreecommitdiffstats
path: root/drivers/video/vt8500lcdfb.c
diff options
context:
space:
mode:
authorTony Prisk <linux@prisktech.co.nz>2013-04-03 07:20:38 +1300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-04 13:07:34 +0300
commit7ab0a48420c95dc4099d1777a5a24dffad102cf1 (patch)
tree197ad4145337b68fbc4cd90a771163c530bbe18f /drivers/video/vt8500lcdfb.c
parentde68efced121eda500792b42547847636066525e (diff)
downloadtalos-obmc-linux-7ab0a48420c95dc4099d1777a5a24dffad102cf1.tar.gz
talos-obmc-linux-7ab0a48420c95dc4099d1777a5a24dffad102cf1.zip
video: fb: vt8500: Convert framebuffer drivers to standardized binding
Now that a display timing binding is available, convert our almost identical binding to use the standard binding. This patch converts the vt8500 and wm8505 framebuffer drivers and associated dts/dtsi files to use the standard binding as defined in bindings/video/display-timing.txt. There are two side-effects of making this conversion: 1) The fb node should now be in the board file, rather than the soc file as the display-timing node is a child of the fb node. 2) We still require a bits per pixel property to initialize the framebuffer for the different lcd panels. Rather than including this as part of the display timing, it is moved into the framebuffer node. I have also taken the opportunity to alphabetise the includes of each driver to avoid double-ups. Signed-off-by: Tony Prisk <linux@prisktech.co.nz> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/vt8500lcdfb.c')
-rw-r--r--drivers/video/vt8500lcdfb.c53
1 files changed, 20 insertions, 33 deletions
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
index 2ff2312a16ac..9547e1831e03 100644
--- a/drivers/video/vt8500lcdfb.c
+++ b/drivers/video/vt8500lcdfb.c
@@ -15,20 +15,21 @@
* GNU General Public License for more details.
*/
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
#include <linux/delay.h>
+#include <linux/dma-mapping.h>
+#include <linux/errno.h>
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
-#include <linux/dma-mapping.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/string.h>
#include <linux/wait.h>
+#include <video/of_display_timing.h>
#include "vt8500lcdfb.h"
#include "wmt_ge_rops.h"
@@ -275,11 +276,11 @@ static int vt8500lcd_probe(struct platform_device *pdev)
{
struct vt8500lcd_info *fbi;
struct resource *res;
+ struct display_timings *disp_timing;
void *addr;
int irq, ret;
struct fb_videomode of_mode;
- struct device_node *np;
u32 bpp;
dma_addr_t fb_mem_phys;
unsigned long fb_mem_len;
@@ -344,32 +345,18 @@ static int vt8500lcd_probe(struct platform_device *pdev)
goto failed_free_res;
}
- np = of_parse_phandle(pdev->dev.of_node, "default-mode", 0);
- if (!np) {
- pr_err("%s: No display description in Device Tree\n", __func__);
- ret = -EINVAL;
- goto failed_free_res;
- }
+ disp_timing = of_get_display_timings(pdev->dev.of_node);
+ if (!disp_timing)
+ return -EINVAL;
- /*
- * This code is copied from Sascha Hauer's of_videomode helper
- * and can be replaced with a call to the helper once mainlined
- */
- ret = 0;
- ret |= of_property_read_u32(np, "hactive", &of_mode.xres);
- ret |= of_property_read_u32(np, "vactive", &of_mode.yres);
- ret |= of_property_read_u32(np, "hback-porch", &of_mode.left_margin);
- ret |= of_property_read_u32(np, "hfront-porch", &of_mode.right_margin);
- ret |= of_property_read_u32(np, "hsync-len", &of_mode.hsync_len);
- ret |= of_property_read_u32(np, "vback-porch", &of_mode.upper_margin);
- ret |= of_property_read_u32(np, "vfront-porch", &of_mode.lower_margin);
- ret |= of_property_read_u32(np, "vsync-len", &of_mode.vsync_len);
- ret |= of_property_read_u32(np, "bpp", &bpp);
- if (ret) {
- pr_err("%s: Unable to read display properties\n", __func__);
- goto failed_free_res;
- }
- of_mode.vmode = FB_VMODE_NONINTERLACED;
+ ret = of_get_fb_videomode(pdev->dev.of_node, &of_mode,
+ OF_USE_NATIVE_MODE);
+ if (ret)
+ return ret;
+
+ ret = of_property_read_u32(pdev->dev.of_node, "bits-per-pixel", &bpp);
+ if (ret)
+ return ret;
/* try allocating the framebuffer */
fb_mem_len = of_mode.xres * of_mode.yres * 2 * (bpp / 8);
OpenPOWER on IntegriCloud