linux/drivers/gpio/gpio-tegra186.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2022 NVIDIA Corporation
 *
 * Author: Thierry Reding <[email protected]>
 *	   Dipen Patel <[email protected]>
 */

#include <linux/gpio/driver.h>
#include <linux/hte.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>

#include <dt-bindings/gpio/tegra186-gpio.h>
#include <dt-bindings/gpio/tegra194-gpio.h>
#include <dt-bindings/gpio/tegra234-gpio.h>
#include <dt-bindings/gpio/tegra241-gpio.h>

/* security registers */
#define TEGRA186_GPIO_CTL_SCR
#define TEGRA186_GPIO_CTL_SCR_SEC_WEN
#define TEGRA186_GPIO_CTL_SCR_SEC_REN

#define TEGRA186_GPIO_INT_ROUTE_MAPPING(p, x)

#define TEGRA186_GPIO_VM
#define TEGRA186_GPIO_VM_RW_MASK
#define TEGRA186_GPIO_SCR
#define TEGRA186_GPIO_SCR_PIN_SIZE
#define TEGRA186_GPIO_SCR_PORT_SIZE
#define TEGRA186_GPIO_SCR_SEC_WEN
#define TEGRA186_GPIO_SCR_SEC_REN
#define TEGRA186_GPIO_SCR_SEC_G1W
#define TEGRA186_GPIO_SCR_SEC_G1R

/* control registers */
#define TEGRA186_GPIO_ENABLE_CONFIG
#define TEGRA186_GPIO_ENABLE_CONFIG_ENABLE
#define TEGRA186_GPIO_ENABLE_CONFIG_OUT
#define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_NONE
#define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_LEVEL
#define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_SINGLE_EDGE
#define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_DOUBLE_EDGE
#define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_MASK
#define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_LEVEL
#define TEGRA186_GPIO_ENABLE_CONFIG_DEBOUNCE
#define TEGRA186_GPIO_ENABLE_CONFIG_INTERRUPT
#define TEGRA186_GPIO_ENABLE_CONFIG_TIMESTAMP_FUNC

#define TEGRA186_GPIO_DEBOUNCE_CONTROL
#define TEGRA186_GPIO_DEBOUNCE_CONTROL_THRESHOLD(x)

#define TEGRA186_GPIO_INPUT
#define TEGRA186_GPIO_INPUT_HIGH

#define TEGRA186_GPIO_OUTPUT_CONTROL
#define TEGRA186_GPIO_OUTPUT_CONTROL_FLOATED

#define TEGRA186_GPIO_OUTPUT_VALUE
#define TEGRA186_GPIO_OUTPUT_VALUE_HIGH

#define TEGRA186_GPIO_INTERRUPT_CLEAR

#define TEGRA186_GPIO_INTERRUPT_STATUS(x)

struct tegra_gpio_port {};

struct tegra186_pin_range {};

struct tegra_gpio_soc {};

struct tegra_gpio {};

static const struct tegra_gpio_port *
tegra186_gpio_get_port(struct tegra_gpio *gpio, unsigned int *pin)
{}

static void __iomem *tegra186_gpio_get_base(struct tegra_gpio *gpio,
					    unsigned int pin)
{}

static void __iomem *tegra186_gpio_get_secure_base(struct tegra_gpio *gpio,
						   unsigned int pin)
{}

static inline bool tegra186_gpio_is_accessible(struct tegra_gpio *gpio, unsigned int pin)
{}

static int tegra186_init_valid_mask(struct gpio_chip *chip,
				    unsigned long *valid_mask, unsigned int ngpios)
{}

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

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

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

#define HTE_BOTH_EDGES

static int tegra186_gpio_en_hw_ts(struct gpio_chip *gc, u32 offset,
				  unsigned long flags)
{}

static int tegra186_gpio_dis_hw_ts(struct gpio_chip *gc, u32 offset,
				   unsigned long flags)
{}

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

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

