linux/drivers/gpio/gpio-nomadik.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * GPIO driver for the IP block found in the Nomadik SoC; it is an AMBA device,
 * managing 32 pins with alternate functions. It can also handle the STA2X11
 * block from ST.
 *
 * The GPIO chips are shared with pinctrl-nomadik if used; it needs access for
 * pinmuxing functionality and others.
 *
 * This driver also handles the mobileye,eyeq5-gpio compatible. It is an STA2X11
 * but with only data, direction and interrupts register active. We want to
 * avoid touching SLPM, RWIMSC, FWIMSC, AFSLA and AFSLB registers; that is,
 * wake and alternate function registers. It is NOT compatible with
 * pinctrl-nomadik.
 *
 * Copyright (C) 2008,2009 STMicroelectronics
 * Copyright (C) 2009 Alessandro Rubini <[email protected]>
 *   Rewritten based on work by Prafulla WADASKAR <[email protected]>
 * Copyright (C) 2011-2013 Linus Walleij <[email protected]>
 */
#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/reset.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/types.h>

#include <linux/gpio/gpio-nomadik.h>

#ifndef CONFIG_PINCTRL_NOMADIK
static DEFINE_SPINLOCK(nmk_gpio_slpm_lock);
#endif

void __nmk_gpio_set_slpm(struct nmk_gpio_chip *nmk_chip, unsigned int offset,
			 enum nmk_gpio_slpm mode)
{}

static void __nmk_gpio_set_output(struct nmk_gpio_chip *nmk_chip,
				  unsigned int offset, int val)
{}

void __nmk_gpio_make_output(struct nmk_gpio_chip *nmk_chip,
			    unsigned int offset, int val)
{}

/* IRQ functions */

static void nmk_gpio_irq_ack(struct irq_data *d)
{}

enum nmk_gpio_irq_type {};

static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip,
				  int offset, enum nmk_gpio_irq_type which,
				  bool enable)
{}

static void __nmk_gpio_set_wake(struct nmk_gpio_chip *nmk_chip,
				int offset, bool on)
{}

static void nmk_gpio_irq_maskunmask(struct nmk_gpio_chip *nmk_chip,
				    struct irq_data *d, bool enable)
{}

static void nmk_gpio_irq_mask(struct irq_data *d)
{}

static void nmk_gpio_irq_unmask(struct irq_data *d)
{}

static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
{}

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

static unsigned int nmk_gpio_irq_startup(struct irq_data *d)
{}

static void nmk_gpio_irq_shutdown(struct irq_data *d)
{}

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

/* I/O Functions */

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

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

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

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

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

#ifdef CONFIG_DEBUG_FS

static int nmk_gpio_get_mode(struct nmk_gpio_chip *nmk_chip, int offset)
{}

void nmk_gpio_dbg_show_one(struct seq_file *s, struct pinctrl_dev *pctldev,
			   struct gpio_chip *chip, unsigned int offset,
			   unsigned int gpio)
{}

static void nmk_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
{}

#else

#define nmk_gpio_dbg_show

#endif

/*
 * We will allocate memory for the state container using devm* allocators
 * binding to the first device reaching this point, it doesn't matter if
 * it is the pin controller or GPIO driver. However we need to use the right
 * platform device when looking up resources so pay attention to pdev.
 */
struct nmk_gpio_chip *nmk_gpio_populate_chip(struct fwnode_handle *fwnode,
					     struct platform_device *pdev)
{}

static void nmk_gpio_irq_print_chip(struct irq_data *d, struct seq_file *p)
{}

static const struct irq_chip nmk_irq_chip =;

static int nmk_gpio_probe(struct platform_device *pdev)
{}

static const struct of_device_id nmk_gpio_match[] =;

static struct platform_driver nmk_gpio_driver =;

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