Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753714AbbEKJ4t (ORCPT ); Mon, 11 May 2015 05:56:49 -0400 Received: from mail-ob0-f176.google.com ([209.85.214.176]:36850 "EHLO mail-ob0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753691AbbEKJ4p (ORCPT ); Mon, 11 May 2015 05:56:45 -0400 MIME-Version: 1.0 In-Reply-To: <1430908148-201129-2-git-send-email-mika.westerberg@linux.intel.com> References: <1430908148-201129-1-git-send-email-mika.westerberg@linux.intel.com> <1430908148-201129-2-git-send-email-mika.westerberg@linux.intel.com> Date: Mon, 11 May 2015 11:56:44 +0200 Message-ID: Subject: Re: [PATCH v2 1/3] gpio / ACPI: Add support for retrieving GpioInt resources from a device From: Linus Walleij To: Mika Westerberg Cc: "Rafael J. Wysocki" , Alexandre Courbot , Wolfram Sang , Octavian Purdila , Robert Dolca , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , ACPI Devel Maling List , "linux-i2c@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1726 Lines: 46 On Wed, May 6, 2015 at 12:29 PM, Mika Westerberg wrote: > ACPI specification knows two types of GPIOs: GpioIo and GpioInt. The latter > is used to describe that a given device interrupt line is connected to a > specific GPIO pin. Typical ACPI _CRS entry for such device looks like > below: > > Name (_CRS, ResourceTemplate () > { > I2cSerialBus (0x004A, ControllerInitiated, 0x00061A80, > AddressingMode7Bit, "\\_SB.PCI0.I2C6", > 0x00, ResourceConsumer) > GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, > IoRestrictionOutputOnly, "\\_SB.GPO0", > 0x00, ResourceConsumer) > { > 0x004B > } > GpioInt (Level, ActiveLow, Shared, PullDefault, 0x0000, > "\\_SB.GPO0", 0x00, ResourceConsumer) > { > 0x004C > } > }) > > Currently drivers need to request a GPIO corresponding to the right GpioInt > and then translate that to Linux IRQ number. This adds unnecessary lines of > boiler-plate code. > > We can ease this a bit by introducing acpi_dev_gpio_irq_get() analogous to > of_irq_get(). This function translates given GpioInt resource under the > device in question to the suitable Linux IRQ number. > > Signed-off-by: Mika Westerberg > Acked-by: Rafael J. Wysocki Patch applied. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/