From patchwork Fri May 27 07:38:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 823172 Received: from bombadil.infradead.org (173-166-109-252-newengland.hfc.comcastbusiness.net [173.166.109.252]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4R7iiNR025076 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 27 May 2011 07:45:06 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QPrdX-0005fy-V8; Fri, 27 May 2011 07:39:12 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QPrdV-0000Gr-Jv; Fri, 27 May 2011 07:39:09 +0000 Received: from na3sys009aog116.obsmtp.com ([74.125.149.240]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1QPrd7-0000FV-Ij for linux-arm-kernel@lists.infradead.org; Fri, 27 May 2011 07:38:47 +0000 Received: from mail-ey0-f182.google.com ([209.85.215.182]) (using TLSv1) by na3sys009aob116.postini.com ([74.125.148.12]) with SMTP ID DSNKTd9VAvN8Bq9pKlZJGGltoAydyQALJ90H@postini.com; Fri, 27 May 2011 00:38:45 PDT Received: by eyg7 with SMTP id 7so761872eyg.41 for ; Fri, 27 May 2011 00:38:41 -0700 (PDT) Received: by 10.213.31.142 with SMTP id y14mr579099ebc.87.1306481921493; Fri, 27 May 2011 00:38:41 -0700 (PDT) Received: from localhost.localdomain (a62-248-131-233.elisa-laajakaista.fi [62.248.131.233]) by mx.google.com with ESMTPS id a45sm1065898eec.23.2011.05.27.00.38.39 (version=SSLv3 cipher=OTHER); Fri, 27 May 2011 00:38:40 -0700 (PDT) From: Tomi Valkeinen To: Kevin Hilman , Paul Walmsley Subject: [PATCHv2 2/2] OMAP: add omap_device_reset() Date: Fri, 27 May 2011 10:38:28 +0300 Message-Id: <1306481908-7386-3-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1306481908-7386-1-git-send-email-tomi.valkeinen@ti.com> References: <1306481908-7386-1-git-send-email-tomi.valkeinen@ti.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110527_033845_877032_060C5DE9 X-CRM114-Status: GOOD ( 14.25 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.240 listed in list.dnswl.org] Cc: Tomi Valkeinen , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 27 May 2011 07:45:06 +0000 (UTC) Add omap_device_reset() function which can be used to reset the hwmods associated with the given platform device. Signed-off-by: Tomi Valkeinen --- arch/arm/plat-omap/include/plat/omap_device.h | 1 + arch/arm/plat-omap/omap_device.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index 70d31d0..bcf1b35 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h @@ -108,6 +108,7 @@ int omap_device_align_pm_lat(struct platform_device *pdev, u32 new_wakeup_lat_limit); struct powerdomain *omap_device_get_pwrdm(struct omap_device *od); int omap_device_get_context_loss_count(struct platform_device *pdev); +int omap_device_reset(struct platform_device *pdev); /* Other */ diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 9753f71..4e6fc1b 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -324,6 +324,29 @@ int omap_device_get_context_loss_count(struct platform_device *pdev) } /** + * omap_device_reset - reset hwmods of given device + * @pdev: struct platform_device * + * + * Reset all hwmods associated with the given device. If a reset of a hwmod + * fails the rest of the hwmods are skipped and the error is returned. + */ +int omap_device_reset(struct platform_device *pdev) +{ + struct omap_device *od; + int i, r; + + od = _find_by_pdev(pdev); + + for (i = 0; i < od->hwmods_cnt; i++) { + r = omap_hwmod_reset(od->hwmods[i]); + if (r) + return r; + } + + return 0; +} + +/** * omap_device_count_resources - count number of struct resource entries needed * @od: struct omap_device * *