blob: 78edb449c763bf3efc448c3d95c4bd459c3c9002 [file] [log] [blame]
Archit Taneja9b372c22011-05-06 11:45:49 +05301/*
2 * linux/drivers/video/omap2/dss/dispc.h
3 *
4 * Copyright (C) 2011 Texas Instruments
5 * Author: Archit Taneja <archit@ti.com>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published by
10 * the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef __OMAP2_DISPC_REG_H
22#define __OMAP2_DISPC_REG_H
23
Archit Taneja702d1442011-05-06 11:45:50 +053024/* DISPC common registers */
Archit Taneja55978cc2011-05-06 11:45:51 +053025#define DISPC_REVISION 0x0000
26#define DISPC_SYSCONFIG 0x0010
27#define DISPC_SYSSTATUS 0x0014
28#define DISPC_IRQSTATUS 0x0018
29#define DISPC_IRQENABLE 0x001C
30#define DISPC_CONTROL 0x0040
31#define DISPC_CONFIG 0x0044
32#define DISPC_CAPABLE 0x0048
33#define DISPC_LINE_STATUS 0x005C
34#define DISPC_LINE_NUMBER 0x0060
35#define DISPC_GLOBAL_ALPHA 0x0074
36#define DISPC_CONTROL2 0x0238
37#define DISPC_CONFIG2 0x0620
38#define DISPC_DIVISOR 0x0804
Tomi Valkeinen66a0f9e2012-08-22 16:57:02 +030039#define DISPC_GLOBAL_BUFFER 0x0800
Chandrabhanu Mahapatrae86d4562012-06-29 10:43:13 +053040#define DISPC_CONTROL3 0x0848
41#define DISPC_CONFIG3 0x084C
Archit Tanejad0df9a22013-03-26 19:15:25 +053042#define DISPC_MSTANDBY_CTRL 0x0858
Tomi Valkeinen29fceee2013-11-14 11:38:25 +020043#define DISPC_GLOBAL_MFLAG_ATTRIBUTE 0x085C
Archit Taneja9b372c22011-05-06 11:45:49 +053044
45/* DISPC overlay registers */
Archit Taneja55978cc2011-05-06 11:45:51 +053046#define DISPC_OVL_BA0(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053047 DISPC_BA0_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053048#define DISPC_OVL_BA1(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053049 DISPC_BA1_OFFSET(n))
Amber Jainab5ca072011-05-19 19:47:53 +053050#define DISPC_OVL_BA0_UV(n) (DISPC_OVL_BASE(n) + \
51 DISPC_BA0_UV_OFFSET(n))
52#define DISPC_OVL_BA1_UV(n) (DISPC_OVL_BASE(n) + \
53 DISPC_BA1_UV_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053054#define DISPC_OVL_POSITION(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053055 DISPC_POS_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053056#define DISPC_OVL_SIZE(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053057 DISPC_SIZE_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053058#define DISPC_OVL_ATTRIBUTES(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053059 DISPC_ATTR_OFFSET(n))
Amber Jainab5ca072011-05-19 19:47:53 +053060#define DISPC_OVL_ATTRIBUTES2(n) (DISPC_OVL_BASE(n) + \
61 DISPC_ATTR2_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053062#define DISPC_OVL_FIFO_THRESHOLD(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053063 DISPC_FIFO_THRESH_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053064#define DISPC_OVL_FIFO_SIZE_STATUS(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053065 DISPC_FIFO_SIZE_STATUS_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053066#define DISPC_OVL_ROW_INC(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053067 DISPC_ROW_INC_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053068#define DISPC_OVL_PIXEL_INC(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053069 DISPC_PIX_INC_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053070#define DISPC_OVL_WINDOW_SKIP(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053071 DISPC_WINDOW_SKIP_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053072#define DISPC_OVL_TABLE_BA(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053073 DISPC_TABLE_BA_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053074#define DISPC_OVL_FIR(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053075 DISPC_FIR_OFFSET(n))
Amber Jainab5ca072011-05-19 19:47:53 +053076#define DISPC_OVL_FIR2(n) (DISPC_OVL_BASE(n) + \
77 DISPC_FIR2_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053078#define DISPC_OVL_PICTURE_SIZE(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053079 DISPC_PIC_SIZE_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053080#define DISPC_OVL_ACCU0(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053081 DISPC_ACCU0_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053082#define DISPC_OVL_ACCU1(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053083 DISPC_ACCU1_OFFSET(n))
Amber Jainab5ca072011-05-19 19:47:53 +053084#define DISPC_OVL_ACCU2_0(n) (DISPC_OVL_BASE(n) + \
85 DISPC_ACCU2_0_OFFSET(n))
86#define DISPC_OVL_ACCU2_1(n) (DISPC_OVL_BASE(n) + \
87 DISPC_ACCU2_1_OFFSET(n))
Archit Taneja55978cc2011-05-06 11:45:51 +053088#define DISPC_OVL_FIR_COEF_H(n, i) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053089 DISPC_FIR_COEF_H_OFFSET(n, i))
Archit Taneja55978cc2011-05-06 11:45:51 +053090#define DISPC_OVL_FIR_COEF_HV(n, i) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053091 DISPC_FIR_COEF_HV_OFFSET(n, i))
Amber Jainab5ca072011-05-19 19:47:53 +053092#define DISPC_OVL_FIR_COEF_H2(n, i) (DISPC_OVL_BASE(n) + \
93 DISPC_FIR_COEF_H2_OFFSET(n, i))
94#define DISPC_OVL_FIR_COEF_HV2(n, i) (DISPC_OVL_BASE(n) + \
95 DISPC_FIR_COEF_HV2_OFFSET(n, i))
Archit Taneja55978cc2011-05-06 11:45:51 +053096#define DISPC_OVL_CONV_COEF(n, i) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053097 DISPC_CONV_COEF_OFFSET(n, i))
Archit Taneja55978cc2011-05-06 11:45:51 +053098#define DISPC_OVL_FIR_COEF_V(n, i) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +053099 DISPC_FIR_COEF_V_OFFSET(n, i))
Amber Jainab5ca072011-05-19 19:47:53 +0530100#define DISPC_OVL_FIR_COEF_V2(n, i) (DISPC_OVL_BASE(n) + \
101 DISPC_FIR_COEF_V2_OFFSET(n, i))
Archit Taneja55978cc2011-05-06 11:45:51 +0530102#define DISPC_OVL_PRELOAD(n) (DISPC_OVL_BASE(n) + \
Archit Taneja9b372c22011-05-06 11:45:49 +0530103 DISPC_PRELOAD_OFFSET(n))
Tomi Valkeinen29fceee2013-11-14 11:38:25 +0200104#define DISPC_OVL_MFLAG_THRESHOLD(n) (DISPC_OVL_BASE(n) + \
105 DISPC_MFLAG_THRESHOLD_OFFSET(n))
Archit Taneja9b372c22011-05-06 11:45:49 +0530106
Chandrabhanu Mahapatradebd9072011-12-19 14:03:44 +0530107/* DISPC up/downsampling FIR filter coefficient structure */
108struct dispc_coef {
109 s8 hc4_vc22;
110 s8 hc3_vc2;
111 u8 hc2_vc1;
112 s8 hc1_vc0;
113 s8 hc0_vc00;
114};
115
116const struct dispc_coef *dispc_ovl_get_scale_coef(int inc, int five_taps);
117
Archit Taneja702d1442011-05-06 11:45:50 +0530118/* DISPC manager/channel specific registers */
Archit Taneja55978cc2011-05-06 11:45:51 +0530119static inline u16 DISPC_DEFAULT_COLOR(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530120{
121 switch (channel) {
122 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530123 return 0x004C;
Archit Taneja702d1442011-05-06 11:45:50 +0530124 case OMAP_DSS_CHANNEL_DIGIT:
Archit Taneja55978cc2011-05-06 11:45:51 +0530125 return 0x0050;
Archit Taneja702d1442011-05-06 11:45:50 +0530126 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530127 return 0x03AC;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530128 case OMAP_DSS_CHANNEL_LCD3:
129 return 0x0814;
Archit Taneja702d1442011-05-06 11:45:50 +0530130 default:
131 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300132 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530133 }
134}
135
Archit Taneja55978cc2011-05-06 11:45:51 +0530136static inline u16 DISPC_TRANS_COLOR(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530137{
138 switch (channel) {
139 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530140 return 0x0054;
Archit Taneja702d1442011-05-06 11:45:50 +0530141 case OMAP_DSS_CHANNEL_DIGIT:
Archit Taneja55978cc2011-05-06 11:45:51 +0530142 return 0x0058;
Archit Taneja702d1442011-05-06 11:45:50 +0530143 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530144 return 0x03B0;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530145 case OMAP_DSS_CHANNEL_LCD3:
146 return 0x0818;
Archit Taneja702d1442011-05-06 11:45:50 +0530147 default:
148 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300149 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530150 }
151}
152
Archit Taneja55978cc2011-05-06 11:45:51 +0530153static inline u16 DISPC_TIMING_H(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530154{
155 switch (channel) {
156 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530157 return 0x0064;
Archit Taneja702d1442011-05-06 11:45:50 +0530158 case OMAP_DSS_CHANNEL_DIGIT:
159 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300160 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530161 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530162 return 0x0400;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530163 case OMAP_DSS_CHANNEL_LCD3:
164 return 0x0840;
Archit Taneja702d1442011-05-06 11:45:50 +0530165 default:
166 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300167 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530168 }
169}
170
Archit Taneja55978cc2011-05-06 11:45:51 +0530171static inline u16 DISPC_TIMING_V(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530172{
173 switch (channel) {
174 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530175 return 0x0068;
Archit Taneja702d1442011-05-06 11:45:50 +0530176 case OMAP_DSS_CHANNEL_DIGIT:
177 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300178 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530179 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530180 return 0x0404;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530181 case OMAP_DSS_CHANNEL_LCD3:
182 return 0x0844;
Archit Taneja702d1442011-05-06 11:45:50 +0530183 default:
184 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300185 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530186 }
187}
188
Archit Taneja55978cc2011-05-06 11:45:51 +0530189static inline u16 DISPC_POL_FREQ(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530190{
191 switch (channel) {
192 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530193 return 0x006C;
Archit Taneja702d1442011-05-06 11:45:50 +0530194 case OMAP_DSS_CHANNEL_DIGIT:
195 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300196 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530197 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530198 return 0x0408;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530199 case OMAP_DSS_CHANNEL_LCD3:
200 return 0x083C;
Archit Taneja702d1442011-05-06 11:45:50 +0530201 default:
202 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300203 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530204 }
205}
206
Archit Taneja55978cc2011-05-06 11:45:51 +0530207static inline u16 DISPC_DIVISORo(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530208{
209 switch (channel) {
210 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530211 return 0x0070;
Archit Taneja702d1442011-05-06 11:45:50 +0530212 case OMAP_DSS_CHANNEL_DIGIT:
213 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300214 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530215 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530216 return 0x040C;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530217 case OMAP_DSS_CHANNEL_LCD3:
218 return 0x0838;
Archit Taneja702d1442011-05-06 11:45:50 +0530219 default:
220 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300221 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530222 }
223}
224
225/* Named as DISPC_SIZE_LCD, DISPC_SIZE_DIGIT and DISPC_SIZE_LCD2 in TRM */
Archit Taneja55978cc2011-05-06 11:45:51 +0530226static inline u16 DISPC_SIZE_MGR(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530227{
228 switch (channel) {
229 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530230 return 0x007C;
Archit Taneja702d1442011-05-06 11:45:50 +0530231 case OMAP_DSS_CHANNEL_DIGIT:
Archit Taneja55978cc2011-05-06 11:45:51 +0530232 return 0x0078;
Archit Taneja702d1442011-05-06 11:45:50 +0530233 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530234 return 0x03CC;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530235 case OMAP_DSS_CHANNEL_LCD3:
236 return 0x0834;
Archit Taneja702d1442011-05-06 11:45:50 +0530237 default:
238 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300239 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530240 }
241}
242
Archit Taneja55978cc2011-05-06 11:45:51 +0530243static inline u16 DISPC_DATA_CYCLE1(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530244{
245 switch (channel) {
246 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530247 return 0x01D4;
Archit Taneja702d1442011-05-06 11:45:50 +0530248 case OMAP_DSS_CHANNEL_DIGIT:
249 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300250 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530251 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530252 return 0x03C0;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530253 case OMAP_DSS_CHANNEL_LCD3:
254 return 0x0828;
Archit Taneja702d1442011-05-06 11:45:50 +0530255 default:
256 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300257 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530258 }
259}
260
Archit Taneja55978cc2011-05-06 11:45:51 +0530261static inline u16 DISPC_DATA_CYCLE2(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530262{
263 switch (channel) {
264 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530265 return 0x01D8;
Archit Taneja702d1442011-05-06 11:45:50 +0530266 case OMAP_DSS_CHANNEL_DIGIT:
267 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300268 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530269 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530270 return 0x03C4;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530271 case OMAP_DSS_CHANNEL_LCD3:
272 return 0x082C;
Archit Taneja702d1442011-05-06 11:45:50 +0530273 default:
274 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300275 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530276 }
277}
278
Archit Taneja55978cc2011-05-06 11:45:51 +0530279static inline u16 DISPC_DATA_CYCLE3(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530280{
281 switch (channel) {
282 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530283 return 0x01DC;
Archit Taneja702d1442011-05-06 11:45:50 +0530284 case OMAP_DSS_CHANNEL_DIGIT:
285 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300286 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530287 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530288 return 0x03C8;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530289 case OMAP_DSS_CHANNEL_LCD3:
290 return 0x0830;
Archit Taneja702d1442011-05-06 11:45:50 +0530291 default:
292 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300293 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530294 }
295}
296
Archit Taneja55978cc2011-05-06 11:45:51 +0530297static inline u16 DISPC_CPR_COEF_R(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530298{
299 switch (channel) {
300 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530301 return 0x0220;
Archit Taneja702d1442011-05-06 11:45:50 +0530302 case OMAP_DSS_CHANNEL_DIGIT:
303 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300304 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530305 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530306 return 0x03BC;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530307 case OMAP_DSS_CHANNEL_LCD3:
308 return 0x0824;
Archit Taneja702d1442011-05-06 11:45:50 +0530309 default:
310 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300311 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530312 }
313}
314
Archit Taneja55978cc2011-05-06 11:45:51 +0530315static inline u16 DISPC_CPR_COEF_G(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530316{
317 switch (channel) {
318 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530319 return 0x0224;
Archit Taneja702d1442011-05-06 11:45:50 +0530320 case OMAP_DSS_CHANNEL_DIGIT:
321 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300322 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530323 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530324 return 0x03B8;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530325 case OMAP_DSS_CHANNEL_LCD3:
326 return 0x0820;
Archit Taneja702d1442011-05-06 11:45:50 +0530327 default:
328 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300329 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530330 }
331}
332
Archit Taneja55978cc2011-05-06 11:45:51 +0530333static inline u16 DISPC_CPR_COEF_B(enum omap_channel channel)
Archit Taneja702d1442011-05-06 11:45:50 +0530334{
335 switch (channel) {
336 case OMAP_DSS_CHANNEL_LCD:
Archit Taneja55978cc2011-05-06 11:45:51 +0530337 return 0x0228;
Archit Taneja702d1442011-05-06 11:45:50 +0530338 case OMAP_DSS_CHANNEL_DIGIT:
339 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300340 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530341 case OMAP_DSS_CHANNEL_LCD2:
Archit Taneja55978cc2011-05-06 11:45:51 +0530342 return 0x03B4;
Chandrabhanu Mahapatraff6331e2012-06-19 15:08:16 +0530343 case OMAP_DSS_CHANNEL_LCD3:
344 return 0x081C;
Archit Taneja702d1442011-05-06 11:45:50 +0530345 default:
346 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300347 return 0;
Archit Taneja702d1442011-05-06 11:45:50 +0530348 }
349}
350
Archit Taneja9b372c22011-05-06 11:45:49 +0530351/* DISPC overlay register base addresses */
352static inline u16 DISPC_OVL_BASE(enum omap_plane plane)
353{
354 switch (plane) {
355 case OMAP_DSS_GFX:
356 return 0x0080;
357 case OMAP_DSS_VIDEO1:
358 return 0x00BC;
359 case OMAP_DSS_VIDEO2:
360 return 0x014C;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530361 case OMAP_DSS_VIDEO3:
362 return 0x0300;
Tomi Valkeinen66a0f9e2012-08-22 16:57:02 +0300363 case OMAP_DSS_WB:
364 return 0x0500;
Archit Taneja9b372c22011-05-06 11:45:49 +0530365 default:
366 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300367 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530368 }
369}
370
371/* DISPC overlay register offsets */
372static inline u16 DISPC_BA0_OFFSET(enum omap_plane plane)
373{
374 switch (plane) {
375 case OMAP_DSS_GFX:
376 case OMAP_DSS_VIDEO1:
377 case OMAP_DSS_VIDEO2:
378 return 0x0000;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530379 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530380 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530381 return 0x0008;
Archit Taneja9b372c22011-05-06 11:45:49 +0530382 default:
383 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300384 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530385 }
386}
387
388static inline u16 DISPC_BA1_OFFSET(enum omap_plane plane)
389{
390 switch (plane) {
391 case OMAP_DSS_GFX:
392 case OMAP_DSS_VIDEO1:
393 case OMAP_DSS_VIDEO2:
394 return 0x0004;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530395 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530396 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530397 return 0x000C;
Archit Taneja9b372c22011-05-06 11:45:49 +0530398 default:
399 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300400 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530401 }
402}
403
Amber Jainab5ca072011-05-19 19:47:53 +0530404static inline u16 DISPC_BA0_UV_OFFSET(enum omap_plane plane)
405{
406 switch (plane) {
407 case OMAP_DSS_GFX:
408 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300409 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530410 case OMAP_DSS_VIDEO1:
411 return 0x0544;
412 case OMAP_DSS_VIDEO2:
413 return 0x04BC;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530414 case OMAP_DSS_VIDEO3:
415 return 0x0310;
Archit Taneja7a155be2012-07-16 15:54:24 +0530416 case OMAP_DSS_WB:
417 return 0x0118;
Amber Jainab5ca072011-05-19 19:47:53 +0530418 default:
419 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300420 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530421 }
422}
423
424static inline u16 DISPC_BA1_UV_OFFSET(enum omap_plane plane)
425{
426 switch (plane) {
427 case OMAP_DSS_GFX:
428 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300429 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530430 case OMAP_DSS_VIDEO1:
431 return 0x0548;
432 case OMAP_DSS_VIDEO2:
433 return 0x04C0;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530434 case OMAP_DSS_VIDEO3:
435 return 0x0314;
Archit Taneja7a155be2012-07-16 15:54:24 +0530436 case OMAP_DSS_WB:
437 return 0x011C;
Amber Jainab5ca072011-05-19 19:47:53 +0530438 default:
439 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300440 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530441 }
442}
443
Archit Taneja9b372c22011-05-06 11:45:49 +0530444static inline u16 DISPC_POS_OFFSET(enum omap_plane plane)
445{
446 switch (plane) {
447 case OMAP_DSS_GFX:
448 case OMAP_DSS_VIDEO1:
449 case OMAP_DSS_VIDEO2:
450 return 0x0008;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530451 case OMAP_DSS_VIDEO3:
452 return 0x009C;
Archit Taneja9b372c22011-05-06 11:45:49 +0530453 default:
454 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300455 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530456 }
457}
458
459static inline u16 DISPC_SIZE_OFFSET(enum omap_plane plane)
460{
461 switch (plane) {
462 case OMAP_DSS_GFX:
463 case OMAP_DSS_VIDEO1:
464 case OMAP_DSS_VIDEO2:
465 return 0x000C;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530466 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530467 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530468 return 0x00A8;
Archit Taneja9b372c22011-05-06 11:45:49 +0530469 default:
470 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300471 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530472 }
473}
474
475static inline u16 DISPC_ATTR_OFFSET(enum omap_plane plane)
476{
477 switch (plane) {
478 case OMAP_DSS_GFX:
479 return 0x0020;
480 case OMAP_DSS_VIDEO1:
481 case OMAP_DSS_VIDEO2:
482 return 0x0010;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530483 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530484 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530485 return 0x0070;
Archit Taneja9b372c22011-05-06 11:45:49 +0530486 default:
487 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300488 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530489 }
490}
491
Amber Jainab5ca072011-05-19 19:47:53 +0530492static inline u16 DISPC_ATTR2_OFFSET(enum omap_plane plane)
493{
494 switch (plane) {
495 case OMAP_DSS_GFX:
496 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300497 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530498 case OMAP_DSS_VIDEO1:
499 return 0x0568;
500 case OMAP_DSS_VIDEO2:
501 return 0x04DC;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530502 case OMAP_DSS_VIDEO3:
503 return 0x032C;
Archit Taneja7a155be2012-07-16 15:54:24 +0530504 case OMAP_DSS_WB:
505 return 0x0310;
Amber Jainab5ca072011-05-19 19:47:53 +0530506 default:
507 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300508 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530509 }
510}
511
Archit Taneja9b372c22011-05-06 11:45:49 +0530512static inline u16 DISPC_FIFO_THRESH_OFFSET(enum omap_plane plane)
513{
514 switch (plane) {
515 case OMAP_DSS_GFX:
516 return 0x0024;
517 case OMAP_DSS_VIDEO1:
518 case OMAP_DSS_VIDEO2:
519 return 0x0014;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530520 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530521 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530522 return 0x008C;
Archit Taneja9b372c22011-05-06 11:45:49 +0530523 default:
524 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300525 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530526 }
527}
528
529static inline u16 DISPC_FIFO_SIZE_STATUS_OFFSET(enum omap_plane plane)
530{
531 switch (plane) {
532 case OMAP_DSS_GFX:
533 return 0x0028;
534 case OMAP_DSS_VIDEO1:
535 case OMAP_DSS_VIDEO2:
536 return 0x0018;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530537 case OMAP_DSS_VIDEO3:
Tomi Valkeinen66a0f9e2012-08-22 16:57:02 +0300538 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530539 return 0x0088;
Archit Taneja9b372c22011-05-06 11:45:49 +0530540 default:
541 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300542 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530543 }
544}
545
546static inline u16 DISPC_ROW_INC_OFFSET(enum omap_plane plane)
547{
548 switch (plane) {
549 case OMAP_DSS_GFX:
550 return 0x002C;
551 case OMAP_DSS_VIDEO1:
552 case OMAP_DSS_VIDEO2:
553 return 0x001C;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530554 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530555 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530556 return 0x00A4;
Archit Taneja9b372c22011-05-06 11:45:49 +0530557 default:
558 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300559 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530560 }
561}
562
563static inline u16 DISPC_PIX_INC_OFFSET(enum omap_plane plane)
564{
565 switch (plane) {
566 case OMAP_DSS_GFX:
567 return 0x0030;
568 case OMAP_DSS_VIDEO1:
569 case OMAP_DSS_VIDEO2:
570 return 0x0020;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530571 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530572 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530573 return 0x0098;
Archit Taneja9b372c22011-05-06 11:45:49 +0530574 default:
575 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300576 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530577 }
578}
579
580static inline u16 DISPC_WINDOW_SKIP_OFFSET(enum omap_plane plane)
581{
582 switch (plane) {
583 case OMAP_DSS_GFX:
584 return 0x0034;
585 case OMAP_DSS_VIDEO1:
586 case OMAP_DSS_VIDEO2:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530587 case OMAP_DSS_VIDEO3:
Archit Taneja9b372c22011-05-06 11:45:49 +0530588 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300589 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530590 default:
591 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300592 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530593 }
594}
595
596static inline u16 DISPC_TABLE_BA_OFFSET(enum omap_plane plane)
597{
598 switch (plane) {
599 case OMAP_DSS_GFX:
600 return 0x0038;
601 case OMAP_DSS_VIDEO1:
602 case OMAP_DSS_VIDEO2:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530603 case OMAP_DSS_VIDEO3:
Archit Taneja9b372c22011-05-06 11:45:49 +0530604 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300605 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530606 default:
607 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300608 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530609 }
610}
611
612static inline u16 DISPC_FIR_OFFSET(enum omap_plane plane)
613{
614 switch (plane) {
615 case OMAP_DSS_GFX:
616 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300617 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530618 case OMAP_DSS_VIDEO1:
619 case OMAP_DSS_VIDEO2:
620 return 0x0024;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530621 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530622 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530623 return 0x0090;
Archit Taneja9b372c22011-05-06 11:45:49 +0530624 default:
625 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300626 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530627 }
628}
629
Amber Jainab5ca072011-05-19 19:47:53 +0530630static inline u16 DISPC_FIR2_OFFSET(enum omap_plane plane)
631{
632 switch (plane) {
633 case OMAP_DSS_GFX:
634 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300635 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530636 case OMAP_DSS_VIDEO1:
637 return 0x0580;
638 case OMAP_DSS_VIDEO2:
639 return 0x055C;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530640 case OMAP_DSS_VIDEO3:
641 return 0x0424;
Archit Taneja7a155be2012-07-16 15:54:24 +0530642 case OMAP_DSS_WB:
643 return 0x290;
Amber Jainab5ca072011-05-19 19:47:53 +0530644 default:
645 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300646 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530647 }
648}
649
Archit Taneja9b372c22011-05-06 11:45:49 +0530650static inline u16 DISPC_PIC_SIZE_OFFSET(enum omap_plane plane)
651{
652 switch (plane) {
653 case OMAP_DSS_GFX:
654 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300655 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530656 case OMAP_DSS_VIDEO1:
657 case OMAP_DSS_VIDEO2:
658 return 0x0028;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530659 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530660 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530661 return 0x0094;
Archit Taneja9b372c22011-05-06 11:45:49 +0530662 default:
663 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300664 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530665 }
666}
667
668
669static inline u16 DISPC_ACCU0_OFFSET(enum omap_plane plane)
670{
671 switch (plane) {
672 case OMAP_DSS_GFX:
673 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300674 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530675 case OMAP_DSS_VIDEO1:
676 case OMAP_DSS_VIDEO2:
677 return 0x002C;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530678 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530679 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530680 return 0x0000;
Archit Taneja9b372c22011-05-06 11:45:49 +0530681 default:
682 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300683 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530684 }
685}
686
Amber Jainab5ca072011-05-19 19:47:53 +0530687static inline u16 DISPC_ACCU2_0_OFFSET(enum omap_plane plane)
688{
689 switch (plane) {
690 case OMAP_DSS_GFX:
691 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300692 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530693 case OMAP_DSS_VIDEO1:
694 return 0x0584;
695 case OMAP_DSS_VIDEO2:
696 return 0x0560;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530697 case OMAP_DSS_VIDEO3:
698 return 0x0428;
Archit Taneja7a155be2012-07-16 15:54:24 +0530699 case OMAP_DSS_WB:
700 return 0x0294;
Amber Jainab5ca072011-05-19 19:47:53 +0530701 default:
702 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300703 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530704 }
705}
706
Archit Taneja9b372c22011-05-06 11:45:49 +0530707static inline u16 DISPC_ACCU1_OFFSET(enum omap_plane plane)
708{
709 switch (plane) {
710 case OMAP_DSS_GFX:
711 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300712 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530713 case OMAP_DSS_VIDEO1:
714 case OMAP_DSS_VIDEO2:
715 return 0x0030;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530716 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530717 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530718 return 0x0004;
Archit Taneja9b372c22011-05-06 11:45:49 +0530719 default:
720 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300721 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530722 }
723}
724
Amber Jainab5ca072011-05-19 19:47:53 +0530725static inline u16 DISPC_ACCU2_1_OFFSET(enum omap_plane plane)
726{
727 switch (plane) {
728 case OMAP_DSS_GFX:
729 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300730 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530731 case OMAP_DSS_VIDEO1:
732 return 0x0588;
733 case OMAP_DSS_VIDEO2:
734 return 0x0564;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530735 case OMAP_DSS_VIDEO3:
736 return 0x042C;
Archit Taneja7a155be2012-07-16 15:54:24 +0530737 case OMAP_DSS_WB:
738 return 0x0298;
Amber Jainab5ca072011-05-19 19:47:53 +0530739 default:
740 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300741 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530742 }
743}
744
Archit Taneja9b372c22011-05-06 11:45:49 +0530745/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
746static inline u16 DISPC_FIR_COEF_H_OFFSET(enum omap_plane plane, u16 i)
747{
748 switch (plane) {
749 case OMAP_DSS_GFX:
750 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300751 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530752 case OMAP_DSS_VIDEO1:
753 case OMAP_DSS_VIDEO2:
754 return 0x0034 + i * 0x8;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530755 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530756 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530757 return 0x0010 + i * 0x8;
Archit Taneja9b372c22011-05-06 11:45:49 +0530758 default:
759 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300760 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530761 }
762}
763
764/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
Amber Jainab5ca072011-05-19 19:47:53 +0530765static inline u16 DISPC_FIR_COEF_H2_OFFSET(enum omap_plane plane, u16 i)
766{
767 switch (plane) {
768 case OMAP_DSS_GFX:
769 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300770 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530771 case OMAP_DSS_VIDEO1:
772 return 0x058C + i * 0x8;
773 case OMAP_DSS_VIDEO2:
774 return 0x0568 + i * 0x8;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530775 case OMAP_DSS_VIDEO3:
776 return 0x0430 + i * 0x8;
Archit Taneja7a155be2012-07-16 15:54:24 +0530777 case OMAP_DSS_WB:
778 return 0x02A0 + i * 0x8;
Amber Jainab5ca072011-05-19 19:47:53 +0530779 default:
780 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300781 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530782 }
783}
784
785/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
Archit Taneja9b372c22011-05-06 11:45:49 +0530786static inline u16 DISPC_FIR_COEF_HV_OFFSET(enum omap_plane plane, u16 i)
787{
788 switch (plane) {
789 case OMAP_DSS_GFX:
790 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300791 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530792 case OMAP_DSS_VIDEO1:
793 case OMAP_DSS_VIDEO2:
794 return 0x0038 + i * 0x8;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530795 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530796 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530797 return 0x0014 + i * 0x8;
Archit Taneja9b372c22011-05-06 11:45:49 +0530798 default:
799 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300800 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530801 }
802}
803
Amber Jainab5ca072011-05-19 19:47:53 +0530804/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
805static inline u16 DISPC_FIR_COEF_HV2_OFFSET(enum omap_plane plane, u16 i)
806{
807 switch (plane) {
808 case OMAP_DSS_GFX:
809 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300810 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530811 case OMAP_DSS_VIDEO1:
812 return 0x0590 + i * 8;
813 case OMAP_DSS_VIDEO2:
814 return 0x056C + i * 0x8;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530815 case OMAP_DSS_VIDEO3:
816 return 0x0434 + i * 0x8;
Archit Taneja7a155be2012-07-16 15:54:24 +0530817 case OMAP_DSS_WB:
818 return 0x02A4 + i * 0x8;
Amber Jainab5ca072011-05-19 19:47:53 +0530819 default:
820 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300821 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530822 }
823}
824
Archit Taneja9b372c22011-05-06 11:45:49 +0530825/* coef index i = {0, 1, 2, 3, 4,} */
826static inline u16 DISPC_CONV_COEF_OFFSET(enum omap_plane plane, u16 i)
827{
828 switch (plane) {
829 case OMAP_DSS_GFX:
830 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300831 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530832 case OMAP_DSS_VIDEO1:
833 case OMAP_DSS_VIDEO2:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530834 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530835 case OMAP_DSS_WB:
Archit Taneja9b372c22011-05-06 11:45:49 +0530836 return 0x0074 + i * 0x4;
837 default:
838 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300839 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530840 }
841}
842
843/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
844static inline u16 DISPC_FIR_COEF_V_OFFSET(enum omap_plane plane, u16 i)
845{
846 switch (plane) {
847 case OMAP_DSS_GFX:
848 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300849 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530850 case OMAP_DSS_VIDEO1:
851 return 0x0124 + i * 0x4;
852 case OMAP_DSS_VIDEO2:
853 return 0x00B4 + i * 0x4;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530854 case OMAP_DSS_VIDEO3:
Archit Taneja7a155be2012-07-16 15:54:24 +0530855 case OMAP_DSS_WB:
Archit Tanejab8c095b2011-09-13 18:20:33 +0530856 return 0x0050 + i * 0x4;
Archit Taneja9b372c22011-05-06 11:45:49 +0530857 default:
858 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300859 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530860 }
861}
862
Amber Jainab5ca072011-05-19 19:47:53 +0530863/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
864static inline u16 DISPC_FIR_COEF_V2_OFFSET(enum omap_plane plane, u16 i)
865{
866 switch (plane) {
867 case OMAP_DSS_GFX:
868 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300869 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530870 case OMAP_DSS_VIDEO1:
871 return 0x05CC + i * 0x4;
872 case OMAP_DSS_VIDEO2:
873 return 0x05A8 + i * 0x4;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530874 case OMAP_DSS_VIDEO3:
875 return 0x0470 + i * 0x4;
Archit Taneja7a155be2012-07-16 15:54:24 +0530876 case OMAP_DSS_WB:
877 return 0x02E0 + i * 0x4;
Amber Jainab5ca072011-05-19 19:47:53 +0530878 default:
879 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300880 return 0;
Amber Jainab5ca072011-05-19 19:47:53 +0530881 }
882}
883
Archit Taneja9b372c22011-05-06 11:45:49 +0530884static inline u16 DISPC_PRELOAD_OFFSET(enum omap_plane plane)
885{
886 switch (plane) {
887 case OMAP_DSS_GFX:
888 return 0x01AC;
889 case OMAP_DSS_VIDEO1:
890 return 0x0174;
891 case OMAP_DSS_VIDEO2:
892 return 0x00E8;
Archit Tanejab8c095b2011-09-13 18:20:33 +0530893 case OMAP_DSS_VIDEO3:
894 return 0x00A0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530895 default:
896 BUG();
Tomi Valkeinenc6eee962012-05-18 11:47:02 +0300897 return 0;
Archit Taneja9b372c22011-05-06 11:45:49 +0530898 }
899}
Tomi Valkeinen29fceee2013-11-14 11:38:25 +0200900
901static inline u16 DISPC_MFLAG_THRESHOLD_OFFSET(enum omap_plane plane)
902{
903 switch (plane) {
904 case OMAP_DSS_GFX:
905 return 0x0860;
906 case OMAP_DSS_VIDEO1:
907 return 0x0864;
908 case OMAP_DSS_VIDEO2:
909 return 0x0868;
910 case OMAP_DSS_VIDEO3:
911 return 0x086c;
912 default:
913 BUG();
914 return 0;
915 }
916}
Archit Taneja9b372c22011-05-06 11:45:49 +0530917#endif