linux/drivers/gpio/gpio-mxs.c

// SPDX-License-Identifier: GPL-2.0+
//
// MXS GPIO support. (c) 2008 Daniel Mack <[email protected]>
// Copyright 2008 Juergen Beisert, [email protected]
//
// Based on code from Freescale,
// Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.

#include <linux/err.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/irqdomain.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/gpio/driver.h>
#include <linux/module.h>

#define MXS_SET
#define MXS_CLR

#define PINCTRL_DOUT(p)
#define PINCTRL_DIN(p)
#define PINCTRL_DOE(p)
#define PINCTRL_PIN2IRQ(p)
#define PINCTRL_IRQEN(p)
#define PINCTRL_IRQLEV(p)
#define PINCTRL_IRQPOL(p)
#define PINCTRL_IRQSTAT(p)

#define GPIO_INT_FALL_EDGE
#define GPIO_INT_LOW_LEV
#define GPIO_INT_RISE_EDGE
#define GPIO_INT_HIGH_LEV
#define GPIO_INT_LEV_MASK
#define GPIO_INT_POL_MASK

enum mxs_gpio_id {};

struct mxs_gpio_port {};

static inline int is_imx23_gpio(struct mxs_gpio_port *port)
{}

/* Note: This driver assumes 32 GPIOs are handled in one register */

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

static void mxs_flip_edge(struct mxs_gpio_port *port, u32 gpio)
{}

/* MXS has one interrupt *per* gpio port */
static void mxs_gpio_irq_handler(struct irq_desc *desc)
{}

/*
 * Set interrupt number "irq" in the GPIO as a wake-up source.
 * While system is running, all registered GPIO interrupts need to have
 * wake-up enabled. When system is suspended, only selected GPIO interrupts
 * need to have wake-up enabled.
 * @param  irq          interrupt source number
 * @param  enable       enable as wake-up if equal to non-zero
 * @return       This function returns 0 on success.
 */
static int mxs_gpio_set_wake_irq(struct irq_data *d, unsigned int enable)
{}

static int mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base)
{}

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

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

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

static int mxs_gpio_probe(struct platform_device *pdev)
{}

static struct platform_driver mxs_gpio_driver =;

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

MODULE_AUTHOR();
MODULE_DESCRIPTION();