提交 6ff9dd5a 编写于 作者: A Archit Taneja

OMAPDSS: RFBI: Add function to set panel size

RFBI drivers requires configuration of the update area. Since we don't support
partial updates, the size to be configures is the panel size itself.

Add a timings field in RFBI's driver data. Apart from x_res and y_res, all the
other fields are configured to an initial value when RFBI is enabled. A panel
driver is expected to call omapdss_rfbi_set_size() configure the size of the
panel.
Signed-off-by: NArchit Taneja <archit@ti.com>
上级 43eab861
...@@ -297,6 +297,9 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev) ...@@ -297,6 +297,9 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev)
goto err_plat_en; goto err_plat_en;
} }
omapdss_rfbi_set_size(dssdev, dssdev->panel.timings.x_res,
dssdev->panel.timings.y_res);
r = omapdss_rfbi_display_enable(dssdev); r = omapdss_rfbi_display_enable(dssdev);
if (r) if (r)
goto err_rfbi_en; goto err_rfbi_en;
......
...@@ -111,6 +111,8 @@ static struct { ...@@ -111,6 +111,8 @@ static struct {
struct omap_dss_device *dssdev[2]; struct omap_dss_device *dssdev[2];
struct semaphore bus_lock; struct semaphore bus_lock;
struct omap_video_timings timings;
} rfbi; } rfbi;
static inline void rfbi_write_reg(const struct rfbi_reg idx, u32 val) static inline void rfbi_write_reg(const struct rfbi_reg idx, u32 val)
...@@ -305,26 +307,15 @@ static int rfbi_transfer_area(struct omap_dss_device *dssdev, ...@@ -305,26 +307,15 @@ static int rfbi_transfer_area(struct omap_dss_device *dssdev,
{ {
u32 l; u32 l;
int r; int r;
struct omap_video_timings timings; u16 width = rfbi.timings.x_res;
u16 width, height; u16 height = rfbi.timings.y_res;
dssdev->driver->get_resolution(dssdev, &width, &height);
timings.x_res = width;
timings.y_res = height;
timings.hsw = 1;
timings.hfp = 1;
timings.hbp = 1;
timings.vsw = 1;
timings.vfp = 0;
timings.vbp = 0;
/*BUG_ON(callback == 0);*/ /*BUG_ON(callback == 0);*/
BUG_ON(rfbi.framedone_callback != NULL); BUG_ON(rfbi.framedone_callback != NULL);
DSSDBG("rfbi_transfer_area %dx%d\n", width, height); DSSDBG("rfbi_transfer_area %dx%d\n", width, height);
dss_mgr_set_timings(dssdev->manager, &timings); dss_mgr_set_timings(dssdev->manager, &rfbi.timings);
r = dss_mgr_enable(dssdev->manager); r = dss_mgr_enable(dssdev->manager);
if (r) if (r)
...@@ -787,6 +778,13 @@ int omap_rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *), ...@@ -787,6 +778,13 @@ int omap_rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *),
} }
EXPORT_SYMBOL(omap_rfbi_update); EXPORT_SYMBOL(omap_rfbi_update);
void omapdss_rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h)
{
rfbi.timings.x_res = w;
rfbi.timings.y_res = h;
}
EXPORT_SYMBOL(omapdss_rfbi_set_size);
static void rfbi_dump_regs(struct seq_file *s) static void rfbi_dump_regs(struct seq_file *s)
{ {
#define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, rfbi_read_reg(r)) #define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, rfbi_read_reg(r))
...@@ -841,6 +839,27 @@ static void rfbi_config_lcd_manager(struct omap_dss_device *dssdev) ...@@ -841,6 +839,27 @@ static void rfbi_config_lcd_manager(struct omap_dss_device *dssdev)
mgr_config.lcden_sig_polarity = 0; mgr_config.lcden_sig_polarity = 0;
dss_mgr_set_lcd_config(dssdev->manager, &mgr_config); dss_mgr_set_lcd_config(dssdev->manager, &mgr_config);
/*
* Set rfbi.timings with default values, the x_res and y_res fields
* are expected to be already configured by the panel driver via
* omapdss_rfbi_set_size()
*/
rfbi.timings.hsw = 1;
rfbi.timings.hfp = 1;
rfbi.timings.hbp = 1;
rfbi.timings.vsw = 1;
rfbi.timings.vfp = 0;
rfbi.timings.vbp = 0;
rfbi.timings.interlace = false;
rfbi.timings.hsync_level = OMAPDSS_SIG_ACTIVE_HIGH;
rfbi.timings.vsync_level = OMAPDSS_SIG_ACTIVE_HIGH;
rfbi.timings.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE;
rfbi.timings.de_level = OMAPDSS_SIG_ACTIVE_HIGH;
rfbi.timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES;
dss_mgr_set_timings(dssdev->manager, &rfbi.timings);
} }
int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev) int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
......
...@@ -753,5 +753,6 @@ int omap_rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *), ...@@ -753,5 +753,6 @@ int omap_rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *),
void *data); void *data);
int omap_rfbi_configure(struct omap_dss_device *dssdev, int pixel_size, int omap_rfbi_configure(struct omap_dss_device *dssdev, int pixel_size,
int data_lines); int data_lines);
void omapdss_rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h);
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册