Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 1 | /* |
| 2 | * linux/drivers/video/omap2/dss/dss_features.c |
| 3 | * |
| 4 | * Copyright (C) 2010 Texas Instruments |
| 5 | * Author: Archit Taneja <archit@ti.com> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify it |
| 8 | * under the terms of the GNU General Public License version 2 as published by |
| 9 | * the Free Software Foundation. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 14 | * more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License along with |
| 17 | * this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | #include <linux/kernel.h> |
| 21 | #include <linux/types.h> |
| 22 | #include <linux/err.h> |
| 23 | #include <linux/slab.h> |
| 24 | |
| 25 | #include <plat/display.h> |
| 26 | #include <plat/cpu.h> |
| 27 | |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 28 | #include "dss.h" |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 29 | #include "dss_features.h" |
| 30 | |
| 31 | /* Defines a generic omap register field */ |
| 32 | struct dss_reg_field { |
| 33 | enum dss_feat_reg_field id; |
| 34 | u8 start, end; |
| 35 | }; |
| 36 | |
| 37 | struct omap_dss_features { |
| 38 | const struct dss_reg_field *reg_fields; |
| 39 | const int num_reg_fields; |
| 40 | |
| 41 | const u32 has_feature; |
| 42 | |
| 43 | const int num_mgrs; |
| 44 | const int num_ovls; |
Archit Taneja | 819d807 | 2011-03-01 11:54:00 +0530 | [diff] [blame] | 45 | const unsigned long max_dss_fck; |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 46 | const enum omap_display_type *supported_displays; |
| 47 | const enum omap_color_mode *supported_color_modes; |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 48 | const struct dss_clk_source_name *clksrc_names; |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | /* This struct is assigned to one of the below during initialization */ |
| 52 | static struct omap_dss_features *omap_current_dss_features; |
| 53 | |
| 54 | static const struct dss_reg_field omap2_dss_reg_fields[] = { |
| 55 | { FEAT_REG_FIRHINC, 11, 0 }, |
| 56 | { FEAT_REG_FIRVINC, 27, 16 }, |
| 57 | { FEAT_REG_FIFOLOWTHRESHOLD, 8, 0 }, |
| 58 | { FEAT_REG_FIFOHIGHTHRESHOLD, 24, 16 }, |
| 59 | { FEAT_REG_FIFOSIZE, 8, 0 }, |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 60 | { FEAT_REG_HORIZONTALACCU, 9, 0 }, |
| 61 | { FEAT_REG_VERTICALACCU, 25, 16 }, |
Taneja, Archit | ea75159 | 2011-03-08 05:50:35 -0600 | [diff] [blame^] | 62 | { FEAT_REG_DISPC_CLK_SWITCH, 0, 0 }, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 63 | }; |
| 64 | |
| 65 | static const struct dss_reg_field omap3_dss_reg_fields[] = { |
| 66 | { FEAT_REG_FIRHINC, 12, 0 }, |
| 67 | { FEAT_REG_FIRVINC, 28, 16 }, |
| 68 | { FEAT_REG_FIFOLOWTHRESHOLD, 11, 0 }, |
| 69 | { FEAT_REG_FIFOHIGHTHRESHOLD, 27, 16 }, |
| 70 | { FEAT_REG_FIFOSIZE, 10, 0 }, |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 71 | { FEAT_REG_HORIZONTALACCU, 9, 0 }, |
| 72 | { FEAT_REG_VERTICALACCU, 25, 16 }, |
Taneja, Archit | ea75159 | 2011-03-08 05:50:35 -0600 | [diff] [blame^] | 73 | { FEAT_REG_DISPC_CLK_SWITCH, 0, 0 }, |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 74 | }; |
| 75 | |
| 76 | static const struct dss_reg_field omap4_dss_reg_fields[] = { |
| 77 | { FEAT_REG_FIRHINC, 12, 0 }, |
| 78 | { FEAT_REG_FIRVINC, 28, 16 }, |
| 79 | { FEAT_REG_FIFOLOWTHRESHOLD, 15, 0 }, |
| 80 | { FEAT_REG_FIFOHIGHTHRESHOLD, 31, 16 }, |
| 81 | { FEAT_REG_FIFOSIZE, 15, 0 }, |
| 82 | { FEAT_REG_HORIZONTALACCU, 10, 0 }, |
| 83 | { FEAT_REG_VERTICALACCU, 26, 16 }, |
Taneja, Archit | ea75159 | 2011-03-08 05:50:35 -0600 | [diff] [blame^] | 84 | { FEAT_REG_DISPC_CLK_SWITCH, 9, 8 }, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 85 | }; |
| 86 | |
| 87 | static const enum omap_display_type omap2_dss_supported_displays[] = { |
| 88 | /* OMAP_DSS_CHANNEL_LCD */ |
Tomi Valkeinen | f8df01f | 2011-02-24 14:21:25 +0200 | [diff] [blame] | 89 | OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 90 | |
| 91 | /* OMAP_DSS_CHANNEL_DIGIT */ |
| 92 | OMAP_DISPLAY_TYPE_VENC, |
| 93 | }; |
| 94 | |
Tomi Valkeinen | 4e777dd | 2011-02-24 14:20:31 +0200 | [diff] [blame] | 95 | static const enum omap_display_type omap3430_dss_supported_displays[] = { |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 96 | /* OMAP_DSS_CHANNEL_LCD */ |
| 97 | OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI | |
| 98 | OMAP_DISPLAY_TYPE_SDI | OMAP_DISPLAY_TYPE_DSI, |
| 99 | |
| 100 | /* OMAP_DSS_CHANNEL_DIGIT */ |
| 101 | OMAP_DISPLAY_TYPE_VENC, |
| 102 | }; |
| 103 | |
Tomi Valkeinen | 4e777dd | 2011-02-24 14:20:31 +0200 | [diff] [blame] | 104 | static const enum omap_display_type omap3630_dss_supported_displays[] = { |
| 105 | /* OMAP_DSS_CHANNEL_LCD */ |
| 106 | OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI | |
| 107 | OMAP_DISPLAY_TYPE_DSI, |
| 108 | |
| 109 | /* OMAP_DSS_CHANNEL_DIGIT */ |
| 110 | OMAP_DISPLAY_TYPE_VENC, |
| 111 | }; |
| 112 | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 113 | static const enum omap_display_type omap4_dss_supported_displays[] = { |
| 114 | /* OMAP_DSS_CHANNEL_LCD */ |
| 115 | OMAP_DISPLAY_TYPE_DBI | OMAP_DISPLAY_TYPE_DSI, |
| 116 | |
| 117 | /* OMAP_DSS_CHANNEL_DIGIT */ |
| 118 | OMAP_DISPLAY_TYPE_VENC, |
| 119 | |
| 120 | /* OMAP_DSS_CHANNEL_LCD2 */ |
| 121 | OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI | |
| 122 | OMAP_DISPLAY_TYPE_DSI, |
| 123 | }; |
| 124 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 125 | static const enum omap_color_mode omap2_dss_supported_color_modes[] = { |
| 126 | /* OMAP_DSS_GFX */ |
| 127 | OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 | |
| 128 | OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 | |
| 129 | OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_RGB16 | |
| 130 | OMAP_DSS_COLOR_RGB24U | OMAP_DSS_COLOR_RGB24P, |
| 131 | |
| 132 | /* OMAP_DSS_VIDEO1 */ |
| 133 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | |
| 134 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 | |
| 135 | OMAP_DSS_COLOR_UYVY, |
| 136 | |
| 137 | /* OMAP_DSS_VIDEO2 */ |
| 138 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | |
| 139 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 | |
| 140 | OMAP_DSS_COLOR_UYVY, |
| 141 | }; |
| 142 | |
| 143 | static const enum omap_color_mode omap3_dss_supported_color_modes[] = { |
| 144 | /* OMAP_DSS_GFX */ |
| 145 | OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 | |
| 146 | OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 | |
| 147 | OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 | |
| 148 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | |
| 149 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 | |
| 150 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, |
| 151 | |
| 152 | /* OMAP_DSS_VIDEO1 */ |
| 153 | OMAP_DSS_COLOR_RGB24U | OMAP_DSS_COLOR_RGB24P | |
| 154 | OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_RGB16 | |
| 155 | OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_UYVY, |
| 156 | |
| 157 | /* OMAP_DSS_VIDEO2 */ |
| 158 | OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 | |
| 159 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | |
| 160 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 | |
| 161 | OMAP_DSS_COLOR_UYVY | OMAP_DSS_COLOR_ARGB32 | |
| 162 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, |
| 163 | }; |
| 164 | |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 165 | static const struct dss_clk_source_name omap2_dss_clk_source_names[] = { |
| 166 | { DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, "N/A" }, |
| 167 | { DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, "N/A" }, |
| 168 | { DSS_CLK_SRC_FCK, "DSS_FCLK1" }, |
| 169 | }; |
| 170 | |
| 171 | static const struct dss_clk_source_name omap3_dss_clk_source_names[] = { |
| 172 | { DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, "DSI1_PLL_FCLK" }, |
| 173 | { DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, "DSI2_PLL_FCLK" }, |
| 174 | { DSS_CLK_SRC_FCK, "DSS1_ALWON_FCLK" }, |
| 175 | }; |
| 176 | |
Taneja, Archit | ea75159 | 2011-03-08 05:50:35 -0600 | [diff] [blame^] | 177 | static const struct dss_clk_source_name omap4_dss_clk_source_names[] = { |
| 178 | { DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC, "PLL1_CLK1" }, |
| 179 | { DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, "PLL1_CLK2" }, |
| 180 | { DSS_CLK_SRC_FCK, "DSS_FCLK" }, |
| 181 | }; |
| 182 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 183 | /* OMAP2 DSS Features */ |
| 184 | static struct omap_dss_features omap2_dss_features = { |
| 185 | .reg_fields = omap2_dss_reg_fields, |
| 186 | .num_reg_fields = ARRAY_SIZE(omap2_dss_reg_fields), |
| 187 | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 188 | .has_feature = |
| 189 | FEAT_LCDENABLEPOL | FEAT_LCDENABLESIGNAL | |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 190 | FEAT_PCKFREEENABLE | FEAT_FUNCGATED | |
| 191 | FEAT_ROWREPEATENABLE | FEAT_RESIZECONF, |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 192 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 193 | .num_mgrs = 2, |
| 194 | .num_ovls = 3, |
Archit Taneja | 819d807 | 2011-03-01 11:54:00 +0530 | [diff] [blame] | 195 | .max_dss_fck = 173000000, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 196 | .supported_displays = omap2_dss_supported_displays, |
| 197 | .supported_color_modes = omap2_dss_supported_color_modes, |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 198 | .clksrc_names = omap2_dss_clk_source_names, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 199 | }; |
| 200 | |
| 201 | /* OMAP3 DSS Features */ |
Samreen | 8fbde10 | 2010-11-04 12:28:41 +0100 | [diff] [blame] | 202 | static struct omap_dss_features omap3430_dss_features = { |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 203 | .reg_fields = omap3_dss_reg_fields, |
| 204 | .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), |
| 205 | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 206 | .has_feature = |
| 207 | FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL | |
| 208 | FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 209 | FEAT_FUNCGATED | FEAT_ROWREPEATENABLE | |
| 210 | FEAT_LINEBUFFERSPLIT | FEAT_RESIZECONF, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 211 | |
| 212 | .num_mgrs = 2, |
| 213 | .num_ovls = 3, |
Archit Taneja | 819d807 | 2011-03-01 11:54:00 +0530 | [diff] [blame] | 214 | .max_dss_fck = 173000000, |
Tomi Valkeinen | 4e777dd | 2011-02-24 14:20:31 +0200 | [diff] [blame] | 215 | .supported_displays = omap3430_dss_supported_displays, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 216 | .supported_color_modes = omap3_dss_supported_color_modes, |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 217 | .clksrc_names = omap3_dss_clk_source_names, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 218 | }; |
| 219 | |
Samreen | 8fbde10 | 2010-11-04 12:28:41 +0100 | [diff] [blame] | 220 | static struct omap_dss_features omap3630_dss_features = { |
| 221 | .reg_fields = omap3_dss_reg_fields, |
| 222 | .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), |
| 223 | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 224 | .has_feature = |
| 225 | FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL | |
| 226 | FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 227 | FEAT_PRE_MULT_ALPHA | FEAT_FUNCGATED | |
| 228 | FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT | |
| 229 | FEAT_RESIZECONF, |
Samreen | 8fbde10 | 2010-11-04 12:28:41 +0100 | [diff] [blame] | 230 | |
| 231 | .num_mgrs = 2, |
| 232 | .num_ovls = 3, |
Archit Taneja | 819d807 | 2011-03-01 11:54:00 +0530 | [diff] [blame] | 233 | .max_dss_fck = 173000000, |
Tomi Valkeinen | 4e777dd | 2011-02-24 14:20:31 +0200 | [diff] [blame] | 234 | .supported_displays = omap3630_dss_supported_displays, |
Samreen | 8fbde10 | 2010-11-04 12:28:41 +0100 | [diff] [blame] | 235 | .supported_color_modes = omap3_dss_supported_color_modes, |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 236 | .clksrc_names = omap3_dss_clk_source_names, |
Samreen | 8fbde10 | 2010-11-04 12:28:41 +0100 | [diff] [blame] | 237 | }; |
| 238 | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 239 | /* OMAP4 DSS Features */ |
| 240 | static struct omap_dss_features omap4_dss_features = { |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 241 | .reg_fields = omap4_dss_reg_fields, |
| 242 | .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields), |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 243 | |
| 244 | .has_feature = |
| 245 | FEAT_GLOBAL_ALPHA | FEAT_PRE_MULT_ALPHA | |
Murthy, Raghuveer | 5c6366e | 2011-03-03 09:27:58 -0600 | [diff] [blame] | 246 | FEAT_MGR_LCD2 | FEAT_GLOBAL_ALPHA_VID1 | |
Taneja, Archit | ea75159 | 2011-03-08 05:50:35 -0600 | [diff] [blame^] | 247 | FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC, |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 248 | |
| 249 | .num_mgrs = 3, |
| 250 | .num_ovls = 3, |
Archit Taneja | 819d807 | 2011-03-01 11:54:00 +0530 | [diff] [blame] | 251 | .max_dss_fck = 186000000, |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 252 | .supported_displays = omap4_dss_supported_displays, |
| 253 | .supported_color_modes = omap3_dss_supported_color_modes, |
Taneja, Archit | ea75159 | 2011-03-08 05:50:35 -0600 | [diff] [blame^] | 254 | .clksrc_names = omap4_dss_clk_source_names, |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 255 | }; |
| 256 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 257 | /* Functions returning values related to a DSS feature */ |
| 258 | int dss_feat_get_num_mgrs(void) |
| 259 | { |
| 260 | return omap_current_dss_features->num_mgrs; |
| 261 | } |
| 262 | |
| 263 | int dss_feat_get_num_ovls(void) |
| 264 | { |
| 265 | return omap_current_dss_features->num_ovls; |
| 266 | } |
| 267 | |
Archit Taneja | 819d807 | 2011-03-01 11:54:00 +0530 | [diff] [blame] | 268 | /* Max supported DSS FCK in Hz */ |
| 269 | unsigned long dss_feat_get_max_dss_fck(void) |
| 270 | { |
| 271 | return omap_current_dss_features->max_dss_fck; |
| 272 | } |
| 273 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 274 | enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel) |
| 275 | { |
| 276 | return omap_current_dss_features->supported_displays[channel]; |
| 277 | } |
| 278 | |
| 279 | enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane) |
| 280 | { |
| 281 | return omap_current_dss_features->supported_color_modes[plane]; |
| 282 | } |
| 283 | |
Archit Taneja | 8dad2ab | 2010-11-25 17:58:10 +0530 | [diff] [blame] | 284 | bool dss_feat_color_mode_supported(enum omap_plane plane, |
| 285 | enum omap_color_mode color_mode) |
| 286 | { |
| 287 | return omap_current_dss_features->supported_color_modes[plane] & |
| 288 | color_mode; |
| 289 | } |
| 290 | |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 291 | const char *dss_feat_get_clk_source_name(enum dss_clk_source id) |
| 292 | { |
| 293 | return omap_current_dss_features->clksrc_names[id].clksrc_name; |
| 294 | } |
| 295 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 296 | /* DSS has_feature check */ |
| 297 | bool dss_has_feature(enum dss_feat_id id) |
| 298 | { |
| 299 | return omap_current_dss_features->has_feature & id; |
| 300 | } |
| 301 | |
| 302 | void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end) |
| 303 | { |
| 304 | if (id >= omap_current_dss_features->num_reg_fields) |
| 305 | BUG(); |
| 306 | |
| 307 | *start = omap_current_dss_features->reg_fields[id].start; |
| 308 | *end = omap_current_dss_features->reg_fields[id].end; |
| 309 | } |
| 310 | |
| 311 | void dss_features_init(void) |
| 312 | { |
| 313 | if (cpu_is_omap24xx()) |
| 314 | omap_current_dss_features = &omap2_dss_features; |
Samreen | 8fbde10 | 2010-11-04 12:28:41 +0100 | [diff] [blame] | 315 | else if (cpu_is_omap3630()) |
| 316 | omap_current_dss_features = &omap3630_dss_features; |
| 317 | else if (cpu_is_omap34xx()) |
| 318 | omap_current_dss_features = &omap3430_dss_features; |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 319 | else |
| 320 | omap_current_dss_features = &omap4_dss_features; |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 321 | } |