4 #include <linux/notifier.h>
5 #include <linux/workqueue.h>
10 #define DCON_REG_MODE 1
12 #define MODE_PASSTHRU (1<<0)
13 #define MODE_SLEEP (1<<1)
14 #define MODE_SLEEP_AUTO (1<<2)
15 #define MODE_BL_ENABLE (1<<3)
16 #define MODE_BLANK (1<<4)
17 #define MODE_CSWIZZLE (1<<5)
18 #define MODE_COL_AA (1<<6)
19 #define MODE_MONO_LUMA (1<<7)
20 #define MODE_SCAN_INT (1<<8)
21 #define MODE_CLOCKDIV (1<<9)
22 #define MODE_DEBUG (1<<14)
23 #define MODE_SELFTEST (1<<15)
25 #define DCON_REG_HRES 0x2
26 #define DCON_REG_HTOTAL 0x3
27 #define DCON_REG_HSYNC_WIDTH 0x4
28 #define DCON_REG_VRES 0x5
29 #define DCON_REG_VTOTAL 0x6
30 #define DCON_REG_VSYNC_WIDTH 0x7
31 #define DCON_REG_TIMEOUT 0x8
32 #define DCON_REG_SCAN_INT 0x9
33 #define DCON_REG_BRIGHT 0xa
34 #define DCON_REG_MEM_OPT_A 0x41
35 #define DCON_REG_MEM_OPT_B 0x42
37 /* Load Delay Locked Loop (DLL) settings for clock delay */
38 #define MEM_DLL_CLOCK_DELAY (1<<0)
39 /* Memory controller power down function */
40 #define MEM_POWER_DOWN (1<<8)
41 /* Memory controller software reset */
42 #define MEM_SOFT_RESET (1<<0)
46 #define DCONSTAT_SCANINT 0
47 #define DCONSTAT_SCANINT_DCON 1
48 #define DCONSTAT_DISPLAYLOAD 2
49 #define DCONSTAT_MISSED 3
53 #define DCON_SOURCE_DCON 0
54 #define DCON_SOURCE_CPU 1
60 struct i2c_client *client;
61 struct fb_info *fbinfo;
62 struct backlight_device *bl_dev;
64 wait_queue_head_t waitq;
65 struct work_struct switch_source;
66 struct notifier_block reboot_nb;
68 /* Shadow register for the DCON_REG_MODE register */
71 /* The current backlight value - this saves us some smbus traffic */
74 /* Current source, initialized at probe time */
80 /* Variables used during switches */
85 /* Current output type; true == mono, false == color */
88 /* This get set while controlling fb blank state from the driver */
89 bool ignore_fb_events;
92 struct dcon_platform_data {
93 int (*init)(struct dcon_priv *);
94 void (*bus_stabilize_wiggle)(void);
95 void (*set_dconload)(int);
96 int (*read_status)(u8 *);
99 #include <linux/interrupt.h>
101 irqreturn_t dcon_interrupt(int irq, void *id);
103 #ifdef CONFIG_FB_OLPC_DCON_1
104 extern struct dcon_platform_data dcon_pdata_xo_1;
107 #ifdef CONFIG_FB_OLPC_DCON_1_5
108 extern struct dcon_platform_data dcon_pdata_xo_1_5;