From patchwork Fri Apr 1 23:41:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 682721 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 p31Neq9v005900 for ; Fri, 1 Apr 2011 23:40:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753914Ab1DAXkv (ORCPT ); Fri, 1 Apr 2011 19:40:51 -0400 Received: from na3sys009aog116.obsmtp.com ([74.125.149.240]:43286 "EHLO na3sys009aog116.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753698Ab1DAXkv (ORCPT ); Fri, 1 Apr 2011 19:40:51 -0400 Received: from source ([209.85.210.181]) (using TLSv1) by na3sys009aob116.postini.com ([74.125.148.12]) with SMTP ID DSNKTZZignjvrGCYrBSrv4X2OJW4sInr4FA4@postini.com; Fri, 01 Apr 2011 16:40:50 PDT Received: by mail-iy0-f181.google.com with SMTP id 26so4704968iyb.12 for ; Fri, 01 Apr 2011 16:40:50 -0700 (PDT) Received: by 10.42.213.132 with SMTP id gw4mr2678187icb.59.1301701250276; Fri, 01 Apr 2011 16:40:50 -0700 (PDT) Received: from localhost (c-24-18-179-55.hsd1.wa.comcast.net [24.18.179.55]) by mx.google.com with ESMTPS id i26sm1760588iby.7.2011.04.01.16.40.49 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Apr 2011 16:40:49 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Subject: [PATCH/RFC 09/13] OMAP3+: VC: move on/onlp/ret/off command configuration into common init Date: Fri, 1 Apr 2011 16:41:07 -0700 Message-Id: <1301701271-22096-10-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1301701271-22096-1-git-send-email-khilman@ti.com> References: <1301701271-22096-1-git-send-email-khilman@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]); Fri, 01 Apr 2011 23:40:52 +0000 (UTC) diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 7731794..4114909 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c @@ -148,26 +148,11 @@ static void __init omap3_vfsm_init(struct voltagedomain *voltdm) static void __init omap3_vc_init_channel(struct voltagedomain *voltdm) { - struct omap_vc_channel *vc = voltdm->vc; - struct omap_vdd_info *vdd = voltdm->vdd; static bool is_initialized; - u8 on_vsel, onlp_vsel, ret_vsel, off_vsel; - u32 vc_val; if (is_initialized) return; - /* Set up the on, inactive, retention and off voltage */ - on_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->on_volt); - onlp_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->onlp_volt); - ret_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->ret_volt); - off_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->off_volt); - vc_val = ((on_vsel << vc->common->cmd_on_shift) | - (onlp_vsel << vc->common->cmd_onlp_shift) | - (ret_vsel << vc->common->cmd_ret_shift) | - (off_vsel << vc->common->cmd_off_shift)); - voltdm->write(vc_val, vc->cmdval_reg); - /* * Generic VC parameters init * XXX This data should be abstracted out @@ -192,8 +177,6 @@ static void __init omap4_vc_init_channel(struct voltagedomain *voltdm) if (is_initialized) return; - /* TODO: Configure setup times and CMD_VAL values*/ - /* * Generic VC parameters init * XXX This data should be abstracted out @@ -214,6 +197,8 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) { struct omap_vc_channel *vc = voltdm->vc; struct omap_vdd_info *vdd = voltdm->vdd; + u8 on_vsel, onlp_vsel, ret_vsel, off_vsel; + u32 val; if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { pr_err("%s: PMIC info requried to configure vc for" @@ -250,6 +235,17 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) vc->cmd_reg_addr << __ffs(vc->smps_cmdra_mask), vc->common->smps_cmdra_reg); + /* Set up the on, inactive, retention and off voltage */ + on_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->on_volt); + onlp_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->onlp_volt); + ret_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->ret_volt); + off_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->off_volt); + val = ((on_vsel << vc->common->cmd_on_shift) | + (onlp_vsel << vc->common->cmd_onlp_shift) | + (ret_vsel << vc->common->cmd_ret_shift) | + (off_vsel << vc->common->cmd_off_shift)); + voltdm->write(val, vc->cmdval_reg); + /* Configure the setup times */ voltdm->rmw(voltdm->vfsm->voltsetup_mask, vc->setup_time << __ffs(voltdm->vfsm->voltsetup_mask),