From bdb8bfc652543dc392caa66343fe32cf66c4095b Mon Sep 17 00:00:00 2001 From: Archit Taneja Date: Thu, 12 Sep 2013 18:07:49 +0530 Subject: omapdss: HDMI: Clean up the header files Keep only OMAP4 HDMI core block related structs and enums in ti_hdmi_4xxx_ip.h, move the rest to ti_hdmi.h. This holds all library specific data which will be shared between OMAP4 and OMAP5/DRA7x HDMI encoder drivers. Move the duplicate register read/write/wait_for_bit_change functions in the hdmi library files to ti_hdmi.h Signed-off-by: Archit Taneja Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/hdmi_phy.c | 31 ------ drivers/video/omap2/dss/hdmi_pll.c | 31 ------ drivers/video/omap2/dss/hdmi_wp.c | 31 ------ drivers/video/omap2/dss/ti_hdmi.h | 170 ++++++++++++++++++++++++++++++ drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 31 ------ drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h | 141 +------------------------ 6 files changed, 171 insertions(+), 264 deletions(-) diff --git a/drivers/video/omap2/dss/hdmi_phy.c b/drivers/video/omap2/dss/hdmi_phy.c index 48bdba8..29f7552 100644 --- a/drivers/video/omap2/dss/hdmi_phy.c +++ b/drivers/video/omap2/dss/hdmi_phy.c @@ -9,7 +9,6 @@ */ #include -#include #include #include #include @@ -17,40 +16,10 @@ #include "dss.h" #include "ti_hdmi.h" -#include "ti_hdmi_4xxx_ip.h" #define HDMI_IRQ_LINK_CONNECT (1 << 25) #define HDMI_IRQ_LINK_DISCONNECT (1 << 26) -static inline void hdmi_write_reg(void __iomem *base_addr, const u16 idx, - u32 val) -{ - __raw_writel(val, base_addr + idx); -} - -static inline u32 hdmi_read_reg(void __iomem *base_addr, const u16 idx) -{ - return __raw_readl(base_addr + idx); -} - -#define REG_FLD_MOD(base, idx, val, start, end) \ - hdmi_write_reg(base, idx, FLD_MOD(hdmi_read_reg(base, idx),\ - val, start, end)) -#define REG_GET(base, idx, start, end) \ - FLD_GET(hdmi_read_reg(base, idx), start, end) - -static inline int hdmi_wait_for_bit_change(void __iomem *base_addr, - const u16 idx, int b2, int b1, u32 val) -{ - u32 t = 0; - while (val != REG_GET(base_addr, idx, b2, b1)) { - udelay(1); - if (t++ > 10000) - return !val; - } - return val; -} - void hdmi_phy_dump(struct hdmi_phy_data *phy, struct seq_file *s) { #define DUMPPHY(r) seq_printf(s, "%-35s %08x\n", #r,\ diff --git a/drivers/video/omap2/dss/hdmi_pll.c b/drivers/video/omap2/dss/hdmi_pll.c index e12fa6a..6e187e6 100644 --- a/drivers/video/omap2/dss/hdmi_pll.c +++ b/drivers/video/omap2/dss/hdmi_pll.c @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -18,40 +17,10 @@ #include "dss.h" #include "ti_hdmi.h" -#include "ti_hdmi_4xxx_ip.h" #define HDMI_DEFAULT_REGN 16 #define HDMI_DEFAULT_REGM2 1 -static inline void hdmi_write_reg(void __iomem *base_addr, const u16 idx, - u32 val) -{ - __raw_writel(val, base_addr + idx); -} - -static inline u32 hdmi_read_reg(void __iomem *base_addr, const u16 idx) -{ - return __raw_readl(base_addr + idx); -} - -#define REG_FLD_MOD(base, idx, val, start, end) \ - hdmi_write_reg(base, idx, FLD_MOD(hdmi_read_reg(base, idx),\ - val, start, end)) -#define REG_GET(base, idx, start, end) \ - FLD_GET(hdmi_read_reg(base, idx), start, end) - -static inline int hdmi_wait_for_bit_change(void __iomem *base_addr, - const u16 idx, int b2, int b1, u32 val) -{ - u32 t = 0; - while (val != REG_GET(base_addr, idx, b2, b1)) { - udelay(1); - if (t++ > 10000) - return !val; - } - return val; -} - void hdmi_pll_dump(struct hdmi_pll_data *pll, struct seq_file *s) { #define DUMPPLL(r) seq_printf(s, "%-35s %08x\n", #r,\ diff --git a/drivers/video/omap2/dss/hdmi_wp.c b/drivers/video/omap2/dss/hdmi_wp.c index 1b6dbe10..93039ea 100644 --- a/drivers/video/omap2/dss/hdmi_wp.c +++ b/drivers/video/omap2/dss/hdmi_wp.c @@ -9,7 +9,6 @@ */ #include -#include #include #include #include @@ -17,36 +16,6 @@ #include "dss.h" #include "ti_hdmi.h" -#include "ti_hdmi_4xxx_ip.h" - -static inline void hdmi_write_reg(void __iomem *base_addr, const u16 idx, - u32 val) -{ - __raw_writel(val, base_addr + idx); -} - -static inline u32 hdmi_read_reg(void __iomem *base_addr, const u16 idx) -{ - return __raw_readl(base_addr + idx); -} - -#define REG_FLD_MOD(base, idx, val, start, end) \ - hdmi_write_reg(base, idx, FLD_MOD(hdmi_read_reg(base, idx),\ - val, start, end)) -#define REG_GET(base, idx, start, end) \ - FLD_GET(hdmi_read_reg(base, idx), start, end) - -static inline int hdmi_wait_for_bit_change(void __iomem *base_addr, - const u16 idx, int b2, int b1, u32 val) -{ - u32 t = 0; - while (val != REG_GET(base_addr, idx, b2, b1)) { - udelay(1); - if (t++ > 10000) - return !val; - } - return val; -} void hdmi_wp_dump(struct hdmi_wp_data *wp, struct seq_file *s) { diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h index 107a606..cf096fd 100644 --- a/drivers/video/omap2/dss/ti_hdmi.h +++ b/drivers/video/omap2/dss/ti_hdmi.h @@ -21,7 +21,52 @@ #ifndef _TI_HDMI_H #define _TI_HDMI_H +#include +#include #include +#include