From patchwork Mon Aug 29 17:58:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1109862 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7TI35Xg008068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 29 Aug 2011 18:08:03 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qy6AU-0002Gp-AJ; Mon, 29 Aug 2011 18:02:42 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qy6AT-0007Dj-NC; Mon, 29 Aug 2011 18:02:41 +0000 Received: from na3sys009aog111.obsmtp.com ([74.125.149.205]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qy65w-0006lN-Ew for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2011 17:58:01 +0000 Received: from mail-iy0-f181.google.com ([209.85.210.181]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKTlvTJiT9fMD9dG3YOQGXo04YSw0F0Ia3@postini.com; Mon, 29 Aug 2011 10:58:00 PDT Received: by mail-iy0-f181.google.com with SMTP id z21so1194263iab.12 for ; Mon, 29 Aug 2011 10:57:58 -0700 (PDT) Received: by 10.231.26.68 with SMTP id d4mr11118145ibc.66.1314640678695; Mon, 29 Aug 2011 10:57:58 -0700 (PDT) Received: from localhost.localdomain (c-24-19-7-36.hsd1.wa.comcast.net [24.19.7.36]) by mx.google.com with ESMTPS id b9sm2718294ibb.32.2011.08.29.10.57.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Aug 2011 10:57:57 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Subject: [PATCH 09/12] OMAP: VP: Explicitly mask VPVOLTAGE field Date: Mon, 29 Aug 2011 10:58:09 -0700 Message-Id: <1314640692-3386-10-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1314640692-3386-1-git-send-email-khilman@ti.com> References: <1314640692-3386-1-git-send-email-khilman@ti.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110829_135800_884584_22F1D83B X-CRM114-Status: GOOD ( 15.40 ) X-Spam-Score: -1.6 (-) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-1.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.205 listed in list.dnswl.org] 0.7 FRT_TODAY2 BODY: ReplaceTags: Today (2) Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 29 Aug 2011 18:09:23 +0000 (UTC) From: Todd Poynor Reading the VPVOLTAGE field of PRM_VP_*_VOLTAGE registers currently relies on a u32 -> u8 conversion to mask off the FORCEUPDATEWAIT field in the upper bits. Make this explicit using the mask symbol already defined, added as a new field in struct omap_vp_common. Signed-off-by: Todd Poynor Signed-off-by: Kevin Hilman --- arch/arm/mach-omap2/vp.c | 3 ++- arch/arm/mach-omap2/vp.h | 2 ++ arch/arm/mach-omap2/vp3xxx_data.c | 2 ++ arch/arm/mach-omap2/vp44xx_data.c | 1 + 4 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c index e7d38f6..3807620 100644 --- a/arch/arm/mach-omap2/vp.c +++ b/arch/arm/mach-omap2/vp.c @@ -227,7 +227,8 @@ unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm) return 0; } - curr_vsel = voltdm->read(vp->voltage); + curr_vsel = (voltdm->read(vp->voltage) & vp->common->vpvoltage_mask) + >> __ffs(vp->common->vpvoltage_mask); if (!voltdm->pmic || !voltdm->pmic->vsel_to_uv) { pr_warning("%s: PMIC function to convert vsel to voltage" diff --git a/arch/arm/mach-omap2/vp.h b/arch/arm/mach-omap2/vp.h index 0d63267..f78752b 100644 --- a/arch/arm/mach-omap2/vp.h +++ b/arch/arm/mach-omap2/vp.h @@ -63,6 +63,7 @@ struct omap_vp_ops { * @vlimitto_vddmin_shift: VDDMIN field shift in PRM_VP*_VLIMITTO reg * @vlimitto_vddmax_shift: VDDMAX field shift in PRM_VP*_VLIMITTO reg * @vlimitto_timeout_shift: TIMEOUT field shift in PRM_VP*_VLIMITTO reg + * @vpvoltage_mask: VPVOLTAGE field mask in PRM_VP*_VOLTAGE reg */ struct omap_vp_common { u32 vpconfig_erroroffset_mask; @@ -79,6 +80,7 @@ struct omap_vp_common { u8 vlimitto_vddmin_shift; u8 vlimitto_vddmax_shift; u8 vlimitto_timeout_shift; + u8 vpvoltage_mask; const struct omap_vp_ops *ops; }; diff --git a/arch/arm/mach-omap2/vp3xxx_data.c b/arch/arm/mach-omap2/vp3xxx_data.c index d429c44..260c554 100644 --- a/arch/arm/mach-omap2/vp3xxx_data.c +++ b/arch/arm/mach-omap2/vp3xxx_data.c @@ -51,6 +51,8 @@ static const struct omap_vp_common omap3_vp_common = { .vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT, .vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT, .vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT, + .vpvoltage_mask = OMAP3430_VPVOLTAGE_MASK, + .ops = &omap3_vp_ops, }; diff --git a/arch/arm/mach-omap2/vp44xx_data.c b/arch/arm/mach-omap2/vp44xx_data.c index 0daf2a4..b4e7704 100644 --- a/arch/arm/mach-omap2/vp44xx_data.c +++ b/arch/arm/mach-omap2/vp44xx_data.c @@ -51,6 +51,7 @@ static const struct omap_vp_common omap4_vp_common = { .vlimitto_vddmin_shift = OMAP4430_VDDMIN_SHIFT, .vlimitto_vddmax_shift = OMAP4430_VDDMAX_SHIFT, .vlimitto_timeout_shift = OMAP4430_TIMEOUT_SHIFT, + .vpvoltage_mask = OMAP4430_VPVOLTAGE_MASK, .ops = &omap4_vp_ops, };