Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
olpc_dcon.h
Go to the documentation of this file.
1 #ifndef OLPC_DCON_H_
2 #define OLPC_DCON_H_
3 
4 #include <linux/notifier.h>
5 #include <linux/workqueue.h>
6 
7 /* DCON registers */
8 
9 #define DCON_REG_ID 0
10 #define DCON_REG_MODE 1
11 
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)
24 
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
34 
35 /* Status values */
36 
37 #define DCONSTAT_SCANINT 0
38 #define DCONSTAT_SCANINT_DCON 1
39 #define DCONSTAT_DISPLAYLOAD 2
40 #define DCONSTAT_MISSED 3
41 
42 /* Source values */
43 
44 #define DCON_SOURCE_DCON 0
45 #define DCON_SOURCE_CPU 1
46 
47 /* Interrupt */
48 #define DCON_IRQ 6
49 
50 struct dcon_priv {
51  struct i2c_client *client;
52  struct fb_info *fbinfo;
54 
58 
59  /* Shadow register for the DCON_REG_MODE register */
61 
62  /* The current backlight value - this saves us some smbus traffic */
64 
65  /* Current source, initialized at probe time */
66  int curr_src;
67 
68  /* Desired source */
70 
71  /* Variables used during switches */
72  bool switched;
75 
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 */
81 };
82 
84  int (*init)(struct dcon_priv *);
88 };
89 
90 #include <linux/interrupt.h>
91 
92 extern irqreturn_t dcon_interrupt(int irq, void *id);
93 
94 #ifdef CONFIG_FB_OLPC_DCON_1
96 #endif
97 
98 #ifdef CONFIG_FB_OLPC_DCON_1_5
100 #endif
101 
102 #endif