linux/drivers/gpio/gpio-mxc.c

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

#include <linux/clk.h>
#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/irqchip/chained_irq.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/syscore_ops.h>
#include <linux/gpio/driver.h>
#include <linux/of.h>
#include <linux/bug.h>

#define IMX_SCU_WAKEUP_OFF
#define IMX_SCU_WAKEUP_LOW_LVL
#define IMX_SCU_WAKEUP_FALL_EDGE
#define IMX_SCU_WAKEUP_RISE_EDGE
#define IMX_SCU_WAKEUP_HIGH_LVL

/* device type dependent stuff */
struct mxc_gpio_hwdata {};

struct mxc_gpio_reg_saved {};

struct mxc_gpio_port {};

static struct mxc_gpio_hwdata imx1_imx21_gpio_hwdata =;

static struct mxc_gpio_hwdata imx31_gpio_hwdata =;

static struct mxc_gpio_hwdata imx35_gpio_hwdata =;

#define GPIO_DR
#define GPIO_GDIR
#define GPIO_PSR
#define GPIO_ICR1
#define GPIO_ICR2
#define GPIO_IMR
#define GPIO_ISR
#define GPIO_EDGE_SEL

#define GPIO_INT_LOW_LEV
#define GPIO_INT_HIGH_LEV
#define GPIO_INT_RISE_EDGE
#define GPIO_INT_FALL_EDGE
#define GPIO_INT_BOTH_EDGES

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

/*
 * MX2 has one interrupt *for all* gpio ports. The list is used
 * to save the references to all ports, so that mx2_gpio_irq_handler
 * can walk through all interrupt status registers.
 */
static LIST_HEAD(mxc_gpio_ports);

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

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

static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
{}

/* handle 32 interrupts in one status register */
static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
{}

/* MX1 and MX3 has one interrupt *per* gpio port */
static void mx3_gpio_irq_handler(struct irq_desc *desc)
{}

/* MX2 has one interrupt *for all* gpio ports */
static void mx2_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 gpio_set_wake_irq(struct irq_data *d, u32 enable)
{}

static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
{}

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

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

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

static void mxc_update_irq_chained_handler(struct mxc_gpio_port *port, bool enable)
{}

static int mxc_gpio_probe(struct platform_device *pdev)
{}

static void mxc_gpio_save_regs(struct mxc_gpio_port *port)
{}

static void mxc_gpio_restore_regs(struct mxc_gpio_port *port)
{}

static bool mxc_gpio_generic_config(struct mxc_gpio_port *port,
		unsigned int offset, unsigned long conf)
{}

static bool mxc_gpio_set_pad_wakeup(struct mxc_gpio_port *port, bool enable)
{}

static int mxc_gpio_runtime_suspend(struct device *dev)
{}

static int mxc_gpio_runtime_resume(struct device *dev)
{}

static int mxc_gpio_noirq_suspend(struct device *dev)
{}

static int mxc_gpio_noirq_resume(struct device *dev)
{}

static const struct dev_pm_ops mxc_gpio_dev_pm_ops =;

static int mxc_gpio_syscore_suspend(void)
{}

static void mxc_gpio_syscore_resume(void)
{}

static struct syscore_ops mxc_gpio_syscore_ops =;

static struct platform_driver mxc_gpio_driver =;

static int __init gpio_mxc_init(void)
{}
subsys_initcall(gpio_mxc_init);

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