summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-01-10 02:11:13 +0400
committerAlejandro Mery <amery@geeks.cl>2013-01-14 14:36:05 +0400
commitbc284ccd34c3073657f09e80909c7941a533486c (patch)
treed6f8839847ccd67e2c21cf0166a50d842a02591d
parent5469f00d0ab0b58b6da0b026ad088a33aade79a7 (diff)
downloadlinux-sunxi-bc284ccd34c3073657f09e80909c7941a533486c.tar.xz
sunxi-hdmi: Replace some magic constants with defines
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--drivers/video/sunxi/hdmi/hdmi_core.c7
-rw-r--r--drivers/video/sunxi/hdmi/hdmi_core.h11
-rw-r--r--drivers/video/sunxi/hdmi/hdmi_edid.c2
3 files changed, 12 insertions, 8 deletions
diff --git a/drivers/video/sunxi/hdmi/hdmi_core.c b/drivers/video/sunxi/hdmi/hdmi_core.c
index 417413350f05..2985e90e6fc0 100644
--- a/drivers/video/sunxi/hdmi/hdmi_core.c
+++ b/drivers/video/sunxi/hdmi/hdmi_core.c
@@ -36,7 +36,7 @@ __bool audio_enable = 1;
__s32 video_mode = HDMI720P_50;
HDMI_AUDIO_INFO audio_info;
__u8 EDID_Buf[1024];
-__u8 Device_Support_VIC[512];
+__u8 Device_Support_VIC[HDMI_DEVICE_SUPPORT_VIC_SIZE];
static __s32 HPD;
__u32 hdmi_pll = AW_SYS_CLK_PLL3;
@@ -87,7 +87,7 @@ __s32 hdmi_core_initial(void)
hdmi_state = HDMI_State_Wait_Hpd;
video_mode = HDMI720P_50;
memset(&audio_info, 0, sizeof(HDMI_AUDIO_INFO));
- memset(Device_Support_VIC, 0, sizeof(Device_Support_VIC));
+ memset(Device_Support_VIC, 0, HDMI_DEVICE_SUPPORT_VIC_SIZE);
HDMI_WUINT32(0x004, 0x80000000); /* start hdmi controller */
@@ -343,7 +343,8 @@ __s32 video_config(__s32 vic)
#endif
HDMI_WUINT8(0x086, 0x00);
- HDMI_WUINT8(0x087, (video_timing[vic_tab].VIC >= 256) ?
+ HDMI_WUINT8(0x087, (video_timing[vic_tab].VIC >=
+ HDMI_NON_CEA861D_START) ?
0 : video_timing[vic_tab].VIC);
HDMI_WUINT8(0x088, video_timing[vic_tab].AVI_PR);
HDMI_WUINT8(0x089, 0x00);
diff --git a/drivers/video/sunxi/hdmi/hdmi_core.h b/drivers/video/sunxi/hdmi/hdmi_core.h
index bdb8e6cf1ef7..f8cf67664212 100644
--- a/drivers/video/sunxi/hdmi/hdmi_core.h
+++ b/drivers/video/sunxi/hdmi/hdmi_core.h
@@ -24,6 +24,8 @@
extern void __iomem *HDMI_BASE;
+#define HDMI_DEVICE_SUPPORT_VIC_SIZE 512
+
#define HDMI_State_Wait_Hpd 0x02
#define HDMI_State_Rx_Sense 0x03
#define HDMI_State_EDID_Parse 0x04
@@ -49,9 +51,10 @@ extern void __iomem *HDMI_BASE;
#define HDMI720P_60_3D_FP (HDMI720P_60 + 0x80)
/* Non CEA-861-D modes */
-#define HDMI1360_768_60 256
-#define HDMI1280_1024_60 257
-#define HDMI_EDID 511
+#define HDMI_NON_CEA861D_START 256
+#define HDMI1360_768_60 (HDMI_NON_CEA861D_START + 0)
+#define HDMI1280_1024_60 (HDMI_NON_CEA861D_START + 1)
+#define HDMI_EDID (HDMI_DEVICE_SUPPORT_VIC_SIZE - 1)
#define HDMI_WUINT32(offset, value) writel(value, HDMI_BASE + offset)
#define HDMI_RUINT32(offset) readl(HDMI_BASE + offset)
@@ -103,7 +106,7 @@ void send_ini_sequence(void);
__s32 DDC_Read(char cmd, char pointer, char offset, int nbyte, char *pbuf);
extern __u8 EDID_Buf[1024];
-extern __u8 Device_Support_VIC[512];
+extern __u8 Device_Support_VIC[HDMI_DEVICE_SUPPORT_VIC_SIZE];
extern __bool video_enable;
extern __s32 hdmi_state;
diff --git a/drivers/video/sunxi/hdmi/hdmi_edid.c b/drivers/video/sunxi/hdmi/hdmi_edid.c
index 432d0c762684..5cee38399a48 100644
--- a/drivers/video/sunxi/hdmi/hdmi_edid.c
+++ b/drivers/video/sunxi/hdmi/hdmi_edid.c
@@ -427,7 +427,7 @@ __s32 ParseEDID(void)
pr_info("ParseEDID\n");
- memset(Device_Support_VIC, 0, sizeof(Device_Support_VIC));
+ memset(Device_Support_VIC, 0, HDMI_DEVICE_SUPPORT_VIC_SIZE);
memset(EDID_Buf, 0, sizeof(EDID_Buf));
DDC_Init();