ACPI / video: Add use_native_backlight quirks for more systems
[linux-2.6/btrfs-unstable.git] / drivers / gpio / gpiolib.h
blobcf092941a9fdda28f6ec3b58ab97f49e5dd963c8
1 /*
2 * Internal GPIO functions.
4 * Copyright (C) 2013, Intel Corporation
5 * Author: Mika Westerberg <mika.westerberg@linux.intel.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #ifndef GPIOLIB_H
13 #define GPIOLIB_H
15 #include <linux/err.h>
16 #include <linux/device.h>
18 /**
19 * struct acpi_gpio_info - ACPI GPIO specific information
20 * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
21 * @active_low: in case of @gpioint, the pin is active low
23 struct acpi_gpio_info {
24 bool gpioint;
25 bool active_low;
28 #ifdef CONFIG_ACPI
29 void acpi_gpiochip_add(struct gpio_chip *chip);
30 void acpi_gpiochip_remove(struct gpio_chip *chip);
32 struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,
33 struct acpi_gpio_info *info);
34 #else
35 static inline void acpi_gpiochip_add(struct gpio_chip *chip) { }
36 static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { }
38 static inline struct gpio_desc *
39 acpi_get_gpiod_by_index(struct device *dev, int index,
40 struct acpi_gpio_info *info)
42 return ERR_PTR(-ENOSYS);
44 #endif
46 int gpiochip_request_own_desc(struct gpio_desc *desc, const char *label);
47 void gpiochip_free_own_desc(struct gpio_desc *desc);
49 #endif /* GPIOLIB_H */