diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2011-04-26 04:22:15 -0400 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2011-04-26 04:22:59 -0400 |
| commit | 07f9479a40cc778bc1462ada11f95b01360ae4ff (patch) | |
| tree | 0676cf38df3844004bb3ebfd99dfa67a4a8998f5 /include/linux/amba | |
| parent | 9d5e6bdb3013acfb311ab407eeca0b6a6a3dedbf (diff) | |
| parent | cd2e49e90f1cae7726c9a2c54488d881d7f1cd1c (diff) | |
Merge branch 'master' into for-next
Fast-forwarded to current state of Linus' tree as there are patches to be
applied for files that didn't exist on the old branch.
Diffstat (limited to 'include/linux/amba')
| -rw-r--r-- | include/linux/amba/clcd.h | 92 | ||||
| -rw-r--r-- | include/linux/amba/mmci.h | 6 |
2 files changed, 73 insertions, 25 deletions
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h index be33b3affc8a..e82e3ee2c54a 100644 --- a/include/linux/amba/clcd.h +++ b/include/linux/amba/clcd.h | |||
| @@ -53,6 +53,7 @@ | |||
| 53 | #define CNTL_LCDBPP8 (3 << 1) | 53 | #define CNTL_LCDBPP8 (3 << 1) |
| 54 | #define CNTL_LCDBPP16 (4 << 1) | 54 | #define CNTL_LCDBPP16 (4 << 1) |
| 55 | #define CNTL_LCDBPP16_565 (6 << 1) | 55 | #define CNTL_LCDBPP16_565 (6 << 1) |
| 56 | #define CNTL_LCDBPP16_444 (7 << 1) | ||
| 56 | #define CNTL_LCDBPP24 (5 << 1) | 57 | #define CNTL_LCDBPP24 (5 << 1) |
| 57 | #define CNTL_LCDBW (1 << 4) | 58 | #define CNTL_LCDBW (1 << 4) |
| 58 | #define CNTL_LCDTFT (1 << 5) | 59 | #define CNTL_LCDTFT (1 << 5) |
| @@ -66,6 +67,32 @@ | |||
| 66 | #define CNTL_LDMAFIFOTIME (1 << 15) | 67 | #define CNTL_LDMAFIFOTIME (1 << 15) |
| 67 | #define CNTL_WATERMARK (1 << 16) | 68 | #define CNTL_WATERMARK (1 << 16) |
| 68 | 69 | ||
| 70 | enum { | ||
| 71 | /* individual formats */ | ||
| 72 | CLCD_CAP_RGB444 = (1 << 0), | ||
| 73 | CLCD_CAP_RGB5551 = (1 << 1), | ||
| 74 | CLCD_CAP_RGB565 = (1 << 2), | ||
| 75 | CLCD_CAP_RGB888 = (1 << 3), | ||
| 76 | CLCD_CAP_BGR444 = (1 << 4), | ||
| 77 | CLCD_CAP_BGR5551 = (1 << 5), | ||
| 78 | CLCD_CAP_BGR565 = (1 << 6), | ||
| 79 | CLCD_CAP_BGR888 = (1 << 7), | ||
| 80 | |||
| 81 | /* connection layouts */ | ||
| 82 | CLCD_CAP_444 = CLCD_CAP_RGB444 | CLCD_CAP_BGR444, | ||
| 83 | CLCD_CAP_5551 = CLCD_CAP_RGB5551 | CLCD_CAP_BGR5551, | ||
| 84 | CLCD_CAP_565 = CLCD_CAP_RGB565 | CLCD_CAP_BGR565, | ||
| 85 | CLCD_CAP_888 = CLCD_CAP_RGB888 | CLCD_CAP_BGR888, | ||
| 86 | |||
| 87 | /* red/blue ordering */ | ||
| 88 | CLCD_CAP_RGB = CLCD_CAP_RGB444 | CLCD_CAP_RGB5551 | | ||
| 89 | CLCD_CAP_RGB565 | CLCD_CAP_RGB888, | ||
| 90 | CLCD_CAP_BGR = CLCD_CAP_BGR444 | CLCD_CAP_BGR5551 | | ||
| 91 | CLCD_CAP_BGR565 | CLCD_CAP_BGR888, | ||
| 92 | |||
| 93 | CLCD_CAP_ALL = CLCD_CAP_BGR | CLCD_CAP_RGB, | ||
| 94 | }; | ||
| 95 | |||
| 69 | struct clcd_panel { | 96 | struct clcd_panel { |
| 70 | struct fb_videomode mode; | 97 | struct fb_videomode mode; |
| 71 | signed short width; /* width in mm */ | 98 | signed short width; /* width in mm */ |
| @@ -73,6 +100,7 @@ struct clcd_panel { | |||
| 73 | u32 tim2; | 100 | u32 tim2; |
| 74 | u32 tim3; | 101 | u32 tim3; |
| 75 | u32 cntl; | 102 | u32 cntl; |
| 103 | u32 caps; | ||
| 76 | unsigned int bpp:8, | 104 | unsigned int bpp:8, |
| 77 | fixedtimings:1, | 105 | fixedtimings:1, |
| 78 | grayscale:1; | 106 | grayscale:1; |
| @@ -97,13 +125,18 @@ struct clcd_board { | |||
| 97 | const char *name; | 125 | const char *name; |
| 98 | 126 | ||
| 99 | /* | 127 | /* |
| 128 | * Optional. Hardware capability flags. | ||
| 129 | */ | ||
| 130 | u32 caps; | ||
| 131 | |||
| 132 | /* | ||
| 100 | * Optional. Check whether the var structure is acceptable | 133 | * Optional. Check whether the var structure is acceptable |
| 101 | * for this display. | 134 | * for this display. |
| 102 | */ | 135 | */ |
| 103 | int (*check)(struct clcd_fb *fb, struct fb_var_screeninfo *var); | 136 | int (*check)(struct clcd_fb *fb, struct fb_var_screeninfo *var); |
| 104 | 137 | ||
| 105 | /* | 138 | /* |
| 106 | * Compulsary. Decode fb->fb.var into regs->*. In the case of | 139 | * Compulsory. Decode fb->fb.var into regs->*. In the case of |
| 107 | * fixed timing, set regs->* to the register values required. | 140 | * fixed timing, set regs->* to the register values required. |
| 108 | */ | 141 | */ |
| 109 | void (*decode)(struct clcd_fb *fb, struct clcd_regs *regs); | 142 | void (*decode)(struct clcd_fb *fb, struct clcd_regs *regs); |
| @@ -155,34 +188,35 @@ struct clcd_fb { | |||
| 155 | 188 | ||
| 156 | static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) | 189 | static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) |
| 157 | { | 190 | { |
| 191 | struct fb_var_screeninfo *var = &fb->fb.var; | ||
| 158 | u32 val, cpl; | 192 | u32 val, cpl; |
| 159 | 193 | ||
| 160 | /* | 194 | /* |
| 161 | * Program the CLCD controller registers and start the CLCD | 195 | * Program the CLCD controller registers and start the CLCD |
| 162 | */ | 196 | */ |
| 163 | val = ((fb->fb.var.xres / 16) - 1) << 2; | 197 | val = ((var->xres / 16) - 1) << 2; |
| 164 | val |= (fb->fb.var.hsync_len - 1) << 8; | 198 | val |= (var->hsync_len - 1) << 8; |
| 165 | val |= (fb->fb.var.right_margin - 1) << 16; | 199 | val |= (var->right_margin - 1) << 16; |
| 166 | val |= (fb->fb.var.left_margin - 1) << 24; | 200 | val |= (var->left_margin - 1) << 24; |
| 167 | regs->tim0 = val; | 201 | regs->tim0 = val; |
| 168 | 202 | ||
| 169 | val = fb->fb.var.yres; | 203 | val = var->yres; |
| 170 | if (fb->panel->cntl & CNTL_LCDDUAL) | 204 | if (fb->panel->cntl & CNTL_LCDDUAL) |
| 171 | val /= 2; | 205 | val /= 2; |
| 172 | val -= 1; | 206 | val -= 1; |
| 173 | val |= (fb->fb.var.vsync_len - 1) << 10; | 207 | val |= (var->vsync_len - 1) << 10; |
| 174 | val |= fb->fb.var.lower_margin << 16; | 208 | val |= var->lower_margin << 16; |
| 175 | val |= fb->fb.var.upper_margin << 24; | 209 | val |= var->upper_margin << 24; |
| 176 | regs->tim1 = val; | 210 | regs->tim1 = val; |
| 177 | 211 | ||
| 178 | val = fb->panel->tim2; | 212 | val = fb->panel->tim2; |
| 179 | val |= fb->fb.var.sync & FB_SYNC_HOR_HIGH_ACT ? 0 : TIM2_IHS; | 213 | val |= var->sync & FB_SYNC_HOR_HIGH_ACT ? 0 : TIM2_IHS; |
| 180 | val |= fb->fb.var.sync & FB_SYNC_VERT_HIGH_ACT ? 0 : TIM2_IVS; | 214 | val |= var->sync & FB_SYNC_VERT_HIGH_ACT ? 0 : TIM2_IVS; |
| 181 | 215 | ||
| 182 | cpl = fb->fb.var.xres_virtual; | 216 | cpl = var->xres_virtual; |
| 183 | if (fb->panel->cntl & CNTL_LCDTFT) /* TFT */ | 217 | if (fb->panel->cntl & CNTL_LCDTFT) /* TFT */ |
| 184 | /* / 1 */; | 218 | /* / 1 */; |
| 185 | else if (!fb->fb.var.grayscale) /* STN color */ | 219 | else if (!var->grayscale) /* STN color */ |
| 186 | cpl = cpl * 8 / 3; | 220 | cpl = cpl * 8 / 3; |
| 187 | else if (fb->panel->cntl & CNTL_LCDMONO8) /* STN monochrome, 8bit */ | 221 | else if (fb->panel->cntl & CNTL_LCDMONO8) /* STN monochrome, 8bit */ |
| 188 | cpl /= 8; | 222 | cpl /= 8; |
| @@ -194,10 +228,22 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) | |||
| 194 | regs->tim3 = fb->panel->tim3; | 228 | regs->tim3 = fb->panel->tim3; |
| 195 | 229 | ||
| 196 | val = fb->panel->cntl; | 230 | val = fb->panel->cntl; |
| 197 | if (fb->fb.var.grayscale) | 231 | if (var->grayscale) |
| 198 | val |= CNTL_LCDBW; | 232 | val |= CNTL_LCDBW; |
| 199 | 233 | ||
| 200 | switch (fb->fb.var.bits_per_pixel) { | 234 | if (fb->panel->caps && fb->board->caps && |
| 235 | var->bits_per_pixel >= 16) { | ||
| 236 | /* | ||
| 237 | * if board and panel supply capabilities, we can support | ||
| 238 | * changing BGR/RGB depending on supplied parameters | ||
| 239 | */ | ||
| 240 | if (var->red.offset == 0) | ||
| 241 | val &= ~CNTL_BGR; | ||
| 242 | else | ||
| 243 | val |= CNTL_BGR; | ||
| 244 | } | ||
| 245 | |||
| 246 | switch (var->bits_per_pixel) { | ||
| 201 | case 1: | 247 | case 1: |
| 202 | val |= CNTL_LCDBPP1; | 248 | val |= CNTL_LCDBPP1; |
| 203 | break; | 249 | break; |
| @@ -212,15 +258,17 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) | |||
| 212 | break; | 258 | break; |
| 213 | case 16: | 259 | case 16: |
| 214 | /* | 260 | /* |
| 215 | * PL110 cannot choose between 5551 and 565 modes in | 261 | * PL110 cannot choose between 5551 and 565 modes in its |
| 216 | * its control register | 262 | * control register. It is possible to use 565 with |
| 263 | * custom external wiring. | ||
| 217 | */ | 264 | */ |
| 218 | if ((fb->dev->periphid & 0x000fffff) == 0x00041110) | 265 | if (amba_part(fb->dev) == 0x110 || |
| 266 | var->green.length == 5) | ||
| 219 | val |= CNTL_LCDBPP16; | 267 | val |= CNTL_LCDBPP16; |
| 220 | else if (fb->fb.var.green.length == 5) | 268 | else if (var->green.length == 6) |
| 221 | val |= CNTL_LCDBPP16; | ||
| 222 | else | ||
| 223 | val |= CNTL_LCDBPP16_565; | 269 | val |= CNTL_LCDBPP16_565; |
| 270 | else | ||
| 271 | val |= CNTL_LCDBPP16_444; | ||
| 224 | break; | 272 | break; |
| 225 | case 32: | 273 | case 32: |
| 226 | val |= CNTL_LCDBPP24; | 274 | val |= CNTL_LCDBPP24; |
| @@ -228,7 +276,7 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) | |||
| 228 | } | 276 | } |
| 229 | 277 | ||
| 230 | regs->cntl = val; | 278 | regs->cntl = val; |
| 231 | regs->pixclock = fb->fb.var.pixclock; | 279 | regs->pixclock = var->pixclock; |
| 232 | } | 280 | } |
| 233 | 281 | ||
| 234 | static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var) | 282 | static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var) |
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h index f60227088b7b..21114810c7c0 100644 --- a/include/linux/amba/mmci.h +++ b/include/linux/amba/mmci.h | |||
| @@ -30,15 +30,15 @@ struct dma_chan; | |||
| 30 | * @cd_invert: true if the gpio_cd pin value is active low | 30 | * @cd_invert: true if the gpio_cd pin value is active low |
| 31 | * @capabilities: the capabilities of the block as implemented in | 31 | * @capabilities: the capabilities of the block as implemented in |
| 32 | * this platform, signify anything MMC_CAP_* from mmc/host.h | 32 | * this platform, signify anything MMC_CAP_* from mmc/host.h |
| 33 | * @dma_filter: function used to select an apropriate RX and TX | 33 | * @dma_filter: function used to select an appropriate RX and TX |
| 34 | * DMA channel to be used for DMA, if and only if you're deploying the | 34 | * DMA channel to be used for DMA, if and only if you're deploying the |
| 35 | * generic DMA engine | 35 | * generic DMA engine |
| 36 | * @dma_rx_param: parameter passed to the DMA allocation | 36 | * @dma_rx_param: parameter passed to the DMA allocation |
| 37 | * filter in order to select an apropriate RX channel. If | 37 | * filter in order to select an appropriate RX channel. If |
| 38 | * there is a bidirectional RX+TX channel, then just specify | 38 | * there is a bidirectional RX+TX channel, then just specify |
| 39 | * this and leave dma_tx_param set to NULL | 39 | * this and leave dma_tx_param set to NULL |
| 40 | * @dma_tx_param: parameter passed to the DMA allocation | 40 | * @dma_tx_param: parameter passed to the DMA allocation |
| 41 | * filter in order to select an apropriate TX channel. If this | 41 | * filter in order to select an appropriate TX channel. If this |
| 42 | * is NULL the driver will attempt to use the RX channel as a | 42 | * is NULL the driver will attempt to use the RX channel as a |
| 43 | * bidirectional channel | 43 | * bidirectional channel |
| 44 | */ | 44 | */ |
