From patchwork Mon Apr 6 07:17:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francesco VIRLINZI X-Patchwork-Id: 16481 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n367HJE1007353 for ; Mon, 6 Apr 2009 07:17:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753059AbZDFHRT (ORCPT ); Mon, 6 Apr 2009 03:17:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753820AbZDFHRT (ORCPT ); Mon, 6 Apr 2009 03:17:19 -0400 Received: from eu1sys200aog106.obsmtp.com ([207.126.144.121]:39508 "EHLO eu1sys200aog106.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753059AbZDFHRS (ORCPT ); Mon, 6 Apr 2009 03:17:18 -0400 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob106.postini.com ([207.126.147.11]) with SMTP ID DSNKSdmse2q6nEyM0AAGyvJXF3VVMyzRufeU@postini.com; Mon, 06 Apr 2009 07:17:17 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4E4E8DAB2 for ; Mon, 6 Apr 2009 07:16:08 +0000 (GMT) Received: from mail1.ctn.st.com (mail1.ctn.st.com [164.130.116.128]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 69BB24BF5F for ; Mon, 6 Apr 2009 07:17:14 +0000 (GMT) Received: from [10.52.139.41] (mdt-dhcp41.ctn.st.com [10.52.139.41]) by mail1.ctn.st.com (MOS 3.8.7a) with ESMTP id DAH52098 (AUTH virlinzi); Mon, 6 Apr 2009 09:17:11 +0200 (CEST) Message-ID: <49D9AC70.3040001@st.com> Date: Mon, 06 Apr 2009 09:17:04 +0200 From: Francesco VIRLINZI User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Linux-sh Cc: Francesco VIRLINZI Subject: [PATCH] Added resume from hibernation support to the intc Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From 9d6047a32ebd72af6abae5ae2d6e7ea5e2447c25 Mon Sep 17 00:00:00 2001 From: Francesco Virlinzi Date: Mon, 6 Apr 2009 09:09:39 +0200 Subject: [PATCH] sh_intc: Added resume from hibernation support to the intc It's required for all modules loaded in the previous runtime session because not initilized duing the kernel start-up. Signed-off-by: Francesco Virlinzi --- drivers/sh/intc.c | 35 +++++++++++++++++++++++++++++++---- 1 files changed, 31 insertions(+), 4 deletions(-) diff --git a/drivers/sh/intc.c b/drivers/sh/intc.c index 7fb9b5c..12d13d9 100644 --- a/drivers/sh/intc.c +++ b/drivers/sh/intc.c @@ -44,6 +44,7 @@ struct intc_handle_int { struct intc_desc_int { struct list_head list; struct sys_device sysdev; + pm_message_t state; unsigned long *reg; #ifdef CONFIG_SMP unsigned long *smp; @@ -786,18 +787,44 @@ static int intc_suspend(struct sys_device *dev, pm_message_t state) /* get intc controller associated with this sysdev */ d = container_of(dev, struct intc_desc_int, sysdev); - /* enable wakeup irqs belonging to this intc controller */ - for_each_irq_desc(irq, desc) { - if ((desc->status & IRQ_WAKEUP) && (desc->chip == &d->chip)) - intc_enable(irq); + switch (state.event) { + case PM_EVENT_ON: + if (d->state.event != PM_EVENT_FREEZE) + break; + for_each_irq_desc(irq, desc) { + if (desc->chip != &d->chip) + continue; + if (desc->status & IRQ_DISABLED) + intc_disable(irq); + else + intc_enable(irq); + } + break; + case PM_EVENT_FREEZE: + /* nothing has to be done */ + break; + case PM_EVENT_SUSPEND: + /* enable wakeup irqs belonging to this intc controller */ + for_each_irq_desc(irq, desc) { + if ((desc->status & IRQ_WAKEUP) && (desc->chip == &d->chip)) + intc_enable(irq); + } + break; } + d->state = state; return 0; } +static int intc_resume(struct sys_device *dev) +{ + return intc_suspend(dev, PMSG_ON); +} + static struct sysdev_class intc_sysdev_class = { .name = "intc", .suspend = intc_suspend, + .resume = intc_resume, }; /* register this intc as sysdev to allow suspend/resume */ -- 1.6.0.6