From patchwork Tue Sep 6 12:56:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "K, Mythri P" X-Patchwork-Id: 1126342 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p86D4Y1H025887 for ; Tue, 6 Sep 2011 13:04:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754155Ab1IFNEe (ORCPT ); Tue, 6 Sep 2011 09:04:34 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:54764 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753590Ab1IFNEd (ORCPT ); Tue, 6 Sep 2011 09:04:33 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p86D4UH7016593 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 6 Sep 2011 08:04:32 -0500 Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p86D4Sqb010560 for ; Tue, 6 Sep 2011 18:34:29 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 8.3.106.1; Tue, 6 Sep 2011 18:34:28 +0530 Received: from localhost.localdomain (graphicspc.apr.dhcp.ti.com [172.24.136.217]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p86D4R9l001488; Tue, 6 Sep 2011 18:34:27 +0530 (IST) From: To: , CC: Mythri P K Subject: [PATCH v4 10/11] OMAP4: DSS2: HDMI: Function pointer approach to call Date: Tue, 6 Sep 2011 18:26:24 +0530 Message-ID: <1315313784-28478-1-git-send-email-mythripk@ti.com> X-Mailer: git-send-email 1.5.6.3 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 06 Sep 2011 13:04:35 +0000 (UTC) From: Mythri P K To make the current hdmi DSS driver compatible with future OMAP having different IP blocks( A combination of different core, PHY, PLL blocks), Add HDMI hdmi functions as a function pointer in dss_features to abstract hdmi dss driver IP agnostic, hdmi dss driver which will now access generic functions irrespective of underlying IP. Signed-off-by: Mythri P K --- drivers/video/omap2/dss/dss_features.c | 20 ++++++++++++++++++++ drivers/video/omap2/dss/dss_features.h | 7 +++++++ drivers/video/omap2/dss/hdmi.c | 19 ++++++++++--------- include/video/ti_hdmi.h | 21 +++++++++++++++++++++ 4 files changed, 58 insertions(+), 9 deletions(-) diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index b63c5f8..8670612 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c @@ -429,6 +429,26 @@ static const struct omap_dss_features omap4_dss_features = { .burst_size_unit = 16, }; +#if defined(CONFIG_OMAP4_DSS_HDMI) +/* HDMI OMAP4 Functions*/ +static const struct ti_hdmi_ip_ops omap4_hdmi_functions = { + + .video_configure = ti_hdmi_4xxx_basic_configure, + .phy_enable = ti_hdmi_4xxx_phy_enable, + .phy_disable = ti_hdmi_4xxx_phy_disable, + .read_edid = ti_hdmi_4xxx_read_edid, + .pll_enable = ti_hdmi_4xxx_pll_enable, + .pll_disable = ti_hdmi_4xxx_pll_disable, + .video_enable = ti_hdmi_4xxx_wp_video_start, +}; + +void dss_init_hdmi_ip_ops(struct hdmi_ip_data *ip_data) +{ + if (cpu_is_omap44xx()) + ip_data->ops = &omap4_hdmi_functions; +} +#endif + /* Functions returning values related to a DSS feature */ int dss_feat_get_num_mgrs(void) { diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h index 4271e96..e89ae5f 100644 --- a/drivers/video/omap2/dss/dss_features.h +++ b/drivers/video/omap2/dss/dss_features.h @@ -20,6 +20,10 @@ #ifndef __OMAP2_DSS_FEATURES_H #define __OMAP2_DSS_FEATURES_H +#if defined(CONFIG_OMAP4_DSS_HDMI) +#include