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 | |
Tomi Valkeinen | a0b38cc | 2011-05-11 14:05:07 +0300 | [diff] [blame] | 25 | #include <video/omapdss.h> |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 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 { |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 33 | u8 start, end; |
| 34 | }; |
| 35 | |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 36 | struct dss_param_range { |
| 37 | int min, max; |
| 38 | }; |
| 39 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 40 | struct omap_dss_features { |
| 41 | const struct dss_reg_field *reg_fields; |
| 42 | const int num_reg_fields; |
| 43 | |
| 44 | const u32 has_feature; |
| 45 | |
| 46 | const int num_mgrs; |
| 47 | const int num_ovls; |
| 48 | const enum omap_display_type *supported_displays; |
| 49 | const enum omap_color_mode *supported_color_modes; |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 50 | const enum omap_overlay_caps *overlay_caps; |
Taneja, Archit | 235e7db | 2011-03-14 23:28:21 -0500 | [diff] [blame] | 51 | const char * const *clksrc_names; |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 52 | const struct dss_param_range *dss_params; |
Tomi Valkeinen | 5ed8cf5 | 2011-06-21 09:35:36 +0300 | [diff] [blame] | 53 | |
| 54 | const u32 buffer_size_unit; |
| 55 | const u32 burst_size_unit; |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | /* This struct is assigned to one of the below during initialization */ |
Tomi Valkeinen | ea29033 | 2011-04-20 10:09:36 +0300 | [diff] [blame] | 59 | static const struct omap_dss_features *omap_current_dss_features; |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 60 | |
| 61 | static const struct dss_reg_field omap2_dss_reg_fields[] = { |
Taneja, Archit | 4964111 | 2011-03-14 23:28:23 -0500 | [diff] [blame] | 62 | [FEAT_REG_FIRHINC] = { 11, 0 }, |
| 63 | [FEAT_REG_FIRVINC] = { 27, 16 }, |
| 64 | [FEAT_REG_FIFOLOWTHRESHOLD] = { 8, 0 }, |
| 65 | [FEAT_REG_FIFOHIGHTHRESHOLD] = { 24, 16 }, |
| 66 | [FEAT_REG_FIFOSIZE] = { 8, 0 }, |
| 67 | [FEAT_REG_HORIZONTALACCU] = { 9, 0 }, |
| 68 | [FEAT_REG_VERTICALACCU] = { 25, 16 }, |
| 69 | [FEAT_REG_DISPC_CLK_SWITCH] = { 0, 0 }, |
| 70 | [FEAT_REG_DSIPLL_REGN] = { 0, 0 }, |
| 71 | [FEAT_REG_DSIPLL_REGM] = { 0, 0 }, |
| 72 | [FEAT_REG_DSIPLL_REGM_DISPC] = { 0, 0 }, |
| 73 | [FEAT_REG_DSIPLL_REGM_DSI] = { 0, 0 }, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 74 | }; |
| 75 | |
| 76 | static const struct dss_reg_field omap3_dss_reg_fields[] = { |
Taneja, Archit | 4964111 | 2011-03-14 23:28:23 -0500 | [diff] [blame] | 77 | [FEAT_REG_FIRHINC] = { 12, 0 }, |
| 78 | [FEAT_REG_FIRVINC] = { 28, 16 }, |
| 79 | [FEAT_REG_FIFOLOWTHRESHOLD] = { 11, 0 }, |
| 80 | [FEAT_REG_FIFOHIGHTHRESHOLD] = { 27, 16 }, |
| 81 | [FEAT_REG_FIFOSIZE] = { 10, 0 }, |
| 82 | [FEAT_REG_HORIZONTALACCU] = { 9, 0 }, |
| 83 | [FEAT_REG_VERTICALACCU] = { 25, 16 }, |
| 84 | [FEAT_REG_DISPC_CLK_SWITCH] = { 0, 0 }, |
| 85 | [FEAT_REG_DSIPLL_REGN] = { 7, 1 }, |
| 86 | [FEAT_REG_DSIPLL_REGM] = { 18, 8 }, |
| 87 | [FEAT_REG_DSIPLL_REGM_DISPC] = { 22, 19 }, |
| 88 | [FEAT_REG_DSIPLL_REGM_DSI] = { 26, 23 }, |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 89 | }; |
| 90 | |
| 91 | static const struct dss_reg_field omap4_dss_reg_fields[] = { |
Taneja, Archit | 4964111 | 2011-03-14 23:28:23 -0500 | [diff] [blame] | 92 | [FEAT_REG_FIRHINC] = { 12, 0 }, |
| 93 | [FEAT_REG_FIRVINC] = { 28, 16 }, |
| 94 | [FEAT_REG_FIFOLOWTHRESHOLD] = { 15, 0 }, |
| 95 | [FEAT_REG_FIFOHIGHTHRESHOLD] = { 31, 16 }, |
| 96 | [FEAT_REG_FIFOSIZE] = { 15, 0 }, |
| 97 | [FEAT_REG_HORIZONTALACCU] = { 10, 0 }, |
| 98 | [FEAT_REG_VERTICALACCU] = { 26, 16 }, |
| 99 | [FEAT_REG_DISPC_CLK_SWITCH] = { 9, 8 }, |
| 100 | [FEAT_REG_DSIPLL_REGN] = { 8, 1 }, |
| 101 | [FEAT_REG_DSIPLL_REGM] = { 20, 9 }, |
| 102 | [FEAT_REG_DSIPLL_REGM_DISPC] = { 25, 21 }, |
| 103 | [FEAT_REG_DSIPLL_REGM_DSI] = { 30, 26 }, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 104 | }; |
| 105 | |
| 106 | static const enum omap_display_type omap2_dss_supported_displays[] = { |
| 107 | /* OMAP_DSS_CHANNEL_LCD */ |
Tomi Valkeinen | f8df01f | 2011-02-24 14:21:25 +0200 | [diff] [blame] | 108 | OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 109 | |
| 110 | /* OMAP_DSS_CHANNEL_DIGIT */ |
| 111 | OMAP_DISPLAY_TYPE_VENC, |
| 112 | }; |
| 113 | |
Tomi Valkeinen | 4e777dd | 2011-02-24 14:20:31 +0200 | [diff] [blame] | 114 | static const enum omap_display_type omap3430_dss_supported_displays[] = { |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 115 | /* OMAP_DSS_CHANNEL_LCD */ |
| 116 | OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI | |
| 117 | OMAP_DISPLAY_TYPE_SDI | OMAP_DISPLAY_TYPE_DSI, |
| 118 | |
| 119 | /* OMAP_DSS_CHANNEL_DIGIT */ |
| 120 | OMAP_DISPLAY_TYPE_VENC, |
| 121 | }; |
| 122 | |
Tomi Valkeinen | 4e777dd | 2011-02-24 14:20:31 +0200 | [diff] [blame] | 123 | static const enum omap_display_type omap3630_dss_supported_displays[] = { |
| 124 | /* OMAP_DSS_CHANNEL_LCD */ |
| 125 | OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI | |
| 126 | OMAP_DISPLAY_TYPE_DSI, |
| 127 | |
| 128 | /* OMAP_DSS_CHANNEL_DIGIT */ |
| 129 | OMAP_DISPLAY_TYPE_VENC, |
| 130 | }; |
| 131 | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 132 | static const enum omap_display_type omap4_dss_supported_displays[] = { |
| 133 | /* OMAP_DSS_CHANNEL_LCD */ |
| 134 | OMAP_DISPLAY_TYPE_DBI | OMAP_DISPLAY_TYPE_DSI, |
| 135 | |
| 136 | /* OMAP_DSS_CHANNEL_DIGIT */ |
Mythri P K | b119601 | 2011-03-08 17:15:54 +0530 | [diff] [blame] | 137 | OMAP_DISPLAY_TYPE_VENC | OMAP_DISPLAY_TYPE_HDMI, |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 138 | |
| 139 | /* OMAP_DSS_CHANNEL_LCD2 */ |
| 140 | OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI | |
| 141 | OMAP_DISPLAY_TYPE_DSI, |
| 142 | }; |
| 143 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 144 | static const enum omap_color_mode omap2_dss_supported_color_modes[] = { |
| 145 | /* OMAP_DSS_GFX */ |
| 146 | OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 | |
| 147 | OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 | |
| 148 | OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_RGB16 | |
| 149 | OMAP_DSS_COLOR_RGB24U | OMAP_DSS_COLOR_RGB24P, |
| 150 | |
| 151 | /* OMAP_DSS_VIDEO1 */ |
| 152 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | |
| 153 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 | |
| 154 | OMAP_DSS_COLOR_UYVY, |
| 155 | |
| 156 | /* OMAP_DSS_VIDEO2 */ |
| 157 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | |
| 158 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 | |
| 159 | OMAP_DSS_COLOR_UYVY, |
| 160 | }; |
| 161 | |
| 162 | static const enum omap_color_mode omap3_dss_supported_color_modes[] = { |
| 163 | /* OMAP_DSS_GFX */ |
| 164 | OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 | |
| 165 | OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 | |
| 166 | OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 | |
| 167 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | |
| 168 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 | |
| 169 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, |
| 170 | |
| 171 | /* OMAP_DSS_VIDEO1 */ |
| 172 | OMAP_DSS_COLOR_RGB24U | OMAP_DSS_COLOR_RGB24P | |
| 173 | OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_RGB16 | |
| 174 | OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_UYVY, |
| 175 | |
| 176 | /* OMAP_DSS_VIDEO2 */ |
| 177 | OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 | |
| 178 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | |
| 179 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 | |
| 180 | OMAP_DSS_COLOR_UYVY | OMAP_DSS_COLOR_ARGB32 | |
| 181 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, |
| 182 | }; |
| 183 | |
Amber Jain | f20e422 | 2011-05-19 19:47:50 +0530 | [diff] [blame] | 184 | static const enum omap_color_mode omap4_dss_supported_color_modes[] = { |
| 185 | /* OMAP_DSS_GFX */ |
| 186 | OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 | |
| 187 | OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 | |
| 188 | OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 | |
| 189 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | |
| 190 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 | |
| 191 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32 | |
| 192 | OMAP_DSS_COLOR_ARGB16_1555, |
| 193 | |
| 194 | /* OMAP_DSS_VIDEO1 */ |
| 195 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U | |
| 196 | OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 | |
| 197 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 | |
| 198 | OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U | |
| 199 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY | |
| 200 | OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 | |
| 201 | OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 | |
| 202 | OMAP_DSS_COLOR_RGBX32, |
| 203 | |
| 204 | /* OMAP_DSS_VIDEO2 */ |
| 205 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U | |
| 206 | OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 | |
| 207 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 | |
| 208 | OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U | |
| 209 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY | |
| 210 | OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 | |
| 211 | OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 | |
| 212 | OMAP_DSS_COLOR_RGBX32, |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 213 | |
| 214 | /* OMAP_DSS_VIDEO3 */ |
| 215 | OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U | |
| 216 | OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 | |
| 217 | OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 | |
| 218 | OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U | |
| 219 | OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY | |
| 220 | OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 | |
| 221 | OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 | |
| 222 | OMAP_DSS_COLOR_RGBX32, |
Amber Jain | f20e422 | 2011-05-19 19:47:50 +0530 | [diff] [blame] | 223 | }; |
| 224 | |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 225 | static const enum omap_overlay_caps omap2_dss_overlay_caps[] = { |
| 226 | /* OMAP_DSS_GFX */ |
| 227 | 0, |
| 228 | |
| 229 | /* OMAP_DSS_VIDEO1 */ |
| 230 | OMAP_DSS_OVL_CAP_SCALE, |
| 231 | |
| 232 | /* OMAP_DSS_VIDEO2 */ |
| 233 | OMAP_DSS_OVL_CAP_SCALE, |
| 234 | }; |
| 235 | |
| 236 | static const enum omap_overlay_caps omap3430_dss_overlay_caps[] = { |
| 237 | /* OMAP_DSS_GFX */ |
Tomi Valkeinen | f6dc815 | 2011-08-15 15:18:20 +0300 | [diff] [blame] | 238 | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 239 | |
| 240 | /* OMAP_DSS_VIDEO1 */ |
| 241 | OMAP_DSS_OVL_CAP_SCALE, |
| 242 | |
| 243 | /* OMAP_DSS_VIDEO2 */ |
Tomi Valkeinen | f6dc815 | 2011-08-15 15:18:20 +0300 | [diff] [blame] | 244 | OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 245 | }; |
| 246 | |
| 247 | static const enum omap_overlay_caps omap3630_dss_overlay_caps[] = { |
| 248 | /* OMAP_DSS_GFX */ |
Tomi Valkeinen | f6dc815 | 2011-08-15 15:18:20 +0300 | [diff] [blame] | 249 | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 250 | |
| 251 | /* OMAP_DSS_VIDEO1 */ |
| 252 | OMAP_DSS_OVL_CAP_SCALE, |
| 253 | |
| 254 | /* OMAP_DSS_VIDEO2 */ |
Tomi Valkeinen | f6dc815 | 2011-08-15 15:18:20 +0300 | [diff] [blame] | 255 | OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | |
| 256 | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 257 | }; |
| 258 | |
| 259 | static const enum omap_overlay_caps omap4_dss_overlay_caps[] = { |
| 260 | /* OMAP_DSS_GFX */ |
Archit Taneja | 11354dd | 2011-09-26 11:47:29 +0530 | [diff] [blame] | 261 | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | |
| 262 | OMAP_DSS_OVL_CAP_ZORDER, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 263 | |
| 264 | /* OMAP_DSS_VIDEO1 */ |
Tomi Valkeinen | f6dc815 | 2011-08-15 15:18:20 +0300 | [diff] [blame] | 265 | OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | |
Archit Taneja | 11354dd | 2011-09-26 11:47:29 +0530 | [diff] [blame] | 266 | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 267 | |
| 268 | /* OMAP_DSS_VIDEO2 */ |
Tomi Valkeinen | f6dc815 | 2011-08-15 15:18:20 +0300 | [diff] [blame] | 269 | OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | |
Archit Taneja | 11354dd | 2011-09-26 11:47:29 +0530 | [diff] [blame] | 270 | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER, |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 271 | |
| 272 | /* OMAP_DSS_VIDEO3 */ |
| 273 | OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | |
| 274 | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 275 | }; |
| 276 | |
Taneja, Archit | 235e7db | 2011-03-14 23:28:21 -0500 | [diff] [blame] | 277 | static const char * const omap2_dss_clk_source_names[] = { |
Archit Taneja | 89a35e5 | 2011-04-12 13:52:23 +0530 | [diff] [blame] | 278 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "N/A", |
| 279 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "N/A", |
| 280 | [OMAP_DSS_CLK_SRC_FCK] = "DSS_FCLK1", |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 281 | }; |
| 282 | |
Taneja, Archit | 235e7db | 2011-03-14 23:28:21 -0500 | [diff] [blame] | 283 | static const char * const omap3_dss_clk_source_names[] = { |
Archit Taneja | 89a35e5 | 2011-04-12 13:52:23 +0530 | [diff] [blame] | 284 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "DSI1_PLL_FCLK", |
| 285 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "DSI2_PLL_FCLK", |
| 286 | [OMAP_DSS_CLK_SRC_FCK] = "DSS1_ALWON_FCLK", |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 287 | }; |
| 288 | |
Taneja, Archit | 235e7db | 2011-03-14 23:28:21 -0500 | [diff] [blame] | 289 | static const char * const omap4_dss_clk_source_names[] = { |
Archit Taneja | 89a35e5 | 2011-04-12 13:52:23 +0530 | [diff] [blame] | 290 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "PLL1_CLK1", |
| 291 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "PLL1_CLK2", |
| 292 | [OMAP_DSS_CLK_SRC_FCK] = "DSS_FCLK", |
Archit Taneja | 5a8b572 | 2011-05-12 17:26:29 +0530 | [diff] [blame] | 293 | [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC] = "PLL2_CLK1", |
| 294 | [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI] = "PLL2_CLK2", |
Taneja, Archit | ea75159 | 2011-03-08 05:50:35 -0600 | [diff] [blame] | 295 | }; |
| 296 | |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 297 | static const struct dss_param_range omap2_dss_param_range[] = { |
Taneja, Archit | 4964111 | 2011-03-14 23:28:23 -0500 | [diff] [blame] | 298 | [FEAT_PARAM_DSS_FCK] = { 0, 173000000 }, |
Tomi Valkeinen | 9eaaf20 | 2011-08-29 15:56:04 +0300 | [diff] [blame] | 299 | [FEAT_PARAM_DSS_PCD] = { 2, 255 }, |
Taneja, Archit | 4964111 | 2011-03-14 23:28:23 -0500 | [diff] [blame] | 300 | [FEAT_PARAM_DSIPLL_REGN] = { 0, 0 }, |
| 301 | [FEAT_PARAM_DSIPLL_REGM] = { 0, 0 }, |
| 302 | [FEAT_PARAM_DSIPLL_REGM_DISPC] = { 0, 0 }, |
| 303 | [FEAT_PARAM_DSIPLL_REGM_DSI] = { 0, 0 }, |
| 304 | [FEAT_PARAM_DSIPLL_FINT] = { 0, 0 }, |
| 305 | [FEAT_PARAM_DSIPLL_LPDIV] = { 0, 0 }, |
Archit Taneja | 0373cac | 2011-09-08 13:25:17 +0530 | [diff] [blame] | 306 | [FEAT_PARAM_DOWNSCALE] = { 1, 2 }, |
Chandrabhanu Mahapatra | 7282f1b | 2011-12-19 14:03:56 +0530 | [diff] [blame^] | 307 | /* |
| 308 | * Assuming the line width buffer to be 768 pixels as OMAP2 DISPC |
| 309 | * scaler cannot scale a image with width more than 768. |
| 310 | */ |
| 311 | [FEAT_PARAM_LINEWIDTH] = { 1, 768 }, |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 312 | }; |
| 313 | |
| 314 | static const struct dss_param_range omap3_dss_param_range[] = { |
Taneja, Archit | 4964111 | 2011-03-14 23:28:23 -0500 | [diff] [blame] | 315 | [FEAT_PARAM_DSS_FCK] = { 0, 173000000 }, |
Tomi Valkeinen | 9eaaf20 | 2011-08-29 15:56:04 +0300 | [diff] [blame] | 316 | [FEAT_PARAM_DSS_PCD] = { 1, 255 }, |
Taneja, Archit | 4964111 | 2011-03-14 23:28:23 -0500 | [diff] [blame] | 317 | [FEAT_PARAM_DSIPLL_REGN] = { 0, (1 << 7) - 1 }, |
| 318 | [FEAT_PARAM_DSIPLL_REGM] = { 0, (1 << 11) - 1 }, |
| 319 | [FEAT_PARAM_DSIPLL_REGM_DISPC] = { 0, (1 << 4) - 1 }, |
| 320 | [FEAT_PARAM_DSIPLL_REGM_DSI] = { 0, (1 << 4) - 1 }, |
| 321 | [FEAT_PARAM_DSIPLL_FINT] = { 750000, 2100000 }, |
| 322 | [FEAT_PARAM_DSIPLL_LPDIV] = { 1, (1 << 13) - 1}, |
Archit Taneja | 0373cac | 2011-09-08 13:25:17 +0530 | [diff] [blame] | 323 | [FEAT_PARAM_DOWNSCALE] = { 1, 4 }, |
Chandrabhanu Mahapatra | 7282f1b | 2011-12-19 14:03:56 +0530 | [diff] [blame^] | 324 | [FEAT_PARAM_LINEWIDTH] = { 1, 1024 }, |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 325 | }; |
| 326 | |
| 327 | static const struct dss_param_range omap4_dss_param_range[] = { |
Taneja, Archit | 4964111 | 2011-03-14 23:28:23 -0500 | [diff] [blame] | 328 | [FEAT_PARAM_DSS_FCK] = { 0, 186000000 }, |
Tomi Valkeinen | 9eaaf20 | 2011-08-29 15:56:04 +0300 | [diff] [blame] | 329 | [FEAT_PARAM_DSS_PCD] = { 1, 255 }, |
Taneja, Archit | 4964111 | 2011-03-14 23:28:23 -0500 | [diff] [blame] | 330 | [FEAT_PARAM_DSIPLL_REGN] = { 0, (1 << 8) - 1 }, |
| 331 | [FEAT_PARAM_DSIPLL_REGM] = { 0, (1 << 12) - 1 }, |
| 332 | [FEAT_PARAM_DSIPLL_REGM_DISPC] = { 0, (1 << 5) - 1 }, |
| 333 | [FEAT_PARAM_DSIPLL_REGM_DSI] = { 0, (1 << 5) - 1 }, |
| 334 | [FEAT_PARAM_DSIPLL_FINT] = { 500000, 2500000 }, |
| 335 | [FEAT_PARAM_DSIPLL_LPDIV] = { 0, (1 << 13) - 1 }, |
Archit Taneja | 0373cac | 2011-09-08 13:25:17 +0530 | [diff] [blame] | 336 | [FEAT_PARAM_DOWNSCALE] = { 1, 4 }, |
Chandrabhanu Mahapatra | 7282f1b | 2011-12-19 14:03:56 +0530 | [diff] [blame^] | 337 | [FEAT_PARAM_LINEWIDTH] = { 1, 2048 }, |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 338 | }; |
| 339 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 340 | /* OMAP2 DSS Features */ |
Tomi Valkeinen | ea29033 | 2011-04-20 10:09:36 +0300 | [diff] [blame] | 341 | static const struct omap_dss_features omap2_dss_features = { |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 342 | .reg_fields = omap2_dss_reg_fields, |
| 343 | .num_reg_fields = ARRAY_SIZE(omap2_dss_reg_fields), |
| 344 | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 345 | .has_feature = |
| 346 | FEAT_LCDENABLEPOL | FEAT_LCDENABLESIGNAL | |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 347 | FEAT_PCKFREEENABLE | FEAT_FUNCGATED | |
| 348 | FEAT_ROWREPEATENABLE | FEAT_RESIZECONF, |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 349 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 350 | .num_mgrs = 2, |
| 351 | .num_ovls = 3, |
| 352 | .supported_displays = omap2_dss_supported_displays, |
| 353 | .supported_color_modes = omap2_dss_supported_color_modes, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 354 | .overlay_caps = omap2_dss_overlay_caps, |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 355 | .clksrc_names = omap2_dss_clk_source_names, |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 356 | .dss_params = omap2_dss_param_range, |
Tomi Valkeinen | 5ed8cf5 | 2011-06-21 09:35:36 +0300 | [diff] [blame] | 357 | .buffer_size_unit = 1, |
| 358 | .burst_size_unit = 8, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 359 | }; |
| 360 | |
| 361 | /* OMAP3 DSS Features */ |
Tomi Valkeinen | ea29033 | 2011-04-20 10:09:36 +0300 | [diff] [blame] | 362 | static const struct omap_dss_features omap3430_dss_features = { |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 363 | .reg_fields = omap3_dss_reg_fields, |
| 364 | .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), |
| 365 | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 366 | .has_feature = |
Archit Taneja | 11354dd | 2011-09-26 11:47:29 +0530 | [diff] [blame] | 367 | FEAT_LCDENABLEPOL | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 368 | FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 369 | FEAT_FUNCGATED | FEAT_ROWREPEATENABLE | |
Archit Taneja | 9613c02 | 2011-03-22 06:33:36 -0500 | [diff] [blame] | 370 | FEAT_LINEBUFFERSPLIT | FEAT_RESIZECONF | |
Tomi Valkeinen | 525dae6 | 2011-05-18 11:59:21 +0300 | [diff] [blame] | 371 | FEAT_DSI_PLL_FREQSEL | FEAT_DSI_REVERSE_TXCLKESC | |
Tomi Valkeinen | 332e9d7 | 2011-05-27 14:22:16 +0300 | [diff] [blame] | 372 | FEAT_VENC_REQUIRES_TV_DAC_CLK | FEAT_CPR | FEAT_PRELOAD | |
Archit Taneja | 11354dd | 2011-09-26 11:47:29 +0530 | [diff] [blame] | 373 | FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 374 | |
| 375 | .num_mgrs = 2, |
| 376 | .num_ovls = 3, |
Tomi Valkeinen | 4e777dd | 2011-02-24 14:20:31 +0200 | [diff] [blame] | 377 | .supported_displays = omap3430_dss_supported_displays, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 378 | .supported_color_modes = omap3_dss_supported_color_modes, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 379 | .overlay_caps = omap3430_dss_overlay_caps, |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 380 | .clksrc_names = omap3_dss_clk_source_names, |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 381 | .dss_params = omap3_dss_param_range, |
Tomi Valkeinen | 5ed8cf5 | 2011-06-21 09:35:36 +0300 | [diff] [blame] | 382 | .buffer_size_unit = 1, |
| 383 | .burst_size_unit = 8, |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 384 | }; |
| 385 | |
Tomi Valkeinen | ea29033 | 2011-04-20 10:09:36 +0300 | [diff] [blame] | 386 | static const struct omap_dss_features omap3630_dss_features = { |
Samreen | 8fbde10 | 2010-11-04 12:28:41 +0100 | [diff] [blame] | 387 | .reg_fields = omap3_dss_reg_fields, |
| 388 | .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), |
| 389 | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 390 | .has_feature = |
Archit Taneja | 11354dd | 2011-09-26 11:47:29 +0530 | [diff] [blame] | 391 | FEAT_LCDENABLEPOL | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 392 | FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE | |
Tomi Valkeinen | f6dc815 | 2011-08-15 15:18:20 +0300 | [diff] [blame] | 393 | FEAT_FUNCGATED | |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 394 | FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT | |
Archit Taneja | 9613c02 | 2011-03-22 06:33:36 -0500 | [diff] [blame] | 395 | FEAT_RESIZECONF | FEAT_DSI_PLL_PWR_BUG | |
Tomi Valkeinen | 332e9d7 | 2011-05-27 14:22:16 +0300 | [diff] [blame] | 396 | FEAT_DSI_PLL_FREQSEL | FEAT_CPR | FEAT_PRELOAD | |
Archit Taneja | 11354dd | 2011-09-26 11:47:29 +0530 | [diff] [blame] | 397 | FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER, |
Samreen | 8fbde10 | 2010-11-04 12:28:41 +0100 | [diff] [blame] | 398 | |
| 399 | .num_mgrs = 2, |
| 400 | .num_ovls = 3, |
Tomi Valkeinen | 4e777dd | 2011-02-24 14:20:31 +0200 | [diff] [blame] | 401 | .supported_displays = omap3630_dss_supported_displays, |
Samreen | 8fbde10 | 2010-11-04 12:28:41 +0100 | [diff] [blame] | 402 | .supported_color_modes = omap3_dss_supported_color_modes, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 403 | .overlay_caps = omap3630_dss_overlay_caps, |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 404 | .clksrc_names = omap3_dss_clk_source_names, |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 405 | .dss_params = omap3_dss_param_range, |
Tomi Valkeinen | 5ed8cf5 | 2011-06-21 09:35:36 +0300 | [diff] [blame] | 406 | .buffer_size_unit = 1, |
| 407 | .burst_size_unit = 8, |
Samreen | 8fbde10 | 2010-11-04 12:28:41 +0100 | [diff] [blame] | 408 | }; |
| 409 | |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 410 | /* OMAP4 DSS Features */ |
Ricardo Neri | 6ff7084 | 2011-05-18 22:23:33 -0500 | [diff] [blame] | 411 | /* For OMAP4430 ES 1.0 revision */ |
| 412 | static const struct omap_dss_features omap4430_es1_0_dss_features = { |
| 413 | .reg_fields = omap4_dss_reg_fields, |
| 414 | .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields), |
| 415 | |
| 416 | .has_feature = |
Tomi Valkeinen | f6dc815 | 2011-08-15 15:18:20 +0300 | [diff] [blame] | 417 | FEAT_MGR_LCD2 | |
Ricardo Neri | 6ff7084 | 2011-05-18 22:23:33 -0500 | [diff] [blame] | 418 | FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC | |
| 419 | FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH | |
Tomi Valkeinen | 332e9d7 | 2011-05-27 14:22:16 +0300 | [diff] [blame] | 420 | FEAT_DSI_GNQ | FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 | |
Archit Taneja | 11354dd | 2011-09-26 11:47:29 +0530 | [diff] [blame] | 421 | FEAT_CPR | FEAT_PRELOAD | FEAT_FIR_COEF_V | |
| 422 | FEAT_ALPHA_FREE_ZORDER, |
Ricardo Neri | 6ff7084 | 2011-05-18 22:23:33 -0500 | [diff] [blame] | 423 | |
| 424 | .num_mgrs = 3, |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 425 | .num_ovls = 4, |
Ricardo Neri | 6ff7084 | 2011-05-18 22:23:33 -0500 | [diff] [blame] | 426 | .supported_displays = omap4_dss_supported_displays, |
Amber Jain | f20e422 | 2011-05-19 19:47:50 +0530 | [diff] [blame] | 427 | .supported_color_modes = omap4_dss_supported_color_modes, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 428 | .overlay_caps = omap4_dss_overlay_caps, |
Ricardo Neri | 6ff7084 | 2011-05-18 22:23:33 -0500 | [diff] [blame] | 429 | .clksrc_names = omap4_dss_clk_source_names, |
| 430 | .dss_params = omap4_dss_param_range, |
Tomi Valkeinen | 5ed8cf5 | 2011-06-21 09:35:36 +0300 | [diff] [blame] | 431 | .buffer_size_unit = 16, |
| 432 | .burst_size_unit = 16, |
Ricardo Neri | 6ff7084 | 2011-05-18 22:23:33 -0500 | [diff] [blame] | 433 | }; |
| 434 | |
| 435 | /* For all the other OMAP4 versions */ |
Tomi Valkeinen | ea29033 | 2011-04-20 10:09:36 +0300 | [diff] [blame] | 436 | static const struct omap_dss_features omap4_dss_features = { |
Archit Taneja | 87a7484 | 2011-03-02 11:19:50 +0530 | [diff] [blame] | 437 | .reg_fields = omap4_dss_reg_fields, |
| 438 | .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields), |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 439 | |
| 440 | .has_feature = |
Tomi Valkeinen | f6dc815 | 2011-08-15 15:18:20 +0300 | [diff] [blame] | 441 | FEAT_MGR_LCD2 | |
Archit Taneja | 9613c02 | 2011-03-22 06:33:36 -0500 | [diff] [blame] | 442 | FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC | |
Archit Taneja | 75d7247 | 2011-05-16 15:17:08 +0530 | [diff] [blame] | 443 | FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH | |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 444 | FEAT_DSI_GNQ | FEAT_HDMI_CTS_SWMODE | |
Tomi Valkeinen | 332e9d7 | 2011-05-27 14:22:16 +0300 | [diff] [blame] | 445 | FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 | FEAT_CPR | |
Archit Taneja | 11354dd | 2011-09-26 11:47:29 +0530 | [diff] [blame] | 446 | FEAT_PRELOAD | FEAT_FIR_COEF_V | FEAT_ALPHA_FREE_ZORDER, |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 447 | |
| 448 | .num_mgrs = 3, |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 449 | .num_ovls = 4, |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 450 | .supported_displays = omap4_dss_supported_displays, |
Amber Jain | f20e422 | 2011-05-19 19:47:50 +0530 | [diff] [blame] | 451 | .supported_color_modes = omap4_dss_supported_color_modes, |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 452 | .overlay_caps = omap4_dss_overlay_caps, |
Taneja, Archit | ea75159 | 2011-03-08 05:50:35 -0600 | [diff] [blame] | 453 | .clksrc_names = omap4_dss_clk_source_names, |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 454 | .dss_params = omap4_dss_param_range, |
Tomi Valkeinen | 5ed8cf5 | 2011-06-21 09:35:36 +0300 | [diff] [blame] | 455 | .buffer_size_unit = 16, |
| 456 | .burst_size_unit = 16, |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 457 | }; |
| 458 | |
Mythri P K | 60634a2 | 2011-09-08 19:06:26 +0530 | [diff] [blame] | 459 | #if defined(CONFIG_OMAP4_DSS_HDMI) |
| 460 | /* HDMI OMAP4 Functions*/ |
| 461 | static const struct ti_hdmi_ip_ops omap4_hdmi_functions = { |
| 462 | |
| 463 | .video_configure = ti_hdmi_4xxx_basic_configure, |
| 464 | .phy_enable = ti_hdmi_4xxx_phy_enable, |
| 465 | .phy_disable = ti_hdmi_4xxx_phy_disable, |
| 466 | .read_edid = ti_hdmi_4xxx_read_edid, |
Tomi Valkeinen | 759593f | 2011-08-29 18:10:20 +0300 | [diff] [blame] | 467 | .detect = ti_hdmi_4xxx_detect, |
Mythri P K | 60634a2 | 2011-09-08 19:06:26 +0530 | [diff] [blame] | 468 | .pll_enable = ti_hdmi_4xxx_pll_enable, |
| 469 | .pll_disable = ti_hdmi_4xxx_pll_disable, |
| 470 | .video_enable = ti_hdmi_4xxx_wp_video_start, |
Mythri P K | 162874d | 2011-09-22 13:37:45 +0530 | [diff] [blame] | 471 | .dump_wrapper = ti_hdmi_4xxx_wp_dump, |
| 472 | .dump_core = ti_hdmi_4xxx_core_dump, |
| 473 | .dump_pll = ti_hdmi_4xxx_pll_dump, |
| 474 | .dump_phy = ti_hdmi_4xxx_phy_dump, |
| 475 | |
Mythri P K | 60634a2 | 2011-09-08 19:06:26 +0530 | [diff] [blame] | 476 | }; |
| 477 | |
| 478 | void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data) |
| 479 | { |
| 480 | if (cpu_is_omap44xx()) |
| 481 | ip_data->ops = &omap4_hdmi_functions; |
| 482 | } |
| 483 | #endif |
| 484 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 485 | /* Functions returning values related to a DSS feature */ |
| 486 | int dss_feat_get_num_mgrs(void) |
| 487 | { |
| 488 | return omap_current_dss_features->num_mgrs; |
| 489 | } |
| 490 | |
| 491 | int dss_feat_get_num_ovls(void) |
| 492 | { |
| 493 | return omap_current_dss_features->num_ovls; |
| 494 | } |
| 495 | |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 496 | unsigned long dss_feat_get_param_min(enum dss_range_param param) |
Archit Taneja | 819d807 | 2011-03-01 11:54:00 +0530 | [diff] [blame] | 497 | { |
Taneja, Archit | 31ef823 | 2011-03-14 23:28:22 -0500 | [diff] [blame] | 498 | return omap_current_dss_features->dss_params[param].min; |
| 499 | } |
| 500 | |
| 501 | unsigned long dss_feat_get_param_max(enum dss_range_param param) |
| 502 | { |
| 503 | return omap_current_dss_features->dss_params[param].max; |
Archit Taneja | 819d807 | 2011-03-01 11:54:00 +0530 | [diff] [blame] | 504 | } |
| 505 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 506 | enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel) |
| 507 | { |
| 508 | return omap_current_dss_features->supported_displays[channel]; |
| 509 | } |
| 510 | |
| 511 | enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane) |
| 512 | { |
| 513 | return omap_current_dss_features->supported_color_modes[plane]; |
| 514 | } |
| 515 | |
Tomi Valkeinen | 67019db | 2011-08-15 15:18:15 +0300 | [diff] [blame] | 516 | enum omap_overlay_caps dss_feat_get_overlay_caps(enum omap_plane plane) |
| 517 | { |
| 518 | return omap_current_dss_features->overlay_caps[plane]; |
| 519 | } |
| 520 | |
Archit Taneja | 8dad2ab | 2010-11-25 17:58:10 +0530 | [diff] [blame] | 521 | bool dss_feat_color_mode_supported(enum omap_plane plane, |
| 522 | enum omap_color_mode color_mode) |
| 523 | { |
| 524 | return omap_current_dss_features->supported_color_modes[plane] & |
| 525 | color_mode; |
| 526 | } |
| 527 | |
Archit Taneja | 89a35e5 | 2011-04-12 13:52:23 +0530 | [diff] [blame] | 528 | const char *dss_feat_get_clk_source_name(enum omap_dss_clk_source id) |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 529 | { |
Taneja, Archit | 235e7db | 2011-03-14 23:28:21 -0500 | [diff] [blame] | 530 | return omap_current_dss_features->clksrc_names[id]; |
Archit Taneja | 067a57e | 2011-03-02 11:57:25 +0530 | [diff] [blame] | 531 | } |
| 532 | |
Tomi Valkeinen | 5ed8cf5 | 2011-06-21 09:35:36 +0300 | [diff] [blame] | 533 | u32 dss_feat_get_buffer_size_unit(void) |
| 534 | { |
| 535 | return omap_current_dss_features->buffer_size_unit; |
| 536 | } |
| 537 | |
| 538 | u32 dss_feat_get_burst_size_unit(void) |
| 539 | { |
| 540 | return omap_current_dss_features->burst_size_unit; |
| 541 | } |
| 542 | |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 543 | /* DSS has_feature check */ |
| 544 | bool dss_has_feature(enum dss_feat_id id) |
| 545 | { |
| 546 | return omap_current_dss_features->has_feature & id; |
| 547 | } |
| 548 | |
| 549 | void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end) |
| 550 | { |
| 551 | if (id >= omap_current_dss_features->num_reg_fields) |
| 552 | BUG(); |
| 553 | |
| 554 | *start = omap_current_dss_features->reg_fields[id].start; |
| 555 | *end = omap_current_dss_features->reg_fields[id].end; |
| 556 | } |
| 557 | |
| 558 | void dss_features_init(void) |
| 559 | { |
| 560 | if (cpu_is_omap24xx()) |
| 561 | omap_current_dss_features = &omap2_dss_features; |
Samreen | 8fbde10 | 2010-11-04 12:28:41 +0100 | [diff] [blame] | 562 | else if (cpu_is_omap3630()) |
| 563 | omap_current_dss_features = &omap3630_dss_features; |
| 564 | else if (cpu_is_omap34xx()) |
| 565 | omap_current_dss_features = &omap3430_dss_features; |
Ricardo Neri | 6ff7084 | 2011-05-18 22:23:33 -0500 | [diff] [blame] | 566 | else if (omap_rev() == OMAP4430_REV_ES1_0) |
| 567 | omap_current_dss_features = &omap4430_es1_0_dss_features; |
| 568 | else if (cpu_is_omap44xx()) |
Archit Taneja | d50cd03 | 2010-12-02 11:27:08 +0000 | [diff] [blame] | 569 | omap_current_dss_features = &omap4_dss_features; |
Ricardo Neri | 6ff7084 | 2011-05-18 22:23:33 -0500 | [diff] [blame] | 570 | else |
| 571 | DSSWARN("Unsupported OMAP version"); |
Archit Taneja | e1ef4d2 | 2010-09-15 18:47:29 +0530 | [diff] [blame] | 572 | } |