dispc.h 17.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
 * linux/drivers/video/omap2/dss/dispc.h
 *
 * Copyright (C) 2011 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/>.
 */

#ifndef __OMAP2_DISPC_REG_H
#define __OMAP2_DISPC_REG_H

24
/* DISPC common registers */
25 26 27 28 29 30 31 32 33 34 35 36 37 38
#define DISPC_REVISION			0x0000
#define DISPC_SYSCONFIG			0x0010
#define DISPC_SYSSTATUS			0x0014
#define DISPC_IRQSTATUS			0x0018
#define DISPC_IRQENABLE			0x001C
#define DISPC_CONTROL			0x0040
#define DISPC_CONFIG			0x0044
#define DISPC_CAPABLE			0x0048
#define DISPC_LINE_STATUS		0x005C
#define DISPC_LINE_NUMBER		0x0060
#define DISPC_GLOBAL_ALPHA		0x0074
#define DISPC_CONTROL2			0x0238
#define DISPC_CONFIG2			0x0620
#define DISPC_DIVISOR			0x0804
39
#define DISPC_GLOBAL_BUFFER		0x0800
40 41
#define DISPC_CONTROL3                  0x0848
#define DISPC_CONFIG3                   0x084C
42
#define DISPC_MSTANDBY_CTRL		0x0858
T
Tomi Valkeinen 已提交
43
#define DISPC_GLOBAL_MFLAG_ATTRIBUTE	0x085C
44 45

/* DISPC overlay registers */
46
#define DISPC_OVL_BA0(n)		(DISPC_OVL_BASE(n) + \
47
					DISPC_BA0_OFFSET(n))
48
#define DISPC_OVL_BA1(n)		(DISPC_OVL_BASE(n) + \
49
					DISPC_BA1_OFFSET(n))
50 51 52 53
#define DISPC_OVL_BA0_UV(n)		(DISPC_OVL_BASE(n) + \
					DISPC_BA0_UV_OFFSET(n))
#define DISPC_OVL_BA1_UV(n)		(DISPC_OVL_BASE(n) + \
					DISPC_BA1_UV_OFFSET(n))
54
#define DISPC_OVL_POSITION(n)		(DISPC_OVL_BASE(n) + \
55
					DISPC_POS_OFFSET(n))
56
#define DISPC_OVL_SIZE(n)		(DISPC_OVL_BASE(n) + \
57
					DISPC_SIZE_OFFSET(n))
58
#define DISPC_OVL_ATTRIBUTES(n)		(DISPC_OVL_BASE(n) + \
59
					DISPC_ATTR_OFFSET(n))
60 61
#define DISPC_OVL_ATTRIBUTES2(n)	(DISPC_OVL_BASE(n) + \
					DISPC_ATTR2_OFFSET(n))
62
#define DISPC_OVL_FIFO_THRESHOLD(n)	(DISPC_OVL_BASE(n) + \
63
					DISPC_FIFO_THRESH_OFFSET(n))
64
#define DISPC_OVL_FIFO_SIZE_STATUS(n)	(DISPC_OVL_BASE(n) + \
65
					DISPC_FIFO_SIZE_STATUS_OFFSET(n))
66
#define DISPC_OVL_ROW_INC(n)		(DISPC_OVL_BASE(n) + \
67
					DISPC_ROW_INC_OFFSET(n))
68
#define DISPC_OVL_PIXEL_INC(n)		(DISPC_OVL_BASE(n) + \
69
					DISPC_PIX_INC_OFFSET(n))
70
#define DISPC_OVL_WINDOW_SKIP(n)	(DISPC_OVL_BASE(n) + \
71
					DISPC_WINDOW_SKIP_OFFSET(n))
72
#define DISPC_OVL_TABLE_BA(n)		(DISPC_OVL_BASE(n) + \
73
					DISPC_TABLE_BA_OFFSET(n))
74
#define DISPC_OVL_FIR(n)		(DISPC_OVL_BASE(n) + \
75
					DISPC_FIR_OFFSET(n))
76 77
#define DISPC_OVL_FIR2(n)		(DISPC_OVL_BASE(n) + \
					DISPC_FIR2_OFFSET(n))
