dm table: share target argument parsing functions
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / staging / olpc_dcon / olpc_dcon.h
blob0264c94375aa4fbe7728ffedf45cef9c0c4019e8
1 #ifndef OLPC_DCON_H_
2 #define OLPC_DCON_H_
4 #include <linux/notifier.h>
5 #include <linux/workqueue.h>
7 /* DCON registers */
9 #define DCON_REG_ID 0
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 2
26 #define DCON_REG_HTOTAL 3
27 #define DCON_REG_HSYNC_WIDTH 4
28 #define DCON_REG_VRES 5
29 #define DCON_REG_VTOTAL 6
30 #define DCON_REG_VSYNC_WIDTH 7
31 #define DCON_REG_TIMEOUT 8
32 #define DCON_REG_SCAN_INT 9
33 #define DCON_REG_BRIGHT 10
35 /* Status values */
37 #define DCONSTAT_SCANINT 0
38 #define DCONSTAT_SCANINT_DCON 1
39 #define DCONSTAT_DISPLAYLOAD 2
40 #define DCONSTAT_MISSED 3
42 /* Source values */
44 #define DCON_SOURCE_DCON 0
45 #define DCON_SOURCE_CPU 1
47 /* Interrupt */
48 #define DCON_IRQ 6
50 struct dcon_priv {
51 struct i2c_client *client;
52 struct fb_info *fbinfo;
53 struct backlight_device *bl_dev;
55 struct work_struct switch_source;
56 struct notifier_block reboot_nb;
57 struct notifier_block fbevent_nb;
59 /* Shadow register for the DCON_REG_MODE register */
60 u8 disp_mode;
62 /* The current backlight value - this saves us some smbus traffic */
63 u8 bl_val;
65 /* Current source, initialized at probe time */
66 int curr_src;
68 /* Desired source */
69 int pending_src;
71 /* Variables used during switches */
72 bool switched;
73 struct timespec irq_time;
74 struct timespec load_time;
76 /* Current output type; true == mono, false == color */
77 bool mono;
78 bool asleep;
79 /* This get set while controlling fb blank state from the driver */
80 bool ignore_fb_events;
83 struct dcon_platform_data {
84 int (*init)(struct dcon_priv *);
85 void (*bus_stabilize_wiggle)(void);
86 void (*set_dconload)(int);
87 u8 (*read_status)(void);
90 #include <linux/interrupt.h>
92 extern irqreturn_t dcon_interrupt(int irq, void *id);
94 #ifdef CONFIG_FB_OLPC_DCON_1
95 extern struct dcon_platform_data dcon_pdata_xo_1;
96 #endif
98 #ifdef CONFIG_FB_OLPC_DCON_1_5
99 extern struct dcon_platform_data dcon_pdata_xo_1_5;
100 #endif
102 #endif