From f5bab22291908dc395c018f12c8485ef5fc9b90a Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 13 Mar 2014 12:44:14 +0200 Subject: [PATCH] OMAPDSS: HDMI: Add OMAP5 HDMI support This adds a new driver to omapdss for OMAP5 HDMI. However, the new driver uses common HDMI files which are shared with OMAP4 HDMI driver. OMAP5 HDMI has a different HDMI core IP compared to OMAP4, but has very similar PLL and PHY IPs which can be handled with common code. Signed-off-by: Tomi Valkeinen --- drivers/video/fbdev/omap2/dss/Kconfig | 13 + drivers/video/fbdev/omap2/dss/Makefile | 1 + drivers/video/fbdev/omap2/dss/core.c | 6 + drivers/video/fbdev/omap2/dss/dss.h | 3 + drivers/video/fbdev/omap2/dss/hdmi.h | 2 +- drivers/video/fbdev/omap2/dss/hdmi5.c | 829 ++++++++++++++++++ drivers/video/fbdev/omap2/dss/hdmi5_core.c | 922 +++++++++++++++++++++ drivers/video/fbdev/omap2/dss/hdmi5_core.h | 306 +++++++ drivers/video/fbdev/omap2/dss/hdmi_wp.c | 2 +- 9 files changed, 2082 insertions(+), 2 deletions(-) create mode 100644 drivers/video/fbdev/omap2/dss/hdmi5.c create mode 100644 drivers/video/fbdev/omap2/dss/hdmi5_core.c create mode 100644 drivers/video/fbdev/omap2/dss/hdmi5_core.h diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig index 36de3d5d2896..8921a7a76a15 100644 --- a/drivers/video/fbdev/omap2/dss/Kconfig +++ b/drivers/video/fbdev/omap2/dss/Kconfig @@ -72,6 +72,19 @@ config OMAP4_DSS_HDMI config OMAP4_DSS_HDMI_AUDIO bool +config OMAP5_DSS_HDMI + bool "HDMI support for OMAP5" + default n + select OMAP2_DSS_HDMI_COMMON + help + HDMI Interface for OMAP5 and similar cores. This adds the High + Definition Multimedia Interface. See http://www.hdmi.org/ for HDMI + specification. + +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/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile index 4cbe7ce406f9..390ab746bdc0 100644 --- a/drivers/video/fbdev/omap2/dss/Makefile +++ b/drivers/video/fbdev/omap2/dss/Makefile @@ -13,4 +13,5 @@ omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \ hdmi_phy.o omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o +omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG diff --git a/drivers/video/fbdev/omap2/dss/core.c b/drivers/video/fbdev/omap2/dss/core.c index ffa45c894cd4..6b74f73fb524 100644 --- a/drivers/video/fbdev/omap2/dss/core.c +++ b/drivers/video/fbdev/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/fbdev/omap2/dss/dss.h b/drivers/video/fbdev/omap2/dss/dss.h index 560078fcb198..8ff22c134c62 100644 --- a/drivers/video/fbdev/omap2/dss/dss.h +++ b/drivers/video/fbdev/omap2/dss/dss.h @@ -419,6 +419,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/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h index 1819f93cd49e..fbee07816337 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi.h +++ b/drivers/video/fbdev/omap2/dss/hdmi.h @@ -431,7 +431,7 @@ struct hdmi_cm hdmi_get_code(struct omap_video_timings *timing); int hdmi_parse_lanes_of(struct platform_device *pdev, struct device_node *ep, struct hdmi_phy_data *phy); -#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/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c new file mode 100644 index 000000000000..c468b9e1f295 --- /dev/null +++ b/drivers/video/fbdev/omap2/dss/hdmi5.c @@ -0,0 +1,829 @@ +/* + * HDMI driver for OMAP5 + * + * Copyright (C) 2014 Texas Instruments Incorporated + * + * Authors: + * Yong Zhi + * Mythri pk + * Archit Taneja + * Tomi Valkeinen + * + * 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