dispc.h 14.6 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 40

/* DISPC overlay registers */
41
#define DISPC_OVL_BA0(n)		(DISPC_OVL_BASE(n) + \
42
					DISPC_BA0_OFFSET(n))
43
#define DISPC_OVL_BA1(n)		(DISPC_OVL_BASE(n) + \
44
					DISPC_BA1_OFFSET(n))
45 46 47 48
#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))
49
#define DISPC_OVL_POSITION(n)		(DISPC_OVL_BASE(n) + \
50
					DISPC_POS_OFFSET(n))
51
#define DISPC_OVL_SIZE(n)		(DISPC_OVL_BASE(n) + \
52
					DISPC_SIZE_OFFSET(n))
53
#define DISPC_OVL_ATTRIBUTES(n)		(DISPC_OVL_BASE(n) + \
54
					DISPC_ATTR_OFFSET(n))
55 56
#define DISPC_OVL_ATTRIBUTES2(n)	(DISPC_OVL_BASE(n) + \
					DISPC_ATTR2_OFFSET(n))
57
#define DISPC_OVL_FIFO_THRESHOLD(n)	(DISPC_OVL_BASE(n) + \
58
					DISPC_FIFO_THRESH_OFFSET(n))
59
#define DISPC_OVL_FIFO_SIZE_STATUS(n)	(DISPC_OVL_BASE(n) + \
60
					DISPC_FIFO_SIZE_STATUS_OFFSET(n))
61
#define DISPC_OVL_ROW_INC(n)		(DISPC_OVL_BASE(n) + \
62
					DISPC_ROW_INC_OFFSET(n))
63
#define DISPC_OVL_PIXEL_INC(n)		(DISPC_OVL_BASE(n) + \
64
					DISPC_PIX_INC_OFFSET(n))
65
#define DISPC_OVL_WINDOW_SKIP(n)	(DISPC_OVL_BASE(n) + \
66
					DISPC_WINDOW_SKIP_OFFSET(n))
67
#define DISPC_OVL_TABLE_BA(n)		(DISPC_OVL_BASE(n) + \
68
					DISPC_TABLE_BA_OFFSET(n))
69
#define DISPC_OVL_FIR(n)		(DISPC_OVL_BASE(n) + \
70
					DISPC_FIR_OFFSET(n))
71 72
#define DISPC_OVL_FIR2(n)		(DISPC_OVL_BASE(n) + \
					DISPC_FIR2_OFFSET(n))
73
#define DISPC_OVL_PICTURE_SIZE(n)	(DISPC_OVL_BASE(n) + \
74
					DISPC_PIC_SIZE_OFFSET(n))
75
#define DISPC_OVL_ACCU0(n)		(DISPC_OVL_BASE(n) + \
76
					DISPC_ACCU0_OFFSET(n))
77
#define DISPC_OVL_ACCU1(n)		(DISPC_OVL_BASE(n) + \
78
					DISPC_ACCU1_OFFSET(n))
79 80 81 82
#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))
83
#define DISPC_OVL_FIR_COEF_H(n, i)	(DISPC_OVL_BASE(n) + \
84
					DISPC_FIR_COEF_H_OFFSET(n, i))
85
#define DISPC_OVL_FIR_COEF_HV(n, i)	(DISPC_OVL_BASE(n) + \
86
					DISPC_FIR_COEF_HV_OFFSET(n, i))
87 88 89 90
#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))
91
#define DISPC_OVL_CONV_COEF(n, i)	(DISPC_OVL_BASE(n) + \
92
					DISPC_CONV_COEF_OFFSET(n, i))
93
#define DISPC_OVL_FIR_COEF_V(n, i)	(DISPC_OVL_BASE(n) + \
94
					DISPC_FIR_COEF_V_OFFSET(n, i))
95 96
#define DISPC_OVL_FIR_COEF_V2(n, i)	(DISPC_OVL_BASE(n) + \
					DISPC_FIR_COEF_V2_OFFSET(n, i))
