1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/notifier.h>
6 #include <linux/workqueue.h>
11 #define DCON_REG_MODE 1
13 #define MODE_PASSTHRU BIT(0)
14 #define MODE_SLEEP BIT(1)
15 #define MODE_SLEEP_AUTO BIT(2)
16 #define MODE_BL_ENABLE BIT(3)
17 #define MODE_BLANK BIT(4)
18 #define MODE_CSWIZZLE BIT(5)
19 #define MODE_COL_AA BIT(6)
20 #define MODE_MONO_LUMA BIT(7)
21 #define MODE_SCAN_INT BIT(8)
22 #define MODE_CLOCKDIV BIT(9)
23 #define MODE_DEBUG BIT(14)
24 #define MODE_SELFTEST BIT(15)
26 #define DCON_REG_HRES 0x2
27 #define DCON_REG_HTOTAL 0x3
28 #define DCON_REG_HSYNC_WIDTH 0x4
29 #define DCON_REG_VRES 0x5
30 #define DCON_REG_VTOTAL 0x6
31 #define DCON_REG_VSYNC_WIDTH 0x7
32 #define DCON_REG_TIMEOUT 0x8
33 #define DCON_REG_SCAN_INT 0x9
34 #define DCON_REG_BRIGHT 0xa
35 #define DCON_REG_MEM_OPT_A 0x41
36 #define DCON_REG_MEM_OPT_B 0x42
38 /* Load Delay Locked Loop (DLL) settings for clock delay */
39 #define MEM_DLL_CLOCK_DELAY BIT(0)
40 /* Memory controller power down function */
41 #define MEM_POWER_DOWN BIT(8)
42 /* Memory controller software reset */
43 #define MEM_SOFT_RESET BIT(0)
47 #define DCONSTAT_SCANINT 0
48 #define DCONSTAT_SCANINT_DCON 1
49 #define DCONSTAT_DISPLAYLOAD 2
50 #define DCONSTAT_MISSED 3
54 #define DCON_SOURCE_DCON 0
55 #define DCON_SOURCE_CPU 1
61 struct i2c_client *client;
62 struct fb_info *fbinfo;
63 struct backlight_device *bl_dev;
65 wait_queue_head_t waitq;
66 struct work_struct switch_source;
67 struct notifier_block reboot_nb;
69 /* Shadow register for the DCON_REG_MODE register */
72 /* The current backlight value - this saves us some smbus traffic */
75 /* Current source, initialized at probe time */
81 /* Variables used during switches */
86 /* Current output type; true == mono, false == color */
89 /* This get set while controlling fb blank state from the driver */
90 bool ignore_fb_events;
93 struct dcon_platform_data {
94 int (*init)(struct dcon_priv *dcon);
95 void (*bus_stabilize_wiggle)(void);
96 void (*set_dconload)(int load);
97 int (*read_status)(u8 *status);
105 #include <linux/interrupt.h>
107 irqreturn_t dcon_interrupt(int irq, void *id);
109 extern struct dcon_platform_data dcon_pdata_xo_1;
110 extern struct dcon_platform_data dcon_pdata_xo_1_5;