From patchwork Wed May 1 19:02:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2508751 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id F2E463FC5A for ; Wed, 1 May 2013 19:06:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4AEDE62C4 for ; Wed, 1 May 2013 12:06:35 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f48.google.com (mail-ee0-f48.google.com [74.125.83.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B78BE62A6 for ; Wed, 1 May 2013 12:02:44 -0700 (PDT) Received: by mail-ee0-f48.google.com with SMTP id d49so796683eek.21 for ; Wed, 01 May 2013 12:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=z8j6h43TfKuVMXeVTUv0pmZ1KUdQbX/ZpG1/bECtAHM=; b=R4qNK4ZHaXd9rYd1uNwc8rTewLr4oE9mLG3WwYVctGZStnUjFUOHNadtFrh0abqWkR rev+pMYXoP89HRp1dX2fuK0Bp14zawFBMWEhSUlvpc9jXsHV2NaNr1dtg0qOc7tSvTAy 1zfaMbtEiX6Mv85MgNuZ7hOov8ojfS4vKP6rqGY5hHq2fqviNXyY8VISFRbyHeccUoiW XRcQUc14ftuSW6lsWgOdRtw0FQ3ea0RNlx2kc0nH48+728+pQojDUmRr6jJxB6ld5Q95 3VU+JVUSeReNZa3MRdCMA9hbUa5bBK1l+HjD9ioT9NpJUh82D3LqRK0nTAV+JFJ+r7wT v0+A== X-Received: by 10.14.110.198 with SMTP id u46mr11206898eeg.41.1367434963783; Wed, 01 May 2013 12:02:43 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id cb50sm5126987eeb.14.2013.05.01.12.02.42 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 12:02:42 -0700 (PDT) From: Tomasz Figa To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/4] drm/exynos: fimd: Add support for FIMD variants with clock selection Date: Wed, 1 May 2013 21:02:28 +0200 Message-Id: <1367434949-14838-4-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1367434949-14838-1-git-send-email-tomasz.figa@gmail.com> References: <1367434949-14838-1-git-send-email-tomasz.figa@gmail.com> Cc: linux-samsung-soc@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Some platforms that can be supported this driver has additional clock source selection bits in VIDCON0 register that allows to select which clock should be used to drive the pixel clock: bus clock or special clock. Since this driver assumes that special clock always drives the pixel clock, this patch sets the selection bitfield to use the special clock. Signed-off-by: Tomasz Figa --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index a5559f6..a2e385d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -65,6 +65,7 @@ struct fimd_driver_data { unsigned int timing_base; unsigned int has_shadowcon:1; + unsigned int has_clksel:1; }; static struct fimd_driver_data exynos4_fimd_driver_data = { @@ -278,6 +279,11 @@ static void fimd_commit(struct device *dev) val = ctx->vidcon0; val &= ~(VIDCON0_CLKVAL_F_MASK | VIDCON0_CLKDIR); + if (ctx->driver_data->has_clksel) { + val &= ~VIDCON0_CLKSEL_MASK; + val |= VIDCON0_CLKSEL_LCD; + } + if (ctx->clkdiv > 1) val |= VIDCON0_CLKVAL_F(ctx->clkdiv - 1) | VIDCON0_CLKDIR; else