From patchwork Fri Mar 22 16:20:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Andersson X-Patchwork-Id: 2321681 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B5D47DFE82 for ; Fri, 22 Mar 2013 16:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933769Ab3CVQUa (ORCPT ); Fri, 22 Mar 2013 12:20:30 -0400 Received: from eu1sys200aog106.obsmtp.com ([207.126.144.121]:38423 "EHLO eu1sys200aog106.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933818Ab3CVQU2 (ORCPT ); Fri, 22 Mar 2013 12:20:28 -0400 Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob106.postini.com ([207.126.147.11]) with SMTP ID DSNKUUyEyOGjA/5FomrZvg88uFnxjsidaXzs@postini.com; Fri, 22 Mar 2013 16:20:28 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id A4F4A4E; Fri, 22 Mar 2013 16:19:27 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 9267050; Fri, 22 Mar 2013 09:52:39 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 3C51824C07C; Fri, 22 Mar 2013 17:20:10 +0100 (CET) Received: from steludxu2826.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Fri, 22 Mar 2013 17:20:18 +0100 From: Rickard Andersson To: , Cc: , , , , , Subject: [RFC PATCH 1/8] mfd: db8500: Add IO force function Date: Fri, 22 Mar 2013 17:20:05 +0100 Message-ID: <1363969212-14864-2-git-send-email-rickard.andersson@stericsson.com> X-Mailer: git-send-email 1.8.2 In-Reply-To: <1363969212-14864-1-git-send-email-rickard.andersson@stericsson.com> References: <1363969212-14864-1-git-send-email-rickard.andersson@stericsson.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The IO force signal needs to be controlled when the system enters/exits the sleep state ApSleep. This hardware signal tells the system that some pins could be driven by GPIO settings instead of directly from the hardware block. Signed-off-by: Rickard Andersson --- drivers/mfd/db8500-prcmu.c | 9 +++++++++ include/linux/mfd/db8500-prcmu.h | 1 + include/linux/mfd/dbx500-prcmu.h | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 268f45d..7f32575 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -879,6 +879,15 @@ bool db8500_prcmu_pending_irq(void) return false; } +void db8500_prcmu_set_ioforce(bool enable) +{ + u32 val = readl(PRCM_IOCR) & ~PRCM_IOCR_IOFORCE; + + if (enable) + val |= PRCM_IOCR_IOFORCE; + writel(val, PRCM_IOCR); +} + /* * This function checks if the specified cpu is in in WFI. It's usage * makes sense only if the gic is decoupled with the db8500_prcmu_gic_decouple diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h index 6ee4247..21660f6 100644 --- a/include/linux/mfd/db8500-prcmu.h +++ b/include/linux/mfd/db8500-prcmu.h @@ -547,6 +547,7 @@ int db8500_prcmu_gic_recouple(void); int db8500_prcmu_copy_gic_settings(void); bool db8500_prcmu_gic_pending_irq(void); bool db8500_prcmu_pending_irq(void); +void db8500_prcmu_set_ioforce(bool enable); bool db8500_prcmu_is_cpu_in_wfi(int cpu); void db8500_prcmu_enable_wakeups(u32 wakeups); int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state); diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index c202d6c..2909546 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h @@ -267,6 +267,11 @@ static inline bool prcmu_pending_irq(void) return db8500_prcmu_pending_irq(); } +static inline void prcmu_set_ioforce(bool force) +{ + return db8500_prcmu_set_ioforce(force); +} + static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) { return db8500_prcmu_set_epod(epod_id, epod_state);