linux/drivers/gpio/gpio-mpc8xxx.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * GPIOs on MPC512x/8349/8572/8610/QorIQ and compatible
 *
 * Copyright (C) 2008 Peter Korsgaard <[email protected]>
 * Copyright (C) 2016 Freescale Semiconductor Inc.
 */

#include <linux/acpi.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/property.h>
#include <linux/mod_devicetable.h>
#include <linux/slab.h>
#include <linux/irq.h>
#include <linux/gpio/driver.h>
#include <linux/bitops.h>
#include <linux/interrupt.h>

#define MPC8XXX_GPIO_PINS

#define GPIO_DIR
#define GPIO_ODR
#define GPIO_DAT
#define GPIO_IER
#define GPIO_IMR
#define GPIO_ICR
#define GPIO_ICR2
#define GPIO_IBE

struct mpc8xxx_gpio_chip {};

/*
 * This hardware has a big endian bit assignment such that GPIO line 0 is
 * connected to bit 31, line 1 to bit 30 ... line 31 to bit 0.
 * This inline helper give the right bitmask for a certain line.
 */
static inline u32 mpc_pin2mask(unsigned int offset)
{}

/* Workaround GPIO 1 errata on MPC8572/MPC8536. The status of GPIOs
 * defined as output cannot be determined by reading GPDAT register,
 * so we use shadow data register instead. The status of input pins
 * is determined by reading GPDAT register.
 */
static int mpc8572_gpio_get(struct gpio_chip *gc, unsigned int gpio)
{}

static int mpc5121_gpio_dir_out(struct gpio_chip *gc,
				unsigned int gpio, int val)
{}

static int mpc5125_gpio_dir_out(struct gpio_chip *gc,
				unsigned int gpio, int val)
{}

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

static irqreturn_t mpc8xxx_gpio_irq_cascade(int irq, void *data)
{}

static void mpc8xxx_irq_unmask(struct irq_data *d)
{}

static void mpc8xxx_irq_mask(struct irq_data *d)
{}

static void mpc8xxx_irq_ack(struct irq_data *d)
{}

static int mpc8xxx_irq_set_type(struct irq_data *d, unsigned int flow_type)
{}

static int mpc512x_irq_set_type(struct irq_data *d, unsigned int flow_type)
{}

static struct irq_chip mpc8xxx_irq_chip =;

static int mpc8xxx_gpio_irq_map(struct irq_domain *h, unsigned int irq,
				irq_hw_number_t hwirq)
{}

static const struct irq_domain_ops mpc8xxx_gpio_irq_ops =;

struct mpc8xxx_gpio_devtype {};

static const struct mpc8xxx_gpio_devtype mpc512x_gpio_devtype =;

static const struct mpc8xxx_gpio_devtype mpc5125_gpio_devtype =;

static const struct mpc8xxx_gpio_devtype mpc8572_gpio_devtype =;

static const struct mpc8xxx_gpio_devtype mpc8xxx_gpio_devtype_default =;

static const struct of_device_id mpc8xxx_gpio_ids[] =;

static int mpc8xxx_probe(struct platform_device *pdev)
{}

static void mpc8xxx_remove(struct platform_device *pdev)
{}

#ifdef CONFIG_ACPI
static const struct acpi_device_id gpio_acpi_ids[] =;
MODULE_DEVICE_TABLE(acpi, gpio_acpi_ids);
#endif

static struct platform_driver mpc8xxx_plat_driver =;

static int __init mpc8xxx_init(void)
{}

arch_initcall(mpc8xxx_init);