static int tegra186_gpio_set_config(struct gpio_chip *chip,
				    unsigned int offset,
				    unsigned long config)
{}

static int tegra186_gpio_add_pin_ranges(struct gpio_chip *chip)
{}

static int tegra186_gpio_of_xlate(struct gpio_chip *chip,
				  const struct of_phandle_args *spec,
				  u32 *flags)
{}

#define to_tegra_gpio(x)

static void tegra186_irq_ack(struct irq_data *data)
{}

static void tegra186_irq_mask(struct irq_data *data)
{}

static void tegra186_irq_unmask(struct irq_data *data)
{}

static int tegra186_irq_set_type(struct irq_data *data, unsigned int type)
{}

static int tegra186_irq_set_wake(struct irq_data *data, unsigned int on)
{}

static void tegra186_irq_print_chip(struct irq_data *data, struct seq_file *p)
{}

static const struct irq_chip tegra186_gpio_irq_chip =;

static void tegra186_gpio_irq(struct irq_desc *desc)
{}

static int tegra186_gpio_irq_domain_translate(struct irq_domain *domain,
					      struct irq_fwspec *fwspec,
					      unsigned long *hwirq,
					      unsigned int *type)
{}

static int tegra186_gpio_populate_parent_fwspec(struct gpio_chip *chip,
						union gpio_irq_fwspec *gfwspec,
						unsigned int parent_hwirq,
						unsigned int parent_type)
{}

static int tegra186_gpio_child_to_parent_hwirq(struct gpio_chip *chip,
					       unsigned int hwirq,
					       unsigned int type,
					       unsigned int *parent_hwirq,
					       unsigned int *parent_type)
{}

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

static const struct of_device_id tegra186_pmc_of_match[] =;

static void tegra186_gpio_init_route_mapping(struct tegra_gpio *gpio)
{}

static unsigned int tegra186_gpio_irqs_per_bank(struct tegra_gpio *gpio)
{}

static int tegra186_gpio_probe(struct platform_device *pdev)
{}

#define TEGRA186_MAIN_GPIO_PORT(_name, _bank, _port, _pins)

static const struct tegra_gpio_port tegra186_main_ports[] =;

static const struct tegra_gpio_soc tegra186_main_soc =;

#define TEGRA186_AON_GPIO_PORT(_name, _bank, _port, _pins)

static const struct tegra_gpio_port tegra186_aon_ports[] =;

static const struct tegra_gpio_soc tegra186_aon_soc =;

#define TEGRA194_MAIN_GPIO_PORT(_name, _bank, _port, _pins)

static const struct tegra_gpio_port tegra194_main_ports[] =;

static const struct tegra186_pin_range tegra194_main_pin_ranges[] =;

static const struct tegra_gpio_soc tegra194_main_soc =;

#define TEGRA194_AON_GPIO_PORT(_name, _bank, _port, _pins)

static const struct tegra_gpio_port tegra194_aon_ports[] =;

static const struct tegra_gpio_soc tegra194_aon_soc =;

#define TEGRA234_MAIN_GPIO_PORT(_name, _bank, _port, _pins)

static const struct tegra_gpio_port tegra234_main_ports[] =;

static const struct tegra_gpio_soc tegra234_main_soc =;

#define TEGRA234_AON_GPIO_PORT(_name, _bank, _port, _pins)

static const struct tegra_gpio_port tegra234_aon_ports[] =;

static const struct tegra_gpio_soc tegra234_aon_soc =;

#define TEGRA241_MAIN_GPIO_PORT(_name, _bank, _port, _pins)

static const struct tegra_gpio_port tegra241_main_ports[] =;

static const struct tegra_gpio_soc tegra241_main_soc =;

#define TEGRA241_AON_GPIO_PORT(_name, _bank, _port, _pins)

static const struct tegra_gpio_port tegra241_aon_ports[] =;

static const struct tegra_gpio_soc tegra241_aon_soc =;

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

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

static struct platform_driver tegra186_gpio_driver =;
module_platform_driver();

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