dispc.h 16.3 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 101 102 103 104 105 106 107 108 109 110
/* 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);

111
/* DISPC manager/channel specific registers */
112
static inline u16 DISPC_DEFAULT_COLOR(enum omap_channel channel)
113 114 115
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
116
		return 0x004C;
117
	case OMAP_DSS_CHANNEL_DIGIT:
118
		return 0x0050;
119
	case OMAP_DSS_CHANNEL_LCD2:
120
		return 0x03AC;
121 122
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0814;
123 124
	default:
		BUG();
125
		return 0;
126 127 128
	}
}

129
static inline u16 DISPC_TRANS_COLOR(enum omap_channel channel)
130 131 132
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
133
		return 0x0054;
134
	case OMAP_DSS_CHANNEL_DIGIT:
135
		return 0x0058;
136
	case OMAP_DSS_CHANNEL_LCD2:
137
		return 0x03B0;
138 139
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0818;
140 141
	default:
		BUG();
142
		return 0;
143 144 145
	}
}

146
static inline u16 DISPC_TIMING_H(enum omap_channel channel)
147 148 149
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
150
		return 0x0064;
151 152
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
153
		return 0;
154
	case OMAP_DSS_CHANNEL_LCD2:
155
		return 0x0400;
156 157
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0840;
158 159
	default:
		BUG();
160
		return 0;
161 162 163
	}
}

164
static inline u16 DISPC_TIMING_V(enum omap_channel channel)
165 166 167
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
168
		return 0x0068;
169 170
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
171
		return 0;
172
	case OMAP_DSS_CHANNEL_LCD2:
173
		return 0x0404;
174 175
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0844;
176 177
	default:
		BUG();
178
		return 0;
179 180 181
	}
}

182
static inline u16 DISPC_POL_FREQ(enum omap_channel channel)
183 184 185
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
186
		return 0x006C;
187 188
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
189
		return 0;
190
	case OMAP_DSS_CHANNEL_LCD2:
191
		return 0x0408;
192 193
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x083C;
194 195
	default:
		BUG();
196
		return 0;
197 198 199
	}
}

200
static inline u16 DISPC_DIVISORo(enum omap_channel channel)
201 202 203
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
204
		return 0x0070;
205 206
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
207
		return 0;
208
	case OMAP_DSS_CHANNEL_LCD2:
209
		return 0x040C;
210 211
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0838;
212 213
	default:
		BUG();
214
		return 0;
215 216 217 218
	}
}

/* Named as DISPC_SIZE_LCD, DISPC_SIZE_DIGIT and DISPC_SIZE_LCD2 in TRM */
219
static inline u16 DISPC_SIZE_MGR(enum omap_channel channel)
220 221 222
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
223
		return 0x007C;
224
	case OMAP_DSS_CHANNEL_DIGIT:
225
		return 0x0078;
226
	case OMAP_DSS_CHANNEL_LCD2:
227
		return 0x03CC;
228 229
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0834;
230 231
	default:
		BUG();
232
		return 0;
233 234 235
	}
}

236
static inline u16 DISPC_DATA_CYCLE1(enum omap_channel channel)
237 238 239
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
240
		return 0x01D4;
241 242
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
243
		return 0;
244
	case OMAP_DSS_CHANNEL_LCD2:
245
		return 0x03C0;
246 247
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0828;
248 249
	default:
		BUG();
250
		return 0;
251 252 253
	}
}

254
static inline u16 DISPC_DATA_CYCLE2(enum omap_channel channel)
255 256 257
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
258
		return 0x01D8;
259 260
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
261
		return 0;
262
	case OMAP_DSS_CHANNEL_LCD2:
263
		return 0x03C4;
264 265
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x082C;
266 267
	default:
		BUG();
268
		return 0;
269 270 271
	}
}

272
static inline u16 DISPC_DATA_CYCLE3(enum omap_channel channel)
273 274 275
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
276
		return 0x01DC;
277 278
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
279
		return 0;
280
	case OMAP_DSS_CHANNEL_LCD2:
281
		return 0x03C8;
282 283
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0830;
284 285
	default:
		BUG();
286
		return 0;
287 288 289
	}
}

290
static inline u16 DISPC_CPR_COEF_R(enum omap_channel channel)
291 292 293
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
294
		return 0x0220;
295 296
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
297
		return 0;
298
	case OMAP_DSS_CHANNEL_LCD2:
299
		return 0x03BC;
300 301
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0824;
302 303
	default:
		BUG();
304
		return 0;
305 306 307
	}
}

308
static inline u16 DISPC_CPR_COEF_G(enum omap_channel channel)
309 310 311
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
312
		return 0x0224;
313 314
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
315
		return 0;
316
	case OMAP_DSS_CHANNEL_LCD2:
317
		return 0x03B8;
318 319
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x0820;
320 321
	default:
		BUG();
322
		return 0;
323 324 325
	}
}

