Conflicts: Documentation/devicetree/bindings/drm/msm/mdss-dsi-panel.txt Documentation/devicetree/bindings/pinctrl/qcom,sm8150-pinctrl arch/arm64/include/asm/processor.h arch/arm64/kernel/process.c drivers/block/zram/zram_dedup.c drivers/char/diag/diag_masks.c drivers/char/diag/diag_memorydevice.c drivers/char/diag/diag_memorydevice.h drivers/char/diag/diag_mux.c drivers/char/diag/diag_mux.h drivers/char/diag/diagchar_core.c drivers/char/diag/diagfwd.c drivers/char/diag/diagfwd_bridge.c drivers/gpu/drm/msm/dsi-staging/dsi_backlight.c drivers/gpu/drm/msm/dsi-staging/dsi_display.c drivers/gpu/drm/msm/dsi-staging/dsi_drm.c drivers/gpu/drm/msm/dsi-staging/dsi_panel.c drivers/gpu/drm/msm/sde/sde_connector.c drivers/gpu/drm/msm/sde/sde_connector.h drivers/gpu/drm/msm/sde/sde_crtc.c drivers/gpu/drm/msm/sde/sde_encoder.c drivers/gpu/drm/msm/sde/sde_kms.c drivers/gpu/drm/msm/sde_power_handle.h drivers/gpu/msm/kgsl_events.c drivers/input/misc/lm36011/lm36011_module.c drivers/media/platform/msm/camera/cam_icp/cam_icp_context.c drivers/media/platform/msm/camera/cam_isp/cam_isp_context.c drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.h drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe175_130.h drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.c drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_core.h drivers/media/platform/msm/camera/cam_req_mgr/cam_req_mgr_interface.h drivers/media/platform/msm/camera/cam_sensor_module/Makefile drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/cam_cci_core.c drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/cam_cci_dev.c drivers/media/platform/msm/camera/cam_sensor_module/cam_cci/cam_cci_dev.h drivers/media/platform/msm/camera/cam_sensor_module/cam_csiphy/cam_csiphy_core.c drivers/media/platform/msm/camera/cam_sensor_module/cam_csiphy/cam_csiphy_soc.c drivers/media/platform/msm/camera/cam_sensor_module/cam_eeprom/cam_eeprom_dev.h drivers/media/platform/msm/camera/cam_sensor_module/cam_ois/cam_ois_core.c drivers/media/platform/msm/camera/cam_sensor_module/cam_sensor/cam_sensor_core.c drivers/media/platform/msm/camera/cam_sensor_module/cam_sensor/cam_sensor_dev.h drivers/media/platform/msm/sde/rotator/sde_rotator_core.c drivers/pci/host/pci-msm-msi.c drivers/pci/host/pci-msm.c drivers/platform/msm/gsi/gsi.c drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c drivers/platform/msm/ipa/ipa_v3/ipa_wdi3_i.c drivers/power/supply/google/Kconfig drivers/power/supply/google/Makefile drivers/power/supply/google/gbms_storage.c drivers/power/supply/google/google_battery.c drivers/power/supply/google/google_bms.h drivers/power/supply/google/gvotable.c drivers/power/supply/google/gvotable.h drivers/power/supply/power_supply_sysfs.c drivers/power/supply/qcom/Kconfig drivers/power/supply/qcom/Makefile drivers/power/supply/qcom/qpnp-smb5.c drivers/power/supply/qcom/smb5-lib.c drivers/power/supply/qcom/smb5-lib.h drivers/regulator/Kconfig drivers/regulator/Makefile drivers/regulator/qpnp-amoled-regulator.c drivers/scsi/ufs/ufshcd.h drivers/usb/dwc3/dwc3-msm.c drivers/usb/gadget/function/f_accessory.c fs/ext4/move_extent.c fs/overlayfs/namei.c include/linux/msm_gsi.h include/linux/power_supply.h include/uapi/media/cam_req_mgr.h include/uapi/media/cam_sensor.h kernel/sched/fair.c mm/memory.c Bug: 149536833 Change-Id: I3544549951f29271154814dd78877b83ffb32179 Signed-off-by: Wilson Sung <wilsonsung@google.com>
259 lines
5.3 KiB
C
259 lines
5.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __LINUX_GPIO_H
|
|
#define __LINUX_GPIO_H
|
|
|
|
#include <linux/errno.h>
|
|
|
|
/* see Documentation/gpio/gpio-legacy.txt */
|
|
|
|
/* make these flag values available regardless of GPIO kconfig options */
|
|
#define GPIOF_DIR_OUT (0 << 0)
|
|
#define GPIOF_DIR_IN (1 << 0)
|
|
|
|
#define GPIOF_INIT_LOW (0 << 1)
|
|
#define GPIOF_INIT_HIGH (1 << 1)
|
|
|
|
#define GPIOF_IN (GPIOF_DIR_IN)
|
|
#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
|
|
#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
|
|
|
|
/* Gpio pin is active-low */
|
|
#define GPIOF_ACTIVE_LOW (1 << 2)
|
|
|
|
/* Gpio pin is open drain */
|
|
#define GPIOF_OPEN_DRAIN (1 << 3)
|
|
|
|
/* Gpio pin is open source */
|
|
#define GPIOF_OPEN_SOURCE (1 << 4)
|
|
|
|
#define GPIOF_EXPORT (1 << 5)
|
|
#define GPIOF_EXPORT_CHANGEABLE (1 << 6)
|
|
#define GPIOF_EXPORT_DIR_FIXED (GPIOF_EXPORT)
|
|
#define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE)
|
|
|
|
/**
|
|
* struct gpio - a structure describing a GPIO with configuration
|
|
* @gpio: the GPIO number
|
|
* @flags: GPIO configuration as specified by GPIOF_*
|
|
* @label: a literal description string of this GPIO
|
|
*/
|
|
struct gpio {
|
|
unsigned gpio;
|
|
unsigned long flags;
|
|
const char *label;
|
|
};
|
|
|
|
#ifdef CONFIG_GPIOLIB
|
|
|
|
#ifdef CONFIG_ARCH_HAVE_CUSTOM_GPIO_H
|
|
#include <asm/gpio.h>
|
|
#else
|
|
|
|
#include <asm-generic/gpio.h>
|
|
|
|
static inline int gpio_get_value(unsigned int gpio)
|
|
{
|
|
return __gpio_get_value(gpio);
|
|
}
|
|
|
|
static inline void gpio_set_value(unsigned int gpio, int value)
|
|
{
|
|
__gpio_set_value(gpio, value);
|
|
}
|
|
|
|
static inline int gpio_cansleep(unsigned int gpio)
|
|
{
|
|
return __gpio_cansleep(gpio);
|
|
}
|
|
|
|
static inline int gpio_to_irq(unsigned int gpio)
|
|
{
|
|
return __gpio_to_irq(gpio);
|
|
}
|
|
|
|
static inline int irq_to_gpio(unsigned int irq)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
#endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */
|
|
|
|
/* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */
|
|
|
|
struct device;
|
|
|
|
int devm_gpio_request(struct device *dev, unsigned gpio, const char *label);
|
|
int devm_gpio_request_one(struct device *dev, unsigned gpio,
|
|
unsigned long flags, const char *label);
|
|
void devm_gpio_free(struct device *dev, unsigned int gpio);
|
|
|
|
#else /* ! CONFIG_GPIOLIB */
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/types.h>
|
|
#include <linux/bug.h>
|
|
#include <linux/pinctrl/pinctrl.h>
|
|
|
|
struct device;
|
|
struct gpio_chip;
|
|
|
|
static inline bool gpio_is_valid(int number)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline int gpio_request(unsigned gpio, const char *label)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline int gpio_request_one(unsigned gpio,
|
|
unsigned long flags, const char *label)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline int gpio_request_array(const struct gpio *array, size_t num)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline void gpio_free(unsigned gpio)
|
|
{
|
|
might_sleep();
|
|
|
|
/* GPIO can never have been requested */
|
|
WARN_ON(1);
|
|
}
|
|
|
|
static inline void gpio_free_array(const struct gpio *array, size_t num)
|
|
{
|
|
might_sleep();
|
|
|
|
/* GPIO can never have been requested */
|
|
WARN_ON(1);
|
|
}
|
|
|
|
static inline int gpio_direction_input(unsigned gpio)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline int gpio_direction_output(unsigned gpio, int value)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline int gpio_set_debounce(unsigned gpio, unsigned debounce)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline int gpio_get_value(unsigned gpio)
|
|
{
|
|
/* GPIO can never have been requested or set as {in,out}put */
|
|
WARN_ON(1);
|
|
return 0;
|
|
}
|
|
|
|
static inline void gpio_set_value(unsigned gpio, int value)
|
|
{
|
|
/* GPIO can never have been requested or set as output */
|
|
WARN_ON(1);
|
|
}
|
|
|
|
static inline int gpio_cansleep(unsigned gpio)
|
|
{
|
|
/* GPIO can never have been requested or set as {in,out}put */
|
|
WARN_ON(1);
|
|
return 0;
|
|
}
|
|
|
|
static inline int gpio_get_value_cansleep(unsigned gpio)
|
|
{
|
|
/* GPIO can never have been requested or set as {in,out}put */
|
|
WARN_ON(1);
|
|
return 0;
|
|
}
|
|
|
|
static inline void gpio_set_value_cansleep(unsigned gpio, int value)
|
|
{
|
|
/* GPIO can never have been requested or set as output */
|
|
WARN_ON(1);
|
|
}
|
|
|
|
static inline int gpio_export(unsigned gpio, bool direction_may_change)
|
|
{
|
|
/* GPIO can never have been requested or set as {in,out}put */
|
|
WARN_ON(1);
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline int gpio_export_link(struct device *dev, const char *name,
|
|
unsigned gpio)
|
|
{
|
|
/* GPIO can never have been exported */
|
|
WARN_ON(1);
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline void gpio_unexport(unsigned gpio)
|
|
{
|
|
/* GPIO can never have been exported */
|
|
WARN_ON(1);
|
|
}
|
|
|
|
static inline int gpio_to_irq(unsigned gpio)
|
|
{
|
|
/* GPIO can never have been requested or set as input */
|
|
WARN_ON(1);
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline int gpiochip_lock_as_irq(struct gpio_chip *chip,
|
|
unsigned int offset)
|
|
{
|
|
WARN_ON(1);
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline void gpiochip_unlock_as_irq(struct gpio_chip *chip,
|
|
unsigned int offset)
|
|
{
|
|
WARN_ON(1);
|
|
}
|
|
|
|
static inline int irq_to_gpio(unsigned irq)
|
|
{
|
|
/* irq can never have been returned from gpio_to_irq() */
|
|
WARN_ON(1);
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline int devm_gpio_request(struct device *dev, unsigned gpio,
|
|
const char *label)
|
|
{
|
|
WARN_ON(1);
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline int devm_gpio_request_one(struct device *dev, unsigned gpio,
|
|
unsigned long flags, const char *label)
|
|
{
|
|
WARN_ON(1);
|
|
return -EINVAL;
|
|
}
|
|
|
|
static inline void devm_gpio_free(struct device *dev, unsigned int gpio)
|
|
{
|
|
WARN_ON(1);
|
|
}
|
|
|
|
#endif /* ! CONFIG_GPIOLIB */
|
|
|
|
#endif /* __LINUX_GPIO_H */
|
|
|
|
int msm_gpio_dump(struct seq_file *s);
|
|
int pmic_gpio_dump(struct seq_file *s);
|
|
extern bool pm_gpio_debug_mask;
|