From patchwork Sat Feb 19 12:01:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 574791 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 p1JC2BhF013921 for ; Sat, 19 Feb 2011 12:03:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754372Ab1BSMDv (ORCPT ); Sat, 19 Feb 2011 07:03:51 -0500 Received: from na3sys009aog105.obsmtp.com ([74.125.149.75]:45206 "EHLO na3sys009aog105.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752901Ab1BSMDu (ORCPT ); Sat, 19 Feb 2011 07:03:50 -0500 Received: from source ([74.125.83.44]) (using TLSv1) by na3sys009aob105.postini.com ([74.125.148.12]) with SMTP ID DSNKTV+xpmuENagoAEZumcUsXF0WQmNxnXXn@postini.com; Sat, 19 Feb 2011 04:03:50 PST Received: by gwb20 with SMTP id 20so2163493gwb.31 for ; Sat, 19 Feb 2011 04:03:49 -0800 (PST) Received: by 10.151.101.1 with SMTP id d1mr2345060ybm.404.1298117029557; Sat, 19 Feb 2011 04:03:49 -0800 (PST) Received: from localhost (dragon.ti.com [192.94.94.33]) by mx.google.com with ESMTPS id x62sm1989613yhc.30.2011.02.19.04.03.46 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 19 Feb 2011 04:03:48 -0800 (PST) From: Nishanth Menon To: linux-omap Cc: Tony Lindgren , Kevin Hilman , Nishanth Menon Subject: [PATCH 13/19] omap3+: sr: enable/disable SR only on need Date: Sat, 19 Feb 2011 17:31:52 +0530 Message-Id: <1298116918-30744-14-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1298116918-30744-1-git-send-email-nm@ti.com> References: <1298116918-30744-1-git-send-email-nm@ti.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]); Sat, 19 Feb 2011 12:03:52 +0000 (UTC) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 9c61ab0..65431df 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -819,10 +819,13 @@ static int omap_sr_autocomp_store(void *data, u64 val) return -EINVAL; } - if (!val) - sr_stop_vddautocomp(sr_info); - else - sr_start_vddautocomp(sr_info); + /* control enable/disable only if there is a delta in value */ + if (sr_info->autocomp_active ^ val) { + if (!val) + sr_stop_vddautocomp(sr_info); + else + sr_start_vddautocomp(sr_info); + } return 0; }