03ac42c5e3ca6a9bd7fef7e7434a75fe9f0cff95
[firefly-linux-kernel-4.4.55.git] / drivers / staging / olpc_dcon / olpc_dcon.h
1 #ifndef OLPC_DCON_H_
2 #define OLPC_DCON_H_
3
4 /* DCON registers */
5
6 #define DCON_REG_ID              0
7 #define DCON_REG_MODE            1
8
9 #define MODE_PASSTHRU   (1<<0)
10 #define MODE_SLEEP      (1<<1)
11 #define MODE_SLEEP_AUTO (1<<2)
12 #define MODE_BL_ENABLE  (1<<3)
13 #define MODE_BLANK      (1<<4)
14 #define MODE_CSWIZZLE   (1<<5)
15 #define MODE_COL_AA     (1<<6)
16 #define MODE_MONO_LUMA  (1<<7)
17 #define MODE_SCAN_INT   (1<<8)
18 #define MODE_CLOCKDIV   (1<<9)
19 #define MODE_DEBUG      (1<<14)
20 #define MODE_SELFTEST   (1<<15)
21
22 #define DCON_REG_HRES           2
23 #define DCON_REG_HTOTAL         3
24 #define DCON_REG_HSYNC_WIDTH    4
25 #define DCON_REG_VRES           5
26 #define DCON_REG_VTOTAL         6
27 #define DCON_REG_VSYNC_WIDTH    7
28 #define DCON_REG_TIMEOUT        8
29 #define DCON_REG_SCAN_INT       9
30 #define DCON_REG_BRIGHT         10
31
32 /* Status values */
33
34 #define DCONSTAT_SCANINT        0
35 #define DCONSTAT_SCANINT_DCON   1
36 #define DCONSTAT_DISPLAYLOAD    2
37 #define DCONSTAT_MISSED         3
38
39 /* Source values */
40
41 #define DCON_SOURCE_DCON        0
42 #define DCON_SOURCE_CPU         1
43
44 /* Interrupt */
45 #define DCON_IRQ                6
46
47 struct dcon_platform_data {
48         int (*init)(void);
49         void (*bus_stabilize_wiggle)(void);
50         void (*set_dconload)(int);
51         u8 (*read_status)(void);
52 };
53
54 #include <linux/interrupt.h>
55
56 extern int dcon_source;
57 extern int dcon_pending;
58 extern irqreturn_t dcon_interrupt(int irq, void *id);
59 extern struct i2c_driver dcon_driver;
60
61 #ifdef CONFIG_FB_OLPC_DCON_1
62 extern struct dcon_platform_data dcon_pdata_xo_1;
63 #endif
64
65 #ifdef CONFIG_FB_OLPC_DCON_1_5
66 extern struct dcon_platform_data dcon_pdata_xo_1_5;
67 #endif
68
69 #endif