From patchwork Thu Mar 18 09:15:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 86640 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2I9GJXb025208 for ; Thu, 18 Mar 2010 09:16:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751458Ab0CRJQZ (ORCPT ); Thu, 18 Mar 2010 05:16:25 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:50250 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143Ab0CRJQJ (ORCPT ); Thu, 18 Mar 2010 05:16:09 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o2I9G4lw019581 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Mar 2010 04:16:07 -0500 Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o2I9Fxhh012487; Thu, 18 Mar 2010 14:46:00 +0530 (IST) Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by linfarm476.india.ti.com (8.12.11/8.12.11) with ESMTP id o2I9Fw7m004333; Thu, 18 Mar 2010 14:45:58 +0530 Received: (from a0393109@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id o2I9Fwxl004331; Thu, 18 Mar 2010 14:45:58 +0530 From: Thara Gopinath To: linux-omap@vger.kernel.org Cc: khilman@deeprootsystems.com, paul@pwsan.com, nm@ti.com, b-cousson@ti.com, vishwanath.bs@ti.com, sawant@ti.com, Thara Gopinath Subject: [PATCHv2 13/17] OMAP3: PM: Support for enabling smartreflex autocompensation by default. Date: Thu, 18 Mar 2010 14:45:51 +0530 Message-Id: <1268903755-4151-14-git-send-email-thara@ti.com> X-Mailer: git-send-email 1.5.5 In-Reply-To: <1268903755-4151-13-git-send-email-thara@ti.com> References: <1268903755-4151-1-git-send-email-thara@ti.com> <1268903755-4151-2-git-send-email-thara@ti.com> <1268903755-4151-3-git-send-email-thara@ti.com> <1268903755-4151-4-git-send-email-thara@ti.com> <1268903755-4151-5-git-send-email-thara@ti.com> <1268903755-4151-6-git-send-email-thara@ti.com> <1268903755-4151-7-git-send-email-thara@ti.com> <1268903755-4151-8-git-send-email-thara@ti.com> <1268903755-4151-9-git-send-email-thara@ti.com> <1268903755-4151-10-git-send-email-thara@ti.com> <1268903755-4151-11-git-send-email-thara@ti.com> <1268903755-4151-12-git-send-email-thara@ti.com> <1268903755-4151-13-git-send-email-thara@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.3 (demeter.kernel.org [140.211.167.41]); Thu, 18 Mar 2010 09:16:38 +0000 (UTC) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 35848d9..aeb9761 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -345,6 +345,7 @@ static void sr_stop_vddautocomp(int srid) static int sr_late_init(struct omap_sr *sr_info) { char name[SMARTREFLEX_NAME_LEN]; + struct omap_smartreflex_data *pdata = sr_info->pdev->dev.platform_data; int ret = 0; if (sr_class->class_type == SR_CLASS2 && @@ -358,6 +359,10 @@ static int sr_late_init(struct omap_sr *sr_info) handler for SR%d. Smartreflex will \ not function as desired\n", sr_info->srid); } + + if (pdata->enable_on_init) + sr_start_vddautocomp(sr_info->srid); + return ret; } diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c index 1ee7f4c..209909c 100644 --- a/arch/arm/mach-omap2/sr_device.c +++ b/arch/arm/mach-omap2/sr_device.c @@ -162,7 +162,21 @@ static int __init omap_devinit_smartreflex(void) if (WARN_ON(!sr_data)) return -ENOMEM; - sr_data->enable_on_init = false; + /* + * OMAP3430 ES3.1 chips by default come with Efuse burnt + * with parameters required for full functionality of + * smartreflex AVS feature like ntarget values , sennenable + * and senpenable. So enable the SR AVS feature during boot up + * itself if it is a OMAP3430 ES3.1 chip. + */ + if (cpu_is_omap343x()) { + if (omap_rev() == OMAP3430_REV_ES3_1) + sr_data->enable_on_init = true; + else + sr_data->enable_on_init = false; + } else { + sr_data->enable_on_init = false; + } sr_data->device_enable = omap_device_enable; sr_data->device_shutdown = omap_device_shutdown; sr_data->device_idle = omap_device_idle;