From patchwork Wed Dec 8 23:54:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: omar ramirez X-Patchwork-Id: 392522 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB905T7a005348 for ; Thu, 9 Dec 2010 00:05:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751516Ab0LIAF3 (ORCPT ); Wed, 8 Dec 2010 19:05:29 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:39313 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928Ab0LIAF2 (ORCPT ); Wed, 8 Dec 2010 19:05:28 -0500 Received: from dlep35.itg.ti.com ([157.170.170.118]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id oB905Fn7013214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Dec 2010 18:05:16 -0600 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id oB905D9K011149; Wed, 8 Dec 2010 18:05:13 -0600 (CST) Received: from localhost (bacab.am.dhcp.ti.com [128.247.77.143]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id oB905Df01336; Wed, 8 Dec 2010 18:05:13 -0600 (CST) From: Omar Ramirez Luna To: Tony Lindgren , Paul Walmsley Cc: Russell King , Kevin Hilman , Omar Ramirez Luna , Thara Gopinath , Hari Kanigeri , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/6] OMAP: device: make rt_va easily avaialable to drivers Date: Wed, 8 Dec 2010 17:54:22 -0600 Message-Id: <1291852462-3509-1-git-send-email-omar.ramirez@ti.com> X-Mailer: git-send-email 1.7.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 09 Dec 2010 00:05:30 +0000 (UTC) diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index 28e2d1a..1877c1a 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h @@ -80,6 +80,7 @@ struct omap_device { int omap_device_enable(struct platform_device *pdev); int omap_device_idle(struct platform_device *pdev); int omap_device_shutdown(struct platform_device *pdev); +void __iomem *omap_device_get_rt_va(struct platform_device *pdev); /* Core code interface */ @@ -101,8 +102,6 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id, int omap_device_register(struct omap_device *od); int omap_early_device_register(struct omap_device *od); -void __iomem *omap_device_get_rt_va(struct omap_device *od); - /* OMAP PM interface */ int omap_device_align_pm_lat(struct platform_device *pdev, u32 new_wakeup_lat_limit); diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index abe933c..9d11195 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -681,7 +681,7 @@ struct powerdomain *omap_device_get_pwrdm(struct omap_device *od) /** * omap_device_get_mpu_rt_va - return the MPU's virtual addr for the hwmod base - * @od: struct omap_device * + * @pdev: struct platform_device * * * Return the MPU's virtual address for the base of the hwmod, from * the ioremap() that the hwmod code does. Only valid if there is one @@ -690,8 +690,12 @@ struct powerdomain *omap_device_get_pwrdm(struct omap_device *od) * otherwise, passes along the return value from * omap_hwmod_get_mpu_rt_va(). */ -void __iomem *omap_device_get_rt_va(struct omap_device *od) +void __iomem *omap_device_get_rt_va(struct platform_device *pdev) { + struct omap_device *od; + + od = _find_by_pdev(pdev); + if (od->hwmods_cnt != 1) return NULL;