From patchwork Wed Mar 2 10:55:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 602761 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 p22AvZpA009122 for ; Wed, 2 Mar 2011 10:57:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757193Ab1CBK50 (ORCPT ); Wed, 2 Mar 2011 05:57:26 -0500 Received: from na3sys009aog108.obsmtp.com ([74.125.149.199]:49401 "EHLO na3sys009aog108.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757115Ab1CBK5Z (ORCPT ); Wed, 2 Mar 2011 05:57:25 -0500 Received: from source ([209.85.213.41]) (using TLSv1) by na3sys009aob108.postini.com ([74.125.148.12]) with SMTP ID DSNKTW4ilAu98B4C/YamRYkr+Kb82H/oukqT@postini.com; Wed, 02 Mar 2011 02:57:25 PST Received: by mail-yw0-f41.google.com with SMTP id 5so2252668yws.28 for ; Wed, 02 Mar 2011 02:57:24 -0800 (PST) Received: by 10.151.45.16 with SMTP id x16mr10155253ybj.358.1299063444758; Wed, 02 Mar 2011 02:57:24 -0800 (PST) Received: from localhost (dragon.ti.com [192.94.94.33]) by mx.google.com with ESMTPS id r18sm21437yba.11.2011.03.02.02.57.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Mar 2011 02:57:23 -0800 (PST) From: Nishanth Menon To: linux-omap Cc: Kevin H , Tony L , linux-arm , Nishanth Menon Subject: [PATCH v2 12/18] omap3+: sr: enable/disable SR only on need Date: Wed, 2 Mar 2011 16:25:25 +0530 Message-Id: <1299063331-27968-13-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1299063331-27968-1-git-send-email-nm@ti.com> References: <1299063331-27968-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]); Wed, 02 Mar 2011 10:57:36 +0000 (UTC) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 8cad92d..4fc679e 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; }