Skip to content
Snippets Groups Projects
Select Git revision
  • 977a7a15231f6c510229f616dd0c24632fcbee4d
  • master default protected
  • android-msm-bullhead-3.10-nougat_kgdb_less_changes
  • android-msm-bullhead-3.10-nougat_kgdb
  • android-msm-bullhead-3.10-nougat_klist
  • android-4.4
  • android-msm-vega-4.4-oreo-daydream
  • android-msm-wahoo-4.4-p-preview-5
  • android-msm-wahoo-4.4-pie
  • android-msm-marlin-3.18-p-preview-5
  • android-msm-marlin-3.18-pie
  • android-msm-wahoo-2018.07-oreo-m2
  • android-msm-wahoo-2018.07-oreo-m4
  • android-msm-wahoo-4.4-p-preview-4
  • android-msm-bullhead-3.10-oreo-m6
  • android-msm-angler-3.10-oreo-m6
  • android-msm-marlin-3.18-p-preview-4
  • android-msm-stargazer-3.18-oreo-wear-dr
  • android-msm-catshark-3.18-oreo-wear-dr
  • android-msm-wahoo-4.4-oreo-m2
  • android-msm-wahoo-4.4-oreo-m4
  • android-daydreamos-8.0.0_r0.5
  • android-8.1.0_r0.92
  • android-8.1.0_r0.91
  • android-daydreamos-8.0.0_r0.4
  • android-p-preview-5_r0.2
  • android-p-preview-5_r0.1
  • android-9.0.0_r0.5
  • android-9.0.0_r0.4
  • android-9.0.0_r0.2
  • android-9.0.0_r0.1
  • android-8.1.0_r0.81
  • android-8.1.0_r0.80
  • android-8.1.0_r0.78
  • android-8.1.0_r0.76
  • android-8.1.0_r0.75
  • android-8.1.0_r0.72
  • android-8.1.0_r0.70
  • android-p-preview-4_r0.2
  • android-p-preview-4_r0.1
  • android-wear-8.0.0_r0.30
41 results

acpi_gpio.h

Blame
  • user avatar
    Mika Westerberg authored and Linus Walleij committed
    Instead of open-coding ACPI GPIO resource lookup in each driver, we provide
    a helper function analogous to Device Tree version that allows drivers to
    specify which GPIO resource they are interested (using an index to the GPIO
    resources). The function then finds out the correct resource, translates
    the ACPI GPIO number to the corresponding Linux GPIO number and returns
    that.
    
    Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
    Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    12028d2d
    History
    acpi_gpio.h 1.03 KiB
    #ifndef _LINUX_ACPI_GPIO_H_
    #define _LINUX_ACPI_GPIO_H_
    
    #include <linux/device.h>
    #include <linux/errno.h>
    #include <linux/gpio.h>
    
    /**
     * struct acpi_gpio_info - ACPI GPIO specific information
     * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
     */
    struct acpi_gpio_info {
    	bool gpioint;
    };
    
    #ifdef CONFIG_GPIO_ACPI
    
    int acpi_get_gpio(char *path, int pin);
    int acpi_get_gpio_by_index(struct device *dev, int index,
    			   struct acpi_gpio_info *info);
    void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
    void acpi_gpiochip_free_interrupts(struct gpio_chip *chip);
    
    #else /* CONFIG_GPIO_ACPI */
    
    static inline int acpi_get_gpio(char *path, int pin)
    {
    	return -ENODEV;
    }
    
    static inline int acpi_get_gpio_by_index(struct device *dev, int index,
    					 struct acpi_gpio_info *info)
    {
    	return -ENODEV;
    }
    
    static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
    static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { }
    
    #endif /* CONFIG_GPIO_ACPI */
    
    #endif /* _LINUX_ACPI_GPIO_H_ */