From patchwork Mon Sep 24 13:58:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1497841 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 78EA83FC71 for ; Mon, 24 Sep 2012 13:59:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755601Ab2IXN7H (ORCPT ); Mon, 24 Sep 2012 09:59:07 -0400 Received: from na3sys009aog114.obsmtp.com ([74.125.149.211]:41762 "EHLO na3sys009aog114.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755563Ab2IXN7B (ORCPT ); Mon, 24 Sep 2012 09:59:01 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]) (using TLSv1) by na3sys009aob114.postini.com ([74.125.148.12]) with SMTP ID DSNKUGBnJKYfUl1WX4LfFccFC2trylEgdKB7@postini.com; Mon, 24 Sep 2012 06:59:01 PDT Received: by lbbgj3 with SMTP id gj3so6750369lbb.19 for ; Mon, 24 Sep 2012 06:58:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=boWOfFJcNvh3ewW5+gd/7TOepp2JX/sN2+S7H0SnAgU=; b=WISn69QFVeiQaisDcqBoJexxorFzFEFxBjBzcIFRgq3w2rR4gbfcIIfBW9sxwEWx6i WzAuDNLDOTrIq4r4A8dZaAxFRrCf2N9WjW2bSNMOoikofsZVHYrrt1z+FYG+wZrK+iEl 5Mg0uuZw3hbLhUmmUSAwCsD/tpsoBaKUh9K7rvGV1BZRfKr7riyzmJxAwa+A9KeWyzld Lfl64/8bfEJAkksG+RYr8w1WvaIAndj6x9/ut+GeJ50TTzBtpH2pLczWoe4GVsxjVdqM Nl4EaMUPIFKlWzaGlQeOZCu3HZpbrURT3iLOYr0s6iiDwcvHeNBC4zeMdFnmE2vmxtQr sDHw== Received: by 10.112.87.162 with SMTP id az2mr4414392lbb.42.1348495139074; Mon, 24 Sep 2012 06:58:59 -0700 (PDT) Received: from deskari.tieu.ti.com (a91-156-160-115.elisa-laajakaista.fi. [91.156.160.115]) by mx.google.com with ESMTPS id ly17sm4364922lab.2.2012.09.24.06.58.57 (version=SSLv3 cipher=OTHER); Mon, 24 Sep 2012 06:58:58 -0700 (PDT) From: Tomi Valkeinen To: archit@ti.com, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Tomi Valkeinen Subject: [PATCH 8/9] OMAPDSS: DSI: Add code to disable PHY DCC Date: Mon, 24 Sep 2012 16:58:38 +0300 Message-Id: <1348495119-8262-9-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348495119-8262-1-git-send-email-tomi.valkeinen@ti.com> References: <1348495119-8262-1-git-send-email-tomi.valkeinen@ti.com> X-Gm-Message-State: ALoCoQn/J7INrNa7vsj9FQH+4RS70NhVP5p+m4W7X0Gw1TZaQF18J5x98PeyKBO8J9BaFNoQjlRa Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org OMAP5 DSI PHY has DCC (Duty Cycle Corrector) block, and by default DCC is enabled and thus the PLL clock is divided by 2 to get the DSI DDR clk. This divider has been 4 for all previous OMAPs, and changing it needs some reorganization of the code. The DCC can be disabled, and in that case the divider is back to the old 4. This patch adds dss feature for the DCC, and adds code to always disable the DCC. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dsi.c | 7 +++++++ drivers/video/omap2/dss/dss_features.c | 1 + drivers/video/omap2/dss/dss_features.h | 1 + 3 files changed, 9 insertions(+) diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 0dc24f2..497b219 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -2292,6 +2292,13 @@ static void dsi_cio_timings(struct platform_device *dsidev) r = FLD_MOD(r, tlpx_half, 22, 16); r = FLD_MOD(r, tclk_trail, 15, 8); r = FLD_MOD(r, tclk_zero, 7, 0); + + if (dss_has_feature(FEAT_DSI_PHY_DCC)) { + r = FLD_MOD(r, 0, 21, 21); /* DCCEN = disable */ + r = FLD_MOD(r, 1, 22, 22); /* CLKINP_DIVBY2EN = enable */ + r = FLD_MOD(r, 1, 23, 23); /* CLKINP_SEL = enable */ + } + dsi_write_reg(dsidev, DSI_DSIPHY_CFG1, r); r = dsi_read_reg(dsidev, DSI_DSIPHY_CFG2); diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index 4685531..e650a4a 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c @@ -521,6 +521,7 @@ static const enum dss_feat_id omap5_dss_feat_list[] = { FEAT_BURST_2D, FEAT_DSI_PLL_SELFREQDCO, FEAT_DSI_PLL_REFSEL, + FEAT_DSI_PHY_DCC, }; /* OMAP2 DSS Features */ diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h index 0020bf6..aacad86 100644 --- a/drivers/video/omap2/dss/dss_features.h +++ b/drivers/video/omap2/dss/dss_features.h @@ -67,6 +67,7 @@ enum dss_feat_id { FEAT_BURST_2D, FEAT_DSI_PLL_SELFREQDCO, FEAT_DSI_PLL_REFSEL, + FEAT_DSI_PHY_DCC, }; /* DSS register field id */