diff options
author | Taneja, Archit <archit@ti.com> | 2011-03-15 00:28:22 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-03-15 03:04:27 -0400 |
commit | 31ef82377f1e0f1bc7d308ae4312e6cc5a431885 (patch) | |
tree | ad2154dfa61c9d2a38ad13895b9931cab03b48ae /drivers/video | |
parent | 235e7dba0264d4c6e56ee217fc7ef6d80da5eb67 (diff) |
OMAP: DSS2: FEATURES: Functions to return min and max values of parameters
Create 2 functions dss_feat_get_param_min() and dss_feat_get_param_max() which
return the minimum and maximum value of a parameter. Introduce a enum in
dss_features called dss_range_param which contains parameters whose ranges we
are interested in.
Replace this with dss_feat_get_max_dss_fck() which is specific to the parameter
DSS_FCK.
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 2 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.c | 2 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss_features.c | 36 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss_features.h | 7 |
4 files changed, 36 insertions, 11 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index be7694ff7ca7..6e7f46828148 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -864,7 +864,7 @@ int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck, | |||
864 | 864 | ||
865 | dss_sys_clk = dss_clk_get_rate(DSS_CLK_SYSCK); | 865 | dss_sys_clk = dss_clk_get_rate(DSS_CLK_SYSCK); |
866 | 866 | ||
867 | max_dss_fck = dss_feat_get_max_dss_fck(); | 867 | max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK); |
868 | 868 | ||
869 | if (req_pck == dsi.cache_req_pck && | 869 | if (req_pck == dsi.cache_req_pck && |
870 | dsi.cache_cinfo.clkin == dss_sys_clk) { | 870 | dsi.cache_cinfo.clkin == dss_sys_clk) { |
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 06ad31290853..562d8d28d4f2 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c | |||
@@ -457,7 +457,7 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck, | |||
457 | 457 | ||
458 | prate = dss_get_dpll4_rate(); | 458 | prate = dss_get_dpll4_rate(); |
459 | 459 | ||
460 | max_dss_fck = dss_feat_get_max_dss_fck(); | 460 | max_dss_fck = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK); |
461 | 461 | ||
462 | fck = dss_clk_get_rate(DSS_CLK_FCK); | 462 | fck = dss_clk_get_rate(DSS_CLK_FCK); |
463 | if (req_pck == dss.cache_req_pck && | 463 | if (req_pck == dss.cache_req_pck && |
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index 8de3344842d7..4c8b32af496c 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c | |||
@@ -33,6 +33,10 @@ struct dss_reg_field { | |||
33 | u8 start, end; | 33 | u8 start, end; |
34 | }; | 34 | }; |
35 | 35 | ||
36 | struct dss_param_range { | ||
37 | int min, max; | ||
38 | }; | ||
39 | |||
36 | struct omap_dss_features { | 40 | struct omap_dss_features { |
37 | const struct dss_reg_field *reg_fields; | 41 | const struct dss_reg_field *reg_fields; |
38 | const int num_reg_fields; | 42 | const int num_reg_fields; |
@@ -41,10 +45,10 @@ struct omap_dss_features { | |||
41 | 45 | ||
42 | const int num_mgrs; | 46 | const int num_mgrs; |
43 | const int num_ovls; | 47 | const int num_ovls; |
44 | const unsigned long max_dss_fck; | ||
45 | const enum omap_display_type *supported_displays; | 48 | const enum omap_display_type *supported_displays; |
46 | const enum omap_color_mode *supported_color_modes; | 49 | const enum omap_color_mode *supported_color_modes; |
47 | const char * const *clksrc_names; | 50 | const char * const *clksrc_names; |
51 | const struct dss_param_range *dss_params; | ||
48 | }; | 52 | }; |
49 | 53 | ||
50 | /* This struct is assigned to one of the below during initialization */ | 54 | /* This struct is assigned to one of the below during initialization */ |
@@ -179,6 +183,18 @@ static const char * const omap4_dss_clk_source_names[] = { | |||
179 | [DSS_CLK_SRC_FCK] = "DSS_FCLK", | 183 | [DSS_CLK_SRC_FCK] = "DSS_FCLK", |
180 | }; | 184 | }; |
181 | 185 | ||
186 | static const struct dss_param_range omap2_dss_param_range[] = { | ||
187 | [FEAT_PARAM_DSS_FCK] = { 0, 173000000 }, | ||
188 | }; | ||
189 | |||
190 | static const struct dss_param_range omap3_dss_param_range[] = { | ||
191 | [FEAT_PARAM_DSS_FCK] = { 0, 173000000 }, | ||
192 | }; | ||
193 | |||
194 | static const struct dss_param_range omap4_dss_param_range[] = { | ||
195 | [FEAT_PARAM_DSS_FCK] = { 0, 186000000 }, | ||
196 | }; | ||
197 | |||
182 | /* OMAP2 DSS Features */ | 198 | /* OMAP2 DSS Features */ |
183 | static struct omap_dss_features omap2_dss_features = { | 199 | static struct omap_dss_features omap2_dss_features = { |
184 | .reg_fields = omap2_dss_reg_fields, | 200 | .reg_fields = omap2_dss_reg_fields, |
@@ -191,10 +207,10 @@ static struct omap_dss_features omap2_dss_features = { | |||
191 | 207 | ||
192 | .num_mgrs = 2, | 208 | .num_mgrs = 2, |
193 | .num_ovls = 3, | 209 | .num_ovls = 3, |
194 | .max_dss_fck = 173000000, | ||
195 | .supported_displays = omap2_dss_supported_displays, | 210 | .supported_displays = omap2_dss_supported_displays, |
196 | .supported_color_modes = omap2_dss_supported_color_modes, | 211 | .supported_color_modes = omap2_dss_supported_color_modes, |
197 | .clksrc_names = omap2_dss_clk_source_names, | 212 | .clksrc_names = omap2_dss_clk_source_names, |
213 | .dss_params = omap2_dss_param_range, | ||
198 | }; | 214 | }; |
199 | 215 | ||
200 | /* OMAP3 DSS Features */ | 216 | /* OMAP3 DSS Features */ |
@@ -210,10 +226,10 @@ static struct omap_dss_features omap3430_dss_features = { | |||
210 | 226 | ||
211 | .num_mgrs = 2, | 227 | .num_mgrs = 2, |
212 | .num_ovls = 3, | 228 | .num_ovls = 3, |
213 | .max_dss_fck = 173000000, | ||
214 | .supported_displays = omap3430_dss_supported_displays, | 229 | .supported_displays = omap3430_dss_supported_displays, |
215 | .supported_color_modes = omap3_dss_supported_color_modes, | 230 | .supported_color_modes = omap3_dss_supported_color_modes, |
216 | .clksrc_names = omap3_dss_clk_source_names, | 231 | .clksrc_names = omap3_dss_clk_source_names, |
232 | .dss_params = omap3_dss_param_range, | ||
217 | }; | 233 | }; |
218 | 234 | ||
219 | static struct omap_dss_features omap3630_dss_features = { | 235 | static struct omap_dss_features omap3630_dss_features = { |
@@ -229,10 +245,10 @@ static struct omap_dss_features omap3630_dss_features = { | |||
229 | 245 | ||
230 | .num_mgrs = 2, | 246 | .num_mgrs = 2, |
231 | .num_ovls = 3, | 247 | .num_ovls = 3, |
232 | .max_dss_fck = 173000000, | ||
233 | .supported_displays = omap3630_dss_supported_displays, | 248 | .supported_displays = omap3630_dss_supported_displays, |
234 | .supported_color_modes = omap3_dss_supported_color_modes, | 249 | .supported_color_modes = omap3_dss_supported_color_modes, |
235 | .clksrc_names = omap3_dss_clk_source_names, | 250 | .clksrc_names = omap3_dss_clk_source_names, |
251 | .dss_params = omap3_dss_param_range, | ||
236 | }; | 252 | }; |
237 | 253 | ||
238 | /* OMAP4 DSS Features */ | 254 | /* OMAP4 DSS Features */ |
@@ -247,10 +263,10 @@ static struct omap_dss_features omap4_dss_features = { | |||
247 | 263 | ||
248 | .num_mgrs = 3, | 264 | .num_mgrs = 3, |
249 | .num_ovls = 3, | 265 | .num_ovls = 3, |
250 | .max_dss_fck = 186000000, | ||
251 | .supported_displays = omap4_dss_supported_displays, | 266 | .supported_displays = omap4_dss_supported_displays, |
252 | .supported_color_modes = omap3_dss_supported_color_modes, | 267 | .supported_color_modes = omap3_dss_supported_color_modes, |
253 | .clksrc_names = omap4_dss_clk_source_names, | 268 | .clksrc_names = omap4_dss_clk_source_names, |
269 | .dss_params = omap4_dss_param_range, | ||
254 | }; | 270 | }; |
255 | 271 | ||
256 | /* Functions returning values related to a DSS feature */ | 272 | /* Functions returning values related to a DSS feature */ |
@@ -264,10 +280,14 @@ int dss_feat_get_num_ovls(void) | |||
264 | return omap_current_dss_features->num_ovls; | 280 | return omap_current_dss_features->num_ovls; |
265 | } | 281 | } |
266 | 282 | ||
267 | /* Max supported DSS FCK in Hz */ | 283 | unsigned long dss_feat_get_param_min(enum dss_range_param param) |
268 | unsigned long dss_feat_get_max_dss_fck(void) | 284 | { |
285 | return omap_current_dss_features->dss_params[param].min; | ||
286 | } | ||
287 | |||
288 | unsigned long dss_feat_get_param_max(enum dss_range_param param) | ||
269 | { | 289 | { |
270 | return omap_current_dss_features->max_dss_fck; | 290 | return omap_current_dss_features->dss_params[param].max; |
271 | } | 291 | } |
272 | 292 | ||
273 | enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel) | 293 | enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel) |
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h index 729b5f19fa2e..da63bbf38e90 100644 --- a/drivers/video/omap2/dss/dss_features.h +++ b/drivers/video/omap2/dss/dss_features.h | |||
@@ -54,10 +54,15 @@ enum dss_feat_reg_field { | |||
54 | FEAT_REG_DISPC_CLK_SWITCH, | 54 | FEAT_REG_DISPC_CLK_SWITCH, |
55 | }; | 55 | }; |
56 | 56 | ||
57 | enum dss_range_param { | ||
58 | FEAT_PARAM_DSS_FCK, | ||
59 | }; | ||
60 | |||
57 | /* DSS Feature Functions */ | 61 | /* DSS Feature Functions */ |
58 | int dss_feat_get_num_mgrs(void); | 62 | int dss_feat_get_num_mgrs(void); |
59 | int dss_feat_get_num_ovls(void); | 63 | int dss_feat_get_num_ovls(void); |
60 | unsigned long dss_feat_get_max_dss_fck(void); | 64 | unsigned long dss_feat_get_param_min(enum dss_range_param param); |
65 | unsigned long dss_feat_get_param_max(enum dss_range_param param); | ||
61 | enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel); | 66 | enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel); |
62 | enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane); | 67 | enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane); |
63 | bool dss_feat_color_mode_supported(enum omap_plane plane, | 68 | bool dss_feat_color_mode_supported(enum omap_plane plane, |