97
#define DISPC_OVL_PRELOAD(n)		(DISPC_OVL_BASE(n) + \
98 99
					DISPC_PRELOAD_OFFSET(n))

100
/* DISPC manager/channel specific registers */
101
static inline u16 DISPC_DEFAULT_COLOR(enum omap_channel channel)
102 103 104
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
105
		return 0x004C;
106
	case OMAP_DSS_CHANNEL_DIGIT:
107
		return 0x0050;
108
	case OMAP_DSS_CHANNEL_LCD2:
109
		return 0x03AC;
110 111 112 113 114
	default:
		BUG();
	}
}

115
static inline u16 DISPC_TRANS_COLOR(enum omap_channel channel)
116 117 118
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
119
		return 0x0054;
120
	case OMAP_DSS_CHANNEL_DIGIT:
121
		return 0x0058;
122
	case OMAP_DSS_CHANNEL_LCD2:
123
		return 0x03B0;
124 125 126 127 128
	default:
		BUG();
	}
}

129
static inline u16 DISPC_TIMING_H(enum omap_channel channel)
130 131 132
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
133
		return 0x0064;
134 135 136
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
	case OMAP_DSS_CHANNEL_LCD2:
137
		return 0x0400;
138 139 140 141 142
	default:
		BUG();
	}
}

143
static inline u16 DISPC_TIMING_V(enum omap_channel channel)
144 145 146
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
147
		return 0x0068;
148 149 150
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
	case OMAP_DSS_CHANNEL_LCD2:
151
		return 0x0404;
152 153 154 155 156
	default:
		BUG();
	}
}

157
static inline u16 DISPC_POL_FREQ(enum omap_channel channel)
158 159 160
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
161
		return 0x006C;
162 163 164
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
	case OMAP_DSS_CHANNEL_LCD2:
165
		return 0x0408;
166 167 168 169 170
	default:
		BUG();
	}
}

171
static inline u16 DISPC_DIVISORo(enum omap_channel channel)
172 173 174
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
175
		return 0x0070;
176 177 178
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
	case OMAP_DSS_CHANNEL_LCD2:
179
		return 0x040C;
180 181 182 183 184 185
	default:
		BUG();
	}
}

/* Named as DISPC_SIZE_LCD, DISPC_SIZE_DIGIT and DISPC_SIZE_LCD2 in TRM */
186
static inline u16 DISPC_SIZE_MGR(enum omap_channel channel)
187 188 189
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
190
		return 0x007C;
191
	case OMAP_DSS_CHANNEL_DIGIT:
192
		return 0x0078;
193
	case OMAP_DSS_CHANNEL_LCD2:
194
		return 0x03CC;
195 196 197 198 199
	default:
		BUG();
	}
}

200
static inline u16 DISPC_DATA_CYCLE1(enum omap_channel channel)
201 202 203
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
204
		return 0x01D4;
205 206 207
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
	case OMAP_DSS_CHANNEL_LCD2:
208
		return 0x03C0;
209 210 211 212 213
	default:
		BUG();
	}
}

214
static inline u16 DISPC_DATA_CYCLE2(enum omap_channel channel)
215 216 217
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
218
		return 0x01D8;
219 220 221
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
	case OMAP_DSS_CHANNEL_LCD2:
222
		return 0x03C4;
223 224 225 226 227
	default:
		BUG();
	}
}

228
static inline u16 DISPC_DATA_CYCLE3(enum omap_channel channel)
229 230 231
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
232
		return 0x01DC;
233 234 235
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
	case OMAP_DSS_CHANNEL_LCD2:
236
		return 0x03C8;
237 238 239 240 241
	default:
		BUG();
	}
}

242
static inline u16 DISPC_CPR_COEF_R(enum omap_channel channel)
243 244 245
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
246
		return 0x0220;
247 248 249
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
	case OMAP_DSS_CHANNEL_LCD2:
