aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/amba
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-06-16 05:36:16 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-08-11 10:54:53 -0400
commit046ad6cdeb3f83abcbfa2af88ce471afb2e7fc30 (patch)
tree6b668c3b7b7540c22105bc5fc22d0ef5e13af9fb /include/linux/amba
parent03d14c36af98dd2191c2e35b5ed55ff93b59d345 (diff)
video: ARM CLCD: support Nomadik variant
The Nomadik variant has a few special quirks that need to be respected to make the driver work: - The block need to be clocked during writing of the TIMn registers or the bus will stall. - Special bits in the control register select how many of the output display lines get activated. - Special bits in the control register select how to manage the different 565 and 5551 modes. - There is a packed 24bit graphics mode, i.e 888 pixels can be stored in memory is three consecutive bytes, not evenly aligned to a 32bit word. This patch uses the vendor data pointer from the AMBA matching mechanism to track the quirks for this variant, and adds two hooks that variants can use to initialize boards and panels during start-up. These will later be used to adopt a Nomadik board profile. Cc: Pawel Moll <pawel.moll@arm.com> Cc: Rob Herring <robh@kernel.org> Cc: Russell King <linux@arm.linux.org.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'include/linux/amba')
-rw-r--r--include/linux/amba/clcd.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h
index 8b64ec0d574b..1035879b322c 100644
--- a/include/linux/amba/clcd.h
+++ b/include/linux/amba/clcd.h
@@ -67,6 +67,17 @@
67#define CNTL_LDMAFIFOTIME (1 << 15) 67#define CNTL_LDMAFIFOTIME (1 << 15)
68#define CNTL_WATERMARK (1 << 16) 68#define CNTL_WATERMARK (1 << 16)
69 69
70/* ST Microelectronics variant bits */
71#define CNTL_ST_1XBPP_444 0x0
72#define CNTL_ST_1XBPP_5551 (1 << 17)
73#define CNTL_ST_1XBPP_565 (1 << 18)
74#define CNTL_ST_CDWID_12 0x0
75#define CNTL_ST_CDWID_16 (1 << 19)
76#define CNTL_ST_CDWID_18 (1 << 20)
77#define CNTL_ST_CDWID_24 ((1 << 19)|(1 << 20))
78#define CNTL_ST_CEAEN (1 << 21)
79#define CNTL_ST_LCDBPP24_PACKED (6 << 1)
80
70enum { 81enum {
71 /* individual formats */ 82 /* individual formats */
72 CLCD_CAP_RGB444 = (1 << 0), 83 CLCD_CAP_RGB444 = (1 << 0),
@@ -179,11 +190,38 @@ struct clcd_board {
179struct amba_device; 190struct amba_device;
180struct clk; 191struct clk;
181 192
193/**
194 * struct clcd_vendor_data - holds hardware (IP-block) vendor-specific
195 * variant information
196 *
197 * @clock_timregs: the CLCD needs to be clocked when accessing the
198 * timer registers, or the hardware will hang.
199 * @packed_24_bit_pixels: this variant supports 24bit packed pixel data,
200 * so that RGB accesses 3 bytes at a time, not just on even 32bit
201 * boundaries, packing the pixel data in memory. ST Microelectronics
202 * have this.
203 * @st_bitmux_control: ST Microelectronics have implemented output
204 * bit line multiplexing into the CLCD control register. This indicates
205 * that we need to use this.
206 * @init_board: custom board init function for this variant
207 * @init_panel: custom panel init function for this variant
208 */
209struct clcd_vendor_data {
210 bool clock_timregs;
211 bool packed_24_bit_pixels;
212 bool st_bitmux_control;
213 int (*init_board)(struct amba_device *adev,
214 struct clcd_board *board);
215 int (*init_panel)(struct clcd_fb *fb,
216 struct device_node *panel);
217};
218
182/* this data structure describes each frame buffer device we find */ 219/* this data structure describes each frame buffer device we find */
183struct clcd_fb { 220struct clcd_fb {
184 struct fb_info fb; 221 struct fb_info fb;
185 struct amba_device *dev; 222 struct amba_device *dev;
186 struct clk *clk; 223 struct clk *clk;
224 struct clcd_vendor_data *vendor;
187 struct clcd_panel *panel; 225 struct clcd_panel *panel;
188 struct clcd_board *board; 226 struct clcd_board *board;
189 void *board_data; 227 void *board_data;
@@ -285,6 +323,10 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
285 else 323 else
286 val |= CNTL_LCDBPP16_444; 324 val |= CNTL_LCDBPP16_444;
287 break; 325 break;
326 case 24:
327 /* Modified variant supporting 24 bit packed pixels */
328 val |= CNTL_ST_LCDBPP24_PACKED;
329 break;
288 case 32: 330 case 32:
289 val |= CNTL_LCDBPP24; 331 val |= CNTL_LCDBPP24;
290 break; 332 break;