linux/drivers/gpio/gpio-rockchip.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2013 MundoReader S.L.
 * Author: Heiko Stuebner <[email protected]>
 *
 * Copyright (c) 2021 Rockchip Electronics Co. Ltd.
 */

#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/gpio/driver.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>

#include "../pinctrl/core.h"
#include "../pinctrl/pinctrl-rockchip.h"

#define GPIO_TYPE_V1
#define GPIO_TYPE_V2
#define GPIO_TYPE_V2_1

static const struct rockchip_gpio_regs gpio_regs_v1 =;

static const struct rockchip_gpio_regs gpio_regs_v2 =;

static inline void gpio_writel_v2(u32 val, void __iomem *reg)
{}

static inline u32 gpio_readl_v2(void __iomem *reg)
{}

static inline void rockchip_gpio_writel(struct rockchip_pin_bank *bank,
					u32 value, unsigned int offset)
{}

static inline u32 rockchip_gpio_readl(struct rockchip_pin_bank *bank,
				      unsigned int offset)
{}

static inline void rockchip_gpio_writel_bit(struct rockchip_pin_bank *bank,
					    u32 bit, u32 value,
					    unsigned int offset)
{}

static inline u32 rockchip_gpio_readl_bit(struct rockchip_pin_bank *bank,
					  u32 bit, unsigned int offset)
{}

static int rockchip_gpio_get_direction(struct gpio_chip *chip,
				       unsigned int offset)
{}

static int rockchip_gpio_set_direction(struct gpio_chip *chip,
				       unsigned int offset, bool input)
{}

static void rockchip_gpio_set(struct gpio_chip *gc, unsigned int offset,
			      int value)
{}

static int rockchip_gpio_get(struct gpio_chip *gc, unsigned int offset)
{}

static int rockchip_gpio_set_debounce(struct gpio_chip *gc,
				      unsigned int offset,
				      unsigned int debounce)
{}

static int rockchip_gpio_direction_input(struct gpio_chip *gc,
					 unsigned int offset)
{}

static int rockchip_gpio_direction_output(struct gpio_chip *gc,
					  unsigned int offset, int value)
{}

/*
 * gpiolib set_config callback function. The setting of the pin
 * mux function as 'gpio output' will be handled by the pinctrl subsystem
 * interface.
 */
static int rockchip_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
				  unsigned long config)
{}

/*
 * gpiod_to_irq() callback function. Creates a mapping between a GPIO pin
 * and a virtual IRQ, if not already present.
 */
static int rockchip_gpio_to_irq(struct gpio_chip *gc, unsigned int offset)
{}

static const struct gpio_chip rockchip_gpiolib_chip =;

static void rockchip_irq_demux(struct irq_desc *desc)
{}

static int rockchip_irq_set_type(struct irq_data *d, unsigned int type)
{}

static int rockchip_irq_reqres(struct irq_data *d)
{}

static void rockchip_irq_relres(struct irq_data *d)
{}

static void rockchip_irq_suspend(struct irq_data *d)
{}

static void rockchip_irq_resume(struct irq_data *d)
{}

static void rockchip_irq_enable(struct irq_data *d)
{}

static void rockchip_irq_disable(struct irq_data *d)
{}

static int rockchip_interrupts_register(struct rockchip_pin_bank *bank)
{}

static int rockchip_gpiolib_register(struct rockchip_pin_bank *bank)
{}

static int rockchip_get_bank_data(struct rockchip_pin_bank *bank)
{}

static struct rockchip_pin_bank *
rockchip_gpio_find_bank(struct pinctrl_dev *pctldev, int id)
{}

static int rockchip_gpio_probe(struct platform_device *pdev)
{}

static void rockchip_gpio_remove(struct platform_device *pdev)
{}

static const struct of_device_id rockchip_gpio_match[] =;

static struct platform_driver rockchip_gpio_driver =;

static int __init rockchip_gpio_init(void)
{}
postcore_initcall(rockchip_gpio_init);

static void __exit rockchip_gpio_exit(void)
{}
module_exit(rockchip_gpio_exit);

MODULE_DESCRIPTION();
MODULE_ALIAS();
MODULE_LICENSE();
MODULE_DEVICE_TABLE(of, rockchip_gpio_match);