326
static inline u16 DISPC_CPR_COEF_B(enum omap_channel channel)
327 328 329
{
	switch (channel) {
	case OMAP_DSS_CHANNEL_LCD:
330
		return 0x0228;
331 332
	case OMAP_DSS_CHANNEL_DIGIT:
		BUG();
333
		return 0;
334
	case OMAP_DSS_CHANNEL_LCD2:
335
		return 0x03B4;
336 337
	case OMAP_DSS_CHANNEL_LCD3:
		return 0x081C;
338 339
	default:
		BUG();
340
		return 0;
341 342 343
	}
}

344 345 346 347 348 349 350 351 352 353
/* 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;
354 355
	case OMAP_DSS_VIDEO3:
		return 0x0300;
356 357
	default:
		BUG();
358
		return 0;
359 360 361 362 363 364 365 366 367 368 369
	}
}

/* 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;
370 371
	case OMAP_DSS_VIDEO3:
		return 0x0008;
372 373
	default:
		BUG();
374
		return 0;
375 376 377 378 379 380 381 382 383 384
	}
}

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;
385 386
	case OMAP_DSS_VIDEO3:
		return 0x000C;
387 388
	default:
		BUG();
389
		return 0;
390 391 392
	}
}

393 394 395 396 397
static inline u16 DISPC_BA0_UV_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
398
		return 0;
399 400 401 402
	case OMAP_DSS_VIDEO1:
		return 0x0544;
	case OMAP_DSS_VIDEO2:
		return 0x04BC;
403 404
	case OMAP_DSS_VIDEO3:
		return 0x0310;
405 406
	default:
		BUG();
407
		return 0;
408 409 410 411 412 413 414 415
	}
}

static inline u16 DISPC_BA1_UV_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
416
		return 0;
417 418 419 420
	case OMAP_DSS_VIDEO1:
		return 0x0548;
	case OMAP_DSS_VIDEO2:
		return 0x04C0;
421 422
	case OMAP_DSS_VIDEO3:
		return 0x0314;
423 424
	default:
		BUG();
425
		return 0;
426 427 428
	}
}

429 430 431 432 433 434 435
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;
436 437
	case OMAP_DSS_VIDEO3:
		return 0x009C;
438 439
	default:
		BUG();
440
		return 0;
441 442 443 444 445 446 447 448 449 450
	}
}

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;
451 452
	case OMAP_DSS_VIDEO3:
		return 0x00A8;
453 454
	default:
		BUG();
455
		return 0;
456 457 458 459 460 461 462 463 464 465 466
	}
}

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;
467 468
	case OMAP_DSS_VIDEO3:
		return 0x0070;
469 470
	default:
		BUG();
471
		return 0;
472 473 474
	}
}

475 476 477 478 479
static inline u16 DISPC_ATTR2_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
480
		return 0;
481 482 483 484
	case OMAP_DSS_VIDEO1:
		return 0x0568;
	case OMAP_DSS_VIDEO2:
		return 0x04DC;
485 486
	case OMAP_DSS_VIDEO3:
		return 0x032C;
487 488
	default:
		BUG();
489
		return 0;
490 491 492
	}
}

493 494 495 496 497 498 499 500
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;
501 502
	case OMAP_DSS_VIDEO3:
		return 0x008C;
503 504
	default:
		BUG();
505
		return 0;
506 507 508 509 510 511 512 513 514 515 516
	}
}

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;
517 518
	case OMAP_DSS_VIDEO3:
		return 0x0088;
519 520
	default:
		BUG();
521
		return 0;
522 523 524 525 526 527 528 529 530 531 532
	}
}

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;
533 534
	case OMAP_DSS_VIDEO3:
		return 0x00A4;
535 536
	default:
		BUG();
537
		return 0;
538 539 540 541 542 543 544 545 546 547 548
	}
}

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;
549 550
	case OMAP_DSS_VIDEO3:
		return 0x0098;
551 552
	default:
		BUG();
553
		return 0;
554 555 556 557 558 559 560 561 562 563
	}
}

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:
564
	case OMAP_DSS_VIDEO3:
565
		BUG();
566
		return 0;
567 568
	default:
		BUG();
569
		return 0;
570 571 572 573 574 575 576 577 578 579
	}
}

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:
580
	case OMAP_DSS_VIDEO3:
581
		BUG();
582
		return 0;
583 584
	default:
		BUG();
585
		return 0;
586 587 588 589 590 591 592 593
	}
}

static inline u16 DISPC_FIR_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
594
		return 0;
595 596 597
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0024;
598 599
	case OMAP_DSS_VIDEO3:
		return 0x0090;
600 601
	default:
		BUG();
602
		return 0;
603 604 605
	}
}

606 607 608 609 610
static inline u16 DISPC_FIR2_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
611
		return 0;
612 613 614 615
	case OMAP_DSS_VIDEO1:
		return 0x0580;
	case OMAP_DSS_VIDEO2:
		return 0x055C;
616 617
	case OMAP_DSS_VIDEO3:
		return 0x0424;
618 619
	default:
		BUG();
620
		return 0;
621 622 623
	}
}

624 625 626 627 628
static inline u16 DISPC_PIC_SIZE_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
629
		return 0;
630 631 632
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0028;
633 634
	case OMAP_DSS_VIDEO3:
		return 0x0094;
635 636
	default:
		BUG();
637
		return 0;
638 639 640 641 642 643 644 645 646
	}
}


static inline u16 DISPC_ACCU0_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
647
		return 0;
648 649 650
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x002C;
651 652
	case OMAP_DSS_VIDEO3:
		return 0x0000;
653 654
	default:
		BUG();
655
		return 0;
656 657 658
	}
}

659 660 661 662 663
static inline u16 DISPC_ACCU2_0_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
664
		return 0;
665 666 667 668
	case OMAP_DSS_VIDEO1:
		return 0x0584;
	case OMAP_DSS_VIDEO2:
		return 0x0560;
669 670
	case OMAP_DSS_VIDEO3:
		return 0x0428;
671 672
	default:
		BUG();
673
		return 0;
674 675 676
	}
}

677 678 679 680 681
static inline u16 DISPC_ACCU1_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
682
		return 0;
683 684 685
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0030;
686 687
	case OMAP_DSS_VIDEO3:
		return 0x0004;
688 689
	default:
		BUG();
690
		return 0;
691 692 693
	}
}

694 695 696 697 698
static inline u16 DISPC_ACCU2_1_OFFSET(enum omap_plane plane)
{
	switch (plane) {
	case OMAP_DSS_GFX:
		BUG();
699
		return 0;
700 701 702 703
	case OMAP_DSS_VIDEO1:
		return 0x0588;
	case OMAP_DSS_VIDEO2:
		return 0x0564;
704 705
	case OMAP_DSS_VIDEO3:
		return 0x042C;
706 707
	default:
		BUG();
708
		return 0;
709 710 711
	}
}

712 713 714 715 716 717
/* 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();
718
		return 0;
719 720 721
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0034 + i * 0x8;
722 723
	case OMAP_DSS_VIDEO3:
		return 0x0010 + i * 0x8;
724 725
	default:
		BUG();
726
		return 0;
727 728 729
	}
}

730 731 732 733 734 735
/* 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();
736
		return 0;
737 738 739 740
	case OMAP_DSS_VIDEO1:
		return 0x058C + i * 0x8;
	case OMAP_DSS_VIDEO2:
		return 0x0568 + i * 0x8;
741 742
	case OMAP_DSS_VIDEO3:
		return 0x0430 + i * 0x8;
743 744
	default:
		BUG();
745
		return 0;
746 747 748
	}
}

749 750 751 752 753 754
/* 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();
755
		return 0;
756 757 758
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0038 + i * 0x8;
759 760
	case OMAP_DSS_VIDEO3:
		return 0x0014 + i * 0x8;
761 762
	default:
		BUG();
763
		return 0;
764 765 766
	}
}

767 768 769 770 771 772
/* 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();
773
		return 0;
774 775 776 777
	case OMAP_DSS_VIDEO1:
		return 0x0590 + i * 8;
	case OMAP_DSS_VIDEO2:
		return 0x056C + i * 0x8;
778 779
	case OMAP_DSS_VIDEO3:
		return 0x0434 + i * 0x8;
780 781
	default:
		BUG();
782
		return 0;
783 784 785
	}
}

786 787 788 789 790 791
/* 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();
792
		return 0;
793 794
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
795
	case OMAP_DSS_VIDEO3:
796 797 798
		return 0x0074 + i * 0x4;
	default:
		BUG();
799
		return 0;
800 801 802 803 804 805 806 807 808
	}
}

/* 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();
809
		return 0;
810 811 812 813
	case OMAP_DSS_VIDEO1:
		return 0x0124 + i * 0x4;
	case OMAP_DSS_VIDEO2:
		return 0x00B4 + i * 0x4;
814 815
	case OMAP_DSS_VIDEO3:
		return 0x0050 + i * 0x4;
816 817
	default:
		BUG();
818
		return 0;
819 820 821
	}
}

822 823 824 825 826 827
/* 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();
828
		return 0;
829 830 831 832
	case OMAP_DSS_VIDEO1:
		return 0x05CC + i * 0x4;
	case OMAP_DSS_VIDEO2:
		return 0x05A8 + i * 0x4;
833 834
	case OMAP_DSS_VIDEO3:
		return 0x0470 + i * 0x4;
835 836
	default:
		BUG();
837
		return 0;
838 839 840
	}
}

841 842 843 844 845 846 847 848 849
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;
850 851
	case OMAP_DSS_VIDEO3:
		return 0x00A0;
852 853
	default:
		BUG();
854
		return 0;
855 856 857
	}
}
#endif