From patchwork Fri Oct 9 21:34:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 52839 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n99LkGhC005248 for ; Fri, 9 Oct 2009 21:46:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758864AbZJIVfW (ORCPT ); Fri, 9 Oct 2009 17:35:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755454AbZJIVfW (ORCPT ); Fri, 9 Oct 2009 17:35:22 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:36296 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754144AbZJIVfV (ORCPT ); Fri, 9 Oct 2009 17:35:21 -0400 Received: from dlep34.itg.ti.com ([157.170.170.115]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id n99LYhfW021895 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Oct 2009 16:34:44 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id n99LYcvm002311; Fri, 9 Oct 2009 16:34:38 -0500 (CDT) Received: from senorita (senorita.am.dhcp.ti.com [128.247.75.1]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id n99LYcZ29771; Fri, 9 Oct 2009 16:34:38 -0500 (CDT) Received: by senorita (Postfix, from userid 1000) id 6791EC13A; Fri, 9 Oct 2009 16:34:38 -0500 (CDT) From: Nishanth Menon To: linux-omap Cc: Nishanth Menon , Sanjeev Premi , Kevin Hilman , Madhusudhan Chikkature Rajashekar , Sergio Alberto Aguirre Rodriguez Subject: [PATCH v2] OMAP3:PM: introduce enabled flag to omap_opp Date: Fri, 9 Oct 2009 16:34:38 -0500 Message-Id: <1255124078-12792-1-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <[PATCH] OMAP3:PM: introduce enabled flag to omap_opp> References: <[PATCH] OMAP3:PM: introduce enabled flag to omap_opp> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index cea3bca..fd9fa99 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -100,41 +100,41 @@ static struct prm_setup_vc prm_setup = { }; struct omap_opp omap3_mpu_rate_table[] = { - {0, 0, 0}, + {0, 0, 0, 0}, /*OPP1*/ - {S125M, VDD1_OPP1, 0x1E}, + {true, S125M, VDD1_OPP1, 0x1E}, /*OPP2*/ - {S250M, VDD1_OPP2, 0x26}, + {true, S250M, VDD1_OPP2, 0x26}, /*OPP3*/ - {S500M, VDD1_OPP3, 0x30}, + {true, S500M, VDD1_OPP3, 0x30}, /*OPP4*/ - {S550M, VDD1_OPP4, 0x36}, + {true, S550M, VDD1_OPP4, 0x36}, /*OPP5*/ - {S600M, VDD1_OPP5, 0x3C}, + {true, S600M, VDD1_OPP5, 0x3C}, }; struct omap_opp omap3_l3_rate_table[] = { - {0, 0, 0}, + {0, 0, 0, 0}, /*OPP1*/ - {0, VDD2_OPP1, 0x1E}, + {false, 0, VDD2_OPP1, 0x1E}, /*OPP2*/ - {S83M, VDD2_OPP2, 0x24}, + {true, S83M, VDD2_OPP2, 0x24}, /*OPP3*/ - {S166M, VDD2_OPP3, 0x2C}, + {true, S166M, VDD2_OPP3, 0x2C}, }; struct omap_opp omap3_dsp_rate_table[] = { - {0, 0, 0}, + {0, 0, 0, 0}, /*OPP1*/ - {S90M, VDD1_OPP1, 0x1E}, + {true, S90M, VDD1_OPP1, 0x1E}, /*OPP2*/ - {S180M, VDD1_OPP2, 0x26}, + {true, S180M, VDD1_OPP2, 0x26}, /*OPP3*/ - {S360M, VDD1_OPP3, 0x30}, + {true, S360M, VDD1_OPP3, 0x30}, /*OPP4*/ - {S400M, VDD1_OPP4, 0x36}, + {true, S400M, VDD1_OPP4, 0x36}, /*OPP5*/ - {S430M, VDD1_OPP5, 0x3C}, + {true, S430M, VDD1_OPP5, 0x3C}, }; const struct omap_opp_table omap3_mpu_opp_table = { diff --git a/arch/arm/mach-omap2/resource34xx.c b/arch/arm/mach-omap2/resource34xx.c index 491e1dc..12de2c6 100644 --- a/arch/arm/mach-omap2/resource34xx.c +++ b/arch/arm/mach-omap2/resource34xx.c @@ -282,6 +282,9 @@ static int program_opp(int res, struct omap_opp *opp, int target_level, t_opp = ID_VDD(res) | ID_OPP_NO(opp[target_level].opp_id); c_opp = ID_VDD(res) | ID_OPP_NO(opp[current_level].opp_id); #endif + /* only allow enabled OPPs */ + if (!opp[target_level].enabled) + return -EINVAL; /* Sanity check of the OPP params before attempting to set */ if (!opp[target_level].rate || !opp[target_level].vsel) diff --git a/arch/arm/plat-omap/include/mach/omap-pm.h b/arch/arm/plat-omap/include/mach/omap-pm.h index 51216cf..33e1a3e 100644 --- a/arch/arm/plat-omap/include/mach/omap-pm.h +++ b/arch/arm/plat-omap/include/mach/omap-pm.h @@ -21,6 +21,7 @@ /** * struct omap_opp - clock frequency-to-OPP ID table for DSP, MPU + * @enabled: enabled if true, disabled if false * @rate: target clock rate * @opp_id: OPP ID * @min_vdd: minimum VDD1 voltage (in millivolts) for this OPP @@ -28,6 +29,7 @@ * Operating performance point data. Can vary by OMAP chip and board. */ struct omap_opp { + bool enabled; unsigned long rate; u8 opp_id; u16 vsel;