Commit a0d269ec authored by Tomi Valkeinen's avatar Tomi Valkeinen

OMAPDSS: DSI: remove DSI & DISPC clk divisors from dssdev

struct omap_dss_device contains DSS clock divisors. The idea is that the
board file can pass precalculated divisors to the display driver.
However, these divsors are no longer needed, as the omapdss driver can
calculate the divisors during runtime.

This patch removes the divisors from omap_dss_device, and their uses
from the dsi driver.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: default avatarArchit Taneja <archit@ti.com>
parent 07961ac7
...@@ -261,6 +261,13 @@ struct dsi_data { ...@@ -261,6 +261,13 @@ struct dsi_data {
struct clk *dss_clk; struct clk *dss_clk;
struct clk *sys_clk; struct clk *sys_clk;
struct dispc_clock_info user_dispc_cinfo;
struct dsi_clock_info user_dsi_cinfo;
enum omap_dss_clk_source user_dispc_fclk_src;
enum omap_dss_clk_source user_lcd_clk_src;
enum omap_dss_clk_source user_dsi_fclk_src;
struct dsi_clock_info current_cinfo; struct dsi_clock_info current_cinfo;
bool vdds_dsi_enabled; bool vdds_dsi_enabled;
...@@ -1200,7 +1207,7 @@ static int dsi_set_lp_clk_divisor(struct omap_dss_device *dssdev) ...@@ -1200,7 +1207,7 @@ static int dsi_set_lp_clk_divisor(struct omap_dss_device *dssdev)
unsigned lp_clk_div; unsigned lp_clk_div;
unsigned long lp_clk; unsigned long lp_clk;
lp_clk_div = dssdev->clocks.dsi.lp_clk_div; lp_clk_div = dsi->user_dsi_cinfo.lp_clk_div;
if (lp_clk_div == 0 || lp_clk_div > dsi->lpdiv_max) if (lp_clk_div == 0 || lp_clk_div > dsi->lpdiv_max)
return -EINVAL; return -EINVAL;
...@@ -3910,7 +3917,7 @@ static void dsi_config_cmd_mode_interleaving(struct omap_dss_device *dssdev) ...@@ -3910,7 +3917,7 @@ static void dsi_config_cmd_mode_interleaving(struct omap_dss_device *dssdev)
struct omap_video_timings *timings = &dsi->timings; struct omap_video_timings *timings = &dsi->timings;
int bpp = dsi_get_pixel_size(dsi->pix_fmt); int bpp = dsi_get_pixel_size(dsi->pix_fmt);
int ndl = dsi->num_lanes_used - 1; int ndl = dsi->num_lanes_used - 1;
int dsi_fclk_hsdiv = dssdev->clocks.dsi.regm_dsi + 1; int dsi_fclk_hsdiv = dsi->user_dsi_cinfo.regm_dsi + 1;
int hsa_interleave_hs = 0, hsa_interleave_lp = 0; int hsa_interleave_hs = 0, hsa_interleave_lp = 0;
int hfp_interleave_hs = 0, hfp_interleave_lp = 0; int hfp_interleave_hs = 0, hfp_interleave_lp = 0;
int hbp_interleave_hs = 0, hbp_interleave_lp = 0; int hbp_interleave_hs = 0, hbp_interleave_lp = 0;
...@@ -4302,24 +4309,24 @@ int omapdss_dsi_set_clocks(struct omap_dss_device *dssdev, ...@@ -4302,24 +4309,24 @@ int omapdss_dsi_set_clocks(struct omap_dss_device *dssdev,
dsi_fclk = cinfo.dsi_pll_hsdiv_dsi_clk; dsi_fclk = cinfo.dsi_pll_hsdiv_dsi_clk;
lp_clk_div = DIV_ROUND_UP(dsi_fclk, lp_clk * 2); lp_clk_div = DIV_ROUND_UP(dsi_fclk, lp_clk * 2);
dssdev->clocks.dsi.regn = cinfo.regn; dsi->user_dsi_cinfo.regn = cinfo.regn;
dssdev->clocks.dsi.regm = cinfo.regm; dsi->user_dsi_cinfo.regm = cinfo.regm;
dssdev->clocks.dsi.regm_dispc = cinfo.regm_dispc; dsi->user_dsi_cinfo.regm_dispc = cinfo.regm_dispc;
dssdev->clocks.dsi.regm_dsi = cinfo.regm_dsi; dsi->user_dsi_cinfo.regm_dsi = cinfo.regm_dsi;
dssdev->clocks.dsi.lp_clk_div = lp_clk_div; dsi->user_dsi_cinfo.lp_clk_div = lp_clk_div;
dssdev->clocks.dispc.channel.lck_div = dispc_cinfo.lck_div; dsi->user_dispc_cinfo.lck_div = dispc_cinfo.lck_div;
dssdev->clocks.dispc.channel.pck_div = dispc_cinfo.pck_div; dsi->user_dispc_cinfo.pck_div = dispc_cinfo.pck_div;
dssdev->clocks.dispc.dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK; dsi->user_dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK;
dssdev->clocks.dispc.channel.lcd_clk_src = dsi->user_lcd_clk_src =
dsi->module_id == 0 ? dsi->module_id == 0 ?
OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC : OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC :
OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC; OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC;
dssdev->clocks.dsi.dsi_fclk_src = dsi->user_dsi_fclk_src =
dsi->module_id == 0 ? dsi->module_id == 0 ?
OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI : OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI :
OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI; OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI;
...@@ -4589,8 +4596,8 @@ static int dsi_configure_dispc_clocks(struct omap_dss_device *dssdev) ...@@ -4589,8 +4596,8 @@ static int dsi_configure_dispc_clocks(struct omap_dss_device *dssdev)
fck = dsi_get_pll_hsdiv_dispc_rate(dsidev); fck = dsi_get_pll_hsdiv_dispc_rate(dsidev);
dispc_cinfo.lck_div = dssdev->clocks.dispc.channel.lck_div; dispc_cinfo.lck_div = dsi->user_dispc_cinfo.lck_div;
dispc_cinfo.pck_div = dssdev->clocks.dispc.channel.pck_div; dispc_cinfo.pck_div = dsi->user_dispc_cinfo.pck_div;
r = dispc_calc_clock_rates(fck, &dispc_cinfo); r = dispc_calc_clock_rates(fck, &dispc_cinfo);
if (r) { if (r) {
...@@ -4679,13 +4686,12 @@ static void dsi_display_uninit_dispc(struct omap_dss_device *dssdev) ...@@ -4679,13 +4686,12 @@ static void dsi_display_uninit_dispc(struct omap_dss_device *dssdev)
static int dsi_configure_dsi_clocks(struct omap_dss_device *dssdev) static int dsi_configure_dsi_clocks(struct omap_dss_device *dssdev)
{ {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
struct dsi_clock_info cinfo; struct dsi_clock_info cinfo;
int r; int r;
cinfo.regn = dssdev->clocks.dsi.regn; cinfo = dsi->user_dsi_cinfo;
cinfo.regm = dssdev->clocks.dsi.regm;
cinfo.regm_dispc = dssdev->clocks.dsi.regm_dispc;
cinfo.regm_dsi = dssdev->clocks.dsi.regm_dsi;
r = dsi_calc_clock_rates(dsidev, &cinfo); r = dsi_calc_clock_rates(dsidev, &cinfo);
if (r) { if (r) {
DSSERR("Failed to calc dsi clocks\n"); DSSERR("Failed to calc dsi clocks\n");
...@@ -4716,9 +4722,8 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev) ...@@ -4716,9 +4722,8 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev)
if (r) if (r)
goto err1; goto err1;
dss_select_dsi_clk_source(dsi->module_id, dssdev->clocks.dsi.dsi_fclk_src); dss_select_dsi_clk_source(dsi->module_id, dsi->user_dsi_fclk_src);
dss_select_lcd_clk_source(mgr->id, dss_select_lcd_clk_source(mgr->id, dsi->user_lcd_clk_src);
dssdev->clocks.dispc.channel.lcd_clk_src);
DSSDBG("PLL OK\n"); DSSDBG("PLL OK\n");
......
...@@ -591,27 +591,6 @@ struct omap_dss_device { ...@@ -591,27 +591,6 @@ struct omap_dss_device {
} phy; } phy;
struct { struct {
struct {
struct {
u16 lck_div;
u16 pck_div;
enum omap_dss_clk_source lcd_clk_src;
} channel;
enum omap_dss_clk_source dispc_fclk_src;
} dispc;
struct {
/* regn is one greater than TRM's REGN value */
u16 regn;
u16 regm;
u16 regm_dispc;
u16 regm_dsi;
u16 lp_clk_div;
enum omap_dss_clk_source dsi_fclk_src;
} dsi;
struct { struct {
/* regn is one greater than TRM's REGN value */ /* regn is one greater than TRM's REGN value */
u16 regn; u16 regn;
......
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