From patchwork Tue Dec 3 15:00:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 21966 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A0D71202AE for ; Tue, 3 Dec 2013 15:00:31 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ld13sf31815462vcb.1 for ; Tue, 03 Dec 2013 07:00:30 -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=Myx6Ha4Lt0UEEs8ECMQjJpY4suwgGn05qgHOdF2qy9Q=; b=JSF1fx1dprfkdSgJeTzdp32eN4daRZI3dQ48Ny3bNNwjFOT69t8xGhwejuNfwoa6vU NUOD/PkNbeqhblBgq5sMSbncJRijEH/6ahcpdK6uUfEMc94OCuGp17PTNCiii7jtpo+/ Mup+z03SGLNwUoSXWJVWB8WwwBCiDxRLwyg2pjQws+Vu4/7Z2j+PVAbeNpVqikoOW1Y+ f8nwpAv1D4LlL6mjNddiyYGOEKEzF6yQ2TJjzumoVMyek69HCbkFijExHx+dQufwel9Y jA8gex9CnnfVyuE1xr9SHmzKyQRw9XwOaRe7jYYQzu3PPGO/Q2erAc9AHGeDS7xM+tOU ktRQ== X-Gm-Message-State: ALoCoQm5506U+O+9/PWuAMdzNIX3LrvOD2BYRB7NOecnUtOt7kjwmkOIMxdm0IiFInByLlsKnRo+ X-Received: by 10.224.151.71 with SMTP id b7mr5892538qaw.5.1386082830646; Tue, 03 Dec 2013 07:00:30 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.138 with SMTP id k10ls5202322qek.13.gmail; Tue, 03 Dec 2013 07:00:30 -0800 (PST) X-Received: by 10.220.19.134 with SMTP id a6mr1716555vcb.36.1386082830529; Tue, 03 Dec 2013 07:00:30 -0800 (PST) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id tl2si4274364vdc.129.2013.12.03.07.00.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 07:00:30 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id id10so9649600vcb.5 for ; Tue, 03 Dec 2013 07:00:30 -0800 (PST) X-Received: by 10.52.171.79 with SMTP id as15mr47405161vdc.1.1386082830278; Tue, 03 Dec 2013 07:00:30 -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 u4csp214758vcz; Tue, 3 Dec 2013 07:00:29 -0800 (PST) X-Received: by 10.152.44.167 with SMTP id f7mr343532lam.64.1386082829158; Tue, 03 Dec 2013 07:00:29 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id p10si22051243lag.166.2013.12.03.07.00.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 07:00:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.53 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id ea20so9329714lab.12 for ; Tue, 03 Dec 2013 07:00:28 -0800 (PST) X-Received: by 10.112.140.37 with SMTP id rd5mr23640lbb.88.1386082828496; Tue, 03 Dec 2013 07:00:28 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id j1sm50271712lbl.10.2013.12.03.07.00.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Dec 2013 07:00:27 -0800 (PST) From: Linus Walleij To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Stephen Warren , Linus Walleij , Andy Shevchenko , Mika Westerberg , Mathias Nyman Subject: [PATCH v2] pinctrl: baytrail: lock IRQs when starting them Date: Tue, 3 Dec 2013 16:00:22 +0100 Message-Id: <1386082822-20094-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.220.174 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: , This uses the new API for tagging GPIO lines as in use by IRQs. This enforces a few semantic checks on how the underlying GPIO line is used. Cc: Andy Shevchenko Cc: Mika Westerberg Cc: Mathias Nyman Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Actually make the change compile, doh. --- drivers/pinctrl/pinctrl-baytrail.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/pinctrl/pinctrl-baytrail.c b/drivers/pinctrl/pinctrl-baytrail.c index 1174ea86b6e9..998dbb0c4c93 100644 --- a/drivers/pinctrl/pinctrl-baytrail.c +++ b/drivers/pinctrl/pinctrl-baytrail.c @@ -372,11 +372,33 @@ static void byt_irq_mask(struct irq_data *d) { } +static unsigned int byt_irq_startup(struct irq_data *d) +{ + struct byt_gpio *vg = irq_data_get_irq_handler_data(d); + + if (gpio_lock_as_irq(&vg->chip, irqd_to_hwirq(d))) + dev_err(vg->chip.dev, + "unable to lock HW IRQ %lu for IRQ\n", + irqd_to_hwirq(d)); + byt_irq_unmask(d); + return 0; +} + +static void byt_irq_shutdown(struct irq_data *d) +{ + struct byt_gpio *vg = irq_data_get_irq_handler_data(d); + + byt_irq_mask(d); + gpio_unlock_as_irq(&vg->chip, irqd_to_hwirq(d)); +} + static struct irq_chip byt_irqchip = { .name = "BYT-GPIO", .irq_mask = byt_irq_mask, .irq_unmask = byt_irq_unmask, .irq_set_type = byt_irq_type, + .irq_startup = byt_irq_startup, + .irq_shutdown = byt_irq_shutdown, }; static void byt_gpio_irq_init_hw(struct byt_gpio *vg)