From patchwork Fri Nov 22 12:14:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 3222271 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 67F49C045B for ; Fri, 22 Nov 2013 12:16:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCA5B2069E for ; Fri, 22 Nov 2013 12:16:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22306205F0 for ; Fri, 22 Nov 2013 12:16:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932071Ab3KVMPd (ORCPT ); Fri, 22 Nov 2013 07:15:33 -0500 Received: from mga09.intel.com ([134.134.136.24]:59658 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755578Ab3KVMOo (ORCPT ); Fri, 22 Nov 2013 07:14:44 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 22 Nov 2013 04:11:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,751,1378882800"; d="scan'208";a="439827944" Received: from blue.fi.intel.com ([10.237.72.156]) by orsmga002.jf.intel.com with ESMTP; 22 Nov 2013 04:14:39 -0800 Received: by blue.fi.intel.com (Postfix, from userid 1004) id 5DDCCE0097; Fri, 22 Nov 2013 14:14:34 +0200 (EET) From: Mika Westerberg To: linux-acpi@vger.kernel.org Cc: "Rafael J. Wysocki" , Linus Walleij , Chris Ball , Johannes Berg , Rhyland Klein , Adrian Hunter , Alexandre Courbot , Mathias Nyman , Rob Landley , Heikki Krogerus , Stephen Warren , Thierry Reding , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/7] gpio / ACPI: get rid of acpi_gpio.h Date: Fri, 22 Nov 2013 14:14:33 +0200 Message-Id: <1385122474-14926-7-git-send-email-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1385122474-14926-1-git-send-email-mika.westerberg@linux.intel.com> References: <1385122474-14926-1-git-send-email-mika.westerberg@linux.intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Now that all users of acpi_gpio.h have been moved to user either the GPIO descriptor interface or to the internal gpiolib.h we can get rid of acpi_gpio.h entirely. Once this is done the only interface to get GPIOs to drivers enumerated from ACPI namespace is the descriptor based interface. Signed-off-by: Mika Westerberg Acked-by: Alexandre Courbot --- drivers/gpio/gpiolib-acpi.c | 4 +++- drivers/gpio/gpiolib.c | 1 - drivers/gpio/gpiolib.h | 23 +++++++++++++++++++++++ include/linux/acpi_gpio.h | 45 --------------------------------------------- 4 files changed, 26 insertions(+), 47 deletions(-) delete mode 100644 include/linux/acpi_gpio.h diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index cb2da66fbbfe..6c158d9a6efa 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -12,11 +12,13 @@ #include #include +#include #include -#include #include #include +#include "gpiolib.h" + struct acpi_gpio_evt_pin { struct list_head node; acpi_handle *evt_handle; diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 70abccf0d144..a6b82413c290 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h index 2ed23ab8298c..82be586c1f90 100644 --- a/drivers/gpio/gpiolib.h +++ b/drivers/gpio/gpiolib.h @@ -12,12 +12,35 @@ #ifndef GPIOLIB_H #define GPIOLIB_H +#include +#include + +/** + * struct acpi_gpio_info - ACPI GPIO specific information + * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo + * @active_low: in case of @gpioint, the pin is active low + */ +struct acpi_gpio_info { + bool gpioint; + bool active_low; +}; + #ifdef CONFIG_ACPI void acpi_gpiochip_add(struct gpio_chip *chip); void acpi_gpiochip_remove(struct gpio_chip *chip); + +struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, + struct acpi_gpio_info *info); #else static inline void acpi_gpiochip_add(struct gpio_chip *chip) { } static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { } + +static inline struct gpio_desc * +acpi_get_gpiod_by_index(struct device *dev, int index, + struct acpi_gpio_info *info) +{ + return ERR_PTR(-ENOSYS); +} #endif #endif /* GPIOLIB_H */ diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h deleted file mode 100644 index af96a0d452f6..000000000000 --- a/include/linux/acpi_gpio.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _LINUX_ACPI_GPIO_H_ -#define _LINUX_ACPI_GPIO_H_ - -#include -#include -#include -#include -#include - -/** - * struct acpi_gpio_info - ACPI GPIO specific information - * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo - * @active_low: in case of @gpioint, the pin is active low - */ -struct acpi_gpio_info { - bool gpioint; - bool active_low; -}; - -#ifdef CONFIG_GPIO_ACPI - -struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index, - struct acpi_gpio_info *info); -#else /* CONFIG_GPIO_ACPI */ - -static inline struct gpio_desc * -acpi_get_gpiod_by_index(struct device *dev, int index, - struct acpi_gpio_info *info) -{ - return ERR_PTR(-ENOSYS); -} - -#endif /* CONFIG_GPIO_ACPI */ - -static inline int acpi_get_gpio_by_index(struct device *dev, int index, - struct acpi_gpio_info *info) -{ - struct gpio_desc *desc = acpi_get_gpiod_by_index(dev, index, info); - - if (IS_ERR(desc)) - return PTR_ERR(desc); - return desc_to_gpio(desc); -} - -#endif /* _LINUX_ACPI_GPIO_H_ */