linux/drivers/gpio/gpio-dwapb.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2011 Jamie Iles
 *
 * All enquiries to [email protected]
 */
#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/gpio/driver.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/irq.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/spinlock.h>

#include "gpiolib-acpi.h"

#define GPIO_SWPORTA_DR
#define GPIO_SWPORTA_DDR
#define GPIO_SWPORTB_DR
#define GPIO_SWPORTB_DDR
#define GPIO_SWPORTC_DR
#define GPIO_SWPORTC_DDR
#define GPIO_SWPORTD_DR
#define GPIO_SWPORTD_DDR
#define GPIO_INTEN
#define GPIO_INTMASK
#define GPIO_INTTYPE_LEVEL
#define GPIO_INT_POLARITY
#define GPIO_INTSTATUS
#define GPIO_PORTA_DEBOUNCE
#define GPIO_PORTA_EOI
#define GPIO_EXT_PORTA
#define GPIO_EXT_PORTB
#define GPIO_EXT_PORTC
#define GPIO_EXT_PORTD

#define DWAPB_DRIVER_NAME
#define DWAPB_MAX_PORTS
#define DWAPB_MAX_GPIOS

#define GPIO_EXT_PORT_STRIDE
#define GPIO_SWPORT_DR_STRIDE
#define GPIO_SWPORT_DDR_STRIDE

#define GPIO_REG_OFFSET_V1
#define GPIO_REG_OFFSET_V2
#define GPIO_REG_OFFSET_MASK

#define GPIO_INTMASK_V2
#define GPIO_INTTYPE_LEVEL_V2
#define GPIO_INT_POLARITY_V2
#define GPIO_INTSTATUS_V2
#define GPIO_PORTA_EOI_V2

#define DWAPB_NR_CLOCKS

struct dwapb_gpio;

struct dwapb_port_property {};

struct dwapb_platform_data {};

#ifdef CONFIG_PM_SLEEP
/* Store GPIO context across system-wide suspend/resume transitions */
struct dwapb_context {};
#endif

struct dwapb_gpio_port_irqchip {};

struct dwapb_gpio_port {};
#define to_dwapb_gpio(_gc)

struct dwapb_gpio {};

static inline u32 gpio_reg_v2_convert(unsigned int offset)
{}

static inline u32 gpio_reg_convert(struct dwapb_gpio *gpio, unsigned int offset)
{}

static inline u32 dwapb_read(struct dwapb_gpio *gpio, unsigned int offset)
{}

static inline void dwapb_write(struct dwapb_gpio *gpio, unsigned int offset,
			       u32 val)
{}

static struct dwapb_gpio_port *dwapb_offs_to_port(struct dwapb_gpio *gpio, unsigned int offs)
{}

static void dwapb_toggle_trigger(struct dwapb_gpio *gpio, unsigned int offs)
{}

static u32 dwapb_do_irq(struct dwapb_gpio *gpio)
{}

static void dwapb_irq_handler(struct irq_desc *desc)
{}

static irqreturn_t dwapb_irq_handler_mfd(int irq, void *dev_id)
{}

static void dwapb_irq_ack(struct irq_data *d)
{}

static void dwapb_irq_mask(struct irq_data *d)
{}

static void dwapb_irq_unmask(struct irq_data *d)
{}

static void dwapb_irq_enable(struct irq_data *d)
{}

static void dwapb_irq_disable(struct irq_data *d)
{}

static int dwapb_irq_set_type(struct irq_data *d, u32 type)
{}

#ifdef CONFIG_PM_SLEEP
static int dwapb_irq_set_wake(struct irq_data *d, unsigned int enable)
{}
#else
#define dwapb_irq_set_wake
#endif

static const struct irq_chip dwapb_irq_chip =;

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

static int dwapb_gpio_set_config(struct gpio_chip *gc, unsigned offset,
				 unsigned long config)
{}

static int dwapb_convert_irqs(struct dwapb_gpio_port_irqchip *pirq,
			      struct dwapb_port_property *pp)
{}

static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
				 struct dwapb_gpio_port *port,
				 struct dwapb_port_property *pp)
{}

static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
			       struct dwapb_port_property *pp,
			       unsigned int offs)
{}

static void dwapb_get_irq(struct device *dev, struct fwnode_handle *fwnode,
			  struct dwapb_port_property *pp)
{}

static struct dwapb_platform_data *dwapb_gpio_get_pdata(struct device *dev)
{}

static void dwapb_assert_reset(void *data)
{}

static int dwapb_get_reset(struct dwapb_gpio *gpio)
{}

static void dwapb_disable_clks(void *data)
{}

static int dwapb_get_clks(struct dwapb_gpio *gpio)
{}

static const struct of_device_id dwapb_of_match[] =;
MODULE_DEVICE_TABLE(of, dwapb_of_match);

static const struct acpi_device_id dwapb_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, dwapb_acpi_match);

static int dwapb_gpio_probe(struct platform_device *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static int dwapb_gpio_suspend(struct device *dev)
{}

static int dwapb_gpio_resume(struct device *dev)
{}
#endif

static SIMPLE_DEV_PM_OPS(dwapb_gpio_pm_ops, dwapb_gpio_suspend,
			 dwapb_gpio_resume);

static struct platform_driver dwapb_gpio_driver =;

module_platform_driver();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_ALIAS();