diff options
| -rw-r--r-- | drivers/video/fbdev/omap2/dss/Kconfig | 13 | ||||
| -rw-r--r-- | drivers/video/fbdev/omap2/dss/Makefile | 1 | ||||
| -rw-r--r-- | drivers/video/fbdev/omap2/dss/core.c | 6 | ||||
| -rw-r--r-- | drivers/video/fbdev/omap2/dss/dss.h | 3 | ||||
| -rw-r--r-- | drivers/video/fbdev/omap2/dss/hdmi.h | 2 | ||||
| -rw-r--r-- | drivers/video/fbdev/omap2/dss/hdmi5.c | 829 | ||||
| -rw-r--r-- | drivers/video/fbdev/omap2/dss/hdmi5_core.c | 922 | ||||
| -rw-r--r-- | drivers/video/fbdev/omap2/dss/hdmi5_core.h | 306 | ||||
| -rw-r--r-- | drivers/video/fbdev/omap2/dss/hdmi_wp.c | 2 |
9 files changed, 2082 insertions, 2 deletions
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 | |||
| 72 | config OMAP4_DSS_HDMI_AUDIO | 72 | config OMAP4_DSS_HDMI_AUDIO |
| 73 | bool | 73 | bool |
| 74 | 74 | ||
| 75 | config OMAP5_DSS_HDMI | ||
| 76 | bool "HDMI support for OMAP5" | ||
| 77 | default n | ||
| 78 | select OMAP2_DSS_HDMI_COMMON | ||
| 79 | help | ||
| 80 | HDMI Interface for OMAP5 and similar cores. This adds the High | ||
| 81 | Definition Multimedia Interface. See http://www.hdmi.org/ for HDMI | ||
| 82 | specification. | ||
| 83 | |||
| 84 | config OMAP5_DSS_HDMI_AUDIO | ||
| 85 | depends on OMAP5_DSS_HDMI | ||
| 86 | bool | ||
| 87 | |||
| 75 | config OMAP2_DSS_SDI | 88 | config OMAP2_DSS_SDI |
| 76 | bool "SDI support" | 89 | bool "SDI support" |
| 77 | default n | 90 | 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 | |||
| 13 | omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \ | 13 | omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \ |
| 14 | hdmi_phy.o | 14 | hdmi_phy.o |
| 15 | omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o | 15 | omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o |
| 16 | omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o | ||
| 16 | ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG | 17 | 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 = { | |||
| 268 | #ifdef CONFIG_OMAP4_DSS_HDMI | 268 | #ifdef CONFIG_OMAP4_DSS_HDMI |
| 269 | hdmi4_init_platform_driver, | 269 | hdmi4_init_platform_driver, |
| 270 | #endif | 270 | #endif |
| 271 | #ifdef CONFIG_OMAP5_DSS_HDMI | ||
| 272 | hdmi5_init_platform_driver, | ||
| 273 | #endif | ||
| 271 | }; | 274 | }; |
| 272 | 275 | ||
| 273 | static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = { | 276 | static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = { |
| @@ -289,6 +292,9 @@ static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = { | |||
| 289 | #ifdef CONFIG_OMAP4_DSS_HDMI | 292 | #ifdef CONFIG_OMAP4_DSS_HDMI |
| 290 | hdmi4_uninit_platform_driver, | 293 | hdmi4_uninit_platform_driver, |
| 291 | #endif | 294 | #endif |
| 295 | #ifdef CONFIG_OMAP5_DSS_HDMI | ||
| 296 | hdmi5_uninit_platform_driver, | ||
| 297 | #endif | ||
| 292 | }; | 298 | }; |
| 293 | 299 | ||
| 294 | static bool dss_output_drv_loaded[ARRAY_SIZE(dss_output_drv_reg_funcs)]; | 300 | 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; | |||
| 419 | int hdmi4_init_platform_driver(void) __init; | 419 | int hdmi4_init_platform_driver(void) __init; |
| 420 | void hdmi4_uninit_platform_driver(void) __exit; | 420 | void hdmi4_uninit_platform_driver(void) __exit; |
| 421 | 421 | ||
| 422 | int hdmi5_init_platform_driver(void) __init; | ||
| 423 | void hdmi5_uninit_platform_driver(void) __exit; | ||
| 424 | |||
| 422 | /* RFBI */ | 425 | /* RFBI */ |
| 423 | int rfbi_init_platform_driver(void) __init; | 426 | int rfbi_init_platform_driver(void) __init; |
| 424 | void rfbi_uninit_platform_driver(void) __exit; | 427 | 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); | |||
| 431 | int hdmi_parse_lanes_of(struct platform_device *pdev, struct device_node *ep, | 431 | int hdmi_parse_lanes_of(struct platform_device *pdev, struct device_node *ep, |
| 432 | struct hdmi_phy_data *phy); | 432 | struct hdmi_phy_data *phy); |
| 433 | 433 | ||
| 434 | #if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) | 434 | #if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) |
| 435 | int hdmi_compute_acr(u32 pclk, u32 sample_freq, u32 *n, u32 *cts); | 435 | int hdmi_compute_acr(u32 pclk, u32 sample_freq, u32 *n, u32 *cts); |
| 436 | int hdmi_wp_audio_enable(struct hdmi_wp_data *wp, bool enable); | 436 | int hdmi_wp_audio_enable(struct hdmi_wp_data *wp, bool enable); |
| 437 | int hdmi_wp_audio_core_req_enable(struct hdmi_wp_data *wp, bool enable); | 437 | 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 @@ | |||
| 1 | /* | ||
| 2 | * HDMI driver for OMAP5 | ||
| 3 | * | ||
| 4 | * Copyright (C) 2014 Texas Instruments Incorporated | ||
| 5 | * | ||
| 6 | * Authors: | ||
| 7 | * Yong Zhi | ||
| 8 | * Mythri pk | ||
| 9 | * Archit Taneja <archit@ti.com> | ||
| 10 | * Tomi Valkeinen <tomi.valkeinen@ti.com> | ||
| 11 | * | ||
| 12 | * This program is free software; you can redistribute it and/or modify it | ||
| 13 | * under the terms of the GNU General Public License version 2 as published by | ||
| 14 | * the Free Software Foundation. | ||
| 15 | * | ||
| 16 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 18 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 19 | * more details. | ||
| 20 | * | ||
| 21 | * You should have received a copy of the GNU General Public License along with | ||
| 22 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 23 | */ | ||
| 24 | |||
| 25 | #define DSS_SUBSYS_NAME "HDMI" | ||
| 26 | |||
| 27 | #include <linux/kernel.h> | ||
| 28 | #include <linux/module.h> | ||
| 29 | #include <linux/err.h> | ||
| 30 | #include <linux/io.h> | ||
| 31 | #include <linux/interrupt.h> | ||
| 32 | #include <linux/mutex.h> | ||
| 33 | #include <linux/delay.h> | ||
| 34 | #include <linux/string.h> | ||
| 35 | #include <linux/platform_device.h> | ||
| 36 | #include <linux/pm_runtime.h> | ||
| 37 | #include <linux/clk.h> | ||
| 38 | #include <linux/gpio.h> | ||
| 39 | #include <linux/regulator/consumer.h> | ||
| 40 | #include <video/omapdss.h> | ||
| 41 | |||
| 42 | #include "hdmi5_core.h" | ||
| 43 | #include "dss.h" | ||
| 44 | #include "dss_features.h" | ||
| 45 | |||
| 46 | static struct { | ||
| 47 | struct mutex lock; | ||
| 48 | struct platform_device *pdev; | ||
| 49 | |||
| 50 | struct hdmi_wp_data wp; | ||
| 51 | struct hdmi_pll_data pll; | ||
| 52 | struct hdmi_phy_data phy; | ||
| 53 | struct hdmi_core_data core; | ||
| 54 | |||
| 55 | struct hdmi_config cfg; | ||
| 56 | |||
| 57 | struct clk *sys_clk; | ||
| 58 | struct regulator *vdda_reg; | ||
| 59 | |||
| 60 | bool core_enabled; | ||
| 61 | |||
| 62 | struct omap_dss_device output; | ||
| 63 | } hdmi; | ||
| 64 | |||
| 65 | static int hdmi_runtime_get(void) | ||
| 66 | { | ||
| 67 | int r; | ||
| 68 | |||
| 69 | DSSDBG("hdmi_runtime_get\n"); | ||
| 70 | |||
| 71 | r = pm_runtime_get_sync(&hdmi.pdev->dev); | ||
| 72 | WARN_ON(r < 0); | ||
| 73 | if (r < 0) | ||
| 74 | return r; | ||
| 75 | |||
| 76 | return 0; | ||
| 77 | } | ||
| 78 | |||
| 79 | static void hdmi_runtime_put(void) | ||
| 80 | { | ||
| 81 | int r; | ||
| 82 | |||
| 83 | DSSDBG("hdmi_runtime_put\n"); | ||
| 84 | |||
| 85 | r = pm_runtime_put_sync(&hdmi.pdev->dev); | ||
| 86 | WARN_ON(r < 0 && r != -ENOSYS); | ||
| 87 | } | ||
| 88 | |||
| 89 | static irqreturn_t hdmi_irq_handler(int irq, void *data) | ||
| 90 | { | ||
| 91 | struct hdmi_wp_data *wp = data; | ||
| 92 | u32 irqstatus; | ||
| 93 | |||
