Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 1 | /* |
| 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 Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 24 | /* DISPC common registers */ |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 25 | #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 Valkeinen | 66a0f9e | 2012-08-22 16:57:02 +0300 | [diff] [blame] | 39 | #define DISPC_GLOBAL_BUFFER 0x0800 |
Chandrabhanu Mahapatra | e86d456 | 2012-06-29 10:43:13 +0530 | [diff] [blame] | 40 | #define DISPC_CONTROL3 0x0848 |
| 41 | #define DISPC_CONFIG3 0x084C |
Archit Taneja | d0df9a2 | 2013-03-26 19:15:25 +0530 | [diff] [blame] | 42 | #define DISPC_MSTANDBY_CTRL 0x0858 |
Tomi Valkeinen | 29fceee | 2013-11-14 11:38:25 +0200 | [diff] [blame] | 43 | #define DISPC_GLOBAL_MFLAG_ATTRIBUTE 0x085C |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 44 | |
| 45 | /* DISPC overlay registers */ |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 46 | #define DISPC_OVL_BA0(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 47 | DISPC_BA0_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 48 | #define DISPC_OVL_BA1(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 49 | DISPC_BA1_OFFSET(n)) |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 50 | #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 Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 54 | #define DISPC_OVL_POSITION(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 55 | DISPC_POS_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 56 | #define DISPC_OVL_SIZE(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 57 | DISPC_SIZE_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 58 | #define DISPC_OVL_ATTRIBUTES(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 59 | DISPC_ATTR_OFFSET(n)) |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 60 | #define DISPC_OVL_ATTRIBUTES2(n) (DISPC_OVL_BASE(n) + \ |
| 61 | DISPC_ATTR2_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 62 | #define DISPC_OVL_FIFO_THRESHOLD(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 63 | DISPC_FIFO_THRESH_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 64 | #define DISPC_OVL_FIFO_SIZE_STATUS(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 65 | DISPC_FIFO_SIZE_STATUS_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 66 | #define DISPC_OVL_ROW_INC(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 67 | DISPC_ROW_INC_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 68 | #define DISPC_OVL_PIXEL_INC(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 69 | DISPC_PIX_INC_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 70 | #define DISPC_OVL_WINDOW_SKIP(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 71 | DISPC_WINDOW_SKIP_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 72 | #define DISPC_OVL_TABLE_BA(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 73 | DISPC_TABLE_BA_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 74 | #define DISPC_OVL_FIR(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 75 | DISPC_FIR_OFFSET(n)) |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 76 | #define DISPC_OVL_FIR2(n) (DISPC_OVL_BASE(n) + \ |
| 77 | DISPC_FIR2_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 78 | #define DISPC_OVL_PICTURE_SIZE(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 79 | DISPC_PIC_SIZE_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 80 | #define DISPC_OVL_ACCU0(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 81 | DISPC_ACCU0_OFFSET(n)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 82 | #define DISPC_OVL_ACCU1(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 83 | DISPC_ACCU1_OFFSET(n)) |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 84 | #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 Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 88 | #define DISPC_OVL_FIR_COEF_H(n, i) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 89 | DISPC_FIR_COEF_H_OFFSET(n, i)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 90 | #define DISPC_OVL_FIR_COEF_HV(n, i) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 91 | DISPC_FIR_COEF_HV_OFFSET(n, i)) |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 92 | #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 Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 96 | #define DISPC_OVL_CONV_COEF(n, i) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 97 | DISPC_CONV_COEF_OFFSET(n, i)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 98 | #define DISPC_OVL_FIR_COEF_V(n, i) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 99 | DISPC_FIR_COEF_V_OFFSET(n, i)) |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 100 | #define DISPC_OVL_FIR_COEF_V2(n, i) (DISPC_OVL_BASE(n) + \ |
| 101 | DISPC_FIR_COEF_V2_OFFSET(n, i)) |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 102 | #define DISPC_OVL_PRELOAD(n) (DISPC_OVL_BASE(n) + \ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 103 | DISPC_PRELOAD_OFFSET(n)) |
Tomi Valkeinen | 29fceee | 2013-11-14 11:38:25 +0200 | [diff] [blame] | 104 | #define DISPC_OVL_MFLAG_THRESHOLD(n) (DISPC_OVL_BASE(n) + \ |
| 105 | DISPC_MFLAG_THRESHOLD_OFFSET(n)) |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 106 | |
Chandrabhanu Mahapatra | debd907 | 2011-12-19 14:03:44 +0530 | [diff] [blame] | 107 | /* DISPC up/downsampling FIR filter coefficient structure */ |
| 108 | struct dispc_coef { |
| 109 | s8 hc4_vc22; |
| 110 | s8 hc3_vc2; |
| 111 | u8 hc2_vc1; |
| 112 | s8 hc1_vc0; |
| 113 | s8 hc0_vc00; |
| 114 | }; |
| 115 | |
| 116 | const struct dispc_coef *dispc_ovl_get_scale_coef(int inc, int five_taps); |
| 117 | |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 118 | /* DISPC manager/channel specific registers */ |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 119 | static inline u16 DISPC_DEFAULT_COLOR(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 120 | { |
| 121 | switch (channel) { |
| 122 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 123 | return 0x004C; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 124 | case OMAP_DSS_CHANNEL_DIGIT: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 125 | return 0x0050; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 126 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 127 | return 0x03AC; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 128 | case OMAP_DSS_CHANNEL_LCD3: |
| 129 | return 0x0814; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 130 | default: |
| 131 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 132 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 133 | } |
| 134 | } |
| 135 | |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 136 | static inline u16 DISPC_TRANS_COLOR(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 137 | { |
| 138 | switch (channel) { |
| 139 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 140 | return 0x0054; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 141 | case OMAP_DSS_CHANNEL_DIGIT: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 142 | return 0x0058; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 143 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 144 | return 0x03B0; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 145 | case OMAP_DSS_CHANNEL_LCD3: |
| 146 | return 0x0818; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 147 | default: |
| 148 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 149 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 150 | } |
| 151 | } |
| 152 | |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 153 | static inline u16 DISPC_TIMING_H(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 154 | { |
| 155 | switch (channel) { |
| 156 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 157 | return 0x0064; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 158 | case OMAP_DSS_CHANNEL_DIGIT: |
| 159 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 160 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 161 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 162 | return 0x0400; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 163 | case OMAP_DSS_CHANNEL_LCD3: |
| 164 | return 0x0840; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 165 | default: |
| 166 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 167 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 168 | } |
| 169 | } |
| 170 | |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 171 | static inline u16 DISPC_TIMING_V(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 172 | { |
| 173 | switch (channel) { |
| 174 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 175 | return 0x0068; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 176 | case OMAP_DSS_CHANNEL_DIGIT: |
| 177 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 178 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 179 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 180 | return 0x0404; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 181 | case OMAP_DSS_CHANNEL_LCD3: |
| 182 | return 0x0844; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 183 | default: |
| 184 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 185 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 186 | } |
| 187 | } |
| 188 | |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 189 | static inline u16 DISPC_POL_FREQ(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 190 | { |
| 191 | switch (channel) { |
| 192 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 193 | return 0x006C; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 194 | case OMAP_DSS_CHANNEL_DIGIT: |
| 195 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 196 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 197 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 198 | return 0x0408; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 199 | case OMAP_DSS_CHANNEL_LCD3: |
| 200 | return 0x083C; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 201 | default: |
| 202 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 203 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 204 | } |
| 205 | } |
| 206 | |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 207 | static inline u16 DISPC_DIVISORo(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 208 | { |
| 209 | switch (channel) { |
| 210 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 211 | return 0x0070; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 212 | case OMAP_DSS_CHANNEL_DIGIT: |
| 213 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 214 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 215 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 216 | return 0x040C; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 217 | case OMAP_DSS_CHANNEL_LCD3: |
| 218 | return 0x0838; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 219 | default: |
| 220 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 221 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 222 | } |
| 223 | } |
| 224 | |
| 225 | /* Named as DISPC_SIZE_LCD, DISPC_SIZE_DIGIT and DISPC_SIZE_LCD2 in TRM */ |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 226 | static inline u16 DISPC_SIZE_MGR(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 227 | { |
| 228 | switch (channel) { |
| 229 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 230 | return 0x007C; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 231 | case OMAP_DSS_CHANNEL_DIGIT: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 232 | return 0x0078; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 233 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 234 | return 0x03CC; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 235 | case OMAP_DSS_CHANNEL_LCD3: |
| 236 | return 0x0834; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 237 | default: |
| 238 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 239 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 240 | } |
| 241 | } |
| 242 | |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 243 | static inline u16 DISPC_DATA_CYCLE1(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 244 | { |
| 245 | switch (channel) { |
| 246 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 247 | return 0x01D4; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 248 | case OMAP_DSS_CHANNEL_DIGIT: |
| 249 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 250 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 251 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 252 | return 0x03C0; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 253 | case OMAP_DSS_CHANNEL_LCD3: |
| 254 | return 0x0828; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 255 | default: |
| 256 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 257 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 258 | } |
| 259 | } |
| 260 | |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 261 | static inline u16 DISPC_DATA_CYCLE2(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 262 | { |
| 263 | switch (channel) { |
| 264 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 265 | return 0x01D8; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 266 | case OMAP_DSS_CHANNEL_DIGIT: |
| 267 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 268 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 269 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 270 | return 0x03C4; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 271 | case OMAP_DSS_CHANNEL_LCD3: |
| 272 | return 0x082C; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 273 | default: |
| 274 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 275 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 276 | } |
| 277 | } |
| 278 | |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 279 | static inline u16 DISPC_DATA_CYCLE3(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 280 | { |
| 281 | switch (channel) { |
| 282 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 283 | return 0x01DC; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 284 | case OMAP_DSS_CHANNEL_DIGIT: |
| 285 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 286 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 287 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 288 | return 0x03C8; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 289 | case OMAP_DSS_CHANNEL_LCD3: |
| 290 | return 0x0830; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 291 | default: |
| 292 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 293 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 294 | } |
| 295 | } |
| 296 | |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 297 | static inline u16 DISPC_CPR_COEF_R(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 298 | { |
| 299 | switch (channel) { |
| 300 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 301 | return 0x0220; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 302 | case OMAP_DSS_CHANNEL_DIGIT: |
| 303 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 304 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 305 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 306 | return 0x03BC; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 307 | case OMAP_DSS_CHANNEL_LCD3: |
| 308 | return 0x0824; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 309 | default: |
| 310 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 311 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 312 | } |
| 313 | } |
| 314 | |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 315 | static inline u16 DISPC_CPR_COEF_G(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 316 | { |
| 317 | switch (channel) { |
| 318 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 319 | return 0x0224; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 320 | case OMAP_DSS_CHANNEL_DIGIT: |
| 321 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 322 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 323 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 324 | return 0x03B8; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 325 | case OMAP_DSS_CHANNEL_LCD3: |
| 326 | return 0x0820; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 327 | default: |
| 328 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 329 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 330 | } |
| 331 | } |
| 332 | |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 333 | static inline u16 DISPC_CPR_COEF_B(enum omap_channel channel) |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 334 | { |
| 335 | switch (channel) { |
| 336 | case OMAP_DSS_CHANNEL_LCD: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 337 | return 0x0228; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 338 | case OMAP_DSS_CHANNEL_DIGIT: |
| 339 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 340 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 341 | case OMAP_DSS_CHANNEL_LCD2: |
Archit Taneja | 55978cc | 2011-05-06 11:45:51 +0530 | [diff] [blame] | 342 | return 0x03B4; |
Chandrabhanu Mahapatra | ff6331e | 2012-06-19 15:08:16 +0530 | [diff] [blame] | 343 | case OMAP_DSS_CHANNEL_LCD3: |
| 344 | return 0x081C; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 345 | default: |
| 346 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 347 | return 0; |
Archit Taneja | 702d144 | 2011-05-06 11:45:50 +0530 | [diff] [blame] | 348 | } |
| 349 | } |
| 350 | |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 351 | /* DISPC overlay register base addresses */ |
| 352 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 361 | case OMAP_DSS_VIDEO3: |
| 362 | return 0x0300; |
Tomi Valkeinen | 66a0f9e | 2012-08-22 16:57:02 +0300 | [diff] [blame] | 363 | case OMAP_DSS_WB: |
| 364 | return 0x0500; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 365 | default: |
| 366 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 367 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 368 | } |
| 369 | } |
| 370 | |
| 371 | /* DISPC overlay register offsets */ |
| 372 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 379 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 380 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 381 | return 0x0008; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 382 | default: |
| 383 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 384 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 385 | } |
| 386 | } |
| 387 | |
| 388 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 395 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 396 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 397 | return 0x000C; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 398 | default: |
| 399 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 400 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 401 | } |
| 402 | } |
| 403 | |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 404 | static inline u16 DISPC_BA0_UV_OFFSET(enum omap_plane plane) |
| 405 | { |
| 406 | switch (plane) { |
| 407 | case OMAP_DSS_GFX: |
| 408 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 409 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 410 | case OMAP_DSS_VIDEO1: |
| 411 | return 0x0544; |
| 412 | case OMAP_DSS_VIDEO2: |
| 413 | return 0x04BC; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 414 | case OMAP_DSS_VIDEO3: |
| 415 | return 0x0310; |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 416 | case OMAP_DSS_WB: |
| 417 | return 0x0118; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 418 | default: |
| 419 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 420 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 421 | } |
| 422 | } |
| 423 | |
| 424 | static inline u16 DISPC_BA1_UV_OFFSET(enum omap_plane plane) |
| 425 | { |
| 426 | switch (plane) { |
| 427 | case OMAP_DSS_GFX: |
| 428 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 429 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 430 | case OMAP_DSS_VIDEO1: |
| 431 | return 0x0548; |
| 432 | case OMAP_DSS_VIDEO2: |
| 433 | return 0x04C0; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 434 | case OMAP_DSS_VIDEO3: |
| 435 | return 0x0314; |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 436 | case OMAP_DSS_WB: |
| 437 | return 0x011C; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 438 | default: |
| 439 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 440 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 441 | } |
| 442 | } |
| 443 | |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 444 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 451 | case OMAP_DSS_VIDEO3: |
| 452 | return 0x009C; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 453 | default: |
| 454 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 455 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 456 | } |
| 457 | } |
| 458 | |
| 459 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 466 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 467 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 468 | return 0x00A8; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 469 | default: |
| 470 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 471 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 472 | } |
| 473 | } |
| 474 | |
| 475 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 483 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 484 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 485 | return 0x0070; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 486 | default: |
| 487 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 488 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 489 | } |
| 490 | } |
| 491 | |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 492 | static inline u16 DISPC_ATTR2_OFFSET(enum omap_plane plane) |
| 493 | { |
| 494 | switch (plane) { |
| 495 | case OMAP_DSS_GFX: |
| 496 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 497 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 498 | case OMAP_DSS_VIDEO1: |
| 499 | return 0x0568; |
| 500 | case OMAP_DSS_VIDEO2: |
| 501 | return 0x04DC; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 502 | case OMAP_DSS_VIDEO3: |
| 503 | return 0x032C; |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 504 | case OMAP_DSS_WB: |
| 505 | return 0x0310; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 506 | default: |
| 507 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 508 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 509 | } |
| 510 | } |
| 511 | |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 512 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 520 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 521 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 522 | return 0x008C; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 523 | default: |
| 524 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 525 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 526 | } |
| 527 | } |
| 528 | |
| 529 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 537 | case OMAP_DSS_VIDEO3: |
Tomi Valkeinen | 66a0f9e | 2012-08-22 16:57:02 +0300 | [diff] [blame] | 538 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 539 | return 0x0088; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 540 | default: |
| 541 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 542 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 543 | } |
| 544 | } |
| 545 | |
| 546 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 554 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 555 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 556 | return 0x00A4; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 557 | default: |
| 558 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 559 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 560 | } |
| 561 | } |
| 562 | |
| 563 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 571 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 572 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 573 | return 0x0098; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 574 | default: |
| 575 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 576 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 577 | } |
| 578 | } |
| 579 | |
| 580 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 587 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 588 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 589 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 590 | default: |
| 591 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 592 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 593 | } |
| 594 | } |
| 595 | |
| 596 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 603 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 604 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 605 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 606 | default: |
| 607 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 608 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 609 | } |
| 610 | } |
| 611 | |
| 612 | static inline u16 DISPC_FIR_OFFSET(enum omap_plane plane) |
| 613 | { |
| 614 | switch (plane) { |
| 615 | case OMAP_DSS_GFX: |
| 616 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 617 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 618 | case OMAP_DSS_VIDEO1: |
| 619 | case OMAP_DSS_VIDEO2: |
| 620 | return 0x0024; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 621 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 622 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 623 | return 0x0090; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 624 | default: |
| 625 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 626 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 627 | } |
| 628 | } |
| 629 | |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 630 | static inline u16 DISPC_FIR2_OFFSET(enum omap_plane plane) |
| 631 | { |
| 632 | switch (plane) { |
| 633 | case OMAP_DSS_GFX: |
| 634 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 635 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 636 | case OMAP_DSS_VIDEO1: |
| 637 | return 0x0580; |
| 638 | case OMAP_DSS_VIDEO2: |
| 639 | return 0x055C; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 640 | case OMAP_DSS_VIDEO3: |
| 641 | return 0x0424; |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 642 | case OMAP_DSS_WB: |
| 643 | return 0x290; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 644 | default: |
| 645 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 646 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 647 | } |
| 648 | } |
| 649 | |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 650 | static inline u16 DISPC_PIC_SIZE_OFFSET(enum omap_plane plane) |
| 651 | { |
| 652 | switch (plane) { |
| 653 | case OMAP_DSS_GFX: |
| 654 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 655 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 656 | case OMAP_DSS_VIDEO1: |
| 657 | case OMAP_DSS_VIDEO2: |
| 658 | return 0x0028; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 659 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 660 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 661 | return 0x0094; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 662 | default: |
| 663 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 664 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 665 | } |
| 666 | } |
| 667 | |
| 668 | |
| 669 | static inline u16 DISPC_ACCU0_OFFSET(enum omap_plane plane) |
| 670 | { |
| 671 | switch (plane) { |
| 672 | case OMAP_DSS_GFX: |
| 673 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 674 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 675 | case OMAP_DSS_VIDEO1: |
| 676 | case OMAP_DSS_VIDEO2: |
| 677 | return 0x002C; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 678 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 679 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 680 | return 0x0000; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 681 | default: |
| 682 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 683 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 684 | } |
| 685 | } |
| 686 | |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 687 | static inline u16 DISPC_ACCU2_0_OFFSET(enum omap_plane plane) |
| 688 | { |
| 689 | switch (plane) { |
| 690 | case OMAP_DSS_GFX: |
| 691 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 692 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 693 | case OMAP_DSS_VIDEO1: |
| 694 | return 0x0584; |
| 695 | case OMAP_DSS_VIDEO2: |
| 696 | return 0x0560; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 697 | case OMAP_DSS_VIDEO3: |
| 698 | return 0x0428; |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 699 | case OMAP_DSS_WB: |
| 700 | return 0x0294; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 701 | default: |
| 702 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 703 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 704 | } |
| 705 | } |
| 706 | |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 707 | static inline u16 DISPC_ACCU1_OFFSET(enum omap_plane plane) |
| 708 | { |
| 709 | switch (plane) { |
| 710 | case OMAP_DSS_GFX: |
| 711 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 712 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 713 | case OMAP_DSS_VIDEO1: |
| 714 | case OMAP_DSS_VIDEO2: |
| 715 | return 0x0030; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 716 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 717 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 718 | return 0x0004; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 719 | default: |
| 720 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 721 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 722 | } |
| 723 | } |
| 724 | |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 725 | static inline u16 DISPC_ACCU2_1_OFFSET(enum omap_plane plane) |
| 726 | { |
| 727 | switch (plane) { |
| 728 | case OMAP_DSS_GFX: |
| 729 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 730 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 731 | case OMAP_DSS_VIDEO1: |
| 732 | return 0x0588; |
| 733 | case OMAP_DSS_VIDEO2: |
| 734 | return 0x0564; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 735 | case OMAP_DSS_VIDEO3: |
| 736 | return 0x042C; |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 737 | case OMAP_DSS_WB: |
| 738 | return 0x0298; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 739 | default: |
| 740 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 741 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 742 | } |
| 743 | } |
| 744 | |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 745 | /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */ |
| 746 | static 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 Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 751 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 752 | case OMAP_DSS_VIDEO1: |
| 753 | case OMAP_DSS_VIDEO2: |
| 754 | return 0x0034 + i * 0x8; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 755 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 756 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 757 | return 0x0010 + i * 0x8; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 758 | default: |
| 759 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 760 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 761 | } |
| 762 | } |
| 763 | |
| 764 | /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */ |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 765 | static 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 Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 770 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 771 | case OMAP_DSS_VIDEO1: |
| 772 | return 0x058C + i * 0x8; |
| 773 | case OMAP_DSS_VIDEO2: |
| 774 | return 0x0568 + i * 0x8; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 775 | case OMAP_DSS_VIDEO3: |
| 776 | return 0x0430 + i * 0x8; |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 777 | case OMAP_DSS_WB: |
| 778 | return 0x02A0 + i * 0x8; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 779 | default: |
| 780 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 781 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 782 | } |
| 783 | } |
| 784 | |
| 785 | /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */ |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 786 | static 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 Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 791 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 792 | case OMAP_DSS_VIDEO1: |
| 793 | case OMAP_DSS_VIDEO2: |
| 794 | return 0x0038 + i * 0x8; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 795 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 796 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 797 | return 0x0014 + i * 0x8; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 798 | default: |
| 799 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 800 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 801 | } |
| 802 | } |
| 803 | |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 804 | /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */ |
| 805 | static 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 Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 810 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 811 | case OMAP_DSS_VIDEO1: |
| 812 | return 0x0590 + i * 8; |
| 813 | case OMAP_DSS_VIDEO2: |
| 814 | return 0x056C + i * 0x8; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 815 | case OMAP_DSS_VIDEO3: |
| 816 | return 0x0434 + i * 0x8; |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 817 | case OMAP_DSS_WB: |
| 818 | return 0x02A4 + i * 0x8; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 819 | default: |
| 820 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 821 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 822 | } |
| 823 | } |
| 824 | |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 825 | /* coef index i = {0, 1, 2, 3, 4,} */ |
| 826 | static inline u16 DISPC_CONV_COEF_OFFSET(enum omap_plane plane, u16 i) |
| 827 | { |
| 828 | switch (plane) { |
| 829 | case OMAP_DSS_GFX: |
| 830 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 831 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 832 | case OMAP_DSS_VIDEO1: |
| 833 | case OMAP_DSS_VIDEO2: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 834 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 835 | case OMAP_DSS_WB: |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 836 | return 0x0074 + i * 0x4; |
| 837 | default: |
| 838 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 839 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 840 | } |
| 841 | } |
| 842 | |
| 843 | /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */ |
| 844 | static 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 Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 849 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 850 | case OMAP_DSS_VIDEO1: |
| 851 | return 0x0124 + i * 0x4; |
| 852 | case OMAP_DSS_VIDEO2: |
| 853 | return 0x00B4 + i * 0x4; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 854 | case OMAP_DSS_VIDEO3: |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 855 | case OMAP_DSS_WB: |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 856 | return 0x0050 + i * 0x4; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 857 | default: |
| 858 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 859 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 860 | } |
| 861 | } |
| 862 | |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 863 | /* coef index i = {0, 1, 2, 3, 4, 5, 6, 7} */ |
| 864 | static 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 Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 869 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 870 | case OMAP_DSS_VIDEO1: |
| 871 | return 0x05CC + i * 0x4; |
| 872 | case OMAP_DSS_VIDEO2: |
| 873 | return 0x05A8 + i * 0x4; |
Archit Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 874 | case OMAP_DSS_VIDEO3: |
| 875 | return 0x0470 + i * 0x4; |
Archit Taneja | 7a155be | 2012-07-16 15:54:24 +0530 | [diff] [blame] | 876 | case OMAP_DSS_WB: |
| 877 | return 0x02E0 + i * 0x4; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 878 | default: |
| 879 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 880 | return 0; |
Amber Jain | ab5ca07 | 2011-05-19 19:47:53 +0530 | [diff] [blame] | 881 | } |
| 882 | } |
| 883 | |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 884 | static 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 Taneja | b8c095b | 2011-09-13 18:20:33 +0530 | [diff] [blame] | 893 | case OMAP_DSS_VIDEO3: |
| 894 | return 0x00A0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 895 | default: |
| 896 | BUG(); |
Tomi Valkeinen | c6eee96 | 2012-05-18 11:47:02 +0300 | [diff] [blame] | 897 | return 0; |
Archit Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 898 | } |
| 899 | } |
Tomi Valkeinen | 29fceee | 2013-11-14 11:38:25 +0200 | [diff] [blame] | 900 | |
| 901 | static 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 Taneja | 9b372c2 | 2011-05-06 11:45:49 +0530 | [diff] [blame] | 917 | #endif |