From mboxrd@z Thu Jan 1 00:00:00 1970 From: Archit Taneja Date: Thu, 17 Oct 2013 11:38:41 +0000 Subject: [PATCH 5/6] omapdss: hdmi: add OMAP5/DRA7x hdmi driver Message-Id: <1382009202-18984-6-git-send-email-archit@ti.com> List-Id: References: <1382009202-18984-1-git-send-email-archit@ti.com> In-Reply-To: <1382009202-18984-1-git-send-email-archit@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: tomi.valkeinen@ti.com Cc: linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, Archit Taneja The HDMI IP on OMAP5/DRA7x has a different core sub block compared to the one one OMAP4. The rest of the IPs are the same. Add a hdmi5 platform driver which calls hdmi5_core.c apis. The rest of the driver uses the same api's for wrapper, pll and phy, and the common helper funcs for timings. Signed-off-by: Archit Taneja --- drivers/video/omap2/dss/Kconfig | 10 + drivers/video/omap2/dss/Makefile | 2 + drivers/video/omap2/dss/core.c | 6 + drivers/video/omap2/dss/dss.h | 3 + drivers/video/omap2/dss/hdmi.h | 2 +- drivers/video/omap2/dss/hdmi5.c | 699 ++++++++++++++++++++++++++++++++++++++ drivers/video/omap2/dss/hdmi_wp.c | 2 +- 7 files changed, 722 insertions(+), 2 deletions(-) create mode 100644 drivers/video/omap2/dss/hdmi5.c diff --git a/drivers/video/omap2/dss/Kconfig b/drivers/video/omap2/dss/Kconfig index dde4281..a00932f 100644 --- a/drivers/video/omap2/dss/Kconfig +++ b/drivers/video/omap2/dss/Kconfig @@ -69,6 +69,16 @@ config OMAP4_DSS_HDMI config OMAP4_DSS_HDMI_AUDIO bool +config OMAP5_DSS_HDMI + bool "OMAP5 HDMI support" + default y + help + HDMI Interface for OMAP5 and SoCs containing the same HDMI core IP. + +config OMAP5_DSS_HDMI_AUDIO + depends on OMAP5_DSS_HDMI + bool + config OMAP2_DSS_SDI bool "SDI support" default n diff --git a/drivers/video/omap2/dss/Makefile b/drivers/video/omap2/dss/Makefile index d3aa91b..89d83be 100644 --- a/drivers/video/omap2/dss/Makefile +++ b/drivers/video/omap2/dss/Makefile @@ -12,4 +12,6 @@ omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi_common.o hdmi_wp.o hdmi_pll.o \ hdmi_phy.o hdmi4_core.o +omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi_common.o hdmi_wp.o hdmi_pll.o \ + hdmi_phy.o hdmi5_core.o ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index ffa45c8..6b74f73 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -268,6 +268,9 @@ static int (*dss_output_drv_reg_funcs[])(void) __initdata = { #ifdef CONFIG_OMAP4_DSS_HDMI hdmi4_init_platform_driver, #endif +#ifdef CONFIG_OMAP5_DSS_HDMI + hdmi5_init_platform_driver, +#endif }; static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = { @@ -289,6 +292,9 @@ static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = { #ifdef CONFIG_OMAP4_DSS_HDMI hdmi4_uninit_platform_driver, #endif +#ifdef CONFIG_OMAP5_DSS_HDMI + hdmi5_uninit_platform_driver, +#endif }; static bool dss_output_drv_loaded[ARRAY_SIZE(dss_output_drv_reg_funcs)]; diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index f777962..bb8a39c 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -430,6 +430,9 @@ void venc_uninit_platform_driver(void) __exit; int hdmi4_init_platform_driver(void) __init; void hdmi4_uninit_platform_driver(void) __exit; +int hdmi5_init_platform_driver(void) __init; +void hdmi5_uninit_platform_driver(void) __exit; + /* RFBI */ int rfbi_init_platform_driver(void) __init; void rfbi_uninit_platform_driver(void) __exit; diff --git a/drivers/video/omap2/dss/hdmi.h b/drivers/video/omap2/dss/hdmi.h index 8fa2121..2b2db2d 100644 --- a/drivers/video/omap2/dss/hdmi.h +++ b/drivers/video/omap2/dss/hdmi.h @@ -429,7 +429,7 @@ const struct hdmi_config *hdmi_default_timing(void); const struct hdmi_config *hdmi_get_timings(int mode, int code); struct hdmi_cm hdmi_get_code(struct omap_video_timings *timing); -#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) int hdmi_compute_acr(u32 pclk, u32 sample_freq, u32 *n, u32 *cts); int hdmi_wp_audio_enable(struct hdmi_wp_data *wp, bool enable); int hdmi_wp_audio_core_req_enable(struct hdmi_wp_data *wp, bool enable); diff --git a/drivers/video/omap2/dss/hdmi5.c b/drivers/video/omap2/dss/hdmi5.c new file mode 100644 index 0000000..5a1cfd6 --- /dev/null +++ b/drivers/video/omap2/dss/hdmi5.c @@ -0,0 +1,699 @@ +/* + * hdmi.c + * + * HDMI interface DSS driver setting for TI's OMAP4 family of processor. + * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/ + * Authors: Yong Zhi + * Mythri pk + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +#define DSS_SUBSYS_NAME "HDMI" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include