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: 1201811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 81A54E0038 for ; Mon, 16 Jul 2012 19:26:56 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SqqtL-0004K2-8j; Mon, 16 Jul 2012 19:23:36 +0000 Received: from mail-yx0-f177.google.com ([209.85.213.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SqqrZ-0004E9-Js for linux-arm-kernel@lists.infradead.org; Mon, 16 Jul 2012 19:21:46 +0000 Received: by yenr9 with SMTP id r9so5827653yen.36 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=bQ7wOasIEtaOv099uWQnSeUROq6qi1dBy0D7dlIMaOzT4oLe7j6sqwVd641wN/Wkyp 8gYO6R+erEjofIgtRAFwgWppPliFrh8BWsX6NN9vxTNxQm4NG+ZMum4+UT3igV4/Jzxd 6UcHSLb0ijXjEUBKzN8NZ1A7Fl1HjlugslACoFGGQa3exx1T9SaRmnzyy8LJXiqqIWjM Cpwm2hEuLpCMk069WWc3obPJYRYulFtLVkBCO15YZ5R9CV+dpoPZFQ3ViPJZx13pkBmH F6juoi/MtO3twdte5w6Ccrs7pi8KV3k+hWNTjy0WKjyso5s50o+IQhpPFjRg5ZTWK9+M NZtg== 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 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: ALoCoQkl9mI7WfsIKvwQZx2HaW11z07hkQbLhQVwkxXU5VxIszZJ6SdoWF2BB91r31fyPJ4AVPL9 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.177 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Kevin Hilman , Ohad Ben-Cohen , Russell King , Benoit Cousson , Tony Lindgren , linux-kernel@vger.kernel.org, Tomi Valkeinen , Omar Ramirez Luna , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 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 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 * *