From patchwork Mon Sep 24 13:58:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1497781 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5E621DF280 for ; Mon, 24 Sep 2012 13:59:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755603Ab2IXN7C (ORCPT ); Mon, 24 Sep 2012 09:59:02 -0400 Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]:33044 "EHLO na3sys009aog110.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755526Ab2IXN65 (ORCPT ); Mon, 24 Sep 2012 09:58:57 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]) (using TLSv1) by na3sys009aob110.postini.com ([74.125.148.12]) with SMTP ID DSNKUGBnH4Qt9C/2w/0ETQp+74Wk76DgC+BD@postini.com; Mon, 24 Sep 2012 06:58:56 PDT Received: by lbbgj3 with SMTP id gj3so6750220lbb.19 for ; Mon, 24 Sep 2012 06:58:54 -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=lASrQe1zN8UtDi+H4YwvkMc4zeMApTaoXxgu+c1SJCc=; b=X3IiolHK0nh3dEFAaHNEqvqt7CmMb2uBeXDy4f+ejocb+0U6EylNnIfLqcdRMdrDWz ffip7Q4TCADrdkgmhEXyyn86OMjTcK2Z2y3uBJwlurviU8P84dcv/euDy0BZnOVQSJAs 0IIzIczf9TeLpjlSo6Ml8OQ34Hu8GrPwqvwG/pdBAGerIEZohrjG/I56x1U+CtJMBfDG RBZ62p9G5x3FC67KWGeQB/GSSniOlcU4y3PYx1BbvaBNmXNIoDb0lb3DCBX0JO6LHqK1 NA5C25dVrMhu7HrQ7KhCpc0kt5Y3r4mBwkYlFGn/iLzADFWc7oh2fbD3bv8hI1Y7OzQO xKmA== Received: by 10.152.106.81 with SMTP id gs17mr10881497lab.2.1348495134151; Mon, 24 Sep 2012 06:58:54 -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.52 (version=SSLv3 cipher=OTHER); Mon, 24 Sep 2012 06:58:53 -0700 (PDT) From: Tomi Valkeinen To: archit@ti.com, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Tomi Valkeinen Subject: [PATCH 5/9] OMAPDSS: DSI: Add FEAT_DSI_PLL_SELFREQDCO Date: Mon, 24 Sep 2012 16:58:35 +0300 Message-Id: <1348495119-8262-6-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: ALoCoQmEAi5Iz3fFcGPepjLYO5nIm0EtwxA/BddMdGHW2Uc1lpZ7hhUD+cgFY5+Lnhthj9yLih3g Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Add FEAT_DSI_PLL_SELFREQDCO. OMAP5's DSI PLL has a new configuration option that needs to be programmed depending on the PLL's output clock frequency. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dsi.c | 12 ++++++++---- drivers/video/omap2/dss/dss_features.c | 1 + drivers/video/omap2/dss/dss_features.h | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 8d47fb7..0c3afc2 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -1671,18 +1671,22 @@ int dsi_pll_set_clock_div(struct platform_device *dsidev, BUG_ON(cinfo->fint < dsi->fint_min || cinfo->fint > dsi->fint_max); + l = dsi_read_reg(dsidev, DSI_PLL_CONFIGURATION2); + if (dss_has_feature(FEAT_DSI_PLL_FREQSEL)) { f = cinfo->fint < 1000000 ? 0x3 : cinfo->fint < 1250000 ? 0x4 : cinfo->fint < 1500000 ? 0x5 : cinfo->fint < 1750000 ? 0x6 : 0x7; - } - - l = dsi_read_reg(dsidev, DSI_PLL_CONFIGURATION2); - if (dss_has_feature(FEAT_DSI_PLL_FREQSEL)) l = FLD_MOD(l, f, 4, 1); /* DSI_PLL_FREQSEL */ + } else if (dss_has_feature(FEAT_DSI_PLL_SELFREQDCO)) { + f = cinfo->clkin4ddr < 1000000000 ? 0x2 : 0x4; + + l = FLD_MOD(l, f, 4, 1); /* PLL_SELFREQDCO */ + } + l = FLD_MOD(l, 1, 13, 13); /* DSI_PLL_REFEN */ l = FLD_MOD(l, 0, 14, 14); /* DSIPHY_CLKINEN */ l = FLD_MOD(l, 1, 20, 20); /* DSI_HSDIVBYPASS */ diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index af4775a..177f6e8 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c @@ -519,6 +519,7 @@ static const enum dss_feat_id omap5_dss_feat_list[] = { FEAT_ALPHA_FREE_ZORDER, FEAT_FIFO_MERGE, FEAT_BURST_2D, + FEAT_DSI_PLL_SELFREQDCO, }; /* OMAP2 DSS Features */ diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h index b81d603..f9b9d28 100644 --- a/drivers/video/omap2/dss/dss_features.h +++ b/drivers/video/omap2/dss/dss_features.h @@ -65,6 +65,7 @@ enum dss_feat_id { /* An unknown HW bug causing the normal FIFO thresholds not to work */ FEAT_OMAP3_DSI_FIFO_BUG, FEAT_BURST_2D, + FEAT_DSI_PLL_SELFREQDCO, }; /* DSS register field id */