78
#define DISPC_OVL_PICTURE_SIZE(n)	(DISPC_OVL_BASE(n) + \
79
					DISPC_PIC_SIZE_OFFSET(n))
80
#define DISPC_OVL_ACCU0(n)		(DISPC_OVL_BASE(n) + \
81
					DISPC_ACCU0_OFFSET(n))
82
#define DISPC_OVL_ACCU1(n)		(DISPC_OVL_BASE(n) + \
83
					DISPC_ACCU1_OFFSET(n))
84 85 86 87
#define DISPC_OVL_ACCU2_0(n)		(DISPC_OVL_BASE(n) + \
					DISPC_ACCU2_0_OFFSET(n))
#define DISPC_OVL_ACCU2_1(n)		(DISPC_OVL_BASE(n) + \
					DISPC_ACCU2_1_OFFSET(n))
88
#define DISPC_OVL_FIR_COEF_H(n, i)	(DISPC_OVL_BASE(n) + \
89
					DISPC_FIR_COEF_H_OFFSET(n, i))
90
#define DISPC_OVL_FIR_COEF_HV(n, i)	(DISPC_OVL_BASE(n) + \
91
					DISPC_FIR_COEF_HV_OFFSET(n, i))
92 93 94 95
#define DISPC_OVL_FIR_COEF_H2(n, i)	(DISPC_OVL_BASE(n) + \
					DISPC_FIR_COEF_H2_OFFSET(n, i))
#define DISPC_OVL_FIR_COEF_HV2(n, i)	(DISPC_OVL_BASE(n) + \
					DISPC_FIR_COEF_HV2_OFFSET(n, i))
96
#define DISPC_OVL_CONV_COEF(n, i)	(DISPC_OVL_BASE(n) + \
97
					DISPC_CONV_COEF_OFFSET(n, i))
98
#define DISPC_OVL_FIR_COEF_V(n, i)	(DISPC_OVL_BASE(n) + \
99
					DISPC_FIR_COEF_V_OFFSET(n, i))
100 101
#define DISPC_OVL_FIR_COEF_V2(n, i)	(DISPC_OVL_BASE(n) + \
					DISPC_FIR_COEF_V2_OFFSET(n, i))
102
#define DISPC_OVL_PRELOAD(n)		(DISPC_OVL_BASE(n) + \
103
					DISPC_PRELOAD_OFFSET(n))
T
Tomi Valkeinen 已提交
104 105
#define DISPC_OVL_MFLAG_THRESHOLD(n)	(DISPC_OVL_BASE(n) + \
					DISPC_MFLAG_THRESHOLD_OFFSET(n))
106

107 108 109 110 111 112 113 114 115 116 117
/* DISPC up/downsampling FIR filter coefficient structure */
struct dispc_coef {
	s8 hc4_vc22;
	s8 hc3_vc2;
	u8 hc2_vc1;
	s8 hc1_vc0;
	s8 hc0_vc00;
};

const struct dispc_coef *dispc_ovl_get_scale_coef(int inc, int five_taps);

118
/* DISPC manager/channel specific registers */
119
static inline u16 DISPC_DEFAULT_COLOR(enum omap_channel channel)
120 121 122
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
123
		return 0x004C;
124
	case OMAP_DSS_CHANNEL_DIGIT:
125
		return 0x0050;
126
	case OMAP_DSS_CHANNEL_LCD2:
127
		return 0x03AC;
128 129
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0814;
130 131
	default:
		BUG();
132
		return 0;
133 134 135
	}
}

136
static inline u16 DISPC_TRANS_COLOR(enum omap_channel channel)
137 138 139
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
140
		return 0x0054;
141
	case OMAP_DSS_CHANNEL_DIGIT:
142
		return 0x0058;
143
	case OMAP_DSS_CHANNEL_LCD2:
144
		return 0x03B0;
145 146
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0818;
147 148
	default:
		BUG();
149
		return 0;
150 151 152
	}
}

153
static inline u16 DISPC_TIMING_H(enum omap_channel channel)
154 155 156
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
157
		return 0x0064;
158 159
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
160
		return 0;
161
	case OMAP_DSS_CHANNEL_LCD2:
162
		return 0x0400;
163 164
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0840;
165 166
	default:
		BUG();
167
		return 0;
168 169 170
	}
}