250
		return 0x03BC;
251 252 253 254 255
	default:
		BUG();
	}
}

256
static inline u16 DISPC_CPR_COEF_G(enum omap_channel channel)
257 258 259
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
260
		return 0x0224;
261 262 263
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
	case OMAP_DSS_CHANNEL_LCD2:
264
		return 0x03B8;
265 266 267 268 269
	default:
		BUG();
	}
}

270
static inline u16 DISPC_CPR_COEF_B(enum omap_channel channel)
271 272 273
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
274
		return 0x0228;
275 276 277
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
	case OMAP_DSS_CHANNEL_LCD2:
278
		return 0x03B4;
279 280 281 282 283
	default:
		BUG();
	}
}

284 285 286 287 288 289 290 291 292 293
/* 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;
294 295
	case OMAP_DSS_VIDEO3:
		return 0x0300;
296 297 298 299 300 301 302 303 304 305 306 307 308
	default:
		BUG();
	}
}

/* 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;
309 310
	case OMAP_DSS_VIDEO3:
		return 0x0008;
311 312 313 314 315 316 317 318 319 320 321 322
	default:
		BUG();
	}
}

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;
323 324
	case OMAP_DSS_VIDEO3:
		return 0x000C;
325 326 327 328 329
	default:
		BUG();
	}
}

330 331 332 333 334 335 336 337 338
static inline u16 DISPC_BA0_UV_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
	case OMAP_DSS_VIDEO1:
		return 0x0544;
	case OMAP_DSS_VIDEO2:
		return 0x04BC;
339 340
	case OMAP_DSS_VIDEO3:
		return 0x0310;
341 342 343 344 345 346 347 348 349 350 351 352 353 354
	default:
		BUG();
	}
}

static inline u16 DISPC_BA1_UV_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
	case OMAP_DSS_VIDEO1:
		return 0x0548;
	case OMAP_DSS_VIDEO2:
		return 0x04C0;
355 356
	case OMAP_DSS_VIDEO3:
		return 0x0314;
357 358 359 360 361
	default:
		BUG();
	}
}

362 363 364 365 366 367 368
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;
369 370
	case OMAP_DSS_VIDEO3:
		return 0x009C;
371 372 373 374 375 376 377 378 379 380 381 382
	default:
		BUG();
	}
}

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;
383 384
	case OMAP_DSS_VIDEO3:
		return 0x00A8;
385 386 387 388 389 390 391 392 393 394 395 396 397
	default:
		BUG();
	}
}

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;
398 399
	case OMAP_DSS_VIDEO3:
		return 0x0070;
400 401 402 403 404
	default:
		BUG();
	}
}

405 406 407 408 409 410 411 412 413
static inline u16 DISPC_ATTR2_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
	case OMAP_DSS_VIDEO1:
		return 0x0568;
	case OMAP_DSS_VIDEO2:
		return 0x04DC;
414 415
	case OMAP_DSS_VIDEO3:
		return 0x032C;
416 417 418 419 420
	default:
		BUG();
	}
}

421 422 423 424 425 426 427 428
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;
429 430
	case OMAP_DSS_VIDEO3:
		return 0x008C;
431 432 433 434 435 436 437 438 439 440 441 442 443
	default:
		BUG();
	}
}

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;
444 445
	case OMAP_DSS_VIDEO3:
		return 0x0088;
446 447 448 449 450 451 452 453 454 455 456 457 458
	default:
		BUG();
	}
}

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;
459 460
	case OMAP_DSS_VIDEO3:
		return 0x00A4;
461 462 463 464 465 466 467 468 469 470 471 472 473
	default:
		BUG();
	}
}

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;
474 475
	case OMAP_DSS_VIDEO3:
		return 0x0098;
476 477 478 479 480 481 482 483 484 485 486 487
	default:
		BUG();
	}
}

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:
488
	case OMAP_DSS_VIDEO3:
489 490 491 492 493 494 495 496 497 498 499 500 501
		BUG();
	default:
		BUG();
	}
}

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:
502
	case OMAP_DSS_VIDEO3:
503 504 505 506 507 508 509 510 511 512 513 514 515 516
		BUG();
	default:
		BUG();
	}
}

static inline u16 DISPC_FIR_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0024;
517 518
	case OMAP_DSS_VIDEO3:
		return 0x0090;
519 520 521 522 523
	default:
		BUG();
	}
}

524 525 526 527 528 529 530 531 532
static inline u16 DISPC_FIR2_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
	case OMAP_DSS_VIDEO1:
		return 0x0580;
	case OMAP_DSS_VIDEO2:
		return 0x055C;
533 534
	case OMAP_DSS_VIDEO3:
		return 0x0424;
535 536 537 538 539
	default:
		BUG();
	}
}

540 541 542 543 544 545 546 547
static inline u16 DISPC_PIC_SIZE_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0028;
548 549
	case OMAP_DSS_VIDEO3:
		return 0x0094;
550 551 552 553 554 555 556 557 558 559 560 561 562 563
	default:
		BUG();
	}
}


static inline u16 DISPC_ACCU0_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x002C;
564 565
	case OMAP_DSS_VIDEO3:
		return 0x0000;
566 567 568 569 570
	default:
		BUG();
	}
}

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

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

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

618 619 620 621 622 623 624 625 626
/* 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();
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0034 + i * 0x8;
627 628
	case OMAP_DSS_VIDEO3:
		return 0x0010 + i * 0x8;
629 630 631 632 633
	default:
		BUG();
	}
}

634 635 636 637 638 639 640 641 642 643
/* 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();
	case OMAP_DSS_VIDEO1:
		return 0x058C + i * 0x8;
	case OMAP_DSS_VIDEO2:
		return 0x0568 + i * 0x8;
644 645
	case OMAP_DSS_VIDEO3:
		return 0x0430 + i * 0x8;
646 647 648 649 650
	default:
		BUG();
	}
}

651 652 653 654 655 656 657 658 659
/* 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();
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0038 + i * 0x8;
660 661
	case OMAP_DSS_VIDEO3:
		return 0x0014 + i * 0x8;
662 663 664 665 666
	default:
		BUG();
	}
}

667 668 669 670 671 672 673 674 675 676
/* 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();
	case OMAP_DSS_VIDEO1:
		return 0x0590 + i * 8;
	case OMAP_DSS_VIDEO2:
		return 0x056C + i * 0x8;
677 678
	case OMAP_DSS_VIDEO3:
		return 0x0434 + i * 0x8;
679 680 681 682 683
	default:
		BUG();
	}
}

684 685 686 687 688 689 690 691
/* 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();
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
692
	case OMAP_DSS_VIDEO3:
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708
		return 0x0074 + i * 0x4;
	default:
		BUG();
	}
}

/* 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();
	case OMAP_DSS_VIDEO1:
		return 0x0124 + i * 0x4;
	case OMAP_DSS_VIDEO2:
		return 0x00B4 + i * 0x4;
709 710
	case OMAP_DSS_VIDEO3:
		return 0x0050 + i * 0x4;
711 712 713 714 715
	default:
		BUG();
	}
}

716 717 718 719 720 721 722 723 724 725
/* 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();
	case OMAP_DSS_VIDEO1:
		return 0x05CC + i * 0x4;
	case OMAP_DSS_VIDEO2:
		return 0x05A8 + i * 0x4;
726 727
	case OMAP_DSS_VIDEO3:
		return 0x0470 + i * 0x4;
728 729 730 731 732
	default:
		BUG();
	}
}

733 734 735 736 737 738 739 740 741
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;
742 743
	case OMAP_DSS_VIDEO3:
		return 0x00A0;
744 745 746 747 748
	default:
		BUG();
	}
}
#endif