From patchwork Tue Nov 12 13:48:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 21462 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C3E0223FBE for ; Tue, 12 Nov 2013 13:48:50 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id b4sf10139104qen.7 for ; Tue, 12 Nov 2013 05:48:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=O3ZCU2HryvhpD+7Huo/WMh1ggNDbTDl9lECSwErMmMs=; b=CXTJ8fi1TewaV0vOlGVdxxZDEfmqWvL4R5rsMc5VdEw5VXV9FvSf3YFkNs5wdhqyht lTYwIJGhiZtzp5XcN0cSpGU2epAgG53R6f2SxC/34buTZGDfQczu238qP3gJf8S9ynWb YqE870FUgOLSF9koKMKF1CiBMUt4tPj8CDWSJDF+znodRQhdw+CLQlJH7uOLza1w4nVK 4z0DmAFzAmA866YhTm7DAlSPJ4pW85kMSrc+HAbINE42XbfKLrCmSdYRk9CaehkKZtWy PDqxjRg04q/TW5x3PGXBts/Zpk6MnVUoCHdb6Sfs7wBk2CxBtVKYxkGFISzYupm3G76U rsFw== X-Gm-Message-State: ALoCoQl7Zc8LfOoiUa/1hG/VQRbv+EFu54lgFK4Yrdq7rMRkGxGrjiog/c5Y5yWOUdyEdnWmCn1l X-Received: by 10.236.136.199 with SMTP id w47mr68133yhi.56.1384264130636; Tue, 12 Nov 2013 05:48:50 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.109.102 with SMTP id hr6ls99379qeb.13.gmail; Tue, 12 Nov 2013 05:48:50 -0800 (PST) X-Received: by 10.52.28.6 with SMTP id x6mr12761181vdg.3.1384264130559; Tue, 12 Nov 2013 05:48:50 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id s5si12069305vev.41.2013.11.12.05.48.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Nov 2013 05:48:50 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id db12so1444509veb.11 for ; Tue, 12 Nov 2013 05:48:50 -0800 (PST) X-Received: by 10.58.54.69 with SMTP id h5mr2957108vep.25.1384264130492; Tue, 12 Nov 2013 05:48:50 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp163946vcz; Tue, 12 Nov 2013 05:48:50 -0800 (PST) X-Received: by 10.194.94.33 with SMTP id cz1mr581357wjb.73.1384264129710; Tue, 12 Nov 2013 05:48:49 -0800 (PST) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by mx.google.com with ESMTPS id gm6si7786027wib.47.2013.11.12.05.48.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Nov 2013 05:48:49 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.177 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.212.177; Received: by mail-wi0-f177.google.com with SMTP id hq4so3304250wib.16 for ; Tue, 12 Nov 2013 05:48:49 -0800 (PST) X-Received: by 10.180.97.5 with SMTP id dw5mr16284803wib.42.1384264129241; Tue, 12 Nov 2013 05:48:49 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id y20sm8168165wib.0.2013.11.12.05.48.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Nov 2013 05:48:48 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Russell King Cc: Andrea Adami , Dmitry Eremin-Solenikov , Dmitry Artamonow , Dmitry Eremin-Solenikov , Linus Walleij Subject: [PATCH 7/7] ARM: sa1100: move state to the overall container Date: Tue, 12 Nov 2013 14:48:45 +0100 Message-Id: <1384264125-6431-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Instead of saving the state of registers in a special struct across suspend/resume, use some fields in the generic system controller state container struct. Signed-off-by: Linus Walleij --- arch/arm/mach-sa1100/irq.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c index a6823f3281e2..ce847939ac65 100644 --- a/arch/arm/mach-sa1100/irq.c +++ b/arch/arm/mach-sa1100/irq.c @@ -40,6 +40,10 @@ * @gpio_falling: whether the IRQ for the GPIO corresponding to the * bit in this word should trigger on falling edges. * @gpio_mask: whether this GPIO is masked off. + * @saved: indicates whether we have a saved state. + * @icmr: saved state for the ICMR register. + * @iclr: saved state for the ICLR register. + * @iccr: saved state for the ICCR register. */ struct sa1100_sc { struct irq_domain *domain; @@ -50,6 +54,10 @@ struct sa1100_sc { u32 gpio_rising; u32 gpio_falling; u32 gpio_mask; + bool saved; + u32 icmr; + u32 iclr; + u32 iccr; }; static int sa1100_gpio_type(struct irq_data *d, unsigned int type) @@ -286,22 +294,14 @@ static struct irq_domain_ops sa1100_sc_high_irqdomain_ops = { static struct resource irq_resource = DEFINE_RES_MEM_NAMED(0x90050000, SZ_64K, "irqs"); -static struct sa1100irq_state { - unsigned int saved; - unsigned int icmr; - unsigned int iclr; - unsigned int iccr; -} sa1100irq_state; - static int sa1100irq_suspend(void) { struct sa1100_sc *sc = &sa1100_sc; - struct sa1100irq_state *st = &sa1100irq_state; - st->saved = 1; - st->icmr = ICMR; - st->iclr = ICLR; - st->iccr = ICCR; + sc->saved = true; + sc->icmr = ICMR; + sc->iclr = ICLR; + sc->iccr = ICCR; /* * Disable all GPIO-based interrupts. @@ -327,16 +327,13 @@ static int sa1100irq_suspend(void) static void sa1100irq_resume(void) { struct sa1100_sc *sc = &sa1100_sc; - struct sa1100irq_state *st = &sa1100irq_state; - - if (st->saved) { - ICCR = st->iccr; - ICLR = st->iclr; + if (sc->saved) { + ICCR = sc->iccr; + ICLR = sc->iclr; GRER = sc->gpio_rising & sc->gpio_mask; GFER = sc->gpio_falling & sc->gpio_mask; - - ICMR = st->icmr; + ICMR = sc->icmr; } }