171
static inline u16 DISPC_TIMING_V(enum omap_channel channel)
172 173 174
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
175
		return 0x0068;
176 177
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
178
		return 0;
179
	case OMAP_DSS_CHANNEL_LCD2:
180
		return 0x0404;
181 182
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0844;
183 184
	default:
		BUG();
185
		return 0;
186 187 188
	}
}

189
static inline u16 DISPC_POL_FREQ(enum omap_channel channel)
190 191 192
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
193
		return 0x006C;
194 195
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
196
		return 0;
197
	case OMAP_DSS_CHANNEL_LCD2:
198
		return 0x0408;
199 200
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x083C;
201 202
	default:
		BUG();
203
		return 0;
204 205 206
	}
}

207
static inline u16 DISPC_DIVISORo(enum omap_channel channel)
208 209 210
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
211
		return 0x0070;
212 213
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
214
		return 0;
215
	case OMAP_DSS_CHANNEL_LCD2:
216
		return 0x040C;
217 218
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0838;
219 220
	default:
		BUG();
221
		return 0;
222 223 224 225
	}
}

/* Named as DISPC_SIZE_LCD, DISPC_SIZE_DIGIT and DISPC_SIZE_LCD2 in TRM */
226
static inline u16 DISPC_SIZE_MGR(enum omap_channel channel)
227 228 229
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
230
		return 0x007C;
231
	case OMAP_DSS_CHANNEL_DIGIT:
232
		return 0x0078;
233
	case OMAP_DSS_CHANNEL_LCD2:
234
		return 0x03CC;
235 236
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0834;
237 238
	default:
		BUG();
239
		return 0;
240 241 242
	}
}

243
static inline u16 DISPC_DATA_CYCLE1(enum omap_channel channel)
244 245 246
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
247
		return 0x01D4;
248 249
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
250
		return 0;
251
	case OMAP_DSS_CHANNEL_LCD2:
252
		return 0x03C0;
253 254
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0828;
255 256
	default:
		BUG();
257
		return 0;
258 259 260
	}
}

261
static inline u16 DISPC_DATA_CYCLE2(enum omap_channel channel)
262 263 264
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
265
		return 0x01D8;
266 267
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
268
		return 0;
269
	case OMAP_DSS_CHANNEL_LCD2:
270
		return 0x03C4;
271 272
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x082C;
273 274
	default:
		BUG();
275
		return 0;
276 277 278
	}
}

279
static inline u16 DISPC_DATA_CYCLE3(enum omap_channel channel)
280 281 282
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
283
		return 0x01DC;
284 285
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
286
		return 0;
287
	case OMAP_DSS_CHANNEL_LCD2:
288
		return 0x03C8;
289 290
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0830;
291 292
	default:
		BUG();
293
		return 0;
294 295 296
	}
}

297
static inline u16 DISPC_CPR_COEF_R(enum omap_channel channel)
298 299 300
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
301
		return 0x0220;
302 303
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
304
		return 0;
305
	case OMAP_DSS_CHANNEL_LCD2:
306
		return 0x03BC;
307 308
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0824;
309 310
	default:
		BUG();
311
		return 0;
312 313 314
	}
}

315
static inline u16 DISPC_CPR_COEF_G(enum omap_channel channel)
316 317 318
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
319
		return 0x0224;
320 321
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
322
		return 0;
323
	case OMAP_DSS_CHANNEL_LCD2:
324
		return 0x03B8;
325 326
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0820;
327 328
	default:
		BUG();
329
		return 0;
330 331 332
	}
}

333
static inline u16 DISPC_CPR_COEF_B(enum omap_channel channel)
334 335 336
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
337
		return 0x0228;
338 339
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
340
		return 0;
341
	case OMAP_DSS_CHANNEL_LCD2:
342
		return 0x03B4;
343 344
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x081C;
345 346
	default:
		BUG();
347
		return 0;
348 349 350
	}
}

351 352 353 354 355 356 357 358 359 360
/* DISPC overlay register base addresses */
static inline u16 DISPC_OVL_BASE(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		return 0x0080;
	case OMAP_DSS_VIDEO1:
		return 0x00BC;
	case OMAP_DSS_VIDEO2:
		return 0x014C;
361 362
	case OMAP_DSS_VIDEO3:
		return 0x0300;
363 364
	case OMAP_DSS_WB:
		return 0x0500;
365 366
	default:
		BUG();
367
		return 0;
368 369 370 371 372 373 374 375 376 377 378
	}
}

