From patchwork Wed Aug 31 13:21:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1115832 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 p7VDMDlD028217 for ; Wed, 31 Aug 2011 13:22:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755625Ab1HaNWN (ORCPT ); Wed, 31 Aug 2011 09:22:13 -0400 Received: from na3sys009aog119.obsmtp.com ([74.125.149.246]:39029 "EHLO na3sys009aog119.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755534Ab1HaNWK (ORCPT ); Wed, 31 Aug 2011 09:22:10 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]) (using TLSv1) by na3sys009aob119.postini.com ([74.125.148.12]) with SMTP ID DSNKTl41fOpgX84wu8yzQmU2WED3srsDm/cj@postini.com; Wed, 31 Aug 2011 06:22:10 PDT Received: by wyf22 with SMTP id 22so647829wyf.18 for ; Wed, 31 Aug 2011 06:22:01 -0700 (PDT) Received: by 10.227.199.134 with SMTP id es6mr394121wbb.10.1314796921431; Wed, 31 Aug 2011 06:22:01 -0700 (PDT) Received: from localhost.localdomain (a62-248-128-208.elisa-laajakaista.fi [62.248.128.208]) by mx.google.com with ESMTPS id fy13sm3685472wbb.56.2011.08.31.06.21.59 (version=SSLv3 cipher=OTHER); Wed, 31 Aug 2011 06:22:00 -0700 (PDT) From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: archit@ti.com, mythripk@ti.com, Tomi Valkeinen Subject: [PATCH 2/8] OMAP: DSS2: HDMI: use default dividers Date: Wed, 31 Aug 2011 16:21:42 +0300 Message-Id: <1314796908-17354-3-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314796908-17354-1-git-send-email-tomi.valkeinen@ti.com> References: <1314796908-17354-1-git-send-email-tomi.valkeinen@ti.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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]); Wed, 31 Aug 2011 13:22:15 +0000 (UTC) Use default regn and regm2 dividers in the hdmi driver if the board file does not define them. Signed-off-by: Tomi Valkeinen --- arch/arm/mach-omap2/board-4430sdp.c | 9 --------- drivers/video/omap2/dss/hdmi.c | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 6713d6e..3fd7e8f 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -818,15 +818,6 @@ static struct omap_dss_device sdp4430_hdmi_device = { .name = "hdmi", .driver_name = "hdmi_panel", .type = OMAP_DISPLAY_TYPE_HDMI, - .clocks = { - .dispc = { - .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK, - }, - .hdmi = { - .regn = 15, - .regm2 = 1, - }, - }, .platform_enable = sdp4430_panel_enable_hdmi, .platform_disable = sdp4430_panel_disable_hdmi, .channel = OMAP_DSS_CHANNEL_DIGIT, diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index b8e02e4..a3b3899 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -43,6 +43,9 @@ #include "hdmi.h" #include "dss_features.h" +#define HDMI_DEFAULT_REGN 15 +#define HDMI_DEFAULT_REGM2 1 + static struct { struct mutex lock; struct omap_display_platform_data *pdata; @@ -1076,7 +1079,11 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy, * Input clock is predivided by N + 1 * out put of which is reference clk */ - pi->regn = dssdev->clocks.hdmi.regn; + if (dssdev->clocks.hdmi.regn == 0) + pi->regn = HDMI_DEFAULT_REGN; + else + pi->regn = dssdev->clocks.hdmi.regn; + refclk = clkin / (pi->regn + 1); /* @@ -1084,7 +1091,11 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy, * Multiplying by 100 to avoid fractional part removal */ pi->regm = (phy * 100 / (refclk)) / 100; - pi->regm2 = dssdev->clocks.hdmi.regm2; + + if (dssdev->clocks.hdmi.regm2 == 0) + pi->regm2 = HDMI_DEFAULT_REGM2; + else + pi->regm2 = dssdev->clocks.hdmi.regm2; /* * fractional multiplier is remainder of the difference between