Commit b02875be authored by Archit Taneja's avatar Archit Taneja

OMAPDSS: RFBI: Maintain copy of pixel size in driver data

The RFBI driver currently relies on the omap_dss_device struct to receive the
desired pixel size of the panel. This makes the RFBI interface driver dependent
on the omap_dss_device struct.

Make the RFBI driver data maintain it's own pixel format field. A panel driver
is expected to call omapdss_rfbi_set_pixel_size() to configure the pixel format
before enabling the interface or calling omap_rfbi_configure().
Signed-off-by: default avatarArchit Taneja <archit@ti.com>
parent 02c3960b
...@@ -150,11 +150,15 @@ static void blizzard_ctrl_setup_update(struct omap_dss_device *dssdev, ...@@ -150,11 +150,15 @@ static void blizzard_ctrl_setup_update(struct omap_dss_device *dssdev,
BLIZZARD_SRC_WRITE_LCD : BLIZZARD_SRC_WRITE_LCD :
BLIZZARD_SRC_WRITE_LCD_DESTRUCTIVE; BLIZZARD_SRC_WRITE_LCD_DESTRUCTIVE;
omap_rfbi_configure(dssdev, 16, 8); omapdss_rfbi_set_pixel_size(dssdev, 16);
omap_rfbi_configure(dssdev, 8);
blizzard_write(BLIZZARD_INPUT_WIN_X_START_0, tmp, 18); blizzard_write(BLIZZARD_INPUT_WIN_X_START_0, tmp, 18);
omap_rfbi_configure(dssdev, 16, 16); omapdss_rfbi_set_pixel_size(dssdev, 16);
omap_rfbi_configure(dssdev, 16);
} }
static void mipid_transfer(struct spi_device *spi, int cmd, const u8 *wbuf, static void mipid_transfer(struct spi_device *spi, int cmd, const u8 *wbuf,
...@@ -299,6 +303,7 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev) ...@@ -299,6 +303,7 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev)
omapdss_rfbi_set_size(dssdev, dssdev->panel.timings.x_res, omapdss_rfbi_set_size(dssdev, dssdev->panel.timings.x_res,
dssdev->panel.timings.y_res); dssdev->panel.timings.y_res);
omapdss_rfbi_set_pixel_size(dssdev, dssdev->ctrl.pixel_size);
r = omapdss_rfbi_display_enable(dssdev); r = omapdss_rfbi_display_enable(dssdev);
if (r) if (r)
......
...@@ -113,6 +113,7 @@ static struct { ...@@ -113,6 +113,7 @@ static struct {
struct semaphore bus_lock; struct semaphore bus_lock;
struct omap_video_timings timings; struct omap_video_timings timings;
int pixel_size;
} 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)
...@@ -764,10 +765,10 @@ static int rfbi_configure(int rfbi_module, int bpp, int lines) ...@@ -764,10 +765,10 @@ static int rfbi_configure(int rfbi_module, int bpp, int lines)
return 0; return 0;
} }
int omap_rfbi_configure(struct omap_dss_device *dssdev, int pixel_size, int omap_rfbi_configure(struct omap_dss_device *dssdev, int data_lines)
int data_lines)
{ {
return rfbi_configure(dssdev->phy.rfbi.channel, pixel_size, data_lines); return rfbi_configure(dssdev->phy.rfbi.channel, rfbi.pixel_size,
data_lines);
} }
EXPORT_SYMBOL(omap_rfbi_configure); EXPORT_SYMBOL(omap_rfbi_configure);
...@@ -785,6 +786,12 @@ void omapdss_rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h) ...@@ -785,6 +786,12 @@ void omapdss_rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h)
} }
EXPORT_SYMBOL(omapdss_rfbi_set_size); EXPORT_SYMBOL(omapdss_rfbi_set_size);
void omapdss_rfbi_set_pixel_size(struct omap_dss_device *dssdev, int pixel_size)
{
rfbi.pixel_size = pixel_size;
}
EXPORT_SYMBOL(omapdss_rfbi_set_pixel_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))
...@@ -835,7 +842,7 @@ static void rfbi_config_lcd_manager(struct omap_dss_device *dssdev) ...@@ -835,7 +842,7 @@ static void rfbi_config_lcd_manager(struct omap_dss_device *dssdev)
/* Do we need fifohandcheck for RFBI? */ /* Do we need fifohandcheck for RFBI? */
mgr_config.fifohandcheck = false; mgr_config.fifohandcheck = false;
mgr_config.video_port_width = dssdev->ctrl.pixel_size; mgr_config.video_port_width = rfbi.pixel_size;
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);
...@@ -890,9 +897,8 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev) ...@@ -890,9 +897,8 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
rfbi_config_lcd_manager(dssdev); rfbi_config_lcd_manager(dssdev);
rfbi_configure(dssdev->phy.rfbi.channel, rfbi_configure(dssdev->phy.rfbi.channel, rfbi.pixel_size,
dssdev->ctrl.pixel_size, dssdev->phy.rfbi.data_lines);
dssdev->phy.rfbi.data_lines);
rfbi_set_timings(dssdev->phy.rfbi.channel, rfbi_set_timings(dssdev->phy.rfbi.channel,
&dssdev->ctrl.rfbi_timings); &dssdev->ctrl.rfbi_timings);
......
...@@ -753,8 +753,9 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev); ...@@ -753,8 +753,9 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev);
void omapdss_rfbi_display_disable(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 *), 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 data_lines);
int data_lines);
void omapdss_rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h); 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);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment