2010-09-15 13:17:29 +00:00
|
|
|
/*
|
|
|
|
* linux/drivers/video/omap2/dss/dss_features.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Texas Instruments
|
|
|
|
* Author: Archit Taneja <archit@ti.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 as published by
|
|
|
|
* the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
2012-11-07 14:26:11 +00:00
|
|
|
#include <linux/module.h>
|
2010-09-15 13:17:29 +00:00
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/err.h>
|
|
|
|
#include <linux/slab.h>
|
2017-05-04 07:40:46 +00:00
|
|
|
#include <drm/drm_fourcc.h>
|
2010-09-15 13:17:29 +00:00
|
|
|
|
2016-05-27 11:40:49 +00:00
|
|
|
#include "omapdss.h"
|
2011-03-02 06:27:25 +00:00
|
|
|
#include "dss.h"
|
2010-09-15 13:17:29 +00:00
|
|
|
#include "dss_features.h"
|
|
|
|
|
2011-03-15 04:28:22 +00:00
|
|
|
struct dss_param_range {
|
|
|
|
int min, max;
|
|
|
|
};
|
|
|
|
|
2010-09-15 13:17:29 +00:00
|
|
|
struct omap_dss_features {
|
2012-01-30 05:22:39 +00:00
|
|
|
const enum dss_feat_id *features;
|
|
|
|
const int num_features;
|
2010-09-15 13:17:29 +00:00
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
const enum omap_dss_output_id *supported_outputs;
|
2011-03-15 04:28:22 +00:00
|
|
|
const struct dss_param_range *dss_params;
|
2010-09-15 13:17:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* This struct is assigned to one of the below during initialization */
|
2011-04-20 07:09:36 +00:00
|
|
|
static const struct omap_dss_features *omap_current_dss_features;
|
2010-09-15 13:17:29 +00:00
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
static const enum omap_dss_output_id omap2_dss_supported_outputs[] = {
|
|
|
|
/* OMAP_DSS_CHANNEL_LCD */
|
|
|
|
OMAP_DSS_OUTPUT_DPI | OMAP_DSS_OUTPUT_DBI,
|
|
|
|
|
|
|
|
/* OMAP_DSS_CHANNEL_DIGIT */
|
|
|
|
OMAP_DSS_OUTPUT_VENC,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const enum omap_dss_output_id omap3430_dss_supported_outputs[] = {
|
|
|
|
/* OMAP_DSS_CHANNEL_LCD */
|
|
|
|
OMAP_DSS_OUTPUT_DPI | OMAP_DSS_OUTPUT_DBI |
|
|
|
|
OMAP_DSS_OUTPUT_SDI | OMAP_DSS_OUTPUT_DSI1,
|
|
|
|
|
|
|
|
/* OMAP_DSS_CHANNEL_DIGIT */
|
|
|
|
OMAP_DSS_OUTPUT_VENC,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const enum omap_dss_output_id omap3630_dss_supported_outputs[] = {
|
|
|
|
/* OMAP_DSS_CHANNEL_LCD */
|
|
|
|
OMAP_DSS_OUTPUT_DPI | OMAP_DSS_OUTPUT_DBI |
|
|
|
|
OMAP_DSS_OUTPUT_DSI1,
|
|
|
|
|
|
|
|
/* OMAP_DSS_CHANNEL_DIGIT */
|
|
|
|
OMAP_DSS_OUTPUT_VENC,
|
|
|
|
};
|
|
|
|
|
2014-03-24 11:01:51 +00:00
|
|
|
static const enum omap_dss_output_id am43xx_dss_supported_outputs[] = {
|
|
|
|
/* OMAP_DSS_CHANNEL_LCD */
|
|
|
|
OMAP_DSS_OUTPUT_DPI | OMAP_DSS_OUTPUT_DBI,
|
|
|
|
};
|
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
static const enum omap_dss_output_id omap4_dss_supported_outputs[] = {
|
|
|
|
/* OMAP_DSS_CHANNEL_LCD */
|
2013-03-05 14:17:50 +00:00
|
|
|
OMAP_DSS_OUTPUT_DBI | OMAP_DSS_OUTPUT_DSI1,
|
2012-09-26 11:12:39 +00:00
|
|
|
|
|
|
|
/* OMAP_DSS_CHANNEL_DIGIT */
|
2013-03-05 14:17:50 +00:00
|
|
|
OMAP_DSS_OUTPUT_VENC | OMAP_DSS_OUTPUT_HDMI,
|
2012-09-26 11:12:39 +00:00
|
|
|
|
|
|
|
/* OMAP_DSS_CHANNEL_LCD2 */
|
|
|
|
OMAP_DSS_OUTPUT_DPI | OMAP_DSS_OUTPUT_DBI |
|
|
|
|
OMAP_DSS_OUTPUT_DSI2,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const enum omap_dss_output_id omap5_dss_supported_outputs[] = {
|
|
|
|
/* OMAP_DSS_CHANNEL_LCD */
|
|
|
|
OMAP_DSS_OUTPUT_DPI | OMAP_DSS_OUTPUT_DBI |
|
|
|
|
OMAP_DSS_OUTPUT_DSI1 | OMAP_DSS_OUTPUT_DSI2,
|
|
|
|
|
|
|
|
/* OMAP_DSS_CHANNEL_DIGIT */
|
2014-12-10 13:34:35 +00:00
|
|
|
OMAP_DSS_OUTPUT_HDMI,
|
2012-09-26 11:12:39 +00:00
|
|
|
|
|
|
|
/* OMAP_DSS_CHANNEL_LCD2 */
|
|
|
|
OMAP_DSS_OUTPUT_DPI | OMAP_DSS_OUTPUT_DBI |
|
|
|
|
OMAP_DSS_OUTPUT_DSI1,
|
|
|
|
|
|
|
|
/* OMAP_DSS_CHANNEL_LCD3 */
|
|
|
|
OMAP_DSS_OUTPUT_DPI | OMAP_DSS_OUTPUT_DBI |
|
|
|
|
OMAP_DSS_OUTPUT_DSI2,
|
|
|
|
};
|
|
|
|
|
2011-03-15 04:28:22 +00:00
|
|
|
static const struct dss_param_range omap2_dss_param_range[] = {
|
2013-03-26 13:45:23 +00:00
|
|
|
[FEAT_PARAM_DSS_FCK] = { 0, 133000000 },
|
2011-08-29 12:56:04 +00:00
|
|
|
[FEAT_PARAM_DSS_PCD] = { 2, 255 },
|
2011-09-08 07:55:17 +00:00
|
|
|
[FEAT_PARAM_DOWNSCALE] = { 1, 2 },
|
2011-12-19 08:33:56 +00:00
|
|
|
/*
|
|
|
|
* Assuming the line width buffer to be 768 pixels as OMAP2 DISPC
|
|
|
|
* scaler cannot scale a image with width more than 768.
|
|
|
|
*/
|
|
|
|
[FEAT_PARAM_LINEWIDTH] = { 1, 768 },
|
2011-03-15 04:28:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct dss_param_range omap3_dss_param_range[] = {
|
2011-03-15 04:28:23 +00:00
|
|
|
[FEAT_PARAM_DSS_FCK] = { 0, 173000000 },
|
2011-08-29 12:56:04 +00:00
|
|
|
[FEAT_PARAM_DSS_PCD] = { 1, 255 },
|
2011-03-15 04:28:23 +00:00
|
|
|
[FEAT_PARAM_DSIPLL_LPDIV] = { 1, (1 << 13) - 1},
|
2012-08-16 13:25:29 +00:00
|
|
|
[FEAT_PARAM_DSI_FCK] = { 0, 173000000 },
|
2011-09-08 07:55:17 +00:00
|
|
|
[FEAT_PARAM_DOWNSCALE] = { 1, 4 },
|
2011-12-19 08:33:56 +00:00
|
|
|
[FEAT_PARAM_LINEWIDTH] = { 1, 1024 },
|
2011-03-15 04:28:22 +00:00
|
|
|
};
|
|
|
|
|
2014-03-24 11:01:51 +00:00
|
|
|
static const struct dss_param_range am43xx_dss_param_range[] = {
|
|
|
|
[FEAT_PARAM_DSS_FCK] = { 0, 200000000 },
|
2014-09-25 17:56:43 +00:00
|
|
|
[FEAT_PARAM_DSS_PCD] = { 1, 255 },
|
2014-03-24 11:01:51 +00:00
|
|
|
[FEAT_PARAM_DOWNSCALE] = { 1, 4 },
|
|
|
|
[FEAT_PARAM_LINEWIDTH] = { 1, 1024 },
|
|
|
|
};
|
|
|
|
|
2011-03-15 04:28:22 +00:00
|
|
|
static const struct dss_param_range omap4_dss_param_range[] = {
|
2011-03-15 04:28:23 +00:00
|
|
|
[FEAT_PARAM_DSS_FCK] = { 0, 186000000 },
|
2011-08-29 12:56:04 +00:00
|
|
|
[FEAT_PARAM_DSS_PCD] = { 1, 255 },
|
2011-03-15 04:28:23 +00:00
|
|
|
[FEAT_PARAM_DSIPLL_LPDIV] = { 0, (1 << 13) - 1 },
|
2012-08-16 13:25:29 +00:00
|
|
|
[FEAT_PARAM_DSI_FCK] = { 0, 170000000 },
|
2011-09-08 07:55:17 +00:00
|
|
|
[FEAT_PARAM_DOWNSCALE] = { 1, 4 },
|
2011-12-19 08:33:56 +00:00
|
|
|
[FEAT_PARAM_LINEWIDTH] = { 1, 2048 },
|
2011-03-15 04:28:22 +00:00
|
|
|
};
|
|
|
|
|
2012-04-08 11:17:01 +00:00
|
|
|
static const struct dss_param_range omap5_dss_param_range[] = {
|
2013-03-26 13:45:23 +00:00
|
|
|
[FEAT_PARAM_DSS_FCK] = { 0, 209250000 },
|
2012-04-08 11:17:01 +00:00
|
|
|
[FEAT_PARAM_DSS_PCD] = { 1, 255 },
|
|
|
|
[FEAT_PARAM_DSIPLL_LPDIV] = { 0, (1 << 13) - 1 },
|
2013-03-26 13:45:23 +00:00
|
|
|
[FEAT_PARAM_DSI_FCK] = { 0, 209250000 },
|
2012-04-08 11:17:01 +00:00
|
|
|
[FEAT_PARAM_DOWNSCALE] = { 1, 4 },
|
|
|
|
[FEAT_PARAM_LINEWIDTH] = { 1, 2048 },
|
|
|
|
};
|
|
|
|
|
2012-01-30 05:22:39 +00:00
|
|
|
static const enum dss_feat_id omap2_dss_feat_list[] = {
|
|
|
|
FEAT_LCDENABLEPOL,
|
|
|
|
FEAT_LCDENABLESIGNAL,
|
|
|
|
FEAT_PCKFREEENABLE,
|
|
|
|
FEAT_FUNCGATED,
|
|
|
|
FEAT_ROWREPEATENABLE,
|
|
|
|
FEAT_RESIZECONF,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const enum dss_feat_id omap3430_dss_feat_list[] = {
|
|
|
|
FEAT_LCDENABLEPOL,
|
|
|
|
FEAT_LCDENABLESIGNAL,
|
|
|
|
FEAT_PCKFREEENABLE,
|
|
|
|
FEAT_FUNCGATED,
|
|
|
|
FEAT_LINEBUFFERSPLIT,
|
|
|
|
FEAT_ROWREPEATENABLE,
|
|
|
|
FEAT_RESIZECONF,
|
|
|
|
FEAT_CPR,
|
|
|
|
FEAT_PRELOAD,
|
|
|
|
FEAT_FIR_COEF_V,
|
|
|
|
FEAT_ALPHA_FIXED_ZORDER,
|
|
|
|
FEAT_FIFO_MERGE,
|
|
|
|
FEAT_OMAP3_DSI_FIFO_BUG,
|
|
|
|
};
|
|
|
|
|
2012-09-19 19:53:14 +00:00
|
|
|
static const enum dss_feat_id am35xx_dss_feat_list[] = {
|
|
|
|
FEAT_LCDENABLEPOL,
|
|
|
|
FEAT_LCDENABLESIGNAL,
|
|
|
|
FEAT_PCKFREEENABLE,
|
|
|
|
FEAT_FUNCGATED,
|
|
|
|
FEAT_LINEBUFFERSPLIT,
|
|
|
|
FEAT_ROWREPEATENABLE,
|
|
|
|
FEAT_RESIZECONF,
|
|
|
|
FEAT_CPR,
|
|
|
|
FEAT_PRELOAD,
|
|
|
|
FEAT_FIR_COEF_V,
|
|
|
|
FEAT_ALPHA_FIXED_ZORDER,
|
|
|
|
FEAT_FIFO_MERGE,
|
|
|
|
FEAT_OMAP3_DSI_FIFO_BUG,
|
|
|
|
};
|
|
|
|
|
2014-03-24 11:01:51 +00:00
|
|
|
static const enum dss_feat_id am43xx_dss_feat_list[] = {
|
|
|
|
FEAT_LCDENABLEPOL,
|
|
|
|
FEAT_LCDENABLESIGNAL,
|
|
|
|
FEAT_PCKFREEENABLE,
|
|
|
|
FEAT_FUNCGATED,
|
|
|
|
FEAT_LINEBUFFERSPLIT,
|
|
|
|
FEAT_ROWREPEATENABLE,
|
|
|
|
FEAT_RESIZECONF,
|
|
|
|
FEAT_CPR,
|
|
|
|
FEAT_PRELOAD,
|
|
|
|
FEAT_FIR_COEF_V,
|
|
|
|
FEAT_ALPHA_FIXED_ZORDER,
|
|
|
|
FEAT_FIFO_MERGE,
|
|
|
|
};
|
|
|
|
|
2012-01-30 05:22:39 +00:00
|
|
|
static const enum dss_feat_id omap3630_dss_feat_list[] = {
|
|
|
|
FEAT_LCDENABLEPOL,
|
|
|
|
FEAT_LCDENABLESIGNAL,
|
|
|
|
FEAT_PCKFREEENABLE,
|
|
|
|
FEAT_FUNCGATED,
|
|
|
|
FEAT_LINEBUFFERSPLIT,
|
|
|
|
FEAT_ROWREPEATENABLE,
|
|
|
|
FEAT_RESIZECONF,
|
|
|
|
FEAT_CPR,
|
|
|
|
FEAT_PRELOAD,
|
|
|
|
FEAT_FIR_COEF_V,
|
|
|
|
FEAT_ALPHA_FIXED_ZORDER,
|
|
|
|
FEAT_FIFO_MERGE,
|
|
|
|
FEAT_OMAP3_DSI_FIFO_BUG,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const enum dss_feat_id omap4430_es1_0_dss_feat_list[] = {
|
|
|
|
FEAT_MGR_LCD2,
|
|
|
|
FEAT_CORE_CLK_DIV,
|
|
|
|
FEAT_LCD_CLK_SRC,
|
|
|
|
FEAT_HANDLE_UV_SEPARATE,
|
|
|
|
FEAT_ATTR2,
|
|
|
|
FEAT_CPR,
|
|
|
|
FEAT_PRELOAD,
|
|
|
|
FEAT_FIR_COEF_V,
|
|
|
|
FEAT_ALPHA_FREE_ZORDER,
|
|
|
|
FEAT_FIFO_MERGE,
|
2012-05-11 13:49:55 +00:00
|
|
|
FEAT_BURST_2D,
|
2012-01-30 05:22:39 +00:00
|
|
|
};
|
|
|
|
|
2012-02-16 15:20:57 +00:00
|
|
|
static const enum dss_feat_id omap4430_es2_0_1_2_dss_feat_list[] = {
|
|
|
|
FEAT_MGR_LCD2,
|
|
|
|
FEAT_CORE_CLK_DIV,
|
|
|
|
FEAT_LCD_CLK_SRC,
|
|
|
|
FEAT_HANDLE_UV_SEPARATE,
|
|
|
|
FEAT_ATTR2,
|
|
|
|
FEAT_CPR,
|
|
|
|
FEAT_PRELOAD,
|
|
|
|
FEAT_FIR_COEF_V,
|
|
|
|
FEAT_ALPHA_FREE_ZORDER,
|
|
|
|
FEAT_FIFO_MERGE,
|
2012-05-11 13:49:55 +00:00
|
|
|
FEAT_BURST_2D,
|
2012-02-16 15:20:57 +00:00
|
|
|
};
|
|
|
|
|
2012-01-30 05:22:39 +00:00
|
|
|
static const enum dss_feat_id omap4_dss_feat_list[] = {
|
|
|
|
FEAT_MGR_LCD2,
|
|
|
|
FEAT_CORE_CLK_DIV,
|
|
|
|
FEAT_LCD_CLK_SRC,
|
|
|
|
FEAT_HANDLE_UV_SEPARATE,
|
|
|
|
FEAT_ATTR2,
|
|
|
|
FEAT_CPR,
|
|
|
|
FEAT_PRELOAD,
|
|
|
|
FEAT_FIR_COEF_V,
|
|
|
|
FEAT_ALPHA_FREE_ZORDER,
|
|
|
|
FEAT_FIFO_MERGE,
|
2012-05-11 13:49:55 +00:00
|
|
|
FEAT_BURST_2D,
|
2012-01-30 05:22:39 +00:00
|
|
|
};
|
|
|
|
|
2012-04-08 11:17:01 +00:00
|
|
|
static const enum dss_feat_id omap5_dss_feat_list[] = {
|
|
|
|
FEAT_MGR_LCD2,
|
2013-10-25 14:53:21 +00:00
|
|
|
FEAT_MGR_LCD3,
|
2012-04-08 11:17:01 +00:00
|
|
|
FEAT_CORE_CLK_DIV,
|
|
|
|
FEAT_LCD_CLK_SRC,
|
|
|
|
FEAT_HANDLE_UV_SEPARATE,
|
|
|
|
FEAT_ATTR2,
|
|
|
|
FEAT_CPR,
|
|
|
|
FEAT_PRELOAD,
|
|
|
|
FEAT_FIR_COEF_V,
|
|
|
|
FEAT_ALPHA_FREE_ZORDER,
|
|
|
|
FEAT_FIFO_MERGE,
|
|
|
|
FEAT_BURST_2D,
|
2013-11-14 09:38:25 +00:00
|
|
|
FEAT_MFLAG,
|
2012-04-08 11:17:01 +00:00
|
|
|
};
|
|
|
|
|
2010-09-15 13:17:29 +00:00
|
|
|
/* OMAP2 DSS Features */
|
2011-04-20 07:09:36 +00:00
|
|
|
static const struct omap_dss_features omap2_dss_features = {
|
2012-01-30 05:22:39 +00:00
|
|
|
.features = omap2_dss_feat_list,
|
|
|
|
.num_features = ARRAY_SIZE(omap2_dss_feat_list),
|
2010-12-02 11:27:08 +00:00
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
.supported_outputs = omap2_dss_supported_outputs,
|
2011-03-15 04:28:22 +00:00
|
|
|
.dss_params = omap2_dss_param_range,
|
2010-09-15 13:17:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* OMAP3 DSS Features */
|
2011-04-20 07:09:36 +00:00
|
|
|
static const struct omap_dss_features omap3430_dss_features = {
|
2012-01-30 05:22:39 +00:00
|
|
|
.features = omap3430_dss_feat_list,
|
|
|
|
.num_features = ARRAY_SIZE(omap3430_dss_feat_list),
|
2010-09-15 13:17:29 +00:00
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
.supported_outputs = omap3430_dss_supported_outputs,
|
2011-03-15 04:28:22 +00:00
|
|
|
.dss_params = omap3_dss_param_range,
|
2010-09-15 13:17:29 +00:00
|
|
|
};
|
|
|
|
|
2012-09-19 19:53:14 +00:00
|
|
|
/*
|
|
|
|
* AM35xx DSS Features. This is basically OMAP3 DSS Features without the
|
|
|
|
* vdds_dsi regulator.
|
|
|
|
*/
|
|
|
|
static const struct omap_dss_features am35xx_dss_features = {
|
|
|
|
.features = am35xx_dss_feat_list,
|
|
|
|
.num_features = ARRAY_SIZE(am35xx_dss_feat_list),
|
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
.supported_outputs = omap3430_dss_supported_outputs,
|
2012-09-19 19:53:14 +00:00
|
|
|
.dss_params = omap3_dss_param_range,
|
|
|
|
};
|
|
|
|
|
2014-03-24 11:01:51 +00:00
|
|
|
static const struct omap_dss_features am43xx_dss_features = {
|
|
|
|
.features = am43xx_dss_feat_list,
|
|
|
|
.num_features = ARRAY_SIZE(am43xx_dss_feat_list),
|
|
|
|
|
|
|
|
.supported_outputs = am43xx_dss_supported_outputs,
|
|
|
|
.dss_params = am43xx_dss_param_range,
|
|
|
|
};
|
|
|
|
|
2011-04-20 07:09:36 +00:00
|
|
|
static const struct omap_dss_features omap3630_dss_features = {
|
2012-01-30 05:22:39 +00:00
|
|
|
.features = omap3630_dss_feat_list,
|
|
|
|
.num_features = ARRAY_SIZE(omap3630_dss_feat_list),
|
2010-11-04 11:28:41 +00:00
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
.supported_outputs = omap3630_dss_supported_outputs,
|
2011-03-15 04:28:22 +00:00
|
|
|
.dss_params = omap3_dss_param_range,
|
2010-11-04 11:28:41 +00:00
|
|
|
};
|
|
|
|
|
2010-12-02 11:27:08 +00:00
|
|
|
/* OMAP4 DSS Features */
|
2011-05-19 03:23:33 +00:00
|
|
|
/* For OMAP4430 ES 1.0 revision */
|
|
|
|
static const struct omap_dss_features omap4430_es1_0_dss_features = {
|
2012-01-30 05:22:39 +00:00
|
|
|
.features = omap4430_es1_0_dss_feat_list,
|
|
|
|
.num_features = ARRAY_SIZE(omap4430_es1_0_dss_feat_list),
|
2011-05-19 03:23:33 +00:00
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
.supported_outputs = omap4_dss_supported_outputs,
|
2011-05-19 03:23:33 +00:00
|
|
|
.dss_params = omap4_dss_param_range,
|
|
|
|
};
|
|
|
|
|
2012-02-16 15:20:57 +00:00
|
|
|
/* For OMAP4430 ES 2.0, 2.1 and 2.2 revisions */
|
|
|
|
static const struct omap_dss_features omap4430_es2_0_1_2_dss_features = {
|
|
|
|
.features = omap4430_es2_0_1_2_dss_feat_list,
|
|
|
|
.num_features = ARRAY_SIZE(omap4430_es2_0_1_2_dss_feat_list),
|
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
.supported_outputs = omap4_dss_supported_outputs,
|
2012-02-16 15:20:57 +00:00
|
|
|
.dss_params = omap4_dss_param_range,
|
|
|
|
};
|
|
|
|
|
2011-05-19 03:23:33 +00:00
|
|
|
/* For all the other OMAP4 versions */
|
2011-04-20 07:09:36 +00:00
|
|
|
static const struct omap_dss_features omap4_dss_features = {
|
2012-01-30 05:22:39 +00:00
|
|
|
.features = omap4_dss_feat_list,
|
|
|
|
.num_features = ARRAY_SIZE(omap4_dss_feat_list),
|
2010-12-02 11:27:08 +00:00
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
.supported_outputs = omap4_dss_supported_outputs,
|
2011-03-15 04:28:22 +00:00
|
|
|
.dss_params = omap4_dss_param_range,
|
2010-12-02 11:27:08 +00:00
|
|
|
};
|
|
|
|
|
2012-04-08 11:17:01 +00:00
|
|
|
/* OMAP5 DSS Features */
|
|
|
|
static const struct omap_dss_features omap5_dss_features = {
|
|
|
|
.features = omap5_dss_feat_list,
|
|
|
|
.num_features = ARRAY_SIZE(omap5_dss_feat_list),
|
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
.supported_outputs = omap5_dss_supported_outputs,
|
2012-04-08 11:17:01 +00:00
|
|
|
.dss_params = omap5_dss_param_range,
|
|
|
|
};
|
|
|
|
|
2010-09-15 13:17:29 +00:00
|
|
|
/* Functions returning values related to a DSS feature */
|
2011-03-15 04:28:22 +00:00
|
|
|
unsigned long dss_feat_get_param_min(enum dss_range_param param)
|
|
|
|
{
|
|
|
|
return omap_current_dss_features->dss_params[param].min;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long dss_feat_get_param_max(enum dss_range_param param)
|
2011-03-01 06:24:00 +00:00
|
|
|
{
|
2011-03-15 04:28:22 +00:00
|
|
|
return omap_current_dss_features->dss_params[param].max;
|
2011-03-01 06:24:00 +00:00
|
|
|
}
|
|
|
|
|
2012-09-26 11:12:39 +00:00
|
|
|
enum omap_dss_output_id dss_feat_get_supported_outputs(enum omap_channel channel)
|
|
|
|
{
|
|
|
|
return omap_current_dss_features->supported_outputs[channel];
|
|
|
|
}
|
|
|
|
|
2010-09-15 13:17:29 +00:00
|
|
|
/* DSS has_feature check */
|
|
|
|
bool dss_has_feature(enum dss_feat_id id)
|
|
|
|
{
|
2012-01-30 05:22:39 +00:00
|
|
|
int i;
|
|
|
|
const enum dss_feat_id *features = omap_current_dss_features->features;
|
|
|
|
const int num_features = omap_current_dss_features->num_features;
|
|
|
|
|
|
|
|
for (i = 0; i < num_features; i++) {
|
|
|
|
if (features[i] == id)
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2010-09-15 13:17:29 +00:00
|
|
|
}
|
|
|
|
|
2012-09-28 09:46:49 +00:00
|
|
|
void dss_features_init(enum omapdss_version version)
|
2010-09-15 13:17:29 +00:00
|
|
|
{
|
2012-09-28 09:46:49 +00:00
|
|
|
switch (version) {
|
|
|
|
case OMAPDSS_VER_OMAP24xx:
|
2010-09-15 13:17:29 +00:00
|
|
|
omap_current_dss_features = &omap2_dss_features;
|
2012-09-28 09:46:49 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OMAPDSS_VER_OMAP34xx_ES1:
|
|
|
|
case OMAPDSS_VER_OMAP34xx_ES3:
|
|
|
|
omap_current_dss_features = &omap3430_dss_features;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OMAPDSS_VER_OMAP3630:
|
2010-11-04 11:28:41 +00:00
|
|
|
omap_current_dss_features = &omap3630_dss_features;
|
2012-09-28 09:46:49 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OMAPDSS_VER_OMAP4430_ES1:
|
2011-05-19 03:23:33 +00:00
|
|
|
omap_current_dss_features = &omap4430_es1_0_dss_features;
|
2012-09-28 09:46:49 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OMAPDSS_VER_OMAP4430_ES2:
|
2012-02-16 15:20:57 +00:00
|
|
|
omap_current_dss_features = &omap4430_es2_0_1_2_dss_features;
|
2012-09-28 09:46:49 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OMAPDSS_VER_OMAP4:
|
2010-12-02 11:27:08 +00:00
|
|
|
omap_current_dss_features = &omap4_dss_features;
|
2012-09-28 09:46:49 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OMAPDSS_VER_OMAP5:
|
2014-12-31 09:23:31 +00:00
|
|
|
case OMAPDSS_VER_DRA7xx:
|
2012-04-08 11:17:01 +00:00
|
|
|
omap_current_dss_features = &omap5_dss_features;
|
2012-09-28 09:46:49 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case OMAPDSS_VER_AM35xx:
|
|
|
|
omap_current_dss_features = &am35xx_dss_features;
|
|
|
|
break;
|
|
|
|
|
2014-03-24 11:01:51 +00:00
|
|
|
case OMAPDSS_VER_AM43xx:
|
|
|
|
omap_current_dss_features = &am43xx_dss_features;
|
|
|
|
break;
|
|
|
|
|
2012-09-28 09:46:49 +00:00
|
|
|
default:
|
2011-05-19 03:23:33 +00:00
|
|
|
DSSWARN("Unsupported OMAP version");
|
2012-09-28 09:46:49 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-09-15 13:17:29 +00:00
|
|
|
}
|