/* DISPC overlay register offsets */
static inline u16 DISPC_BA0_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0000;
379
	case OMAP_DSS_VIDEO3:
380
	case OMAP_DSS_WB:
381
		return 0x0008;
382 383
	default:
		BUG();
384
		return 0;
385 386 387 388 389 390 391 392 393 394
	}
}

static inline u16 DISPC_BA1_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0004;
395
	case OMAP_DSS_VIDEO3:
396
	case OMAP_DSS_WB:
397
		return 0x000C;
398 399
	default:
		BUG();
400
		return 0;
401 402 403
	}
}

404 405 406 407 408
static inline u16 DISPC_BA0_UV_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
409
		return 0;
410 411 412 413
	case OMAP_DSS_VIDEO1:
		return 0x0544;
	case OMAP_DSS_VIDEO2:
		return 0x04BC;
414 415
	case OMAP_DSS_VIDEO3:
		return 0x0310;
416 417
	case OMAP_DSS_WB:
		return 0x0118;
418 419
	default:
		BUG();
420
		return 0;
421 422 423 424 425 426 427 428
	}
}

static inline u16 DISPC_BA1_UV_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
429
		return 0;
430 431 432 433
	case OMAP_DSS_VIDEO1:
		return 0x0548;
	case OMAP_DSS_VIDEO2:
		return 0x04C0;
434 435
	case OMAP_DSS_VIDEO3:
		return 0x0314;
436 437
	case OMAP_DSS_WB:
		return 0x011C;
438 439
	default:
		BUG();
440
		return 0;
441 442 443
	}
}

444 445 446 447 448 449 450
static inline u16 DISPC_POS_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0008;
451 452
	case OMAP_DSS_VIDEO3:
		return 0x009C;
453 454
	default:
		BUG();
455
		return 0;
456 457 458 459 460 461 462 463 464 465
	}
}

static inline u16 DISPC_SIZE_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x000C;
466
	case OMAP_DSS_VIDEO3:
467
	case OMAP_DSS_WB:
468
		return 0x00A8;
469 470
	default:
		BUG();
471
		return 0;
472 473 474 475 476 477 478 479 480 481 482
	}
}

static inline u16 DISPC_ATTR_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		return 0x0020;
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0010;
483
	case OMAP_DSS_VIDEO3:
484
	case OMAP_DSS_WB:
485
		return 0x0070;
486 487
	default:
		BUG();
488
		return 0;
489 490 491
	}
}

492 493 494 495 496
static inline u16 DISPC_ATTR2_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
497
		return 0;
498 499 500 501
	case OMAP_DSS_VIDEO1:
		return 0x0568;
	case OMAP_DSS_VIDEO2:
		return 0x04DC;
502 503
	case OMAP_DSS_VIDEO3:
		return 0x032C;
504 505
	case OMAP_DSS_WB:
		return 0x0310;
506 507
	default:
		BUG();
508
		return 0;
509 510 511
	}
}

512 513 514 515 516 517 518 519
static inline u16 DISPC_FIFO_THRESH_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		return 0x0024;
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0014;
520
	case OMAP_DSS_VIDEO3:
521
	case OMAP_DSS_WB:
522
		return 0x008C;
523 524
	default:
		BUG();
525
		return 0;
526 527 528 529 530 531 532 533 534 535 536
	}
}

static inline u16 DISPC_FIFO_SIZE_STATUS_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		return 0x0028;
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0018;
537
	case OMAP_DSS_VIDEO3:
538
	case OMAP_DSS_WB:
539
		return 0x0088;
540 541
	default:
		BUG();
542
		return 0;
543 544 545 546 547 548 549 550 551 552 553
	}
}

static inline u16 DISPC_ROW_INC_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		return 0x002C;
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x001C;
554
	case OMAP_DSS_VIDEO3:
555
	case OMAP_DSS_WB:
556
		return 0x00A4;
557 558
	default:
		BUG();
559
		return 0;
