From patchwork Tue Mar 4 16:19:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 25707 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA1AE2066C for ; Tue, 4 Mar 2014 16:20:45 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf25612985iec.0 for ; Tue, 04 Mar 2014 08:20:45 -0800 (PST) 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=CZahZC03CSp3ArMZ514D51ZhWBmYwRRp2Ok0dAOnAGE=; b=ZnHUn8JQ8zc/UIw3E1LUZ3uLX6DiNoq76lp2lXeavXkIv1YBTKjQW5grQNAMS9exzI ZSx9RWzYCAA9kM2LiXnAzlcXyrc79jEXoxFigP4DGQOGUZYkVES1c+GLyCKMUkw7ubBn ltjfrU6OFdsj9djosVhSZdhUOBU1niX0ULgS7Qdg1nbGwAgJJki/BTMhknFptdYAEZ1o TMCkOjXI8WpetkAkI+aQCsC9RfOlYZhSSLnaoF8ZkwdJkKk5KfwpfSbwzWwFRwf5UZ0p 3HX+eyoncNQLum1GoYJU4GTPVkLnYOzZjJ7EwmtiQSSP+ZPksFZT1l4FfVLReAMn8MqV dmyg== X-Gm-Message-State: ALoCoQkr9jaJGxMkhD/d4seTFXl5uK/QRzQ+/D+343phR01VpBwsF+wBR1an94dVb68ey6gE9Hzd X-Received: by 10.182.186.73 with SMTP id fi9mr193672obc.48.1393950045156; Tue, 04 Mar 2014 08:20:45 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.137 with SMTP id l9ls2605771qgf.40.gmail; Tue, 04 Mar 2014 08:20:45 -0800 (PST) X-Received: by 10.52.24.101 with SMTP id t5mr106538vdf.79.1393950045040; Tue, 04 Mar 2014 08:20:45 -0800 (PST) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id lz6si5958864vcb.31.2014.03.04.08.20.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 08:20:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ik5so4495145vcb.23 for ; Tue, 04 Mar 2014 08:20:45 -0800 (PST) X-Received: by 10.52.35.48 with SMTP id e16mr123860vdj.51.1393950044937; Tue, 04 Mar 2014 08:20:44 -0800 (PST) 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.220.130.193 with SMTP id u1csp138090vcs; Tue, 4 Mar 2014 08:20:44 -0800 (PST) X-Received: by 10.68.170.228 with SMTP id ap4mr259289pbc.149.1393950044146; Tue, 04 Mar 2014 08:20:44 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wq4si14758274pbc.137.2014.03.04.08.20.43; Tue, 04 Mar 2014 08:20:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754618AbaCDQUm (ORCPT + 5 others); Tue, 4 Mar 2014 11:20:42 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:48501 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754542AbaCDQUl (ORCPT ); Tue, 4 Mar 2014 11:20:41 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s24GKDem003234; Tue, 4 Mar 2014 10:20:13 -0600 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 s24GKDq3013194; Tue, 4 Mar 2014 10:20:13 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Tue, 4 Mar 2014 10:20:13 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s24GJdRF017797; Tue, 4 Mar 2014 10:20:11 -0600 From: Tero Kristo To: , , , CC: Subject: [PATCH 16/18] ARM: OMAP3: control: add API for setting up the modem pads Date: Tue, 4 Mar 2014 18:19:16 +0200 Message-ID: <1393949958-816-17-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393949958-816-1-git-send-email-t-kristo@ti.com> References: <1393949958-816-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=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 5eb991a..2def1ff 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 0b9a298..8df2d65 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -348,20 +348,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();