From patchwork Wed Mar 2 15:57:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 603161 X-Patchwork-Delegate: khilman@deeprootsystems.com 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 p22FuPHp010307 for ; Wed, 2 Mar 2011 15:56:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754327Ab1CBP4Y (ORCPT ); Wed, 2 Mar 2011 10:56:24 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:59934 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752886Ab1CBP4X (ORCPT ); Wed, 2 Mar 2011 10:56:23 -0500 Received: by mail-ey0-f174.google.com with SMTP id 24so22036eyx.19 for ; Wed, 02 Mar 2011 07:56:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=jB47vAeIkOib3FjfjKeOiJTJ6V2BGGzkKyKfb/2GUv4=; b=jfVKaQESdzrY2TxJPgnkvW/T6yetIR25cTUGXBw4TuBggvEvxcZdArqcfg0nRWyr0U uWZwdhOP3b8zftCZMSFEXHm08tuVVEWIamQl9lu25SPEsVLPI+7Hi9PQux3psw8dVTYZ tfOopriSBHL3J6nf39KV/RW09KHvKBMBo7LM4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=ue9fHHugVxEeShDfNBbZ4BVS6eBGL4AJLIqYRUZO/6lr4i344vgWCgfFitxa8rZKiv WVlLpnRVsLfp6lHahtGrflfddnf6Srb+K/Hk5xujQF+w7pXaO8JMU25/Dz05uHgOf5b2 qbBvuyORX7N0FxnNZBIhK83nabPTFS7MPx49A= Received: by 10.14.126.141 with SMTP id b13mr21777eei.47.1299081382877; Wed, 02 Mar 2011 07:56:22 -0800 (PST) Received: from localhost ([194.136.136.46]) by mx.google.com with ESMTPS id b52sm71227eei.19.2011.03.02.07.56.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Mar 2011 07:56:22 -0800 (PST) From: Jarkko Nikula To: linux-omap@vger.kernel.org Cc: Thara Gopinath , Nishanth Menon , Jarkko Nikula Subject: [RFC 3/3] omap3+: sr: Reuse sr_[start|stop]_vddautocomp functions Date: Wed, 2 Mar 2011 17:57:25 +0200 Message-Id: <1299081445-27938-4-git-send-email-jhnikula@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1299081445-27938-1-git-send-email-jhnikula@gmail.com> References: <1299081445-27938-1-git-send-email-jhnikula@gmail.com> 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.6 (demeter1.kernel.org [140.211.167.41]); Wed, 02 Mar 2011 15:56:25 +0000 (UTC) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 11741d8..7e6002f 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -227,7 +227,7 @@ static void sr_start_vddautocomp(struct omap_sr *sr) sr->autocomp_active = true; } -static void sr_stop_vddautocomp(struct omap_sr *sr) +static void sr_stop_vddautocomp(struct omap_sr *sr, int is_volt_reset) { if (!sr->autocomp_active) return; @@ -239,7 +239,7 @@ static void sr_stop_vddautocomp(struct omap_sr *sr) return; } - if (!sr_class->disable(sr->voltdm, 1)) + if (!sr_class->disable(sr->voltdm, is_volt_reset)) sr->autocomp_active = false; } @@ -681,16 +681,7 @@ void omap_sr_enable(struct voltagedomain *voltdm) return; } - if (!sr->autocomp_active) - return; - - if (!sr_class || !(sr_class->enable) || !(sr_class->configure)) { - dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not" - "registered\n", __func__); - return; - } - - sr_class->enable(voltdm); + sr_start_vddautocomp(sr); } /** @@ -714,16 +705,7 @@ void omap_sr_disable(struct voltagedomain *voltdm) return; } - if (!sr->autocomp_active) - return; - - if (!sr_class || !(sr_class->disable)) { - dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not" - "registered\n", __func__); - return; - } - - sr_class->disable(voltdm, 0); + sr_stop_vddautocomp(sr, 0); } /** @@ -747,16 +729,7 @@ void omap_sr_disable_reset_volt(struct voltagedomain *voltdm) return; } - if (!sr->autocomp_active) - return; - - if (!sr_class || !(sr_class->disable)) { - dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not" - "registered\n", __func__); - return; - } - - sr_class->disable(voltdm, 1); + sr_stop_vddautocomp(sr, 1); } /** @@ -809,7 +782,7 @@ static int omap_sr_autocomp_store(void *data, u64 val) } if (!val) - sr_stop_vddautocomp(sr_info); + sr_stop_vddautocomp(sr_info, 1); else sr_start_vddautocomp(sr_info); @@ -976,7 +949,7 @@ static int __devexit omap_sr_remove(struct platform_device *pdev) } if (sr_info->autocomp_active) - sr_stop_vddautocomp(sr_info); + sr_stop_vddautocomp(sr_info, 1); list_del(&sr_info->node); iounmap(sr_info->base);