#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/err.h>
#include <linux/gpio/driver.h>
#include <linux/platform_device.h>
#include <linux/bitops.h>
#include <asm/types.h>
enum loongson_gpio_mode { … };
struct loongson_gpio_chip_data { … };
struct loongson_gpio_chip { … };
static inline struct loongson_gpio_chip *to_loongson_gpio_chip(struct gpio_chip *chip)
{ … }
static inline void loongson_commit_direction(struct loongson_gpio_chip *lgpio, unsigned int pin,
int input)
{ … }
static void loongson_commit_level(struct loongson_gpio_chip *lgpio, unsigned int pin, int high)
{ … }
static int loongson_gpio_direction_input(struct gpio_chip *chip, unsigned int pin)
{ … }
static int loongson_gpio_direction_output(struct gpio_chip *chip, unsigned int pin, int value)
{ … }
static int loongson_gpio_get(struct gpio_chip *chip, unsigned int pin)
{ … }
static int loongson_gpio_get_direction(struct gpio_chip *chip, unsigned int pin)
{ … }
static void loongson_gpio_set(struct gpio_chip *chip, unsigned int pin, int value)
{ … }
static int loongson_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
{ … }
static int loongson_gpio_init(struct device *dev, struct loongson_gpio_chip *lgpio,
void __iomem *reg_base)
{ … }
static int loongson_gpio_probe(struct platform_device *pdev)
{ … }
static const struct loongson_gpio_chip_data loongson_gpio_ls2k_data = …;
static const struct loongson_gpio_chip_data loongson_gpio_ls2k0500_data0 = …;
static const struct loongson_gpio_chip_data loongson_gpio_ls2k0500_data1 = …;
static const struct loongson_gpio_chip_data loongson_gpio_ls2k2000_data0 = …;
static const struct loongson_gpio_chip_data loongson_gpio_ls2k2000_data1 = …;
static const struct loongson_gpio_chip_data loongson_gpio_ls2k2000_data2 = …;
static const struct loongson_gpio_chip_data loongson_gpio_ls3a5000_data = …;
static const struct loongson_gpio_chip_data loongson_gpio_ls7a_data = …;
static const struct of_device_id loongson_gpio_of_match[] = …;
MODULE_DEVICE_TABLE(of, loongson_gpio_of_match);
static const struct acpi_device_id loongson_gpio_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, loongson_gpio_acpi_match);
static struct platform_driver loongson_gpio_driver = …;
static int __init loongson_gpio_setup(void)
{ … }
postcore_initcall(loongson_gpio_setup);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;