From patchwork Mon Jul 16 19:21:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Ramirez Luna X-Patchwork-Id: 1201781 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 3CC1AE0038 for ; Mon, 16 Jul 2012 19:22:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752078Ab2GPTW3 (ORCPT ); Mon, 16 Jul 2012 15:22:29 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:39594 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753806Ab2GPTVm (ORCPT ); Mon, 16 Jul 2012 15:21:42 -0400 Received: by mail-yx0-f174.google.com with SMTP id l2so5375412yen.19 for ; Mon, 16 Jul 2012 12:21:42 -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=6QFnPwCLEW5idILUEImF841JFb9MiTBgOZNbzQIHXj4=; b=KKOjdESL0mWk/wdtU6whNIw5BIU6oc1c+5kKewZ3NRZ6+OVgmzpKa8uywoYN2yoVI7 TDwevZwGjD9ll8IJD/Ij9GtdnZuBLYZsQpOU8hJvQCzDq+oz9iqfrAyqjxofP0KL6VYp zXWqU4vikOC0YKSMc8QHnJILEee82vt3pakIRKWNgFR11Mffl7GC/WgVT3m3Ooum7m01 1BUfUDXYGX+YlmoPkUBCOXaE8FhQ8jTUjvic6dT7MMu5jqypD6N4s6f14Yqp2UvLtms2 dtW9qwF4vrLP/9v0iUy7N2DyVcBrZae4z1HTm3Vl7CBsMmPjRSXCgG5ON1GuDqwl5A+I T44w== Received: by 10.60.3.137 with SMTP id c9mr17100454oec.21.1342466502490; Mon, 16 Jul 2012 12:21:42 -0700 (PDT) Received: from localhost.localdomain (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id g3sm10205811oeb.5.2012.07.16.12.21.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jul 2012 12:21:41 -0700 (PDT) From: Omar Ramirez Luna To: Paul Walmsley Cc: Benoit Cousson , Tony Lindgren , Russell King , Kevin Hilman , Ohad Ben-Cohen , Tomi Valkeinen , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Omar Ramirez Luna Subject: [PATCH 3/3] ARM: OMAP: omap_device: expose hwmod assert/deassert to omap devices Date: Mon, 16 Jul 2012 14:21:25 -0500 Message-Id: <1342466485-1050-4-git-send-email-omar.luna@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1342466485-1050-1-git-send-email-omar.luna@linaro.org> References: <1342466485-1050-1-git-send-email-omar.luna@linaro.org> X-Gm-Message-State: ALoCoQnOGz7Y+1r2Llj7WUCV+A/SDliZULw6EoSVKjsPu21s0vaW8bW3fRa2nRgB2XRqm65GlCre Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org This APIs are meant to be an interface to hwmod assert/deassert function, omap devices can call them through their platform data to control their reset lines, they are expected to know the name of the reset line they are trying to control. Signed-off-by: Omar Ramirez Luna --- arch/arm/plat-omap/include/plat/omap_device.h | 4 ++ arch/arm/plat-omap/omap_device.c | 45 +++++++++++++++++++++++++ 2 files changed, 49 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 4327b2c..27bcc24 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h @@ -118,6 +118,10 @@ int omap_device_get_context_loss_count(struct platform_device *pdev); /* Other */ +int omap_device_assert_hardreset(struct platform_device *pdev, + const char *name); +int omap_device_deassert_hardreset(struct platform_device *pdev, + const char *name); int omap_device_idle_hwmods(struct omap_device *od); int omap_device_enable_hwmods(struct omap_device *od); diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index c490240..8883074 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -925,6 +925,51 @@ int omap_device_shutdown(struct platform_device *pdev) } /** + * omap_device_assert_hardreset - set a device's reset line + * @pdev: struct platform_device * to reset + * @name: const char * with the name of the reset line + * + * According to @name, set the reset line of the hwmods associated + * with this @pdev deivce. + */ +int omap_device_assert_hardreset(struct platform_device *pdev, const char *name) +{ + int i, ret = 0; + struct omap_device *od = to_omap_device(pdev); + + for (i = 0; i < od->hwmods_cnt; i++) { + ret = omap_hwmod_assert_hardreset(od->hwmods[i], name); + if (ret) + break; + } + + return ret; +} + +/** + * omap_device_deassert_hardreset - lift a device's reset line + * @pdev: struct platform_device * to reset + * @name: const char * with the name of the reset line + * + * According to @name, lift the reset line of the hwmods associated + * with this @pdev deivce. + */ +int omap_device_deassert_hardreset(struct platform_device *pdev, + const char *name) +{ + int i, ret = 0; + struct omap_device *od = to_omap_device(pdev); + + for (i = 0; i < od->hwmods_cnt; i++) { + ret = omap_hwmod_deassert_hardreset(od->hwmods[i], name); + if (ret) + break; + } + + return ret; +} + +/** * omap_device_align_pm_lat - activate/deactivate device to match wakeup lat lim * @od: struct omap_device * *