OMAP4 : DSS2 : HDMI support
Subsystems (4)
v2 cover OMAP4 : DSS2 : HDMI support
Adding HDMI support to OMAP4.
HDMI is a driver that is similar to the VENC or the DSI driver to support HDMI/DVI sink device.
The current design adheres to the DSS2 architecture.
It is split into the HDMI DSS driver and HDMI panel driver.
HDMI DSS driver (hdmi.c) is responsible for
1.OMAP related configuration such as
1.Listening to the DSS_HDMI irq which signals changes such as hot-plug
detect,physical attach/detach.
2.calculate the PLL values based on the TV resolution that is selected 3.configuration of the Mux/GPIO settings.
2.HDMI configuration based on the parameters read from the EDID of the sink device such as:
1. Configuration of the PHY registers.
2. Configuration of the PLL registers and setting of the TMDS clock.
3. Configuration of the DDC to read the EDID data when available.
4. Configuration of the core registers to set:
a. set the video registers to the timing and format that
is selected.
b. set the audio registers based on the EDID value read and
user selected parameters.
c. Set the AVI info frame registers to configure the auxilary
info frame which are repeated.
HDMI Panel Driver (hdmi_omap4_panel.c) . This is a panel driver which acts as the controlling device which synchronizes the audio and video portion of the driver.[enable ,disable , notification to audio on suspend etc].
It registers hdmi driver to the omap_dss bus and calls the functionality of the HDMI DSS driver.
It is also provides the interface for users
1.To read the EDID contents and also confiure the timings based on EDID. 2.To configure AVI Inforframe based on the the EDID(sink capability).
Note : Mux handling with hwmod is dependent on pm_runtime_sync ,so mux with hwmod will be posted once patch series with pm_runtime_sync is done.
verified on 4430 SDP ES2.1 - Penguins on HDMI and DVI TV. verified on PANDA ES2.1 - Penguins on HDMI and DVI TV.
1. v10 of omap2,3 hwmod DSS adaptation:
http://www.mail-archive.com/[email protected]/msg42914.html
2. v3 of OMAP2PLUS: DSS: Generalize clock names
http://www.mail-archive.com/[email protected]/msg43338.html
3. v3 of OMAP4: hwmod DSS support:
http://www.mail-archive.com/[email protected]/msg43177.html
4. OMAP: DSS2: Adding dss_features for independent core clk divider
https://patchwork.kernel.org/patch/529561/
5. OMAP2PLUS-DSS2-Make-members-of-dss_clk_source-generic
Changes from V1:
1. HDMI to call dss_get_dispc_clock_source instead of directly setting register.
2. All HDMI enumerators are added HDMI prefix.
3. Fixed the mutex position.
Mythri P K (8):
OMAP4 : DSS2 : Add display type HDMI to DSS2
OMAP4 : DSS2 : HDMI: HDMI specific display controller and dss change. OMAP4 : DSS2 : HDMI: HDMI driver header file addition OMAP4 : DSS2 : HDMI: HDMI driver addition in the DSS drivers
interface
OMAP4 : DSS2 : HDMI: HDMI panel driver addition in the DSS OMAP4 : DSS : HDMI: Call to HDMI module init to register driver. OMAP4 : HDMI : Add HDMI structure in the board file for OMAP4 SDP OMAP4 : HDMI : Add HDMI structure in the board file for OMAP4 PANDA
arch/arm/mach-omap2/board-4430sdp.c | 75 ++ arch/arm/mach-omap2/board-omap4panda.c | 74 ++ arch/arm/plat-omap/include/plat/display.h | 1 + drivers/video/omap2/dss/Kconfig | 16 + drivers/video/omap2/dss/Makefile | 2 + drivers/video/omap2/dss/core.c | 8 + drivers/video/omap2/dss/dispc.c | 5 + drivers/video/omap2/dss/display.c | 8 + drivers/video/omap2/dss/dss.c | 5 + drivers/video/omap2/dss/dss.h | 38 + drivers/video/omap2/dss/dss_features.c | 2 +- drivers/video/omap2/dss/hdmi.c | 1332 ++++++++++++++++++++++++++++ drivers/video/omap2/dss/hdmi.h | 602 +++++++++++++ drivers/video/omap2/dss/hdmi_omap4_panel.c | 189 ++++ drivers/video/omap2/dss/manager.c | 9 +- drivers/video/omap2/dss/overlay.c | 6 +- 16 files changed, 2367 insertions(+), 5 deletions(-) create mode 100644 drivers/video/omap2/dss/hdmi.c create mode 100644 drivers/video/omap2/dss/hdmi.h create mode 100644 drivers/video/omap2/dss/hdmi_omap4_panel.c
PATCH v2 1/8 OMAP4 : DSS2 : Add display type HDMI to DSS2
Adding HDMI type in dss_features , overlay and
the manager so that HDMI type of display will be recognized.
--- arch/arm/plat-omap/include/plat/display.h | 1 + drivers/video/omap2/dss/display.c | 5 +++++ drivers/video/omap2/dss/dss_features.c | 2 +- drivers/video/omap2/dss/manager.c | 9 +++++++-- drivers/video/omap2/dss/overlay.c | 6 ++++-- 5 files changed, 18 insertions(+), 5 deletions(-)
arch/arm/plat-omap/include/plat/display.h +1 -0
@@ -60,6 +60,7 @@ enum omap_display_type {OMAP_DISPLAY_TYPE_SDI =1 <<2 ,OMAP_DISPLAY_TYPE_DSI =1 <<3 ,OMAP_DISPLAY_TYPE_VENC =1 <<4 , + OMAP_DISPLAY_TYPE_HDMI = 1 << 5, }; enum omap_plane {
drivers/video/omap2/dss/display.c +5 -0
@@ -345,6 +345,7 @@ int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev)return 16 ;case OMAP_DISPLAY_TYPE_VENC :case OMAP_DISPLAY_TYPE_SDI : +case OMAP_DISPLAY_TYPE_HDMI :return 24 ;default :BUG ();
@@ -371,6 +372,7 @@ bool dss_use_replication(struct omap_dss_device *dssdev,case OMAP_DISPLAY_TYPE_DPI : bpp = dssdev->phy.dpi.data_lines;break ; +case OMAP_DISPLAY_TYPE_HDMI :case OMAP_DISPLAY_TYPE_VENC :case OMAP_DISPLAY_TYPE_SDI : bpp =24 ;
@@ -409,6 +411,9 @@ void dss_init_device(struct platform_device *pdev,#ifdef CONFIG_OMAP2_DSS_VENC case OMAP_DISPLAY_TYPE_VENC :#endif +#ifdef CONFIG_OMAP2_DSS_HDMI +case OMAP_DISPLAY_TYPE_HDMI : +#endif break ;default : DSSERR("Support for display '%s' not compiled in.\n",
drivers/video/omap2/dss/dss_features.c +1 -1
@@ -102,7 +102,7 @@ static const enum omap_display_type omap4_dss_supported_displays[] = {OMAP_DISPLAY_TYPE_DBI |OMAP_DISPLAY_TYPE_DSI ,/* OMAP_DSS_CHANNEL_DIGIT */ -OMAP_DISPLAY_TYPE_VENC , +OMAP_DISPLAY_TYPE_VENC |OMAP_DISPLAY_TYPE_HDMI ,/* OMAP_DSS_CHANNEL_LCD2 */ OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI |
drivers/video/omap2/dss/manager.c +7 -2
@@ -516,6 +516,8 @@ static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)if (mgr->device->type ==OMAP_DISPLAY_TYPE_VENC ) { irq =DISPC_IRQ_EVSYNC_ODD ; + }else if (mgr->device->type ==OMAP_DISPLAY_TYPE_HDMI ) { + irq =DISPC_IRQ_EVSYNC_EVEN ; }else {if (mgr->id ==OMAP_DSS_CHANNEL_LCD ) irq =DISPC_IRQ_VSYNC ;
@@ -537,7 +539,8 @@ static int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)if (!dssdev || dssdev->state !=OMAP_DSS_DISPLAY_ACTIVE )return 0 ; -if (dssdev->type ==OMAP_DISPLAY_TYPE_VENC ) { +if (dssdev->type ==OMAP_DISPLAY_TYPE_VENC + || dssdev->type ==OMAP_DISPLAY_TYPE_HDMI ) { irq =DISPC_IRQ_EVSYNC_ODD |DISPC_IRQ_EVSYNC_EVEN ; }else {if (dssdev->caps &OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE ) {
@@ -614,7 +617,8 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)if (!dssdev || dssdev->state !=OMAP_DSS_DISPLAY_ACTIVE )return 0 ; -if (dssdev->type ==OMAP_DISPLAY_TYPE_VENC ) { +if (dssdev->type ==OMAP_DISPLAY_TYPE_VENC + || dssdev->type ==OMAP_DISPLAY_TYPE_HDMI ) { irq =DISPC_IRQ_EVSYNC_ODD |DISPC_IRQ_EVSYNC_EVEN ; }else {if (dssdev->caps &OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE ) {
@@ -1381,6 +1385,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)case OMAP_DISPLAY_TYPE_DBI :case OMAP_DISPLAY_TYPE_SDI :case OMAP_DISPLAY_TYPE_VENC : +case OMAP_DISPLAY_TYPE_HDMI :default_get_overlay_fifo_thresholds (ovl->id, size, &oc->burst_size, &oc->fifo_low, &oc->fifo_high);
drivers/video/omap2/dss/overlay.c +4 -2
@@ -737,7 +737,8 @@ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force) lcd2_mgr->set_device (lcd2_mgr, dssdev); mgr = lcd2_mgr; } - }else if (dssdev->type !=OMAP_DISPLAY_TYPE_VENC ) { + }else if (dssdev->type !=OMAP_DISPLAY_TYPE_VENC + && dssdev->type !=OMAP_DISPLAY_TYPE_HDMI ) {if (!lcd_mgr->device || force) {if (lcd_mgr->device) lcd_mgr->unset_device (lcd_mgr);
@@ -746,7 +747,8 @@ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force) } } -if (dssdev->type ==OMAP_DISPLAY_TYPE_VENC ) { +if (dssdev->type ==OMAP_DISPLAY_TYPE_VENC + || dssdev->type ==OMAP_DISPLAY_TYPE_HDMI ) {if (!tv_mgr->device || force) {if (tv_mgr->device) tv_mgr->unset_device (tv_mgr);
Signature · 1 line
1.5.6.3
PATCH v2 2/8 OMAP4 : DSS2 : HDMI: HDMI specific display controller and dss change.
In reply to Mythri P KAdding changes to set gamma table bit for TV interface and function to select between VENC and HDMI.
--- drivers/video/omap2/dss/dispc.c | 5 +++++ drivers/video/omap2/dss/dss.c | 5 +++++ drivers/video/omap2/dss/dss.h | 7 +++++++ 3 files changed, 17 insertions(+), 0 deletions(-)
drivers/video/omap2/dss/dispc.c +5 -0
@@ -1224,6 +1224,11 @@ void dispc_enable_zorder(enum omap_plane plane, bool enable)dispc_write_reg (dispc_reg_att[plane], val); } +void dispc_enable_gamma_table (bool enable) +{ +REG_FLD_MOD (DISPC_CONFIG , enable,9 ,9 ); +} +static void _dispc_set_vid_color_conv (enum omap_plane plane,bool enable) {u32 val;
drivers/video/omap2/dss/dss.c +5 -0
@@ -559,6 +559,11 @@ void dss_set_dac_pwrdn_bgz(bool enable)REG_FLD_MOD (DSS_CONTROL , enable,5 ,5 );/* DAC Power-Down Control */ } +void dss_select_hdmi_venc (enum dss_hdmi_venc_select hdmi) +{ +REG_FLD_MOD (DSS_CONTROL , hdmi,15 ,15 );/* 0x1 for HDMI, 0x0 VENC */ +} +static int dss_init (bool skip_init) {int r;
drivers/video/omap2/dss/dss.h +7 -0
@@ -123,6 +123,11 @@ enum dss_clk_source { DSS_SRC_DSS1_ALWON_FCLK, }; +enum dss_hdmi_venc_select { +DSS_VENC_SELECT ,/* Select VENC */ +DSS_HDMI_SELECT ,/* Select HDMI */ +}; +struct dss_clock_info {/* rates that we get with dividers below */ unsigned long fck;
@@ -209,6 +214,7 @@ void dss_recheck_connections(struct omap_dss_device *dssdev, bool force);int dss_init_platform_driver (void );void dss_uninit_platform_driver (void ); +void dss_select_hdmi_venc (enum dss_hdmi_venc_select hdmi);void dss_save_context (void );void dss_restore_context (void );void dss_clk_enable (enum dss_clock clks);
@@ -352,6 +358,7 @@ void dispc_set_plane_pos(enum omap_plane plane, u16 x, u16 y);void dispc_set_plane_size (enum omap_plane plane,u16 width,u16 height);void dispc_set_channel_out (enum omap_plane plane,enum omap_channel channel_out); +void dispc_enable_gamma_table (bool enable); int dispc_setup_plane(enum omap_plane plane, u32 paddr, u16 screen_width,
Signature · 1 line
1.5.6.3
PATCH v2 3/8 OMAP4 : DSS2 : HDMI: HDMI driver header file addition
In reply to Mythri P KAdding the hdmi interface driver header file (hdmi.h) to the dss driver. Register and timing declaration to be used by the corresponding c file is added in this file.
--- drivers/video/omap2/dss/hdmi.h | 597 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 597 insertions(+), 0 deletions(-) create mode 100644 drivers/video/omap2/dss/hdmi.h
drivers/video/omap2/dss/hdmi.h new file +597 -0
@@ -0,0 +1,597 @@ +/* +* hdmi.h +* +* HDMI driver definition for TI OMAP4 processors. +* +* Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/ +* +* 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 <http://www.gnu.org/licenses/>. +*/ + +#ifndef _OMAP4_DSS_HDMI_H_ +#define _OMAP4_DSS_HDMI_H_ + +#include <linux/string.h> +#include <plat/display.h> + +#define HDMI_WP 0x0 +#define HDMI_CORE_SYS 0x400 +#define HDMI_CORE_AV 0x900 +#define HDMI_PLLCTRL 0x200 +#define HDMI_PHY 0x300 + +struct hdmi_reg {u16 idx; }; + +#define HDMI_REG (idx) ((const struct hdmi_reg) { idx }) + +/* HDMI Wrapper */ +#define HDMI_WP_REG (idx) HDMI_REG(HDMI_WP + idx) + +#define HDMI_WP_REVISION HDMI_WP_REG(0x0) +#define HDMI_WP_SYSCONFIG HDMI_WP_REG(0x10) +#define HDMI_WP_IRQSTATUS_RAW HDMI_WP_REG(0x24) +#define HDMI_WP_IRQSTATUS HDMI_WP_REG(0x28) +#define HDMI_WP_PWR_CTRL HDMI_WP_REG(0x40) +#define HDMI_WP_IRQENABLE_SET HDMI_WP_REG(0x2C) +#define HDMI_WP_VIDEO_CFG HDMI_WP_REG(0x50) +#define HDMI_WP_VIDEO_SIZE HDMI_WP_REG(0x60) +#define HDMI_WP_VIDEO_TIMING_H HDMI_WP_REG(0x68) +#define HDMI_WP_VIDEO_TIMING_V HDMI_WP_REG(0x6C) +#define HDMI_WP_WP_CLK HDMI_WP_REG(0x70) + +/* HDMI IP Core System */ +#define HDMI_CORE_SYS_REG (idx) HDMI_REG(HDMI_CORE_SYS + idx) + +#define HDMI_CORE_SYS_VND_IDL HDMI_CORE_SYS_REG(0x0) +#define HDMI_CORE_SYS_DEV_IDL HDMI_CORE_SYS_REG(0x8) +#define HDMI_CORE_SYS_DEV_IDH HDMI_CORE_SYS_REG(0xC) +#define HDMI_CORE_SYS_DEV_REV HDMI_CORE_SYS_REG(0x10) +#define HDMI_CORE_SYS_SRST HDMI_CORE_SYS_REG(0x14) +#define HDMI_CORE_CTRL1 HDMI_CORE_SYS_REG(0x20) +#define HDMI_CORE_SYS_SYS_STAT HDMI_CORE_SYS_REG(0x24) +#define HDMI_CORE_SYS_VID_ACEN HDMI_CORE_SYS_REG(0x124) +#define HDMI_CORE_SYS_VID_MODE HDMI_CORE_SYS_REG(0x128) +#define HDMI_CORE_SYS_INTR_STATE HDMI_CORE_SYS_REG(0x1C0) +#define HDMI_CORE_SYS_INTR1 HDMI_CORE_SYS_REG(0x1C4) +#define HDMI_CORE_SYS_INTR2 HDMI_CORE_SYS_REG(0x1C8) +#define HDMI_CORE_SYS_INTR3 HDMI_CORE_SYS_REG(0x1CC) +#define HDMI_CORE_SYS_INTR4 HDMI_CORE_SYS_REG(0x1D0) +#define HDMI_CORE_SYS_UMASK1 HDMI_CORE_SYS_REG(0x1D4) +#define HDMI_CORE_SYS_TMDS_CTRL HDMI_CORE_SYS_REG(0x208) +#define HDMI_CORE_SYS_DE_DLY HDMI_CORE_SYS_REG(0xC8) +#define HDMI_CORE_SYS_DE_CTRL HDMI_CORE_SYS_REG(0xCC) +#define HDMI_CORE_SYS_DE_TOP HDMI_CORE_SYS_REG(0xD0) +#define HDMI_CORE_SYS_DE_CNTL HDMI_CORE_SYS_REG(0xD8) +#define HDMI_CORE_SYS_DE_CNTH HDMI_CORE_SYS_REG(0xDC) +#define HDMI_CORE_SYS_DE_LINL HDMI_CORE_SYS_REG(0xE0) +#define HDMI_CORE_SYS_DE_LINH_1 HDMI_CORE_SYS_REG(0xE4) +#define HDMI_CORE_CTRL1_VEN_FOLLOWVSYNC 0x1 +#define HDMI_CORE_CTRL1_HEN_FOLLOWHSYNC 0x1 +#define HDMI_CORE_CTRL1_BSEL_24BITBUS 0x1 +#define HDMI_CORE_CTRL1_EDGE_RISINGEDGE 0x1 + +/* HDMI DDC E-DID */ +#define HDMI_CORE_DDC_CMD HDMI_CORE_SYS_REG(0x3CC) +#define HDMI_CORE_DDC_STATUS HDMI_CORE_SYS_REG(0x3C8) +#define HDMI_CORE_DDC_ADDR HDMI_CORE_SYS_REG(0x3B4) +#define HDMI_CORE_DDC_OFFSET HDMI_CORE_SYS_REG(0x3BC) +#define HDMI_CORE_DDC_COUNT1 HDMI_CORE_SYS_REG(0x3C0) +#define HDMI_CORE_DDC_COUNT2 HDMI_CORE_SYS_REG(0x3C4) +#define HDMI_CORE_DDC_DATA HDMI_CORE_SYS_REG(0x3D0) +#define HDMI_CORE_DDC_SEGM HDMI_CORE_SYS_REG(0x3B8) + +/* HDMI IP Core Audio Video */ +#define HDMI_CORE_AV_REG (idx) HDMI_REG(HDMI_CORE_AV + idx) + +#define HDMI_CORE_AV_HDMI_CTRL HDMI_CORE_AV_REG(0xBC) +#define HDMI_CORE_AV_DPD HDMI_CORE_AV_REG(0xF4) +#define HDMI_CORE_AV_PB_CTRL1 HDMI_CORE_AV_REG(0xF8) +#define HDMI_CORE_AV_PB_CTRL2 HDMI_CORE_AV_REG(0xFC) +#define HDMI_CORE_AV_AVI_TYPE HDMI_CORE_AV_REG(0x100) +#define HDMI_CORE_AV_AVI_VERS HDMI_CORE_AV_REG(0x104) +#define HDMI_CORE_AV_AVI_LEN HDMI_CORE_AV_REG(0x108) +#define HDMI_CORE_AV_AVI_CHSUM HDMI_CORE_AV_REG(0x10C) +#define HDMI_CORE_AV_AVI_DBYTE (n) HDMI_CORE_AV_REG(n * 4 + 0x110) +#define HDMI_CORE_AV_AVI_DBYTE_NELEMS HDMI_CORE_AV_REG(15) +#define HDMI_CORE_AV_SPD_DBYTE HDMI_CORE_AV_REG(0x190) +#define HDMI_CORE_AV_SPD_DBYTE_NELEMS HDMI_CORE_AV_REG(27) +#define HDMI_CORE_AV_MPEG_DBYTE HDMI_CORE_AV_REG(0x290) +#define HDMI_CORE_AV_MPEG_DBYTE_NELEMS HDMI_CORE_AV_REG(27) +#define HDMI_CORE_AV_GEN_DBYTE HDMI_CORE_AV_REG(0x300) +#define HDMI_CORE_AV_GEN_DBYTE_NELEMS HDMI_CORE_AV_REG(31) +#define HDMI_CORE_AV_GEN2_DBYTE HDMI_CORE_AV_REG(0x380) +#define HDMI_CORE_AV_GEN2_DBYTE_NELEMS HDMI_CORE_AV_REG(31) +#define HDMI_CORE_AV_ACR_CTRL HDMI_CORE_AV_REG(0x4) +#define HDMI_CORE_AV_FREQ_SVAL HDMI_CORE_AV_REG(0x8) +#define HDMI_CORE_AV_N_SVAL1 HDMI_CORE_AV_REG(0xC) +#define HDMI_CORE_AV_N_SVAL2 HDMI_CORE_AV_REG(0x10) +#define HDMI_CORE_AV_N_SVAL3 HDMI_CORE_AV_REG(0x14) +#define HDMI_CORE_AV_CTS_SVAL1 HDMI_CORE_AV_REG(0x18) +#define HDMI_CORE_AV_CTS_SVAL2 HDMI_CORE_AV_REG(0x1C) +#define HDMI_CORE_AV_CTS_SVAL3 HDMI_CORE_AV_REG(0x20) +#define HDMI_CORE_AV_CTS_HVAL1 HDMI_CORE_AV_REG(0x24) +#define HDMI_CORE_AV_CTS_HVAL2 HDMI_CORE_AV_REG(0x28) +#define HDMI_CORE_AV_CTS_HVAL3 HDMI_CORE_AV_REG(0x2C) +#define HDMI_CORE_AV_AUD_MODE HDMI_CORE_AV_REG(0x50) +#define HDMI_CORE_AV_SPDIF_CTRL HDMI_CORE_AV_REG(0x54) +#define HDMI_CORE_AV_HW_SPDIF_FS HDMI_CORE_AV_REG(0x60) +#define HDMI_CORE_AV_SWAP_I2S HDMI_CORE_AV_REG(0x64) +#define HDMI_CORE_AV_SPDIF_ERTH HDMI_CORE_AV_REG(0x6C) +#define HDMI_CORE_AV_I2S_IN_MAP HDMI_CORE_AV_REG(0x70) +#define HDMI_CORE_AV_I2S_IN_CTRL HDMI_CORE_AV_REG(0x74) +#define HDMI_CORE_AV_I2S_CHST0 HDMI_CORE_AV_REG(0x78) +#define HDMI_CORE_AV_I2S_CHST1 HDMI_CORE_AV_REG(0x7C) +#define HDMI_CORE_AV_I2S_CHST2 HDMI_CORE_AV_REG(0x80) +#define HDMI_CORE_AV_I2S_CHST4 HDMI_CORE_AV_REG(0x84) +#define HDMI_CORE_AV_I2S_CHST5 HDMI_CORE_AV_REG(0x88) +#define HDMI_CORE_AV_ASRC HDMI_CORE_AV_REG(0x8C) +#define HDMI_CORE_AV_I2S_IN_LEN HDMI_CORE_AV_REG(0x90) +#define HDMI_CORE_AV_HDMI_CTRL HDMI_CORE_AV_REG(0xBC) +#define HDMI_CORE_AV_AUDO_TXSTAT HDMI_CORE_AV_REG(0xC0) +#define HDMI_CORE_AV_AUD_PAR_BUSCLK_1 HDMI_CORE_AV_REG(0xCC) +#define HDMI_CORE_AV_AUD_PAR_BUSCLK_2 HDMI_CORE_AV_REG(0xD0) +#define HDMI_CORE_AV_AUD_PAR_BUSCLK_3 HDMI_CORE_AV_REG(0xD4) +#define HDMI_CORE_AV_TEST_TXCTRL HDMI_CORE_AV_REG(0xF0) +#define HDMI_CORE_AV_DPD HDMI_CORE_AV_REG(0xF4) +#define HDMI_CORE_AV_PB_CTRL1 HDMI_CORE_AV_REG(0xF8) +#define HDMI_CORE_AV_PB_CTRL2 HDMI_CORE_AV_REG(0xFC) +#define HDMI_CORE_AV_AVI_TYPE HDMI_CORE_AV_REG(0x100) +#define HDMI_CORE_AV_AVI_VERS HDMI_CORE_AV_REG(0x104) +#define HDMI_CORE_AV_AVI_LEN HDMI_CORE_AV_REG(0x108) +#define HDMI_CORE_AV_AVI_CHSUM HDMI_CORE_AV_REG(0x10C) +#define HDMI_CORE_AV_SPD_TYPE HDMI_CORE_AV_REG(0x180) +#define HDMI_CORE_AV_SPD_VERS HDMI_CORE_AV_REG(0x184) +#define HDMI_CORE_AV_SPD_LEN HDMI_CORE_AV_REG(0x188) +#define HDMI_CORE_AV_SPD_CHSUM HDMI_CORE_AV_REG(0x18C) +#define HDMI_CORE_AV_MPEG_TYPE HDMI_CORE_AV_REG(0x280) +#define HDMI_CORE_AV_MPEG_VERS HDMI_CORE_AV_REG(0x284) +#define HDMI_CORE_AV_MPEG_LEN HDMI_CORE_AV_REG(0x288) +#define HDMI_CORE_AV_MPEG_CHSUM HDMI_CORE_AV_REG(0x28C) +#define HDMI_CORE_AV_CP_BYTE1 HDMI_CORE_AV_REG(0x37C) +#define HDMI_CORE_AV_CEC_ADDR_ID HDMI_CORE_AV_REG(0x3FC) +#define HDMI_CORE_AV_SPD_DBYTE_ELSIZE 0x4 +#define HDMI_CORE_AV_GEN2_DBYTE_ELSIZE 0x4 +#define HDMI_CORE_AV_MPEG_DBYTE_ELSIZE 0x4 +#define HDMI_CORE_AV_GEN_DBYTE_ELSIZE 0x4 + +/* PLL */ +#define HDMI_PLL_REG (idx) HDMI_REG(HDMI_PLLCTRL + idx) + +#define PLLCTRL_PLL_CONTROL HDMI_PLL_REG(0x0) +#define PLLCTRL_PLL_STATUS HDMI_PLL_REG(0x4) +#define PLLCTRL_PLL_GO HDMI_PLL_REG(0x8) +#define PLLCTRL_CFG1 HDMI_PLL_REG(0xC) +#define PLLCTRL_CFG2 HDMI_PLL_REG(0x10) +#define PLLCTRL_CFG3 HDMI_PLL_REG(0x14) +#define PLLCTRL_CFG4 HDMI_PLL_REG(0x20) + +/* HDMI PHY */ +#define HDMI_PHY_REG (idx) HDMI_REG(HDMI_PHY + idx) + +#define HDMI_TXPHY_TX_CTRL HDMI_PHY_REG(0x0) +#define HDMI_TXPHY_DIGITAL_CTRL HDMI_PHY_REG(0x4) +#define HDMI_TXPHY_POWER_CTRL HDMI_PHY_REG(0x8) +#define HDMI_TXPHY_PAD_CFG_CTRL HDMI_PHY_REG(0xC) + +/* HDMI EDID Length */ +#define HDMI_EDID_MAX_LENGTH 256 +#define EDID_TIMING_DESCRIPTOR_SIZE 0x12 +#define EDID_DESCRIPTOR_BLOCK0_ADDRESS 0x36 +#define EDID_DESCRIPTOR_BLOCK1_ADDRESS 0x80 +#define EDID_SIZE_BLOCK0_TIMING_DESCRIPTOR 4 +#define EDID_SIZE_BLOCK1_TIMING_DESCRIPTOR 4 + +#define OMAP_HDMI_TIMINGS_NB 34 + +#define REG_FLD_MOD (idx, val, start, end) \ + hdmi_write_reg(idx, FLD_MOD(hdmi_read_reg(idx), val, start, end)) +#define REG_GET (idx, start, end) \ + FLD_GET(hdmi_read_reg(idx), start, end) + +/* HDMI timing structure */ +struct hdmi_timings { +struct omap_video_timings timings; +int vsync_pol; +int hsync_pol; +}; + +enum hdmi_phypwr { +HDMI_PHYPWRCMD_OFF =0 , +HDMI_PHYPWRCMD_LDOON =1 , +HDMI_PHYPWRCMD_TXON =2 +}; + +enum hdmi_pll_pwr { +HDMI_PLLPWRCMD_ALLOFF =0 , +HDMI_PLLPWRCMD_PLLONLY =1 , +HDMI_PLLPWRCMD_BOTHON_ALLCLKS =2 , +HDMI_PLLPWRCMD_BOTHON_NOPHYCLK =3 +}; + +enum hdmi_core_inputbus_width { +HDMI_INPUT_8BIT =0 , +HDMI_INPUT_10BIT =1 , +HDMI_INPUT_12BIT =2 +}; + +enum hdmi_core_dither_trunc { +HDMI_OUTPUTTRUNCATION_8BIT =0 , +HDMI_OUTPUTTRUNCATION_10BIT =1 , +HDMI_OUTPUTTRUNCATION_12BIT =2 , +HDMI_OUTPUTDITHER_8BIT =3 , +HDMI_OUTPUTDITHER_10BIT =4 , +HDMI_OUTPUTDITHER_12BIT =5 +}; + +enum hdmi_core_deepcolor_ed { +HDMI_DEEPCOLORPACKECTDISABLE =0 , +HDMI_DEEPCOLORPACKECTENABLE =1 +}; + +enum hdmi_core_packet_mode { +HDMI_PACKETMODERESERVEDVALUE =0 , +HDMI_PACKETMODE24BITPERPIXEL =4 , +HDMI_PACKETMODE30BITPERPIXEL =5 , +HDMI_PACKETMODE36BITPERPIXEL =6 , +HDMI_PACKETMODE48BITPERPIXEL =7 +}; + +enum hdmi_core_hdmi_dvi { +HDMI_DVI =0 , +HDMI_HDMI =1 +}; + +enum hdmi_core_tclkselclkmult { +HDMI_FPLL05IDCK =0 , +HDMI_FPLL10IDCK =1 , +HDMI_FPLL20IDCK =2 , +HDMI_FPLL40IDCK =3 +}; + +enum hdmi_core_fs { +HDMI_FS_32000 =0 , +HDMI_FS_44100 =1 +}; + +enum hdmi_core_layout { +HDMI_LAYOUT_2CH =0 , +HDMI_LAYOUT_8CH =1 +}; + +enum hdmi_core_cts_mode { +HDMI_CTS_MODE_HW =0 , +HDMI_CTS_MODE_SW =1 +}; + +enum hdmi_core_packet_ctrl { +HDMI_PACKETENABLE =1 , +HDMI_PACKETDISABLE =0 , +HDMI_PACKETREPEATON =1 , +HDMI_PACKETREPEATOFF =0 +}; + +/* INFOFRAME_AVI_ definitions */ +enum hdmi_core_infoframe { +HDMI_INFOFRAME_AVI_DB1Y_RGB =0 , +HDMI_INFOFRAME_AVI_DB1Y_YUV422 =1 , +HDMI_INFOFRAME_AVI_DB1Y_YUV444 =2 , +HDMI_INFOFRAME_AVI_DB1A_ACTIVE_FORMAT_OFF =0 , +HDMI_INFOFRAME_AVI_DB1A_ACTIVE_FORMAT_ON =1 , +HDMI_INFOFRAME_AVI_DB1B_NO =0 , +HDMI_INFOFRAME_AVI_DB1B_VERT =1 , +HDMI_INFOFRAME_AVI_DB1B_HORI =2 , +HDMI_INFOFRAME_AVI_DB1B_VERTHORI =3 , +HDMI_INFOFRAME_AVI_DB1S_0 =0 , +HDMI_INFOFRAME_AVI_DB1S_1 =1 , +HDMI_INFOFRAME_AVI_DB1S_2 =2 , +HDMI_INFOFRAME_AVI_DB2C_NO =0 , +HDMI_INFOFRAME_AVI_DB2C_ITU601 =1 , +HDMI_INFOFRAME_AVI_DB2C_ITU709 =2 , +HDMI_INFOFRAME_AVI_DB2C_EC_EXTENDED =3 , +HDMI_INFOFRAME_AVI_DB2M_NO =0 , +HDMI_INFOFRAME_AVI_DB2M_43 =1 , +HDMI_INFOFRAME_AVI_DB2M_169 =2 , +HDMI_INFOFRAME_AVI_DB2R_SAME =8 , +HDMI_INFOFRAME_AVI_DB2R_43 =9 , +HDMI_INFOFRAME_AVI_DB2R_169 =10 , +HDMI_INFOFRAME_AVI_DB2R_149 =11 , +HDMI_INFOFRAME_AVI_DB3ITC_NO =0 , +HDMI_INFOFRAME_AVI_DB3ITC_YES =1 , +HDMI_INFOFRAME_AVI_DB3EC_XVYUV601 =0 , +HDMI_INFOFRAME_AVI_DB3EC_XVYUV709 =1 , +HDMI_INFOFRAME_AVI_DB3Q_DEFAULT =0 , +HDMI_INFOFRAME_AVI_DB3Q_LR =1 , +HDMI_INFOFRAME_AVI_DB3Q_FR =2 , +HDMI_INFOFRAME_AVI_DB3SC_NO =0 , +HDMI_INFOFRAME_AVI_DB3SC_HORI =1 , +HDMI_INFOFRAME_AVI_DB3SC_VERT =2 , +HDMI_INFOFRAME_AVI_DB3SC_HORIVERT =3 , +HDMI_INFOFRAME_AVI_DB5PR_NO =0 , +HDMI_INFOFRAME_AVI_DB5PR_2 =1 , +HDMI_INFOFRAME_AVI_DB5PR_3 =2 , +HDMI_INFOFRAME_AVI_DB5PR_4 =3 , +HDMI_INFOFRAME_AVI_DB5PR_5 =4 , +HDMI_INFOFRAME_AVI_DB5PR_6 =5 , +HDMI_INFOFRAME_AVI_DB5PR_7 =6 , +HDMI_INFOFRAME_AVI_DB5PR_8 =7 , +HDMI_INFOFRAME_AVI_DB5PR_9 =8 , +HDMI_INFOFRAME_AVI_DB5PR_10 =9 +}; + +enum hdmi_stereo_channel { +HDMI_STEREO_NOCHANNEL =0 , +HDMI_STEREO_ONECHANNELS =1 , +HDMI_STEREO_TWOCHANNELS =2 , +HDMI_STEREO_THREECHANNELS =3 , +HDMI_STEREO_FOURCHANNELS =4 +}; + +enum hdmi_cea_code { +HDMI_CEA_CODE_00 =0x0 , +HDMI_CEA_CODE_01 =0x1 , +HDMI_CEA_CODE_02 =0x2 , +HDMI_CEA_CODE_03 =0x3 , +HDMI_CEA_CODE_04 =0x4 , +HDMI_CEA_CODE_05 =0x5 , +HDMI_CEA_CODE_06 =0x6 , +HDMI_CEA_CODE_07 =0x7 , +HDMI_CEA_CODE_08 =0x8 , +HDMI_CEA_CODE_09 =0x9 , +HDMI_CEA_CODE_0A =0xA , +HDMI_CEA_CODE_0B =0xB , +HDMI_CEA_CODE_0C =0xC , +HDMI_CEA_CODE_0D =0xD , +HDMI_CEA_CODE_0E =0xE , +HDMI_CEA_CODE_0F =0xF , +HDMI_CEA_CODE_10 =0x10 , +HDMI_CEA_CODE_11 =0x11 , +HDMI_CEA_CODE_12 =0x12 , +HDMI_CEA_CODE_13 =0x13 , +HDMI_CEA_CODE_14 =0x14 , +HDMI_CEA_CODE_15 =0x15 , +HDMI_CEA_CODE_16 =0x16 , +HDMI_CEA_CODE_17 =0x17 , +HDMI_CEA_CODE_18 =0x18 , +HDMI_CEA_CODE_19 =0x19 , +HDMI_CEA_CODE_1A =0x1A , +HDMI_CEA_CODE_1B =0x1B , +HDMI_CEA_CODE_1C =0x1C , +HDMI_CEA_CODE_1D =0x1D , +HDMI_CEA_CODE_1E =0x1E , +HDMI_CEA_CODE_1F =0x1F , +HDMI_CEA_CODE_20 =0x20 , +HDMI_CEA_CODE_21 =0x21 , +HDMI_CEA_CODE_22 =0x22 , +HDMI_CEA_CODE_23 =0x23 , +HDMI_CEA_CODE_24 =0x24 , +HDMI_CEA_CODE_25 =0x25 , +HDMI_CEA_CODE_26 =0x26 +}; + +enum hdmi_iec_format { +HDMI_AUDIO_FORMAT_LPCM =0 , +HDMI_AUDIO_FORMAT_IEC =1 +}; + +enum hdmi_audio_justify { +HDMI_AUDIO_JUSTIFY_LEFT =0 , +HDMI_AUDIO_JUSTIFY_RIGHT =1 +}; + +enum hdmi_sample_order { +HDMI_SAMPLE_RIGHT_FIRST =0 , +HDMI_SAMPLE_LEFT_FIRST =1 +}; + +enum hdmi_sample_perword { +HDMI_ONEWORD_ONE_SAMPLE =0 , +HDMI_ONEWORD_TWO_SAMPLES =1 +}; + +enum hdmi_sample_size { +HDMI_SAMPLE_16BITS =0 , +HDMI_SAMPLE_24BITS =1 +}; + +enum hdmi_dma_irq { +HDMI_THRESHOLD_DMA =0 , +HDMI_THRESHOLD_IRQ =1 +}; + +enum hdmi_block_start_end { +HDMI_BLOCK_STARTEND_ON =0 , +HDMI_BLOCK_STARTEND_OFF =1 +}; + + +enum hdmi_core_if_fs { +HDMI_IF_FS_NO =0x0 , +HDMI_IF_FS_32000 =0x1 , +HDMI_IF_FS_44100 =0x2 , +HDMI_IF_FS_48000 =0x3 , +HDMI_IF_FS_88200 =0x4 , +HDMI_IF_FS_96000 =0x5 , +HDMI_IF_FS_176400 =0x6 , +HDMI_IF_FS_192000 =0x7 +}; + +enum hdmi_core_if_sample_size { +HDMI_IF_NO_PER_SAMPLE =0x0 , +HDMI_IF_16BIT_PER_SAMPLE =0x1 , +HDMI_IF_20BIT_PER_SAMPLE =0x2 , +HDMI_IF_24BIT_PER_SAMPLE =0x3 +}; + + +enum hdmi_packing_mode { + HDMI_PACK_10b_RGB_YUV444 =0 , + HDMI_PACK_24b_RGB_YUV444_YUV422 =1 , + HDMI_PACK_20b_YUV422 =2 , +HDMI_PACK_ALREADYPACKED =7 +}; + + +struct hdmi_core_video_config { +enum hdmi_core_inputbus_width ip_bus_width; +enum hdmi_core_dither_trunc op_dither_truc; +enum hdmi_core_deepcolor_ed deep_color_pkt; +enum hdmi_core_packet_mode pkt_mode; +enum hdmi_core_hdmi_dvi hdmi_dvi; +enum hdmi_core_tclkselclkmult tclk_sel_clkmult; +}; + +/* +* Refer to section 8.2 in HDMI 1.3 specification for +* details about infoframe databytes +*/ +struct hdmi_core_infoframe_avi { +u8 db1_format; +/* Y0, Y1 rgb,yCbCr */ +u8 db1_active_info; +/* A0 Active information Present */ +u8 db1_bar_info_dv; +/* B0, B1 Bar info data valid */ +u8 db1_scan_info; +/* S0, S1 scan information */ +u8 db2_colorimetry; +/* C0, C1 colorimetry */ +u8 db2_aspect_ratio; +/* M0, M1 Aspect ratio (4:3, 16:9) */ +u8 db2_active_fmt_ar; +/* R0...R3 Active format aspect ratio */ +u8 db3_itc; +/* ITC IT content. */ +u8 db3_ec; +/* EC0, EC1, EC2 Extended colorimetry */ +u8 db3_q_range; +/* Q1, Q0 Quantization range */ +u8 db3_nup_scaling; +/* SC1, SC0 Non-uniform picture scaling */ +u8 db4_videocode; +/* VIC0..6 Video format identification */ +u8 db5_pixel_repeat; +/* PR0..PR3 Pixel repetition factor */ +u16 db6_7_line_eoftop; +/* Line number end of top bar */ +u16 db8_9_line_sofbottom; +/* Line number start of bottom bar */ +u16 db10_11_pixel_eofleft; +/* Pixel number end of left bar */ +u16 db12_13_pixel_sofright; +/* Pixel number start of right bar */ +}; + +struct hdmi_core_packet_enable_repeat { +u32 audio_pkt; +u32 audio_pkt_repeat; +u32 avi_infoframe; +u32 avi_infoframe_repeat; +u32 gen_cntrl_pkt; +u32 gen_cntrl_pkt_repeat; +u32 generic_pkt; +u32 generic_pkt_repeat; +}; + +struct hdmi_audio_format { +enum hdmi_stereo_channel stereo_channel_enable; +enum hdmi_cea_code audio_channel_location; +enum hdmi_iec_format iec; +enum hdmi_audio_justify justify; +enum hdmi_sample_order left_before; +enum hdmi_sample_perword sample_number; +enum hdmi_sample_size sample_size; +}; + + +struct hdmi_audio_dma { +u8 dma_transfer; +u8 block_size; +enum hdmi_dma_irq dma_or_irq; +u16 threshold_value; +enum hdmi_block_start_end block_start_end; +}; + +struct hdmi_video_format { +enum hdmi_packing_mode packing_mode; +u32 y_res;/* Line per panel */ +u32 x_res;/* pixel per line */ +}; + +struct hdmi_video_interface { +int vsp;/* Vsync polarity */ +int hsp;/* Hsync polarity */ +int interlacing; +int tm;/* Timing mode */ +}; + +struct hdmi_video_timing { +u32 hbp; +u32 hfp; +u32 hsw; +u32 vbp; +u32 vfp; +u32 vsw; +}; + +struct hdmi_config { +u16 ppl;/* pixel per line */ +u16 lpp;/* line per panel */ +u32 pixel_clock; +u16 hsw;/* Horizontal sync pulse width */ +u16 hfp;/* Horizontal front porch */ +u16 hbp;/* Horizontal back porch */ +u16 vsw;/* Vertical sync pulse width */ +u16 vfp;/* Vertical front porch */ +u16 vbp;/* Vertical back porch */ +u16 interlace; +u16 h_pol; +u16 v_pol; +u16 hdmi_dvi; +u16 video_format; +}; + +struct hdmi_core_audio_config { +enum hdmi_core_fs fs;/* 0=32KHz - 1=44.1KHz */ +u32 n; +u32 cts; +u32 aud_par_busclk; +enum hdmi_core_layout layout;/* 0: 2Ch - 1: 8Ch */ +enum hdmi_core_cts_mode cts_mode;/* 0: HW - 1: SW*/ +enum hdmi_core_if_fs if_fs; +u32 if_channel_number; +enum hdmi_core_if_sample_size if_sample_size; +enum hdmi_cea_code if_audio_channel_location; +}; + +struct hdmi_cm { +int code; +int mode; +}; + +struct hdmi_irq_vector { +u8 pll_recal; +u8 pll_unlock; +u8 pll_lock; +u8 phy_disconnect; +u8 phy_connect; +u8 phy_short_5v; +u8 video_end_fr; +u8 video_vsync; +u8 fifo_sample_req; +u8 fifo_overflow; +u8 fifo_underflow; +u8 ocp_timeout; +u8 core; +}; + +#endif
Signature · 1 line
1.5.6.3
PATCH v2 4/8 OMAP4 : DSS2 : HDMI: HDMI driver addition in the DSS drivers interface
In reply to Mythri P KAdding the hdmi interface driver(hdmi.c) to the dss driver. It configures the audio and video portion of HDMI in the display header file to be accessed by the panels.
--- drivers/video/omap2/dss/Kconfig | 8 + drivers/video/omap2/dss/Makefile | 1 + drivers/video/omap2/dss/display.c | 3 + drivers/video/omap2/dss/dss.h | 31 + drivers/video/omap2/dss/hdmi.c | 1329 +++++++++++++++++++++++++++++++++++++ drivers/video/omap2/dss/hdmi.h | 5 + 6 files changed, 1377 insertions(+), 0 deletions(-) create mode 100644 drivers/video/omap2/dss/hdmi.c
drivers/video/omap2/dss/Kconfig +8 -0
@@ -60,6 +60,14 @@ config OMAP2_DSS_VENC help OMAP Video Encoder support for S-Video and composite TV-out. +config OMAP2_DSS_HDMI + bool "HDMI support" + depends on ARCH_OMAP4 + default y + help + HDMI Interface. This adds the High Definition Multimedia Interface. + See http://www.hdmi.org/ for HDMI specification. + config OMAP2_DSS_SDI bool "SDI support" depends on ARCH_OMAP3
drivers/video/omap2/dss/Makefile +1 -0
@@ -5,3 +5,4 @@ omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o +omapdss-$(CONFIG_OMAP2_DSS_HDMI) += hdmi.o
drivers/video/omap2/dss/display.c +3 -0
@@ -447,6 +447,9 @@ void dss_init_device(struct platform_device *pdev, r =dsi_init_display (dssdev);break ;#endif +case OMAP_DISPLAY_TYPE_HDMI : + r =hdmi_init_display (dssdev); +break ;default :BUG (); }
drivers/video/omap2/dss/dss.h +31 -0
@@ -168,6 +168,16 @@ struct dsi_clock_info {bool use_dss2_fck; }; +/* HDMI PLL structure */ +struct hdmi_pll_info { +u16 regn; +u16 regm; +u32 regmf; +u16 regm2; +u16 regsd; +u16 dcofreq; +}; +struct seq_file ;struct platform_device ;
@@ -433,6 +443,27 @@ static inline void venc_uninit_platform_driver(void) }#endif +/* HDMI */ +#ifdef CONFIG_OMAP2_DSS_HDMI +int hdmi_init_platform_driver (void ); +void hdmi_uninit_platform_driver (void ); +int hdmi_init_display (struct omap_dss_device *dssdev); +#else +static inline int hdmi_init_display (struct omap_dss_device *dssdev) +{ +return 0 ; +} +static inline int hdmi_init_platform_driver (void ) +{ +return 0 ; +} +static inline void hdmi_uninit_platform_driver (void ) +{ +} +#endif +int omapdss_hdmi_display_enable (struct omap_dss_device *dssdev); +void omapdss_hdmi_display_disable (struct omap_dss_device *dssdev); +/* RFBI */ #ifdef CONFIG_OMAP2_DSS_RFBI int rfbi_init_platform_driver (void );
drivers/video/omap2/dss/hdmi.c new file +1329 -0
1,329 lines not on this page · raw message
drivers/video/omap2/dss/hdmi.h +5 -0
@@ -594,4 +594,9 @@ struct hdmi_irq_vector { u8 core; }; +/* Function prototype */ +int hdmi_wait_softreset (void ); +int read_edid (u8 *pEDID,u16 max_length); +void hdmi_basic_configure (struct hdmi_config *cfg); +#endif
Signature · 1 line
1.5.6.3
PATCH v2 5/8 OMAP4 : DSS2 : HDMI: HDMI panel driver addition in the DSS
In reply to Mythri P KThe panel driver(hdmi_omap4_panel.c) in dss file acts as a controller to manage the enable and disable requests and synchronize audio and video. Also the header file to export the hdmi registers is added in the plat-omap , so that it can be accessed by audio driver.
--- drivers/video/omap2/dss/Kconfig | 8 ++ drivers/video/omap2/dss/Makefile | 1 + drivers/video/omap2/dss/hdmi_omap4_panel.c | 189 ++++++++++++++++++++++++++++ 3 files changed, 198 insertions(+), 0 deletions(-) create mode 100644 drivers/video/omap2/dss/hdmi_omap4_panel.c
drivers/video/omap2/dss/Kconfig +8 -0
@@ -125,4 +125,12 @@ config OMAP2_DSS_MIN_FCK_PER_PCK Max FCK is 173MHz, so this doesn't work if your PCK is very high. +config OMAP4_PANEL_HDMI + tristate "HDMI panel support" + depends on OMAP2_DSS_HDMI + default n + help + HDMI panel. This adds the High Definition Multimedia panel. + See http://www.hdmi.org/ for HDMI specification. + endif
drivers/video/omap2/dss/Makefile +1 -0
@@ -6,3 +6,4 @@ omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o omapdss-$(CONFIG_OMAP2_DSS_HDMI) += hdmi.o +obj-$(CONFIG_OMAP4_PANEL_HDMI) += hdmi_omap4_panel.o
drivers/video/omap2/dss/hdmi_omap4_panel.c new file +189 -0
189 lines not on this page · raw message
Signature · 1 line
1.5.6.3
PATCH v2 6/8 OMAP4 : DSS : HDMI: Call to HDMI module init to register driver.
In reply to Mythri P Kcalling the platform registration of HDMI driver from core during initialization.
--- drivers/video/omap2/dss/core.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/video/omap2/dss/core.c +8 -0
@@ -229,6 +229,12 @@ static int omap_dss_probe(struct platform_device *pdev) } } + r =hdmi_init_platform_driver (); +if (r) { +DSSERR ("Failed to initialize hdmi\n" ); + goto err_hdmi; + } + r =dss_initialize_debugfs ();if (r) goto err_debugfs;
@@ -258,6 +264,8 @@ static int omap_dss_probe(struct platform_device *pdev) err_register:dss_uninitialize_debugfs (); err_debugfs: +hdmi_uninit_platform_driver (); +err_hdmi:if (cpu_is_omap34xx ())dsi_uninit_platform_driver (); err_dsi:
Signature · 1 line
1.5.6.3
PATCH v2 7/8 OMAP4 : HDMI : Add HDMI structure in the board file for OMAP4 SDP
In reply to Mythri P KAdding board file structure for display which adds the display structure with HDMI as the default driver when the display init is called.
HDMI GPIO configurations are also done in this file.
--- arch/arm/mach-omap2/board-4430sdp.c | 75 +++++++++++++++++++++++++++++++++++ 1 files changed, 75 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-4430sdp.c +75 -0
@@ -35,6 +35,7 @@#include <plat/common.h> #include <plat/usb.h> #include <plat/mmc.h> +#include <plat/display.h> #include "mux.h" #include "hsmmc.h"
@@ -47,6 +48,8 @@#define OMAP4SDP_MDM_PWR_EN_GPIO 157#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184#define OMAP4_SFH7741_ENABLE_GPIO 188 +#define HDMI_GPIO_HPD 60/* Hot plug pin for HDMI */ +#define HDMI_GPIO_LS_OE 41/* Level shifter for HDMI */ static struct gpio_led sdp4430_gpio_leds[] = { {
@@ -552,6 +555,76 @@ static void __init omap_sfh7741prox_init(void) } } +static void sdp4430_hdmi_mux_init (void ) +{ +/* PAD0_HDMI_HPD_PAD1_HDMI_CEC */ +omap_mux_init_signal ("hdmi_hpd" , +OMAP_PIN_INPUT_PULLUP ); +omap_mux_init_signal ("hdmi_cec" , +OMAP_PIN_INPUT_PULLUP ); +/* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */ +omap_mux_init_signal ("hdmi_ddc_scl" , +OMAP_PIN_INPUT_PULLUP ); +omap_mux_init_signal ("hdmi_ddc_sda" , +OMAP_PIN_INPUT_PULLUP ); +} + +static int sdp4430_panel_enable_hdmi (struct omap_dss_device *dssdev) +{ +int status; + + status =gpio_request_one (HDMI_GPIO_HPD ,GPIOF_OUT_INIT_HIGH , +"hdmi_gpio_hpd" ); +if (status) { +pr_err ("Cannot request GPIO %d\n" ,HDMI_GPIO_HPD ); +return status; + } + status =gpio_request_one (HDMI_GPIO_LS_OE ,GPIOF_OUT_INIT_HIGH , +"hdmi_gpio_ls_oe" ); +if (status) { +pr_err ("Cannot request GPIO %d\n" ,HDMI_GPIO_LS_OE ); + goto error1; + } + +return 0 ; + +error1: +gpio_free (HDMI_GPIO_HPD ); + +return status; +} + +static void sdp4430_panel_disable_hdmi (struct omap_dss_device *dssdev) +{ +gpio_free (HDMI_GPIO_LS_OE ); +gpio_free (HDMI_GPIO_HPD ); +} + +static struct omap_dss_device sdp4430_hdmi_device = { + .name ="hdmi" , + .driver_name ="hdmi_panel" , + .type =OMAP_DISPLAY_TYPE_HDMI , + .platform_enable = sdp4430_panel_enable_hdmi, + .platform_disable = sdp4430_panel_disable_hdmi, + .channel =OMAP_DSS_CHANNEL_DIGIT , +}; + +static struct omap_dss_device *sdp4430_dss_devices[] = { + &sdp4430_hdmi_device, +}; + +static struct omap_dss_board_info sdp4430_dss_data = { + .num_devices =ARRAY_SIZE (sdp4430_dss_devices), + .devices = sdp4430_dss_devices, + .default_device = &sdp4430_hdmi_device, +}; + +void omap_4430sdp_display_init (void ) +{ +sdp4430_hdmi_mux_init (); +omap_display_init (&sdp4430_dss_data); +} +#ifdef CONFIG_OMAP_MUX static struct omap_board_mux board_mux[]__initdata = { OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
@@ -594,6 +667,8 @@ static void __init omap_4430sdp_init(void)spi_register_board_info (sdp4430_spi_board_info,ARRAY_SIZE (sdp4430_spi_board_info)); } + +omap_4430sdp_display_init (); }static void __init omap_4430sdp_map_io (void )
Signature · 1 line
1.5.6.3
PATCH v2 8/8 OMAP4 : HDMI : Add HDMI structure in the board file for OMAP4 PANDA
In reply to Mythri P KAdding board file structure for display which adds the display structure with HDMI as the default driver when the display init is called.
HDMI GPIO configurations are also done in this file.
--- arch/arm/mach-omap2/board-omap4panda.c | 74 ++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap4panda.c +74 -0
@@ -32,6 +32,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> +#include <plat/display.h> #include <plat/board.h> #include <plat/common.h>
@@ -45,6 +46,8 @@#define GPIO_HUB_POWER 1#define GPIO_HUB_NRESET 62 +#define HDMI_GPIO_HPD 60/* Hot plug pin for HDMI */ +#define HDMI_GPIO_LS_OE 41/* Level shifter for HDMI */ static struct gpio_led gpio_leds[] = { {
@@ -397,6 +400,76 @@ static struct omap_board_mux board_mux[] __initdata = {#define board_mux NULL#endif +static void sdp4430_hdmi_mux_init (void ) +{ +/* PAD0_HDMI_HPD_PAD1_HDMI_CEC */ +omap_mux_init_signal ("hdmi_hpd" , +OMAP_PIN_INPUT_PULLUP ); +omap_mux_init_signal ("hdmi_cec" , +OMAP_PIN_INPUT_PULLUP ); +/* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */ +omap_mux_init_signal ("hdmi_ddc_scl" , +OMAP_PIN_INPUT_PULLUP ); +omap_mux_init_signal ("hdmi_ddc_sda" , +OMAP_PIN_INPUT_PULLUP ); +} + +static int sdp4430_panel_enable_hdmi (struct omap_dss_device *dssdev) +{ +int status; + + status =gpio_request_one (HDMI_GPIO_HPD ,GPIOF_OUT_INIT_HIGH , +"hdmi_gpio_hpd" ); +if (status) { +pr_err ("Cannot request GPIO %d\n" ,HDMI_GPIO_HPD ); +return status; + } + status =gpio_request_one (HDMI_GPIO_LS_OE ,GPIOF_OUT_INIT_HIGH , +"hdmi_gpio_ls_oe" ); +if (status) { +pr_err ("Cannot request GPIO %d\n" ,HDMI_GPIO_LS_OE ); + goto error1; + } + +return 0 ; + +error1: +gpio_free (HDMI_GPIO_HPD ); + +return status; +} + +static void sdp4430_panel_disable_hdmi (struct omap_dss_device *dssdev) +{ +gpio_free (HDMI_GPIO_LS_OE ); +gpio_free (HDMI_GPIO_HPD ); +} + +static struct omap_dss_device sdp4430_hdmi_device = { + .name ="hdmi" , + .driver_name ="hdmi_panel" , + .type =OMAP_DISPLAY_TYPE_HDMI , + .platform_enable = sdp4430_panel_enable_hdmi, + .platform_disable = sdp4430_panel_disable_hdmi, + .channel =OMAP_DSS_CHANNEL_DIGIT , +}; + +static struct omap_dss_device *sdp4430_dss_devices[] = { + &sdp4430_hdmi_device, +}; + +static struct omap_dss_board_info sdp4430_dss_data = { + .num_devices =ARRAY_SIZE (sdp4430_dss_devices), + .devices = sdp4430_dss_devices, + .default_device = &sdp4430_hdmi_device, +}; + +void omap_panda_display_init (void ) +{ +sdp4430_hdmi_mux_init (); +omap_display_init (&sdp4430_dss_data); +} +static void __init omap4_panda_init (void ) {int package =OMAP_PACKAGE_CBS ;
@@ -411,6 +484,7 @@ static void __init omap4_panda_init(void)omap4_twl6030_hsmmc_init (mmc);omap4_ehci_init ();usb_musb_init (&musb_board_data); +omap_panda_display_init (); }static void __init omap4_panda_map_io (void )
Signature · 1 line
1.5.6.3
Re: [PATCH v2 2/8] OMAP4 : DSS2 : HDMI: HDMI specific display controller and dss change.
In reply to Mythri P KQuoted 15 lines · Mythri P
Adding changes to set gamma table bit for TV interface and function to select between VENC and HDMI.
Signed-off-by Mythri P K <[email protected]>--- drivers/video/omap2/dss/dispc.c | 5 +++++ drivers/video/omap2/dss/dss.c | 5 +++++ drivers/video/omap2/dss/dss.h | 7 +++++++ 3 files changed, 17 insertions(+), 0 deletions(-)drivers/video/omap2/dss/dispc.c +0
-0
drivers/video/omap2/dss/dispc.c void dispc_enable_zorder(enum omap_plane plane, bool enable) · line 1230
Quoted 7 lines
drivers/video/omap2/dss/dispc.c +4
-0@@ -1224,6 +1224,11 @@ void dispc_enable_zorder(enum omap_plane plane, bool enable)dispc_write_reg (dispc_reg_att[plane], val); } +void dispc_enable_gamma_table (bool enable) +{ +REG_FLD_MOD (DISPC_CONFIG , enable,9 ,9 ); +}
I would separate the gamma function out from this patch. These two things are not related in any way.
And I'm not quite happy with this partial gamma implementation, as only the enable function is implemented. At the minimum, put BUG_ON(enable); there, and a comment that this can currently only be used to disable gamma support.
Quoted 9 lines
drivers/video/omap2/dss/dispc.c +1
-0+static void _dispc_set_vid_color_conv (enum omap_plane plane,bool enable) {u32 val;drivers/video/omap2/dss/dss.c +0
-0
drivers/video/omap2/dss/dss.c void dss_set_dac_pwrdn_bgz(bool enable) · line 564
Quoted 6 lines
drivers/video/omap2/dss/dss.c +3
-0@@ -559,6 +559,11 @@ void dss_set_dac_pwrdn_bgz(bool enable)REG_FLD_MOD (DSS_CONTROL , enable,5 ,5 );/* DAC Power-Down Control */ } +void dss_select_hdmi_venc (enum dss_hdmi_venc_select hdmi) +{ +REG_FLD_MOD (DSS_CONTROL , hdmi,15 ,15 );/* 0x1 for HDMI, 0x0 VENC */
That comment is not needed, but you could put "VENC_HDMI_SWITCH" there in the comments.
Quoted 10 lines
drivers/video/omap2/dss/dss.c +2
-0+} +static int dss_init (bool skip_init) {int r;drivers/video/omap2/dss/dss.h +0
-0
drivers/video/omap2/dss/dss.h enum dss_clk_source { · line 129
Quoted 7 lines
drivers/video/omap2/dss/dss.h +4
-0@@ -123,6 +123,11 @@ enum dss_clk_source { DSS_SRC_DSS1_ALWON_FCLK, }; +enum dss_hdmi_venc_select { +DSS_VENC_SELECT ,/* Select VENC */ +DSS_HDMI_SELECT ,/* Select HDMI */ +};
If the integer value of the enum is important, like in this case, you need to define the value: DSS_VENC_SELECT = 0.
Also, the comments are not needed, they just say the same thing as the enum itself.
And only now I realized that this is a clock source switch. The enum and the function should be named appropriately, for example enum dss_tv_clk_out_source. And the sources are TV_CLK and HDMI_M_PCLK, so the the enum values should use those as part of their name.
Tomi
Re: [PATCH v2 5/8] OMAP4 : DSS2 : HDMI: HDMI panel driver addition in the DSS
In reply to Mythri P KQuoted 4 lines · Mythri P
The panel
driver(hdmi_omap4_panel.c)in dss file acts as a controller to manage the enable and disable requests and synchronize audio and video. Also the header file to export the hdmi registers is added in the plat-omap , so that it can be accessed by audio driver.
Could you review the description. The panel driver is not in "dss file" and there's no header in this patch.
The locking is broken in this patch. You cannot return from the function while holding the lock.
Tomi
Re: [PATCH v2 3/8] OMAP4 : DSS2 : HDMI: HDMI driver header file addition
In reply to Mythri P KQuoted 9 lines · Mythri P
Adding the hdmi interface driver header file (
hdmi.h) to the dss driver. Register and timing declaration to be used by the corresponding c file is added in this file.Signed-off-by Mythri P K <[email protected]>--- drivers/video/omap2/dss/hdmi.h | 597 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 597 insertions(+), 0 deletions(-) create mode 100644 drivers/video/omap2/dss/hdmi.h
This file is dss internal header. How will the audio side be handled? Does the audio driver need something from here? If so, those things should be somewhere else.
Some or many of the structs/enums in this file are not used currently. It would make reviewing and understanding the code much easier, if things would be added only when they are actually used. Can you go through them and leave only the things that are needed for the current driver.
Tomi
Re: [PATCH v2 4/8] OMAP4 : DSS2 : HDMI: HDMI driver addition in the DSS drivers interface
In reply to Mythri P KQuoted 3 lines · Mythri P
Adding the hdmi interface driver(hdmi.c) to the dss driver. It configures the audio and video portion of HDMI in the display header file to be accessed by the panels.
Check once more if the private functions and variables are marked as static.
The edid variables should be in the hdmi struct. The constant data arrays should be const.
hdmi_power_on() leaves clocks on in case of error.
Tomi
Re: [PATCH v2 2/8] OMAP4 : DSS2 : HDMI: HDMI specific display controller and dss change.
In reply to Tomi ValkeinenHi Tomi,
Quoted 27 lines · Tomi Valkeinen
Quoted 15 lines · Mythri P
Adding changes to set gamma table bit for TV interface and function to select between VENC and HDMI.
Signed-off-by Mythri P K <[email protected]>---
drivers/video/omap2/dss/dispc.c | 5 +++++
drivers/video/omap2/dss/dss.c | 5 +++++
drivers/video/omap2/dss/dss.h | 7 +++++++3 files changed, 17 insertions(+), 0 deletions(-)drivers/video/omap2/dss/dispc.c +0
-0drivers/video/omap2/dss/dispc.c void dispc_enable_zorder(enum omap_plane plane, bool enable) · line 1230
Quoted 7 lines
drivers/video/omap2/dss/dispc.c +4
-0@@ -1224,6 +1224,11 @@ void dispc_enable_zorder(enum omap_plane plane, bool enable) dispc_write_reg(dispc_reg_att[plane], val); } +void dispc_enable_gamma_table (bool enable) +{ + REG_FLD_MOD(DISPC_CONFIG, enable, 9, 9); +}I would separate the gamma function out from this patch. These two things are not related in any way.
Quoted 4 lines
And I'm not quite happy with this partial gamma implementation, as only the enable function is implemented. At the minimum, put
BUG_ON(enable); there, and a comment that this can currently only be used to disable gamma support.
I shall separate these out.
Quoted 41 lines
Quoted 13 lines
drivers/video/omap2/dss/dispc.c +1
-0+ static void _dispc_set_vid_color_conv(enum omap_plane plane, bool enable) { u32 val;drivers/video/omap2/dss/dss.c +0
-0@@ -559,6 +559,11 @@ void dss_set_dac_pwrdn_bgz(bool enable)
REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */ }drivers/video/omap2/dss/dss.c void dss_set_dac_pwrdn_bgz(bool enable) · line 564
Quoted 3 lines
drivers/video/omap2/dss/dss.c +3
-0+void dss_select_hdmi_venc (enum dss_hdmi_venc_select hdmi) +{ + REG_FLD_MOD(DSS_CONTROL, hdmi, 15, 15); /* 0x1 for HDMI, 0x0 VENC */That comment is not needed, but you could put "
VENC_HDMI_SWITCH" there in the comments.Quoted 10 lines
drivers/video/omap2/dss/dss.c +2
-0+} +static int
dss_init(bool skip_init)
{
int r;drivers/video/omap2/dss/dss.h +0
-0drivers/video/omap2/dss/dss.h enum dss_clk_source { · line 129
Quoted 7 lines
drivers/video/omap2/dss/dss.h +4
-0@@ -123,6 +123,11 @@ enum dss_clk_source { DSS_SRC_DSS1_ALWON_FCLK, }; +enum dss_hdmi_venc_select { + DSS_VENC_SELECT, /* Select VENC */ + DSS_HDMI_SELECT, /* Select HDMI */ +};If the integer value of the enum is important, like in this case, you need to define the value:
DSS_VENC_SELECT= 0.
Quoted 8 lines
Also, the comments are not needed, they just say the same thing as the enum itself.
And only now I realized that this is a clock source switch. The enum and the function should be named appropriately, for example enum
dss_tv_clk_out_source. And the sources areTV_CLKandHDMI_M_PCLK, so the the enum values should use those as part of their name.
ok i shall name them appropriately.
Quoted 4 lines
Tomi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 5/8] OMAP4 : DSS2 : HDMI: HDMI panel driver addition in the DSS
In reply to Tomi ValkeinenQuoted 11 lines · Tomi Valkeinen
Quoted 4 lines · Mythri P
The panel
driver(hdmi_omap4_panel.c)in dss file acts as a controller to manage the enable and disable requests and synchronize audio and video. Also the header file to export the hdmi registers is added in the plat-omap , so that it can be accessed by audio driver.Could you review the description. The panel driver is not in "dss file" and there's no header in this patch.
The locking is broken in this patch. You cannot return from the function while holding the lock.
I shall fix the lock and describe appropriately.
Quoted 5 lines
Tomi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 4/8] OMAP4 : DSS2 : HDMI: HDMI driver addition in the DSS drivers interface
In reply to Tomi ValkeinenHi Tomi,
I have checked for static functions :) .
Ok i will revisit the global variables to either move it to hdmi struct or make it const.
Thanks and regards,
Mythri.
Quoted 8 lines · Tomi Valkeinen
Quoted 3 lines · Mythri P
Adding the hdmi interface driver(hdmi.c) to the dss driver. It configures the audio and video portion of HDMI in the display header file to be accessed by the panels.
Check once more if the private functions and variables are marked as static.
Quoted 9 lines
The edid variables should be in the hdmi struct. The constant data arrays should be const.
hdmi_power_on()leaves clocks on in case of error.Tomi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 2/8] OMAP4 : DSS2 : HDMI: HDMI specific display controller and dss change.
In reply to K, Mythri PHi Tomi,
I just rechecked the TRM.
The TRM description of the bit is VENC_HDMI_switch , Wouldnt it be appropriate to have the same
name for the enum and the variables as suggested by you.
Thanks and regards,
Mythri.
Quoted 79 lines · Mythri P
Hi Tomi,
Quoted 27 lines · Tomi Valkeinen
Quoted 15 lines · Mythri P
Adding changes to set gamma table bit for TV interface and function to select between VENC and HDMI.
Signed-off-by Mythri P K <[email protected]>---
drivers/video/omap2/dss/dispc.c | 5 +++++
drivers/video/omap2/dss/dss.c | 5 +++++
drivers/video/omap2/dss/dss.h | 7 +++++++3 files changed, 17 insertions(+), 0 deletions(-)drivers/video/omap2/dss/dispc.c +0
-0drivers/video/omap2/dss/dispc.c void dispc_enable_zorder(enum omap_plane plane, bool enable) · line 1230
Quoted 7 lines
drivers/video/omap2/dss/dispc.c +4
-0@@ -1224,6 +1224,11 @@ void dispc_enable_zorder(enum omap_plane plane, bool enable) dispc_write_reg(dispc_reg_att[plane], val); } +void dispc_enable_gamma_table (bool enable) +{ + REG_FLD_MOD(DISPC_CONFIG, enable, 9, 9); +}I would separate the gamma function out from this patch. These two things are not related in any way.
Quoted 4 lines
And I'm not quite happy with this partial gamma implementation, as only the enable function is implemented. At the minimum, put
BUG_ON(enable); there, and a comment that this can currently only be used to disable gamma support.I shall separate these out.
Quoted 44 lines
Quoted 13 lines
drivers/video/omap2/dss/dispc.c +1
-0+ static void _dispc_set_vid_color_conv(enum omap_plane plane, bool enable) { u32 val;drivers/video/omap2/dss/dss.c +0
-0@@ -559,6 +559,11 @@ void dss_set_dac_pwrdn_bgz(bool enable)
REG_FLD_MOD(DSS_CONTROL, enable, 5, 5); /* DAC Power-Down Control */ }drivers/video/omap2/dss/dss.c void dss_set_dac_pwrdn_bgz(bool enable) · line 564
Quoted 3 lines
drivers/video/omap2/dss/dss.c +3
-0+void dss_select_hdmi_venc (enum dss_hdmi_venc_select hdmi) +{ + REG_FLD_MOD(DSS_CONTROL, hdmi, 15, 15); /* 0x1 for HDMI, 0x0 VENC */That comment is not needed, but you could put "
VENC_HDMI_SWITCH" there in the comments.Quoted 10 lines
drivers/video/omap2/dss/dss.c +2
-0+} +static int
dss_init(bool skip_init)
{
int r;drivers/video/omap2/dss/dss.h +0
-0drivers/video/omap2/dss/dss.h enum dss_clk_source { · line 129
Quoted 7 lines
drivers/video/omap2/dss/dss.h +4
-0@@ -123,6 +123,11 @@ enum dss_clk_source { DSS_SRC_DSS1_ALWON_FCLK, }; +enum dss_hdmi_venc_select { + DSS_VENC_SELECT, /* Select VENC */ + DSS_HDMI_SELECT, /* Select HDMI */ +};If the integer value of the enum is important, like in this case, you need to define the value:
DSS_VENC_SELECT= 0.Also, the comments are not needed, they just say the same thing as the enum itself.
Quoted 11 lines
Quoted 5 lines
And only now I realized that this is a clock source switch. The enum and the function should be named appropriately, for example enum
dss_tv_clk_out_source. And the sources areTV_CLKandHDMI_M_PCLK, so the the enum values should use those as part of their name.ok i shall name them appropriately.
Quoted 4 lines
Tomi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 2/8] OMAP4 : DSS2 : HDMI: HDMI specific display controller and dss change.
Hi,
Quoted 5 lines · Mythri P
Hi Tomi,
I just rechecked the TRM.
The TRM description of the bit isVENC_HDMI_switch, Wouldnt it be appropriate to have the same
name for the enum and the variables as suggested by you.
Please don't top-post when posting to mailing lists.
Yes, it's a good rule of thumb to have similar naming with the TRM. However, we shouldn't follow TRM blindly, and also TRM can be changed.
In this case we already have a bunch of functions to configure the clock muxes, like
void dss_select_dispc_clk_source(enum dss_clk_source clk_src)
Also, a function name like dss_select_hdmi_venc doesn't really tell anything about what it does. Even if you know the architecture of DSS HW, you can't deduce what the function does.
And usually when you are pondering about the clocking configuration, you look at the DSS clock tree figure (fig 10-4), or the DSS clock sources table 10-3. And in this case I believe the naming in those figures and tables are much better than the name of the bit we are setting.
Tomi