#include <linux/err.h>
#include <linux/bug.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/log2.h>
#include <linux/io.h>
#include <linux/gpio/driver.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/mutex.h>
#include <linux/acpi.h>
#include <linux/seq_file.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/bitops.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/suspend.h>
#include "core.h"
#include "pinctrl-utils.h"
#include "pinctrl-amd.h"
static int amd_gpio_get_direction(struct gpio_chip *gc, unsigned offset)
{ … }
static int amd_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
{ … }
static int amd_gpio_direction_output(struct gpio_chip *gc, unsigned offset,
int value)
{ … }
static int amd_gpio_get_value(struct gpio_chip *gc, unsigned offset)
{ … }
static void amd_gpio_set_value(struct gpio_chip *gc, unsigned offset, int value)
{ … }
static int amd_gpio_set_debounce(struct amd_gpio *gpio_dev, unsigned int offset,
unsigned int debounce)
{ … }
#ifdef CONFIG_DEBUG_FS
static void amd_gpio_dbg_show(struct seq_file *s, struct gpio_chip *gc)
{ … }
#else
#define amd_gpio_dbg_show …
#endif
static void amd_gpio_irq_enable(struct irq_data *d)
{ … }
static void amd_gpio_irq_disable(struct irq_data *d)
{ … }
static void amd_gpio_irq_mask(struct irq_data *d)
{ … }
static void amd_gpio_irq_unmask(struct irq_data *d)
{ … }
static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
{ … }
static void amd_gpio_irq_eoi(struct irq_data *d)
{ … }
static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
{ … }
static void amd_irq_ack(struct irq_data *d)
{ … }
static const struct irq_chip amd_gpio_irqchip = …;
#define PIN_IRQ_PENDING …
static bool do_amd_gpio_irq_handler(int irq, void *dev_id)
{ … }
static irqreturn_t amd_gpio_irq_handler(int irq, void *dev_id)
{ … }
static bool __maybe_unused amd_gpio_check_wake(void *dev_id)
{ … }
static int amd_get_groups_count(struct pinctrl_dev *pctldev)
{ … }
static const char *amd_get_group_name(struct pinctrl_dev *pctldev,
unsigned group)
{ … }
static int amd_get_group_pins(struct pinctrl_dev *pctldev,
unsigned group,
const unsigned **pins,
unsigned *num_pins)
{ … }
static const struct pinctrl_ops amd_pinctrl_ops = …;
static int amd_pinconf_get(struct pinctrl_dev *pctldev,
unsigned int pin,
unsigned long *config)
{ … }
static int amd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *configs, unsigned int num_configs)
{ … }
static int amd_pinconf_group_get(struct pinctrl_dev *pctldev,
unsigned int group,
unsigned long *config)
{ … }
static int amd_pinconf_group_set(struct pinctrl_dev *pctldev,
unsigned group, unsigned long *configs,
unsigned num_configs)
{ … }
static int amd_gpio_set_config(struct gpio_chip *gc, unsigned int pin,
unsigned long config)
{ … }
static const struct pinconf_ops amd_pinconf_ops = …;
static void amd_gpio_irq_init(struct amd_gpio *gpio_dev)
{ … }
#ifdef CONFIG_PM_SLEEP
static bool amd_gpio_should_save(struct amd_gpio *gpio_dev, unsigned int pin)
{ … }
static int amd_gpio_suspend(struct device *dev)
{ … }
static int amd_gpio_resume(struct device *dev)
{ … }
static const struct dev_pm_ops amd_gpio_pm_ops = …;
#endif
static int amd_get_functions_count(struct pinctrl_dev *pctldev)
{ … }
static const char *amd_get_fname(struct pinctrl_dev *pctrldev, unsigned int selector)
{ … }
static int amd_get_groups(struct pinctrl_dev *pctrldev, unsigned int selector,
const char * const **groups,
unsigned int * const num_groups)
{ … }
static int amd_set_mux(struct pinctrl_dev *pctrldev, unsigned int function, unsigned int group)
{ … }
static const struct pinmux_ops amd_pmxops = …;
static struct pinctrl_desc amd_pinctrl_desc = …;
static void amd_get_iomux_res(struct amd_gpio *gpio_dev)
{ … }
static int amd_gpio_probe(struct platform_device *pdev)
{ … }
static void amd_gpio_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_ACPI
static const struct acpi_device_id amd_gpio_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, amd_gpio_acpi_match);
#endif
static struct platform_driver amd_gpio_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;