OMAPDSS: RFBI: Maintain copy of number of data lines in driver data
authorArchit Taneja <archit@ti.com>
Mon, 13 Aug 2012 09:58:15 +0000 (15:28 +0530)
committerArchit Taneja <archit@ti.com>
Thu, 16 Aug 2012 12:30:54 +0000 (18:00 +0530)
The RFBI driver currently relies on the omap_dss_device struct to configure the
number of data lines as specified by the panel. This makes the RFBI interface
driver dependent on the omap_dss_device struct.

Make the RFBI driver data maintain it's own data lines field. A panel driver
is expected to call omapdss_rfbi_set_data_lines() to configure the pixel format
before enabling the interface or calling omap_rfbi_configure().

Signed-off-by: Archit Taneja <archit@ti.com>
drivers/video/omap2/displays/panel-n8x0.c
drivers/video/omap2/dss/rfbi.c
include/video/omapdss.h

index 9565958ebaa95086230dfdefc0de22fdd8ca6b91..3ffd987ad8b22c587ea9ef56e9edb0319baecf3c 100644 (file)
@@ -151,14 +151,16 @@ static void blizzard_ctrl_setup_update(struct omap_dss_device *dssdev,
                        BLIZZARD_SRC_WRITE_LCD_DESTRUCTIVE;
 
        omapdss_rfbi_set_pixel_size(dssdev, 16);
+       omapdss_rfbi_set_data_lines(dssdev, 8);
 
-       omap_rfbi_configure(dssdev, 8);
+       omap_rfbi_configure(dssdev);
 
        blizzard_write(BLIZZARD_INPUT_WIN_X_START_0, tmp, 18);
 
        omapdss_rfbi_set_pixel_size(dssdev, 16);
+       omapdss_rfbi_set_data_lines(dssdev, 16);
 
-       omap_rfbi_configure(dssdev, 16);
+       omap_rfbi_configure(dssdev);
 }
 
 static void mipid_transfer(struct spi_device *spi, int cmd, const u8 *wbuf,
@@ -304,6 +306,7 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev)
        omapdss_rfbi_set_size(dssdev, dssdev->panel.timings.x_res,
                dssdev->panel.timings.y_res);
        omapdss_rfbi_set_pixel_size(dssdev, dssdev->ctrl.pixel_size);
+       omapdss_rfbi_set_data_lines(dssdev, dssdev->phy.rfbi.data_lines);
 
        r = omapdss_rfbi_display_enable(dssdev);
        if (r)
index 98c65223789e380bd3aba1550463c4c2c13a27b1..698d5b92f8e27cba3b4edb0917ffdd759eb6d8d3 100644 (file)
@@ -114,6 +114,7 @@ static struct {
 
        struct omap_video_timings timings;
        int pixel_size;
+       int data_lines;
 } rfbi;
 
 static inline void rfbi_write_reg(const struct rfbi_reg idx, u32 val)
@@ -765,10 +766,10 @@ static int rfbi_configure(int rfbi_module, int bpp, int lines)
        return 0;
 }
 
-int omap_rfbi_configure(struct omap_dss_device *dssdev, int data_lines)
+int omap_rfbi_configure(struct omap_dss_device *dssdev)
 {
        return rfbi_configure(dssdev->phy.rfbi.channel, rfbi.pixel_size,
-                       data_lines);
+                       rfbi.data_lines);
 }
 EXPORT_SYMBOL(omap_rfbi_configure);
 
@@ -792,6 +793,12 @@ void omapdss_rfbi_set_pixel_size(struct omap_dss_device *dssdev, int pixel_size)
 }
 EXPORT_SYMBOL(omapdss_rfbi_set_pixel_size);
 
+void omapdss_rfbi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
+{
+       rfbi.data_lines = data_lines;
+}
+EXPORT_SYMBOL(omapdss_rfbi_set_data_lines);
+
 static void rfbi_dump_regs(struct seq_file *s)
 {
 #define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, rfbi_read_reg(r))
@@ -898,7 +905,7 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
        rfbi_config_lcd_manager(dssdev);
 
        rfbi_configure(dssdev->phy.rfbi.channel, rfbi.pixel_size,
-                       dssdev->phy.rfbi.data_lines);
+                       rfbi.data_lines);
 
        rfbi_set_timings(dssdev->phy.rfbi.channel,
                         &dssdev->ctrl.rfbi_timings);
index d03244a59db4fd40bb951b0de7be9e0dcdca7b67..2e8bb087feff88ea3c50351fedbf95ad4efa3b51 100644 (file)
@@ -753,9 +753,11 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev);
 void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev);
 int omap_rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *),
                void *data);
-int omap_rfbi_configure(struct omap_dss_device *dssdev, int data_lines);
+int omap_rfbi_configure(struct omap_dss_device *dssdev);
 void omapdss_rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h);
 void omapdss_rfbi_set_pixel_size(struct omap_dss_device *dssdev,
                int pixel_size);
+void omapdss_rfbi_set_data_lines(struct omap_dss_device *dssdev,
+               int data_lines);
 
 #endif