Merge branch 'develop' of 10.10.10.29:/home/rockchip/kernel into develop
[firefly-linux-kernel-4.4.55.git] / include / linux / hdmi.h
1 /* include/linux/hdmi.h\r
2  *\r
3  * This program is free software; you can redistribute it and/or modify\r
4  * it under the terms of the GNU General Public License version 2 as\r
5  * published by the Free Software Foundation.\r
6  *\r
7 */\r
8 \r
9 #ifndef __LINUX_HDMI_CORE_H\r
10 #define __LINUX_HDMI_CORE_H\r
11 \r
12 #include <linux/device.h>\r
13 #include <linux/workqueue.h>\r
14 #include <linux/i2c.h>\r
15 #include <linux/completion.h>\r
16 \r
17 \r
18 \r
19 #ifdef CONFIG_HDMI_DEBUG\r
20 #define hdmi_dbg(dev, format, arg...)           \\r
21         dev_printk(KERN_INFO , dev , format , ## arg)\r
22 #else\r
23 #define hdmi_dbg(dev, format, arg...)   \r
24 #endif\r
25 \r
26 \r
27 \r
28 typedef int             BOOL;\r
29 \r
30 #define TRUE            1\r
31 #define FALSE           0\r
32 /* resolution */\r
33 #define HDMI_1280x720p_50Hz     0\r
34 #define HDMI_1280x720p_60Hz             1\r
35 #define HDMI_720x576p_50Hz              2\r
36 #define HDMI_1920x1080p_50Hz    3\r
37 /* HDMI default resolution */\r
38 #define HDMI_DEFAULT_RESOLUTION HDMI_1280x720p_50Hz\r
39 /* I2S Fs */\r
40 #define HDMI_I2S_Fs_44100 0\r
41 #define HDMI_I2S_Fs_48000 2\r
42 /* I2S default sample rate */\r
43 #define HDMI_I2S_DEFAULT_Fs HDMI_I2S_Fs_44100\r
44 \r
45 \r
46 #define HDMI_MAX_ID             32\r
47 \r
48 \r
49 struct hdmi {\r
50         struct device *dev;\r
51         struct work_struct changed_work;\r
52         int id;\r
53         int wait;\r
54         BOOL display_on;\r
55         BOOL plug;\r
56         BOOL auto_switch;\r
57         BOOL hdcp_on;\r
58         BOOL param_conf;\r
59 \r
60         u8 resolution;\r
61         u8 audio_fs;\r
62 \r
63         void *priv;\r
64 \r
65         struct completion       complete;\r
66 \r
67         int (*hdmi_display_on)(struct hdmi *);\r
68         int (*hdmi_display_off)(struct hdmi *);\r
69         int (*hdmi_set_param)(struct hdmi *);\r
70         int (*hdmi_core_init)(struct hdmi *);\r
71 };\r
72 \r
73 extern void *hdmi_get_privdata(struct hdmi *hdmi);\r
74 extern void hdmi_set_privdata(struct hdmi *hdmi, void *data);\r
75 extern int hdmi_register(struct device *parent, struct hdmi *hdmi);\r
76 extern void hdmi_unregister(struct hdmi *hdmi);\r
77 extern void hdmi_changed(struct hdmi *hdmi, int plug);\r
78 \r
79 extern int hdmi_codec_set_audio_fs(unsigned char audio_fs);\r
80 extern int hdmi_fb_set_resolution(unsigned char resolution);\r
81 \r
82 extern int hdmi_switch_fb(struct hdmi *hdmi, int type);\r
83 extern int hdmi_resolution_changed(struct hdmi *hdmi, int xres, int yres, int video_on);\r
84 \r
85 extern struct hdmi *get_hdmi_struct(int nr);\r
86 \r
87 #endif\r