aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-08-04 18:44:15 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-08-15 08:18:25 -0400
commitfe9964cb1ed04195cecf5c11fa44f484a7f00fc9 (patch)
tree3e6e186754af5602db74b2a0d9362050356e9981 /drivers/gpu/drm
parent1ac0c894032692d3cb25583e33ceaea78cc8ab4b (diff)
drm: omapdrm: Move FEAT_PARAM_DSI* features to dsi driver
The FEAT_PARAM_DSI* features are specific to the DSI, move them from the omap_dss_features structure to the dsi driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dsi.c25
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dss_features.c6
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dss_features.h2
3 files changed, 19 insertions, 14 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 1af2c5329c99..0b8409d9b74b 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -326,6 +326,8 @@ struct dsi_of_data {
326 enum dsi_model model; 326 enum dsi_model model;
327 const struct dss_pll_hw *pll_hw; 327 const struct dss_pll_hw *pll_hw;
328 const struct dsi_module_id_data *modules; 328 const struct dsi_module_id_data *modules;
329 unsigned int max_fck_freq;
330 unsigned int max_pll_lpdiv;
329 enum dsi_quirks quirks; 331 enum dsi_quirks quirks;
330}; 332};
331 333
@@ -1323,7 +1325,7 @@ static int dsi_set_lp_clk_divisor(struct platform_device *dsidev)
1323 unsigned long dsi_fclk; 1325 unsigned long dsi_fclk;
1324 unsigned lp_clk_div; 1326 unsigned lp_clk_div;
1325 unsigned long lp_clk; 1327 unsigned long lp_clk;
1326 unsigned lpdiv_max = dss_feat_get_param_max(FEAT_PARAM_DSIPLL_LPDIV); 1328 unsigned lpdiv_max = dsi->data->max_pll_lpdiv;
1327 1329
1328 1330
1329 lp_clk_div = dsi->user_lp_cinfo.lp_clk_div; 1331 lp_clk_div = dsi->user_lp_cinfo.lp_clk_div;
@@ -1400,11 +1402,12 @@ static int dsi_pll_power(struct platform_device *dsidev,
1400} 1402}
1401 1403
1402 1404
1403static void dsi_pll_calc_dsi_fck(struct dss_pll_clock_info *cinfo) 1405static void dsi_pll_calc_dsi_fck(struct dsi_data *dsi,
1406 struct dss_pll_clock_info *cinfo)
1404{ 1407{
1405 unsigned long max_dsi_fck; 1408 unsigned long max_dsi_fck;
1406 1409
1407 max_dsi_fck = dss_feat_get_param_max(FEAT_PARAM_DSI_FCK); 1410 max_dsi_fck = dsi->data->max_fck_freq;
1408 1411
1409 cinfo->mX[HSDIV_DSI] = DIV_ROUND_UP(cinfo->clkdco, max_dsi_fck); 1412 cinfo->mX[HSDIV_DSI] = DIV_ROUND_UP(cinfo->clkdco, max_dsi_fck);
1410 cinfo->clkout[HSDIV_DSI] = cinfo->clkdco / cinfo->mX[HSDIV_DSI]; 1413 cinfo->clkout[HSDIV_DSI] = cinfo->clkdco / cinfo->mX[HSDIV_DSI];
@@ -4537,6 +4540,7 @@ static bool dsi_cm_calc_pll_cb(int n, int m, unsigned long fint,
4537 unsigned long clkdco, void *data) 4540 unsigned long clkdco, void *data)
4538{ 4541{
4539 struct dsi_clk_calc_ctx *ctx = data; 4542 struct dsi_clk_calc_ctx *ctx = data;
4543 struct dsi_data *dsi = dsi_get_dsidrv_data(ctx->dsidev);
4540 4544
4541 ctx->dsi_cinfo.n = n; 4545 ctx->dsi_cinfo.n = n;
4542 ctx->dsi_cinfo.m = m; 4546 ctx->dsi_cinfo.m = m;
@@ -4544,7 +4548,7 @@ static bool dsi_cm_calc_pll_cb(int n, int m, unsigned long fint,
4544 ctx->dsi_cinfo.clkdco = clkdco; 4548 ctx->dsi_cinfo.clkdco = clkdco;
4545 4549
4546 return dss_pll_hsdiv_calc_a(ctx->pll, clkdco, ctx->req_pck_min, 4550 return dss_pll_hsdiv_calc_a(ctx->pll, clkdco, ctx->req_pck_min,
4547 dss_feat_get_param_max(FEAT_PARAM_DSS_FCK), 4551 dsi->data->max_fck_freq,
4548 dsi_cm_calc_hsdiv_cb, ctx); 4552 dsi_cm_calc_hsdiv_cb, ctx);
4549} 4553}
4550 4554
@@ -4836,6 +4840,7 @@ static bool dsi_vm_calc_pll_cb(int n, int m, unsigned long fint,
4836 unsigned long clkdco, void *data) 4840 unsigned long clkdco, void *data)
4837{ 4841{
4838 struct dsi_clk_calc_ctx *ctx = data; 4842 struct dsi_clk_calc_ctx *ctx = data;
4843 struct dsi_data *dsi = dsi_get_dsidrv_data(ctx->dsidev);
4839 4844
4840 ctx->dsi_cinfo.n = n; 4845 ctx->dsi_cinfo.n = n;
4841 ctx->dsi_cinfo.m = m; 4846 ctx->dsi_cinfo.m = m;
@@ -4843,7 +4848,7 @@ static bool dsi_vm_calc_pll_cb(int n, int m, unsigned long fint,
4843 ctx->dsi_cinfo.clkdco = clkdco; 4848 ctx->dsi_cinfo.clkdco = clkdco;
4844 4849
4845 return dss_pll_hsdiv_calc_a(ctx->pll, clkdco, ctx->req_pck_min, 4850 return dss_pll_hsdiv_calc_a(ctx->pll, clkdco, ctx->req_pck_min,
4846 dss_feat_get_param_max(FEAT_PARAM_DSS_FCK), 4851 dsi->data->max_fck_freq,
4847 dsi_vm_calc_hsdiv_cb, ctx); 4852 dsi_vm_calc_hsdiv_cb, ctx);
4848} 4853}
4849 4854
@@ -4914,7 +4919,7 @@ static int dsi_set_config(struct omap_dss_device *dssdev,
4914 goto err; 4919 goto err;
4915 } 4920 }
4916 4921
4917 dsi_pll_calc_dsi_fck(&ctx.dsi_cinfo); 4922 dsi_pll_calc_dsi_fck(dsi, &ctx.dsi_cinfo);
4918 4923
4919 r = dsi_lp_clock_calc(ctx.dsi_cinfo.clkout[HSDIV_DSI], 4924 r = dsi_lp_clock_calc(ctx.dsi_cinfo.clkout[HSDIV_DSI],
4920 config->lp_clk_min, config->lp_clk_max, &dsi->user_lp_cinfo); 4925 config->lp_clk_min, config->lp_clk_max, &dsi->user_lp_cinfo);
@@ -5335,6 +5340,8 @@ static const struct dsi_of_data dsi_of_data_omap34xx = {
5335 { .address = 0x4804fc00, .id = 0, }, 5340 { .address = 0x4804fc00, .id = 0, },
5336 { }, 5341 { },
5337 }, 5342 },
5343 .max_fck_freq = 173000000,
5344 .max_pll_lpdiv = (1 << 13) - 1,
5338 .quirks = DSI_QUIRK_REVERSE_TXCLKESC, 5345 .quirks = DSI_QUIRK_REVERSE_TXCLKESC,
5339}; 5346};
5340 5347
@@ -5345,6 +5352,8 @@ static const struct dsi_of_data dsi_of_data_omap36xx = {
5345 { .address = 0x4804fc00, .id = 0, }, 5352 { .address = 0x4804fc00, .id = 0, },
5346 { }, 5353 { },
5347 }, 5354 },
5355 .max_fck_freq = 173000000,
5356 .max_pll_lpdiv = (1 << 13) - 1,
5348 .quirks = DSI_QUIRK_PLL_PWR_BUG, 5357 .quirks = DSI_QUIRK_PLL_PWR_BUG,
5349}; 5358};
5350 5359
@@ -5356,6 +5365,8 @@ static const struct dsi_of_data dsi_of_data_omap4 = {
5356 { .address = 0x58005000, .id = 1, }, 5365 { .address = 0x58005000, .id = 1, },
5357 { }, 5366 { },
5358 }, 5367 },
5368 .max_fck_freq = 170000000,
5369 .max_pll_lpdiv = (1 << 13) - 1,
5359 .quirks = DSI_QUIRK_DCS_CMD_CONFIG_VC | DSI_QUIRK_VC_OCP_WIDTH 5370 .quirks = DSI_QUIRK_DCS_CMD_CONFIG_VC | DSI_QUIRK_VC_OCP_WIDTH
5360 | DSI_QUIRK_GNQ, 5371 | DSI_QUIRK_GNQ,
5361}; 5372};
@@ -5368,6 +5379,8 @@ static const struct dsi_of_data dsi_of_data_omap5 = {
5368 { .address = 0x58009000, .id = 1, }, 5379 { .address = 0x58009000, .id = 1, },
5369 { }, 5380 { },
5370 }, 5381 },
5382 .max_fck_freq = 209250000,
5383 .max_pll_lpdiv = (1 << 13) - 1,
5371 .quirks = DSI_QUIRK_DCS_CMD_CONFIG_VC | DSI_QUIRK_VC_OCP_WIDTH 5384 .quirks = DSI_QUIRK_DCS_CMD_CONFIG_VC | DSI_QUIRK_VC_OCP_WIDTH
5372 | DSI_QUIRK_GNQ | DSI_QUIRK_PHY_DCC, 5385 | DSI_QUIRK_GNQ | DSI_QUIRK_PHY_DCC,
5373}; 5386};
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.c b/drivers/gpu/drm/omapdrm/dss/dss_features.c
index e28c9f2d35fb..1d35cc80b363 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.c
@@ -114,8 +114,6 @@ static const struct dss_param_range omap2_dss_param_range[] = {
114static const struct dss_param_range omap3_dss_param_range[] = { 114static const struct dss_param_range omap3_dss_param_range[] = {
115 [FEAT_PARAM_DSS_FCK] = { 0, 173000000 }, 115 [FEAT_PARAM_DSS_FCK] = { 0, 173000000 },
116 [FEAT_PARAM_DSS_PCD] = { 1, 255 }, 116 [FEAT_PARAM_DSS_PCD] = { 1, 255 },
117 [FEAT_PARAM_DSIPLL_LPDIV] = { 1, (1 << 13) - 1},
118 [FEAT_PARAM_DSI_FCK] = { 0, 173000000 },
119 [FEAT_PARAM_DOWNSCALE] = { 1, 4 }, 117 [FEAT_PARAM_DOWNSCALE] = { 1, 4 },
120 [FEAT_PARAM_LINEWIDTH] = { 1, 1024 }, 118 [FEAT_PARAM_LINEWIDTH] = { 1, 1024 },
121}; 119};
@@ -130,8 +128,6 @@ static const struct dss_param_range am43xx_dss_param_range[] = {
130static const struct dss_param_range omap4_dss_param_range[] = { 128static const struct dss_param_range omap4_dss_param_range[] = {
131 [FEAT_PARAM_DSS_FCK] = { 0, 186000000 }, 129 [FEAT_PARAM_DSS_FCK] = { 0, 186000000 },
132 [FEAT_PARAM_DSS_PCD] = { 1, 255 }, 130 [FEAT_PARAM_DSS_PCD] = { 1, 255 },
133 [FEAT_PARAM_DSIPLL_LPDIV] = { 0, (1 << 13) - 1 },
134 [FEAT_PARAM_DSI_FCK] = { 0, 170000000 },
135 [FEAT_PARAM_DOWNSCALE] = { 1, 4 }, 131 [FEAT_PARAM_DOWNSCALE] = { 1, 4 },
136 [FEAT_PARAM_LINEWIDTH] = { 1, 2048 }, 132 [FEAT_PARAM_LINEWIDTH] = { 1, 2048 },
137}; 133};
@@ -139,8 +135,6 @@ static const struct dss_param_range omap4_dss_param_range[] = {
139static const struct dss_param_range omap5_dss_param_range[] = { 135static const struct dss_param_range omap5_dss_param_range[] = {
140 [FEAT_PARAM_DSS_FCK] = { 0, 209250000 }, 136 [FEAT_PARAM_DSS_FCK] = { 0, 209250000 },
141 [FEAT_PARAM_DSS_PCD] = { 1, 255 }, 137 [FEAT_PARAM_DSS_PCD] = { 1, 255 },
142 [FEAT_PARAM_DSIPLL_LPDIV] = { 0, (1 << 13) - 1 },
143 [FEAT_PARAM_DSI_FCK] = { 0, 209250000 },
144 [FEAT_PARAM_DOWNSCALE] = { 1, 4 }, 138 [FEAT_PARAM_DOWNSCALE] = { 1, 4 },
145 [FEAT_PARAM_LINEWIDTH] = { 1, 2048 }, 139 [FEAT_PARAM_LINEWIDTH] = { 1, 2048 },
146}; 140};
diff --git a/drivers/gpu/drm/omapdrm/dss/dss_features.h b/drivers/gpu/drm/omapdrm/dss/dss_features.h
index 6725735789d2..289c5dc1ef09 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss_features.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss_features.h
@@ -28,8 +28,6 @@
28enum dss_range_param { 28enum dss_range_param {
29 FEAT_PARAM_DSS_FCK, 29 FEAT_PARAM_DSS_FCK,
30 FEAT_PARAM_DSS_PCD, 30 FEAT_PARAM_DSS_PCD,
31 FEAT_PARAM_DSIPLL_LPDIV,
32 FEAT_PARAM_DSI_FCK,
33 FEAT_PARAM_DOWNSCALE, 31 FEAT_PARAM_DOWNSCALE,
34 FEAT_PARAM_LINEWIDTH, 32 FEAT_PARAM_LINEWIDTH,
35}; 33};