From patchwork Fri Jul 4 14:10:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 33102 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f70.google.com (mail-qg0-f70.google.com [209.85.192.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 48875203AC for ; Fri, 4 Jul 2014 14:10:53 +0000 (UTC) Received: by mail-qg0-f70.google.com with SMTP id z60sf3537240qgd.5 for ; Fri, 04 Jul 2014 07:10:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=l14nf1DftElt3FdNflYjrER4S/OKWqP8ArJSXWHNZoQ=; b=kDunY5vFKs7e+F+3TgvRD2Z3sy84yTqAFiI+rMB7vBo/RJBH8ZX44kf5p7iwY3MwDc X+bSNg7H6p7Ju1A5ZZF62c/Ot0Z9x9T7Tt/axPwAjJUzO1NS8AH2ecYhYEjSDrbSDMWG Ywer9eiHDX94XwmdVaQyJNQhPbzw8rYxp0UBjw58ZkipTitNwIn3FzrnkThL1LojnxDQ fGXFWUOBxO4q68Qwj4Lob8MI3DZllyWapv7BOru3llIRUppt9GiqKV7n/47UOgFsqc1H qsLjQLO9bshqA+Px7xJrG5I5GJJU3syrAE7sU6uQCKmghXKAiTAP6CFcQgvVnwhc1jdQ GccQ== X-Gm-Message-State: ALoCoQmH/DE5np2jQrpuGT+fLt0wh3Ms4zlUOdYRrm0egRiAdyB5pOopBVtFBZrL6Lt5orow02Lh X-Received: by 10.224.72.74 with SMTP id l10mr5525550qaj.4.1404483053160; Fri, 04 Jul 2014 07:10:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.36 with SMTP id k33ls853016qgk.40.gmail; Fri, 04 Jul 2014 07:10:53 -0700 (PDT) X-Received: by 10.58.132.136 with SMTP id ou8mr7324199veb.0.1404483053078; Fri, 04 Jul 2014 07:10:53 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id w15si15582933vcq.9.2014.07.04.07.10.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Jul 2014 07:10:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id il7so1652541vcb.12 for ; Fri, 04 Jul 2014 07:10:53 -0700 (PDT) X-Received: by 10.58.220.230 with SMTP id pz6mr9825203vec.9.1404483052990; Fri, 04 Jul 2014 07:10:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp468967vcb; Fri, 4 Jul 2014 07:10:52 -0700 (PDT) X-Received: by 10.69.18.97 with SMTP id gl1mr11203170pbd.78.1404483049375; Fri, 04 Jul 2014 07:10:49 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ci1si2000775pdb.431.2014.07.04.07.10.48; Fri, 04 Jul 2014 07:10:48 -0700 (PDT) Received-SPF: none (google.com: linux-omap-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758841AbaGDOKr (ORCPT + 6 others); Fri, 4 Jul 2014 10:10:47 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:52163 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756085AbaGDOKp (ORCPT ); Fri, 4 Jul 2014 10:10:45 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s64EAPKw012746; Fri, 4 Jul 2014 09:10:25 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s64EAPXp028509; Fri, 4 Jul 2014 09:10:25 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Fri, 4 Jul 2014 09:10:25 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s64EA8Eo016874; Fri, 4 Jul 2014 09:10:24 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 08/10] ARM: OMAP3: control: add API for setting up the modem pads Date: Fri, 4 Jul 2014 17:10:33 +0300 Message-ID: <1404483035-21666-9-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1404483035-21666-1-git-send-email-t-kristo@ti.com> References: <1404483035-21666-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: t-kristo@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch moves the functionality from PM core to control driver. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/control.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-omap2/control.h | 1 + arch/arm/mach-omap2/pm34xx.c | 15 +-------------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index 8308094..f432ffc 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c @@ -569,4 +569,30 @@ void omap3_ctrl_set_iva_bootmode_idle(void) omap_ctrl_writel(OMAP3_IVA2_BOOTMOD_IDLE, OMAP343X_CONTROL_IVA2_BOOTMOD); } + +/** + * omap3_ctrl_setup_d2d_padconf - setup stacked modem pads for idle + * + * Sets up the pads controlling the stacked modem in such way that the + * device can enter idle. + */ +void omap3_ctrl_setup_d2d_padconf(void) +{ + u16 mask, padconf; + + /* + * In a stand alone OMAP3430 where there is not a stacked + * modem for the D2D Idle Ack and D2D MStandby must be pulled + * high. S CONTROL_PADCONF_SAD2D_IDLEACK and + * CONTROL_PADCONF_SAD2D_MSTDBY to have a pull up. + */ + mask = (1 << 4) | (1 << 3); /* pull-up, enabled */ + padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_MSTANDBY); + padconf |= mask; + omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_MSTANDBY); + + padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_IDLEACK); + padconf |= mask; + omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK); +} #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index da05480..fc00158 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h @@ -428,6 +428,7 @@ extern void omap_ctrl_write_dsp_boot_mode(u8 bootmode); extern void omap3630_ctrl_disable_rta(void); extern int omap3_ctrl_save_padconf(void); extern void omap3_ctrl_set_iva_bootmode_idle(void); +void omap3_ctrl_setup_d2d_padconf(void); extern void omap2_set_globals_control(void __iomem *ctrl, void __iomem *ctrl_pad); #else diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 3ea04ac..126f3ec 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -355,20 +355,7 @@ restore: static void __init omap3_d2d_idle(void) { - u16 mask, padconf; - - /* In a stand alone OMAP3430 where there is not a stacked - * modem for the D2D Idle Ack and D2D MStandby must be pulled - * high. S CONTROL_PADCONF_SAD2D_IDLEACK and - * CONTROL_PADCONF_SAD2D_MSTDBY to have a pull up. */ - mask = (1 << 4) | (1 << 3); /* pull-up, enabled */ - padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_MSTANDBY); - padconf |= mask; - omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_MSTANDBY); - - padconf = omap_ctrl_readw(OMAP3_PADCONF_SAD2D_IDLEACK); - padconf |= mask; - omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK); + omap3_ctrl_setup_d2d_padconf(); /* reset modem */ omap3_prm_reset_modem();