560 561 562 563 564 565 566 567 568 569 570
	}
}

static inline u16 DISPC_PIX_INC_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		return 0x0030;
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0020;
571
	case OMAP_DSS_VIDEO3:
572
	case OMAP_DSS_WB:
573
		return 0x0098;
574 575
	default:
		BUG();
576
		return 0;
577 578 579 580 581 582 583 584 585 586
	}
}

static inline u16 DISPC_WINDOW_SKIP_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		return 0x0034;
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
587
	case OMAP_DSS_VIDEO3:
588
		BUG();
589
		return 0;
590 591
	default:
		BUG();
592
		return 0;
593 594 595 596 597 598 599 600 601 602
	}
}

static inline u16 DISPC_TABLE_BA_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		return 0x0038;
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
603
	case OMAP_DSS_VIDEO3:
604
		BUG();
605
		return 0;
606 607
	default:
		BUG();
608
		return 0;
609 610 611 612 613 614 615 616
	}
}

static inline u16 DISPC_FIR_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
617
		return 0;
618 619 620
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0024;
621
	case OMAP_DSS_VIDEO3:
622
	case OMAP_DSS_WB:
623
		return 0x0090;
624 625
	default:
		BUG();
626
		return 0;
627 628 629
	}
}

630 631 632 633 634
static inline u16 DISPC_FIR2_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
635
		return 0;
636 637 638 639
	case OMAP_DSS_VIDEO1:
		return 0x0580;
	case OMAP_DSS_VIDEO2:
		return 0x055C;
640 641
	case OMAP_DSS_VIDEO3:
		return 0x0424;
642 643
	case OMAP_DSS_WB:
		return 0x290;
644 645
	default:
		BUG();
646
		return 0;
647 648 649
	}
}

650 651 652 653 654
static inline u16 DISPC_PIC_SIZE_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
655
		return 0;
656 657 658
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0028;
659
	case OMAP_DSS_VIDEO3:
660
	case OMAP_DSS_WB:
661
		return 0x0094;
662 663
	default:
		BUG();
664
		return 0;
665 666 667 668 669 670 671 672 673
	}
}


static inline u16 DISPC_ACCU0_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
674
		return 0;
675 676 677
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x002C;
678
	case OMAP_DSS_VIDEO3:
679
	case OMAP_DSS_WB:
680
		return 0x0000;
681 682
	default:
		BUG();
683
		return 0;
684 685 686
	}
}

687 688 689 690 691
static inline u16 DISPC_ACCU2_0_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
692
		return 0;
693 694 695 696
	case OMAP_DSS_VIDEO1:
		return 0x0584;
	case OMAP_DSS_VIDEO2:
		return 0x0560;
697 698
	case OMAP_DSS_VIDEO3:
		return 0x0428;
699 700
	case OMAP_DSS_WB:
		return 0x0294;
701 702
	default:
		BUG();
703
		return 0;
704 705 706
	}
}

707 708 709 710 711
static inline u16 DISPC_ACCU1_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
712
		return 0;
713 714 715
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0030;
716
	case OMAP_DSS_VIDEO3:
717
	case OMAP_DSS_WB:
718
		return 0x0004;
719 720
	default:
		BUG();
721
		return 0;
722 723 724
	}
}

725 726 727 728 729
static inline u16 DISPC_ACCU2_1_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
730
		return 0;
731 732 733 734
	case OMAP_DSS_VIDEO1:
		return 0x0588;
	case OMAP_DSS_VIDEO2:
		return 0x0564;
735 736
	case OMAP_DSS_VIDEO3:
		return 0x042C;
737 738
	case OMAP_DSS_WB:
		return 0x0298;
739 740
	default:
		BUG();
741
		return 0;
742 743 744
	}
}

745 746 747 748 749 750
/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
static inline u16 DISPC_FIR_COEF_H_OFFSET(enum omap_plane plane, u16 i)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
751
		return 0;
752 753 754
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0034 + i * 0x8;
755
	case OMAP_DSS_VIDEO3:
756
	case OMAP_DSS_WB:
757
		return 0x0010 + i * 0x8;
758 759
	default:
		BUG();
760
		return 0;
761 762 763
	}
}

