From patchwork Fri Nov 30 11:43:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 1824771 Return-Path: X-Original-To: patchwork-linux-media@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 AB39BDF24C for ; Fri, 30 Nov 2012 11:44:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754744Ab2K3LoW (ORCPT ); Fri, 30 Nov 2012 06:44:22 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:53110 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932642Ab2K3LoV (ORCPT ); Fri, 30 Nov 2012 06:44:21 -0500 Received: by mail-pb0-f46.google.com with SMTP id wy7so384989pbc.19 for ; Fri, 30 Nov 2012 03:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=Ha9TuGfdjPCA+ZJGXiAqGI4je+m1qefyRNn0qqzrTNA=; b=Ki2SMvtQxHRet9RbIEMGom7bWuppPZOTCEH9rjXB/FXF2opcDbAeJ/g/rBB6BNonGy BI8xLyaYQbYUaK5HH1PIaudBRHERjVb8e2nZjHHHVvTWvUdHWZTZiCgJu39Y48yfpbYP u552U7r7JhRuyMKpUmcxohiIDJYB4a7nVihBuyEGeEdW84MfB8zFUl6oQidD3l2aOyL5 QTa5AMwsP5Y/5sXsKGwLDPhHarvf98ihF1eyO/j8mxHYeMAgSGzaeoTG/ukmlaB3Uof2 z34KKHsAf1OfsnHp05nRFiqrhkQbfqCpq64w/uceveV+wkA3dGbhoGw72RDwo4PP7+US pfnA== Received: by 10.66.79.163 with SMTP id k3mr2452401pax.60.1354275860666; Fri, 30 Nov 2012 03:44:20 -0800 (PST) Received: from localhost.localdomain ([122.166.13.141]) by mx.google.com with ESMTPS id sy1sm2924030pbc.66.2012.11.30.03.44.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Nov 2012 03:44:19 -0800 (PST) From: Prabhakar Lad To: LMML , Mauro Carvalho Chehab Cc: LKML , DLOS , Manjunath Hadli , Prabhakar Lad , Laurent Pinchart , Hans Verkuil , Sakari Ailus Subject: [PATCH v4 2/3] davinci: vpss: dm365: set vpss clk ctrl Date: Fri, 30 Nov 2012 17:13:40 +0530 Message-Id: <1354275821-25235-3-git-send-email-prabhakar.lad@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1354275821-25235-1-git-send-email-prabhakar.lad@ti.com> References: <1354275821-25235-1-git-send-email-prabhakar.lad@ti.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Manjunath Hadli request_mem_region for VPSS_CLK_CTRL register and ioremap. and enable clocks appropriately. Signed-off-by: Manjunath Hadli Signed-off-by: Lad, Prabhakar --- drivers/media/platform/davinci/vpss.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/drivers/media/platform/davinci/vpss.c b/drivers/media/platform/davinci/vpss.c index 1c96ce8..e4ad63d 100644 --- a/drivers/media/platform/davinci/vpss.c +++ b/drivers/media/platform/davinci/vpss.c @@ -69,6 +69,11 @@ MODULE_AUTHOR("Texas Instruments"); #define DM365_ISP5_CCDCMUX 0x20 #define DM365_ISP5_PG_FRAME_SIZE 0x28 #define DM365_VPBE_CLK_CTRL 0x00 + +#define VPSS_CLK_CTRL 0x01c40044 +#define VPSS_CLK_CTRL_VENCCLKEN BIT(3) +#define VPSS_CLK_CTRL_DACCLKEN BIT(4) + /* * vpss interrupts. VDINT0 - vpss_int0, VDINT1 - vpss_int1, * AF - vpss_int3 @@ -112,6 +117,7 @@ struct vpss_hw_ops { struct vpss_oper_config { __iomem void *vpss_regs_base0; __iomem void *vpss_regs_base1; + resource_size_t *vpss_regs_base2; enum vpss_platform_type platform; spinlock_t vpss_lock; struct vpss_hw_ops hw_ops; @@ -492,11 +498,20 @@ static struct platform_driver vpss_driver = { static void vpss_exit(void) { + iounmap(oper_cfg.vpss_regs_base2); + release_mem_region(VPSS_CLK_CTRL, 4); platform_driver_unregister(&vpss_driver); } static int __init vpss_init(void) { + if (!request_mem_region(VPSS_CLK_CTRL, 4, "vpss_clock_control")) + return -EBUSY; + + oper_cfg.vpss_regs_base2 = ioremap(VPSS_CLK_CTRL, 4); + writel(VPSS_CLK_CTRL_VENCCLKEN | + VPSS_CLK_CTRL_DACCLKEN, oper_cfg.vpss_regs_base2); + return platform_driver_register(&vpss_driver); } subsys_initcall(vpss_init);