Commit 5cf9a264 authored by Archit Taneja's avatar Archit Taneja

OMAPDSS: DPI: Configure dss_lcd_mgr_config struct with lcd manager parameters

Create a dss_lcd_mgr_config struct instance in DPI. Fill up all the parameters
of the struct with configurations held by the panel, and the configurations
required by DPI.

Use these to write to the DISPC registers. These direct register writes would be
later replaced by a function which applies the configuration using the shadow
register programming model.

The DISPC_DIVISORo registers were written in the functions dpi_set_dispc_clk()
and dpi_set_dsi_clk(), now they just fill up the dispc_clock_info parameter in
mgr_config. They are written later in dpi_config_lcd_manager.
Signed-off-by: default avatarArchit Taneja <archit@ti.com>
parent c56fb3ef
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
static struct { static struct {
struct regulator *vdds_dsi_reg; struct regulator *vdds_dsi_reg;
struct platform_device *dsidev; struct platform_device *dsidev;
struct dss_lcd_mgr_config mgr_config;
} dpi; } dpi;
static struct platform_device *dpi_get_dsidev(enum omap_dss_clk_source clk) static struct platform_device *dpi_get_dsidev(enum omap_dss_clk_source clk)
...@@ -83,7 +85,7 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev, ...@@ -83,7 +85,7 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev,
dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src); dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src);
dispc_mgr_set_clock_div(dssdev->manager->id, &dispc_cinfo); dpi.mgr_config.clock_info = dispc_cinfo;
*fck = dsi_cinfo.dsi_pll_hsdiv_dispc_clk; *fck = dsi_cinfo.dsi_pll_hsdiv_dispc_clk;
*lck_div = dispc_cinfo.lck_div; *lck_div = dispc_cinfo.lck_div;
...@@ -108,7 +110,7 @@ static int dpi_set_dispc_clk(struct omap_dss_device *dssdev, ...@@ -108,7 +110,7 @@ static int dpi_set_dispc_clk(struct omap_dss_device *dssdev,
if (r) if (r)
return r; return r;
dispc_mgr_set_clock_div(dssdev->manager->id, &dispc_cinfo); dpi.mgr_config.clock_info = dispc_cinfo;
*fck = dss_cinfo.fck; *fck = dss_cinfo.fck;
*lck_div = dispc_cinfo.lck_div; *lck_div = dispc_cinfo.lck_div;
...@@ -149,15 +151,32 @@ static int dpi_set_mode(struct omap_dss_device *dssdev) ...@@ -149,15 +151,32 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
return 0; return 0;
} }
static void dpi_basic_init(struct omap_dss_device *dssdev) static void dpi_config_lcd_manager(struct omap_dss_device *dssdev)
{ {
dispc_mgr_set_io_pad_mode(DSS_IO_PAD_MODE_BYPASS); dpi.mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;
dispc_mgr_enable_stallmode(dssdev->manager->id, false);
dispc_mgr_set_lcd_type_tft(dssdev->manager->id); dpi.mgr_config.stallmode = false;
dpi.mgr_config.fifohandcheck = false;
dpi.mgr_config.video_port_width = dssdev->phy.dpi.data_lines;
dpi.mgr_config.lcden_sig_polarity = 0;
dispc_mgr_set_io_pad_mode(dpi.mgr_config.io_pad_mode);
dispc_mgr_enable_stallmode(dssdev->manager->id,
dpi.mgr_config.stallmode);
dispc_mgr_enable_fifohandcheck(dssdev->manager->id,
dpi.mgr_config.fifohandcheck);
dispc_mgr_set_tft_data_lines(dssdev->manager->id, dispc_mgr_set_tft_data_lines(dssdev->manager->id,
dssdev->phy.dpi.data_lines); dpi.mgr_config.video_port_width);
dispc_mgr_set_clock_div(dssdev->manager->id,
&dpi.mgr_config.clock_info);
dispc_lcd_enable_signal_polarity(dpi.mgr_config.lcden_sig_polarity);
dispc_mgr_set_lcd_type_tft(dssdev->manager->id);
} }
int omapdss_dpi_display_enable(struct omap_dss_device *dssdev) int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
...@@ -190,8 +209,6 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev) ...@@ -190,8 +209,6 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
if (r) if (r)
goto err_get_dispc; goto err_get_dispc;
dpi_basic_init(dssdev);
if (dpi_use_dsi_pll(dssdev)) { if (dpi_use_dsi_pll(dssdev)) {
r = dsi_runtime_get(dpi.dsidev); r = dsi_runtime_get(dpi.dsidev);
if (r) if (r)
...@@ -206,6 +223,8 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev) ...@@ -206,6 +223,8 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
if (r) if (r)
goto err_set_mode; goto err_set_mode;
dpi_config_lcd_manager(dssdev);
mdelay(2); mdelay(2);
r = dss_mgr_enable(dssdev->manager); r = dss_mgr_enable(dssdev->manager);
......
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