linux/drivers/pinctrl/pinctrl-pistachio.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Pistachio SoC pinctrl driver
 *
 * Copyright (C) 2014 Imagination Technologies Ltd.
 * Copyright (C) 2014 Google, Inc.
 */

#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/mod_devicetable.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/spinlock.h>

#include "pinctrl-utils.h"

#define PADS_SCHMITT_EN0
#define PADS_SCHMITT_EN_REG(pin)
#define PADS_SCHMITT_EN_BIT(pin)

#define PADS_PU_PD0
#define PADS_PU_PD_REG(pin)
#define PADS_PU_PD_SHIFT(pin)
#define PADS_PU_PD_MASK
#define PADS_PU_PD_HIGHZ
#define PADS_PU_PD_UP
#define PADS_PU_PD_DOWN
#define PADS_PU_PD_BUS

#define PADS_FUNCTION_SELECT0
#define PADS_FUNCTION_SELECT1
#define PADS_FUNCTION_SELECT2
#define PADS_SCENARIO_SELECT

#define PADS_SLEW_RATE0
#define PADS_SLEW_RATE_REG(pin)
#define PADS_SLEW_RATE_BIT(pin)

#define PADS_DRIVE_STRENGTH0
#define PADS_DRIVE_STRENGTH_REG(pin)
#define PADS_DRIVE_STRENGTH_SHIFT(pin)
#define PADS_DRIVE_STRENGTH_MASK
#define PADS_DRIVE_STRENGTH_2MA
#define PADS_DRIVE_STRENGTH_4MA
#define PADS_DRIVE_STRENGTH_8MA
#define PADS_DRIVE_STRENGTH_12MA

#define GPIO_BANK_BASE(bank)

#define GPIO_BIT_EN
#define GPIO_OUTPUT_EN
#define GPIO_OUTPUT
#define GPIO_INPUT
#define GPIO_INPUT_POLARITY
#define GPIO_INTERRUPT_TYPE
#define GPIO_INTERRUPT_TYPE_LEVEL
#define GPIO_INTERRUPT_TYPE_EDGE
#define GPIO_INTERRUPT_EDGE
#define GPIO_INTERRUPT_EDGE_SINGLE
#define GPIO_INTERRUPT_EDGE_DUAL
#define GPIO_INTERRUPT_EN
#define GPIO_INTERRUPT_STATUS

struct pistachio_function {};

struct pistachio_pin_group {};

struct pistachio_gpio_bank {};

struct pistachio_pinctrl {};

#define PISTACHIO_PIN_MFIO(p)
#define PISTACHIO_PIN_TCK
#define PISTACHIO_PIN_TRSTN
#define PISTACHIO_PIN_TDI
#define PISTACHIO_PIN_TMS
#define PISTACHIO_PIN_TDO
#define PISTACHIO_PIN_JTAG_COMPLY
#define PISTACHIO_PIN_SAFE_MODE
#define PISTACHIO_PIN_POR_DISABLE
#define PISTACHIO_PIN_RESETN

#define MFIO_PIN_DESC(p)

static const struct pinctrl_pin_desc pistachio_pins[] =;

static const char * const pistachio_spim0_groups[] =;

static const char * const pistachio_spim1_groups[] =;

static const char * const pistachio_spis_groups[] =;

static const char *const pistachio_sdhost_groups[] =;

static const char * const pistachio_i2c0_groups[] =;

static const char * const pistachio_i2c1_groups[] =;

static const char * const pistachio_i2c2_groups[] =;

static const char * const pistachio_i2c3_groups[] =;

static const char * const pistachio_audio_clk_in_groups[] =;

static const char * const pistachio_i2s_out_groups[] =;

static const char * const pistachio_debug_raw_cca_ind_groups[] =;

static const char * const pistachio_debug_ed_sec20_cca_ind_groups[] =;

static const char * const pistachio_debug_ed_sec40_cca_ind_groups[] =;

static const char * const pistachio_debug_agc_done_0_groups[] =;

static const char * const pistachio_debug_agc_done_1_groups[] =;

static const char * const pistachio_debug_ed_cca_ind_groups[] =;

static const char * const pistachio_debug_s2l_done_groups[] =;

static const char * const pistachio_i2s_dac_clk_groups[] =;

static const char * const pistachio_audio_sync_groups[] =;

static const char * const pistachio_audio_trigger_groups[] =;

static const char * const pistachio_i2s_in_groups[] =;

static const char * const pistachio_uart0_groups[] =;

static const char * const pistachio_uart1_groups[] =;

static const char * const pistachio_spdif_out_groups[] =;

static const char * const pistachio_spdif_in_groups[] =;
static const int pistachio_spdif_in_scenarios[] =;

static const char * const pistachio_eth_groups[] =;

static const char * const pistachio_ir_groups[] =;

static const char * const pistachio_pwmpdm_groups[] =;

static const char * const pistachio_mips_trace_clk_groups[] =;

static const char * const pistachio_mips_trace_dint_groups[] =;
static const int pistachio_mips_trace_dint_scenarios[] =;

static const char * const pistachio_mips_trace_trigout_groups[] =;

static const char * const pistachio_mips_trace_trigin_groups[] =;
static const int pistachio_mips_trace_trigin_scenarios[] =;

