提交 d34d59bd 编写于 作者: S Sachin Kamat 提交者: Inki Dae

drm/exynos: Convert to use the standard hdmi.h header

Remove local definitions and use the ones provided by hdmi.h.
Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: NInki Dae <inki.dae@samsung.com>
上级 4fe25b82
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/hdmi.h>
#include <drm/exynos_drm.h> #include <drm/exynos_drm.h>
...@@ -59,19 +60,6 @@ ...@@ -59,19 +60,6 @@
#define HDMI_AUI_VERSION 0x01 #define HDMI_AUI_VERSION 0x01
#define HDMI_AUI_LENGTH 0x0A #define HDMI_AUI_LENGTH 0x0A
/* HDMI infoframe to configure HDMI out packet header, AUI and AVI */
enum HDMI_PACKET_TYPE {
/* refer to Table 5-8 Packet Type in HDMI specification v1.4a */
/* InfoFrame packet type */
HDMI_PACKET_TYPE_INFOFRAME = 0x80,
/* Vendor-Specific InfoFrame */
HDMI_PACKET_TYPE_VSI = HDMI_PACKET_TYPE_INFOFRAME + 1,
/* Auxiliary Video information InfoFrame */
HDMI_PACKET_TYPE_AVI = HDMI_PACKET_TYPE_INFOFRAME + 2,
/* Audio information InfoFrame */
HDMI_PACKET_TYPE_AUI = HDMI_PACKET_TYPE_INFOFRAME + 4
};
enum hdmi_type { enum hdmi_type {
HDMI_TYPE13, HDMI_TYPE13,
HDMI_TYPE14, HDMI_TYPE14,
...@@ -379,12 +367,6 @@ static const struct hdmiphy_config hdmiphy_v14_configs[] = { ...@@ -379,12 +367,6 @@ static const struct hdmiphy_config hdmiphy_v14_configs[] = {
}, },
}; };
struct hdmi_infoframe {
enum HDMI_PACKET_TYPE type;
u8 ver;
u8 len;
};
static inline u32 hdmi_reg_read(struct hdmi_context *hdata, u32 reg_id) static inline u32 hdmi_reg_read(struct hdmi_context *hdata, u32 reg_id)
{ {
return readl(hdata->regs + reg_id); return readl(hdata->regs + reg_id);
...@@ -682,7 +664,7 @@ static u8 hdmi_chksum(struct hdmi_context *hdata, ...@@ -682,7 +664,7 @@ static u8 hdmi_chksum(struct hdmi_context *hdata,
} }
static void hdmi_reg_infoframe(struct hdmi_context *hdata, static void hdmi_reg_infoframe(struct hdmi_context *hdata,
struct hdmi_infoframe *infoframe) union hdmi_infoframe *infoframe)
{ {
u32 hdr_sum; u32 hdr_sum;
u8 chksum; u8 chksum;
...@@ -700,13 +682,15 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata, ...@@ -700,13 +682,15 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata,
return; return;
} }
switch (infoframe->type) { switch (infoframe->any.type) {
case HDMI_PACKET_TYPE_AVI: case HDMI_INFOFRAME_TYPE_AVI:
hdmi_reg_writeb(hdata, HDMI_AVI_CON, HDMI_AVI_CON_EVERY_VSYNC); hdmi_reg_writeb(hdata, HDMI_AVI_CON, HDMI_AVI_CON_EVERY_VSYNC);
hdmi_reg_writeb(hdata, HDMI_AVI_HEADER0, infoframe->type); hdmi_reg_writeb(hdata, HDMI_AVI_HEADER0, infoframe->any.type);
hdmi_reg_writeb(hdata, HDMI_AVI_HEADER1, infoframe->ver); hdmi_reg_writeb(hdata, HDMI_AVI_HEADER1,
hdmi_reg_writeb(hdata, HDMI_AVI_HEADER2, infoframe->len); infoframe->any.version);
hdr_sum = infoframe->type + infoframe->ver + infoframe->len; hdmi_reg_writeb(hdata, HDMI_AVI_HEADER2, infoframe->any.length);
hdr_sum = infoframe->any.type + infoframe->any.version +
infoframe->any.length;
/* Output format zero hardcoded ,RGB YBCR selection */ /* Output format zero hardcoded ,RGB YBCR selection */
hdmi_reg_writeb(hdata, HDMI_AVI_BYTE(1), 0 << 5 | hdmi_reg_writeb(hdata, HDMI_AVI_BYTE(1), 0 << 5 |
...@@ -722,18 +706,20 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata, ...@@ -722,18 +706,20 @@ static void hdmi_reg_infoframe(struct hdmi_context *hdata,
hdmi_reg_writeb(hdata, HDMI_AVI_BYTE(4), vic); hdmi_reg_writeb(hdata, HDMI_AVI_BYTE(4), vic);
chksum = hdmi_chksum(hdata, HDMI_AVI_BYTE(1), chksum = hdmi_chksum(hdata, HDMI_AVI_BYTE(1),
infoframe->len, hdr_sum); infoframe->any.length, hdr_sum);
DRM_DEBUG_KMS("AVI checksum = 0x%x\n", chksum); DRM_DEBUG_KMS("AVI checksum = 0x%x\n", chksum);
hdmi_reg_writeb(hdata, HDMI_AVI_CHECK_SUM, chksum); hdmi_reg_writeb(hdata, HDMI_AVI_CHECK_SUM, chksum);
break; break;
case HDMI_PACKET_TYPE_AUI: case HDMI_INFOFRAME_TYPE_AUDIO:
hdmi_reg_writeb(hdata, HDMI_AUI_CON, 0x02); hdmi_reg_writeb(hdata, HDMI_AUI_CON, 0x02);
hdmi_reg_writeb(hdata, HDMI_AUI_HEADER0, infoframe->type); hdmi_reg_writeb(hdata, HDMI_AUI_HEADER0, infoframe->any.type);
hdmi_reg_writeb(hdata, HDMI_AUI_HEADER1, infoframe->ver); hdmi_reg_writeb(hdata, HDMI_AUI_HEADER1,
hdmi_reg_writeb(hdata, HDMI_AUI_HEADER2, infoframe->len); infoframe->any.version);
hdr_sum = infoframe->type + infoframe->ver + infoframe->len; hdmi_reg_writeb(hdata, HDMI_AUI_HEADER2, infoframe->any.length);
hdr_sum = infoframe->any.type + infoframe->any.version +
infoframe->any.length;
chksum = hdmi_chksum(hdata, HDMI_AUI_BYTE(1), chksum = hdmi_chksum(hdata, HDMI_AUI_BYTE(1),
infoframe->len, hdr_sum); infoframe->any.length, hdr_sum);
DRM_DEBUG_KMS("AUI checksum = 0x%x\n", chksum); DRM_DEBUG_KMS("AUI checksum = 0x%x\n", chksum);
hdmi_reg_writeb(hdata, HDMI_AUI_CHECK_SUM, chksum); hdmi_reg_writeb(hdata, HDMI_AUI_CHECK_SUM, chksum);
break; break;
...@@ -985,7 +971,7 @@ static void hdmi_conf_reset(struct hdmi_context *hdata) ...@@ -985,7 +971,7 @@ static void hdmi_conf_reset(struct hdmi_context *hdata)
static void hdmi_conf_init(struct hdmi_context *hdata) static void hdmi_conf_init(struct hdmi_context *hdata)
{ {
struct hdmi_infoframe infoframe; union hdmi_infoframe infoframe;
/* disable HPD interrupts from HDMI IP block, use GPIO instead */ /* disable HPD interrupts from HDMI IP block, use GPIO instead */
hdmi_reg_writemask(hdata, HDMI_INTC_CON, 0, HDMI_INTC_EN_GLOBAL | hdmi_reg_writemask(hdata, HDMI_INTC_CON, 0, HDMI_INTC_EN_GLOBAL |
...@@ -1021,14 +1007,14 @@ static void hdmi_conf_init(struct hdmi_context *hdata) ...@@ -1021,14 +1007,14 @@ static void hdmi_conf_init(struct hdmi_context *hdata)
hdmi_reg_writeb(hdata, HDMI_V13_AUI_CON, 0x02); hdmi_reg_writeb(hdata, HDMI_V13_AUI_CON, 0x02);
hdmi_reg_writeb(hdata, HDMI_V13_ACR_CON, 0x04); hdmi_reg_writeb(hdata, HDMI_V13_ACR_CON, 0x04);
} else { } else {
infoframe.type = HDMI_PACKET_TYPE_AVI; infoframe.any.type = HDMI_INFOFRAME_TYPE_AVI;
infoframe.ver = HDMI_AVI_VERSION; infoframe.any.version = HDMI_AVI_VERSION;
infoframe.len = HDMI_AVI_LENGTH; infoframe.any.length = HDMI_AVI_LENGTH;
hdmi_reg_infoframe(hdata, &infoframe); hdmi_reg_infoframe(hdata, &infoframe);
infoframe.type = HDMI_PACKET_TYPE_AUI; infoframe.any.type = HDMI_INFOFRAME_TYPE_AUDIO;
infoframe.ver = HDMI_AUI_VERSION; infoframe.any.version = HDMI_AUI_VERSION;
infoframe.len = HDMI_AUI_LENGTH; infoframe.any.length = HDMI_AUI_LENGTH;
hdmi_reg_infoframe(hdata, &infoframe); hdmi_reg_infoframe(hdata, &infoframe);
/* enable AVI packet every vsync, fixes purple line problem */ /* enable AVI packet every vsync, fixes purple line problem */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册