From patchwork Mon Jan 13 10:29:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 3474241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8C1C59F169 for ; Mon, 13 Jan 2014 10:29:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80DA42011E for ; Mon, 13 Jan 2014 10:29:56 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 47B732010E for ; Mon, 13 Jan 2014 10:29:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W2emB-00076d-Lj; Mon, 13 Jan 2014 10:29:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W2em9-00025M-70; Mon, 13 Jan 2014 10:29:45 +0000 Received: from 3.mo1.mail-out.ovh.net ([46.105.60.232] helo=mo1.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W2em6-00024i-Hl for linux-arm-kernel@lists.infradead.org; Mon, 13 Jan 2014 10:29:43 +0000 Received: from mail240.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo1.mail-out.ovh.net (Postfix) with SMTP id 404E8FFAF9E for ; Mon, 13 Jan 2014 11:34:27 +0100 (CET) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 13 Jan 2014 12:29:14 +0200 Received: from mail-pd0-f173.google.com (jjhiblot@traphandler.com@209.85.192.173) by ns0.ovh.net with SMTP; 13 Jan 2014 12:29:11 +0200 Received: by mail-pd0-f173.google.com with SMTP id p10so7236806pdj.4 for ; Mon, 13 Jan 2014 02:29:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=6uMjCmWv5ksbzOz/C3wDttvGQE3GUcndFhXFtiz6Pmo=; b=ZA7w1qXaPnKE0U2XtArlfERNKDrc1CKZc3dcNn6uhcyVhj9XQnPNmGkq0XGwfpxjk6 jIdnCUKGGB8oYGopb7jvTtx8Hru4GDMkN9l1ZPpQLITV/pMHRYtg1Cb0SOJXcUwvPHWy YFtr8nEgkpludWGK64PLRWGWPpEe5pVZCXg8a2UqebYkBAOZTRedxVwc0anKkducHuMj Cfgo1PBHIiptVp/U9FbfSi1623Fk1jA3IRCTNZKCIfW5KjXlBWPFHaFz0oZurZfKmUuG MivLPSDvFWiXjI0WeYQLNR3nNYPTHYvnegDFuRX4lxs8ebnc/jfUj/AodukC4X2xidwE xf7Q== MIME-Version: 1.0 X-Received: by 10.66.142.233 with SMTP id rz9mr29060008pab.71.1389608949886; Mon, 13 Jan 2014 02:29:09 -0800 (PST) Received: by 10.68.152.106 with HTTP; Mon, 13 Jan 2014 02:29:09 -0800 (PST) Date: Mon, 13 Jan 2014 11:29:09 +0100 Message-ID: Subject: device-tree: at91: irq and gpios: problem while requesting a gpio used as an interrupt source. From: Jean-Jacques Hiblot To: nicolas.ferre@atmel.com, plagnioj@jcrosoft.com X-Ovh-Tracer-Id: 13832524781372594429 X-Ovh-Remote: 209.85.192.173 (mail-pd0-f173.google.com) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejtddrfeegucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejtddrfeegucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140113_052942_683105_41E64469 X-CRM114-Status: GOOD ( 13.00 ) X-Spam-Score: -1.9 (-) Cc: linux-arm-kernel@lists.infradead.org, boris brezillon X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello Nicolas, Jean-Christophe, As I was trying to enable the touchscreen on the at91sam9261ek with device-tree support, I ran into an issue. The touchscreen driver needs to know the state of the pendown gpio and also needs it as an interrupt source. The problem is that when a gpio is used as an interrupt, it's requested by the pinctrl driver during the xlate stage, marking it unavaliable for the other driver. It looks like the at91 pinctrl driver is the only one to use gpio_request() in the xlate stage. Maybe we should remove this: Jean-Jacques diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index a7549c4..cf91a35 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -1463,14 +1463,6 @@ static int at91_gpio_irq_domain_xlate(struct irq_domain *d, *out_hwirq = intspec[0]; *out_type = intspec[1] & IRQ_TYPE_SENSE_MASK; - ret = gpio_request(pin, ctrlr->full_name); - if (ret) - return ret; - - ret = gpio_direction_input(pin); - if (ret) - return ret; - return 0; }