static const char * const pistachio_mips_trace_dm_groups[] =;

static const char * const pistachio_mips_probe_n_groups[] =;
static const int pistachio_mips_probe_n_scenarios[] =;

static const char * const pistachio_mips_trace_data_groups[] =;

static const char * const pistachio_sram_debug_groups[] =;

static const char * const pistachio_rom_debug_groups[] =;

static const char * const pistachio_rpu_debug_groups[] =;

static const char * const pistachio_mips_debug_groups[] =;

static const char * const pistachio_eth_debug_groups[] =;

static const char * const pistachio_usb_debug_groups[] =;

static const char * const pistachio_sdhost_debug_groups[] =;

static const char * const pistachio_socif_debug_groups[] =;

static const char * const pistachio_mdc_debug_groups[] =;

static const char * const pistachio_ddr_debug_groups[] =;

static const char * const pistachio_dreq0_groups[] =;

static const char * const pistachio_dreq1_groups[] =;

static const char * const pistachio_dreq2_groups[] =;

static const char * const pistachio_dreq3_groups[] =;

static const char * const pistachio_dreq4_groups[] =;

static const char * const pistachio_dreq5_groups[] =;

static const char * const pistachio_mips_pll_lock_groups[] =;

static const char * const pistachio_audio_pll_lock_groups[] =;

static const char * const pistachio_rpu_v_pll_lock_groups[] =;

static const char * const pistachio_rpu_l_pll_lock_groups[] =;

static const char * const pistachio_sys_pll_lock_groups[] =;

static const char * const pistachio_wifi_pll_lock_groups[] =;

static const char * const pistachio_bt_pll_lock_groups[] =;

#define FUNCTION(_name)

#define FUNCTION_SCENARIO(_name, _reg, _shift, _mask)

enum pistachio_mux_option {};

static const struct pistachio_function pistachio_functions[] =;

#define PIN_GROUP(_pin, _name)

#define MFIO_PIN_GROUP(_pin, _func)

#define MFIO_MUX_PIN_GROUP(_pin, _f0, _f1, _f2, _reg, _shift, _mask)

static const struct pistachio_pin_group pistachio_groups[] =;

static inline u32 pctl_readl(struct pistachio_pinctrl *pctl, u32 reg)
{}

static inline void pctl_writel(struct pistachio_pinctrl *pctl, u32 val, u32 reg)
{}

static inline struct pistachio_gpio_bank *irqd_to_bank(struct irq_data *d)
{}

static inline u32 gpio_readl(struct pistachio_gpio_bank *bank, u32 reg)
{}

static inline void gpio_writel(struct pistachio_gpio_bank *bank, u32 val,
			       u32 reg)
{}

static inline void gpio_mask_writel(struct pistachio_gpio_bank *bank,
				    u32 reg, unsigned int bit, u32 val)
{}

static inline void gpio_enable(struct pistachio_gpio_bank *bank,
			       unsigned offset)
{}

static inline void gpio_disable(struct pistachio_gpio_bank *bank,
				unsigned offset)
{}

static int pistachio_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
{}

static const char *pistachio_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
						    unsigned group)
{}

static int pistachio_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
					    unsigned group,
					    const unsigned **pins,
					    unsigned *num_pins)
{}

static const struct pinctrl_ops pistachio_pinctrl_ops =;

static int pistachio_pinmux_get_functions_count(struct pinctrl_dev *pctldev)
{}

static const char *
pistachio_pinmux_get_function_name(struct pinctrl_dev *pctldev, unsigned func)
{}

static int pistachio_pinmux_get_function_groups(struct pinctrl_dev *pctldev,
						unsigned func,
						const char * const **groups,
						unsigned * const num_groups)
{}

static int pistachio_pinmux_enable(struct pinctrl_dev *pctldev,
				   unsigned func, unsigned group)
{}

static const struct pinmux_ops pistachio_pinmux_ops =;

static int pistachio_pinconf_get(struct pinctrl_dev *pctldev, unsigned pin,
				 unsigned long *config)
{}

static int pistachio_pinconf_set(struct pinctrl_dev *pctldev, unsigned pin,
				 unsigned long *configs, unsigned num_configs)
{}

static const struct pinconf_ops pistachio_pinconf_ops =;

static struct pinctrl_desc pistachio_pinctrl_desc =;

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

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

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

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

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

static void pistachio_gpio_irq_ack(struct irq_data *data)
{}

static void pistachio_gpio_irq_mask(struct irq_data *data)
{}

static void pistachio_gpio_irq_unmask(struct irq_data *data)
{}

static unsigned int pistachio_gpio_irq_startup(struct irq_data *data)
{}

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

static void pistachio_gpio_irq_handler(struct irq_desc *desc)
{}

#define GPIO_BANK(_bank, _pin_base, _npins)

static struct pistachio_gpio_bank pistachio_gpio_banks[] =;

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

static const struct irq_chip pistachio_gpio_irq_chip =;

static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
{}

static const struct of_device_id pistachio_pinctrl_of_match[] =;

static int pistachio_pinctrl_probe(struct platform_device *pdev)
{}

static struct platform_driver pistachio_pinctrl_driver =;

static int __init pistachio_pinctrl_register(void)
{}
arch_initcall(pistachio_pinctrl_register);