OMAPDSS: DPI: Maintain copy of number of data lines in driver data
authorArchit Taneja <archit@ti.com>
Fri, 6 Jul 2012 10:00:52 +0000 (15:30 +0530)
committerArchit Taneja <archit@ti.com>
Thu, 16 Aug 2012 12:30:55 +0000 (18:00 +0530)
The DPI driver currently relies on the omap_dss_device struct to configure the
number of data lines as specified by the panel. This makes the DPI interface
driver dependent on the omap_dss_device struct.

Make the DPI driver data maintain it's own data lines field. A panel driver
is expected to call omapdss_dpi_set_data_lines() before enabling the interface.

Signed-off-by: Archit Taneja <archit@ti.com>
drivers/video/omap2/displays/panel-generic-dpi.c
drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c
drivers/video/omap2/displays/panel-picodlp.c
drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
drivers/video/omap2/displays/panel-tfp410.c
drivers/video/omap2/displays/panel-tpo-td043mtea1.c
drivers/video/omap2/dss/dpi.c
include/video/omapdss.h

index a07e18c8f71b97c0ba96dfd535ec648f576d2c22..88295c526815e76a628e1e5641902e1ceac0b07d 100644 (file)
@@ -566,6 +566,7 @@ static int generic_dpi_panel_power_on(struct omap_dss_device *dssdev)
                return 0;
 
        omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
+       omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines);
 
        r = omapdss_dpi_display_enable(dssdev);
        if (r)
index 7e52aee36f4fd2d663b7ee1b004eec583e75220f..90c1cabf244e183ea7572b083a3a2b9a9fa3cc69 100644 (file)
@@ -56,6 +56,7 @@ static int lb035q02_panel_power_on(struct omap_dss_device *dssdev)
                return 0;
 
        omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
+       omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines);
 
        r = omapdss_dpi_display_enable(dssdev);
        if (r)
index e501c401ccb037996a07b38f711c7696f0a93b7f..908fd268f3dc90fd98b3eb4827166a5f5e94214f 100644 (file)
@@ -176,6 +176,7 @@ static int nec_8048_panel_power_on(struct omap_dss_device *dssdev)
                return 0;
 
        omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
+       omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines);
 
        r = omapdss_dpi_display_enable(dssdev);
        if (r)
index 0d7a8ff50f1665cd874d50266184fafc738a898d..9df87640ddd2b0ed574d93e30c69492756167628 100644 (file)
@@ -379,6 +379,7 @@ static int picodlp_panel_power_on(struct omap_dss_device *dssdev)
        msleep(1000);
 
        omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
+       omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines);
 
        r = omapdss_dpi_display_enable(dssdev);
        if (r) {
index 1486a81fc8b608ee52fa4d4ecb8fd7c03324382c..1ec3b277ff155edca2861be48f3d013b01334aa1 100644 (file)
@@ -143,6 +143,7 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev)
                return 0;
 
        omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
+       omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines);
 
        r = omapdss_dpi_display_enable(dssdev);
        if (r)
index 9397236084b17c49a57d5d6c1212d946bb5e0537..4be9a59664d58cd20274c865b6583138217dd446 100644 (file)
@@ -66,6 +66,7 @@ static int tfp410_power_on(struct omap_dss_device *dssdev)
                return 0;
 
        omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
+       omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines);
 
        r = omapdss_dpi_display_enable(dssdev);
        if (r)
index 3f47f5f594b42bf5b75a975b1584a3acc9a65352..b5e6dbc59f0a654c79d9d3b6b40eaba955680c2a 100644 (file)
@@ -338,6 +338,7 @@ static int tpo_td043_enable_dss(struct omap_dss_device *dssdev)
                return 0;
 
        omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
+       omapdss_dpi_set_data_lines(dssdev, dssdev->phy.dpi.data_lines);
 
        r = omapdss_dpi_display_enable(dssdev);
        if (r)
index d561a9198a8d12b9e096de6a18ecc09fb872f656..f260343e24517c33a5a2325f3805bac76debcd62 100644 (file)
@@ -43,6 +43,7 @@ static struct {
 
        struct omap_video_timings timings;
        struct dss_lcd_mgr_config mgr_config;
+       int data_lines;
 } dpi;
 
 static struct platform_device *dpi_get_dsidev(enum omap_dss_clk_source clk)
@@ -161,7 +162,7 @@ static void dpi_config_lcd_manager(struct omap_dss_device *dssdev)
        dpi.mgr_config.stallmode = false;
        dpi.mgr_config.fifohandcheck = false;
 
-       dpi.mgr_config.video_port_width = dssdev->phy.dpi.data_lines;
+       dpi.mgr_config.video_port_width = dpi.data_lines;
 
        dpi.mgr_config.lcden_sig_polarity = 0;
 
@@ -347,6 +348,16 @@ int dpi_check_timings(struct omap_dss_device *dssdev,
 }
 EXPORT_SYMBOL(dpi_check_timings);
 
+void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
+{
+       mutex_lock(&dpi.lock);
+
+       dpi.data_lines = data_lines;
+
+       mutex_unlock(&dpi.lock);
+}
+EXPORT_SYMBOL(omapdss_dpi_set_data_lines);
+
 static int __init dpi_init_display(struct omap_dss_device *dssdev)
 {
        DSSDBG("init_display\n");
index 2e8bb087feff88ea3c50351fedbf95ad4efa3b51..38633b29195d21fac3491867601b3999ed85bd8f 100644 (file)
@@ -743,6 +743,7 @@ void omapdss_dpi_set_timings(struct omap_dss_device *dssdev,
                struct omap_video_timings *timings);
 int dpi_check_timings(struct omap_dss_device *dssdev,
                        struct omap_video_timings *timings);
+void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines);
 
 int omapdss_sdi_display_enable(struct omap_dss_device *dssdev);
 void omapdss_sdi_display_disable(struct omap_dss_device *dssdev);