From patchwork Mon Nov 30 22:47:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Ricard X-Patchwork-Id: 550544 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B72A11401DE for ; Tue, 1 Dec 2015 09:48:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=B6PUGzqh; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755154AbbK3Wsq (ORCPT ); Mon, 30 Nov 2015 17:48:46 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:36719 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755132AbbK3Wsp (ORCPT ); Mon, 30 Nov 2015 17:48:45 -0500 Received: by wmww144 with SMTP id w144so150096249wmw.1; Mon, 30 Nov 2015 14:48:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DgVTR9ZGPBxguuGLwmcAmpUSryJv+7MA1HNC/BWmUGw=; b=B6PUGzqhu9tG+iqt6IPRPG4RSQp9mT8Ac1sfAiavZH9RpM6J5VjeQ17ulC0PzHJfwD t/fWy8PfC8NGl1QIxaYmzXJfq+9dEb5eWnF9VGUrRZui89fgfIqSksxs5AzWbwQeoVbA VHvgufo8m9jAl0ohNgiLxL79LB+o127ouHTiunWnRnjhx6qWHdY+++nPJrv3ovT3T1Ry X2OVk5AsXMY5NW2iVsiBXPxcbP4Hc/qEmcru/fS7yuVVGHGf61dCV7pE9kK4mLu/mVXz QPKT6qM+JriQf6bnQwgtMMUrxRMLTttfKlg8fcae4h1b9pF1YtQNTXTkewNO/KLJr8MC eirA== X-Received: by 10.28.93.144 with SMTP id r138mr16468920wmb.84.1448923723658; Mon, 30 Nov 2015 14:48:43 -0800 (PST) Received: from localhost.localdomain (ax113-6-78-236-204-66.fbx.proxad.net. [78.236.204.66]) by smtp.gmail.com with ESMTPSA id gj2sm48599174wjb.40.2015.11.30.14.48.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Nov 2015 14:48:42 -0800 (PST) From: Christophe Ricard X-Google-Original-From: Christophe Ricard To: rjw@rjwysocki.net, lenb@kernel.org, linus.walleij@linaro.org, gnurou@gmail.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com Cc: linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, Christophe Ricard Subject: [PATCH v3 2/2] ACPI / gpio: Add irq_type when a gpio is used as an interrupt Date: Mon, 30 Nov 2015 23:47:53 +0100 Message-Id: <1448923673-2582-3-git-send-email-christophe-h.ricard@st.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1448923673-2582-1-git-send-email-christophe-h.ricard@st.com> References: <1448923673-2582-1-git-send-email-christophe-h.ricard@st.com> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org When a gpio is used as an interrupt, the irq_type was not available for device driver. It is not align with devicetree probing. Signed-off-by: Christophe Ricard Acked-by: Linus Walleij --- drivers/gpio/gpiolib-acpi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index bbcac3a..cff8736 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -416,9 +416,12 @@ static int acpi_find_gpio(struct acpi_resource *ares, void *data) * GpioIo is used then the only way to set the flag is * to use _DSD "gpios" property. */ - if (lookup->info.gpioint) + if (lookup->info.gpioint) { lookup->info.active_low = agpio->polarity == ACPI_ACTIVE_LOW; + irq_set_irq_type(gpiod_to_irq(lookup->desc), + acpi_get_irq_type(agpio->triggering, agpio->polarity)); + } } return 1;