dispc.h 17.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
#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
#define DISPC_OVL_MFLAG_THRESHOLD(n)	DISPC_MFLAG_THRESHOLD_OFFSET(n)
105

106 107 108 109 110 111 112 113 114 115 116
/* 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);

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

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

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

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

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

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

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

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

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

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

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

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

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

350 351 352 353 354 355 356 357 358 359
/* 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;
360 361
	case OMAP_DSS_VIDEO3:
		return 0x0300;
362 363
	case OMAP_DSS_WB:
		return 0x0500;
364 365
	default:
		BUG();
366
		return 0;
367 368 369 370 371 372 373 374 375 376 377
	}
}

/* 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;
378
	case OMAP_DSS_VIDEO3:
379
	case OMAP_DSS_WB:
380
		return 0x0008;
381 382
	default:
		BUG();
383
		return 0;
384 385 386 387 388 389 390 391 392 393
	}
}

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;
394
	case OMAP_DSS_VIDEO3:
395
	case OMAP_DSS_WB:
396
		return 0x000C;
397 398
	default:
		BUG();
399
		return 0;
400 401 402
	}
}

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

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

443 444 445 446 447 448 449
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;
450 451
	case OMAP_DSS_VIDEO3:
		return 0x009C;
452 453
	default:
		BUG();
454
		return 0;
455 456 457 458 459 460 461 462 463 464
	}
}

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;
465
	case OMAP_DSS_VIDEO3:
466
	case OMAP_DSS_WB:
467
		return 0x00A8;
468 469
	default:
		BUG();
470
		return 0;
471 472 473 474 475 476 477 478 479 480 481
	}
}

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;
482
	case OMAP_DSS_VIDEO3:
483
	case OMAP_DSS_WB:
484
		return 0x0070;
485 486
	default:
		BUG();
487
		return 0;
488 489 490
	}
}

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

511 512 513 514 515 516 517 518
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;
519
	case OMAP_DSS_VIDEO3:
520
	case OMAP_DSS_WB:
521
		return 0x008C;
522 523
	default:
		BUG();
524
		return 0;
525 526 527 528 529 530 531 532 533 534 535
	}
}

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;
536
	case OMAP_DSS_VIDEO3:
537
	case OMAP_DSS_WB:
538
		return 0x0088;
539 540
	default:
		BUG();
541
		return 0;
542 543 544 545 546 547 548 549 550 551 552
	}
}

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;
553
	case OMAP_DSS_VIDEO3:
554
	case OMAP_DSS_WB:
555
		return 0x00A4;
556 557
	default:
		BUG();
558
		return 0;
559 560 561 562 563 564 565 566 567 568 569
	}
}

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;
570
	case OMAP_DSS_VIDEO3:
571
	case OMAP_DSS_WB:
572
		return 0x0098;
573 574
	default:
		BUG();
575
		return 0;
576 577 578 579 580 581 582 583 584 585
	}
}

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:
586
	case OMAP_DSS_VIDEO3:
587
		BUG();
588
		return 0;
589 590
	default:
		BUG();
591
		return 0;
592 593 594 595 596 597 598 599 600 601
	}
}

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:
602
	case OMAP_DSS_VIDEO3:
603
		BUG();
604
		return 0;
605 606
	default:
		BUG();
607
		return 0;
608 609 610 611 612 613 614 615
	}
}

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

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

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


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

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

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

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

744 745 746 747 748 749
/* 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();
750
		return 0;
751 752 753
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0034 + i * 0x8;
754
	case OMAP_DSS_VIDEO3:
755
	case OMAP_DSS_WB:
756
		return 0x0010 + i * 0x8;
757 758
	default:
		BUG();
759
		return 0;
760 761 762
	}
}

763 764 765 766 767 768
/* 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();
769
		return 0;
770 771 772 773
	case OMAP_DSS_VIDEO1:
		return 0x058C + i * 0x8;
	case OMAP_DSS_VIDEO2:
		return 0x0568 + i * 0x8;
774 775
	case OMAP_DSS_VIDEO3:
		return 0x0430 + i * 0x8;
776 777
	case OMAP_DSS_WB:
		return 0x02A0 + i * 0x8;
778 779
	default:
		BUG();
780
		return 0;
781 782 783
	}
}

784 785 786 787 788 789
/* 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();
790
		return 0;
791 792 793
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
		return 0x0038 + i * 0x8;
794
	case OMAP_DSS_VIDEO3:
795
	case OMAP_DSS_WB:
796
		return 0x0014 + i * 0x8;
797 798
	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_HV2_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 0x0590 + i * 8;
	case OMAP_DSS_VIDEO2:
		return 0x056C + i * 0x8;
814 815
	case OMAP_DSS_VIDEO3:
		return 0x0434 + i * 0x8;
816 817
	case OMAP_DSS_WB:
		return 0x02A4 + i * 0x8;
818 819
	default:
		BUG();
820
		return 0;
821 822 823
	}
}

824 825 826 827 828 829
/* 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();
830
		return 0;
831 832
	case OMAP_DSS_VIDEO1:
	case OMAP_DSS_VIDEO2:
833
	case OMAP_DSS_VIDEO3:
834
	case OMAP_DSS_WB:
835 836 837
		return 0x0074 + i * 0x4;
	default:
		BUG();
838
		return 0;
839 840 841 842 843 844 845 846 847
	}
}

/* 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();
848
		return 0;
849 850 851 852
	case OMAP_DSS_VIDEO1:
		return 0x0124 + i * 0x4;
	case OMAP_DSS_VIDEO2:
		return 0x00B4 + i * 0x4;
853
	case OMAP_DSS_VIDEO3:
854
	case OMAP_DSS_WB:
855
		return 0x0050 + i * 0x4;
856 857
	default:
		BUG();
858
		return 0;
859 860 861
	}
}

862 863 864 865 866 867
/* 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();
868
		return 0;
869 870 871 872
	case OMAP_DSS_VIDEO1:
		return 0x05CC + i * 0x4;
	case OMAP_DSS_VIDEO2:
		return 0x05A8 + i * 0x4;
873 874
	case OMAP_DSS_VIDEO3:
		return 0x0470 + i * 0x4;
875 876
	case OMAP_DSS_WB:
		return 0x02E0 + i * 0x4;
877 878
	default:
		BUG();
879
		return 0;
880 881 882
	}
}

883 884 885 886 887 888 889 890 891
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;
892 893
	case OMAP_DSS_VIDEO3:
		return 0x00A0;
894 895
	default:
		BUG();
896
		return 0;
897 898
	}
}
T
Tomi Valkeinen 已提交
899 900 901 902 903 904 905 906 907 908 909 910

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;
911 912
	case OMAP_DSS_WB:
		return 0x0870;
T
Tomi Valkeinen 已提交
913 914 915 916 917
	default:
		BUG();
		return 0;
	}
}
918
#endif