764 765 766 767 768 769
/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
static inline u16 DISPC_FIR_COEF_H2_OFFSET(enum omap_plane plane, u16 i)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
770
		return 0;
771 772 773 774
	case OMAP_DSS_VIDEO1:
		return 0x058C + i * 0x8;
	case OMAP_DSS_VIDEO2:
		return 0x0568 + i * 0x8;
775 776
	case OMAP_DSS_VIDEO3:
		return 0x0430 + i * 0x8;
777 778
	case OMAP_DSS_WB:
		return 0x02A0 + i * 0x8;
779 780
	default:
		BUG();
781
		return 0;
782 783 784
	}
}

785 786 787 788 789 790
/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
static inline u16 DISPC_FIR_COEF_HV_OFFSET(enum omap_plane plane, u16 i)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
791
		return 0;
792 793 794
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0038 + i * 0x8;
795
	case OMAP_DSS_VIDEO3:
796
	case OMAP_DSS_WB:
797
		return 0x0014 + i * 0x8;
798 799
	default:
		BUG();
800
		return 0;
801 802 803
	}
}

804 805 806 807 808 809
/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
static inline u16 DISPC_FIR_COEF_HV2_OFFSET(enum omap_plane plane, u16 i)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
810
		return 0;
811 812 813 814
	case OMAP_DSS_VIDEO1:
		return 0x0590 + i * 8;
	case OMAP_DSS_VIDEO2:
		return 0x056C + i * 0x8;
815 816
	case OMAP_DSS_VIDEO3:
		return 0x0434 + i * 0x8;
817 818
	case OMAP_DSS_WB:
		return 0x02A4 + i * 0x8;
819 820
	default:
		BUG();
821
		return 0;
822 823 824
	}
}

825 826 827 828 829 830
/* coef index i = {0, 1, 2, 3, 4,} */
static inline u16 DISPC_CONV_COEF_OFFSET(enum omap_plane plane, u16 i)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
831
		return 0;
832 833
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
834
	case OMAP_DSS_VIDEO3:
835
	case OMAP_DSS_WB:
836 837 838
		return 0x0074 + i * 0x4;
	default:
		BUG();
839
		return 0;
840 841 842 843 844 845 846 847 848
	}
}

/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
static inline u16 DISPC_FIR_COEF_V_OFFSET(enum omap_plane plane, u16 i)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
849
		return 0;
850 851 852 853
	case OMAP_DSS_VIDEO1:
		return 0x0124 + i * 0x4;
	case OMAP_DSS_VIDEO2:
		return 0x00B4 + i * 0x4;
854
	case OMAP_DSS_VIDEO3:
855
	case OMAP_DSS_WB:
856
		return 0x0050 + i * 0x4;
857 858
	default:
		BUG();
859
		return 0;
860 861 862
	}
}

863 864 865 866 867 868
/* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */
static inline u16 DISPC_FIR_COEF_V2_OFFSET(enum omap_plane plane, u16 i)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
869
		return 0;
870 871 872 873
	case OMAP_DSS_VIDEO1:
		return 0x05CC + i * 0x4;
	case OMAP_DSS_VIDEO2:
		return 0x05A8 + i * 0x4;
874 875
	case OMAP_DSS_VIDEO3:
		return 0x0470 + i * 0x4;
876 877
	case OMAP_DSS_WB:
		return 0x02E0 + i * 0x4;
878 879
	default:
		BUG();
880
		return 0;
881 882 883
	}
}

884 885 886 887 888 889 890 891 892
static inline u16 DISPC_PRELOAD_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		return 0x01AC;
	case OMAP_DSS_VIDEO1:
		return 0x0174;
	case OMAP_DSS_VIDEO2:
		return 0x00E8;
893 894
	case OMAP_DSS_VIDEO3:
		return 0x00A0;
895 896
	default:
		BUG();
897
		return 0;
898 899
	}
}
T
Tomi Valkeinen 已提交
900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916

static inline u16 DISPC_MFLAG_THRESHOLD_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		return 0x0860;
	case OMAP_DSS_VIDEO1:
		return 0x0864;
	case OMAP_DSS_VIDEO2:
		return 0x0868;
	case OMAP_DSS_VIDEO3:
		return 0x086c;
	default:
		BUG();
		return 0;
	}
}
917
#endif