linux/drivers/pinctrl/mediatek/pinctrl-mt7981.c

// SPDX-License-Identifier: GPL-2.0
/*
 * The MT7981 driver based on Linux generic pinctrl binding.
 *
 * Copyright (C) 2020 MediaTek Inc.
 * Author: Sam Shih <[email protected]>
 */

#include "pinctrl-moore.h"

#define MT7981_PIN(_number, _name)

#define PIN_FIELD_BASE(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, _x_bits)

#define PINS_FIELD_BASE(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, _x_bits)

static const struct mtk_pin_field_calc mt7981_pin_mode_range[] =;

static const struct mtk_pin_field_calc mt7981_pin_dir_range[] =;

static const struct mtk_pin_field_calc mt7981_pin_di_range[] =;

static const struct mtk_pin_field_calc mt7981_pin_do_range[] =;

static const struct mtk_pin_field_calc mt7981_pin_ies_range[] =;

static const struct mtk_pin_field_calc mt7981_pin_smt_range[] =;

static const struct mtk_pin_field_calc mt7981_pin_pu_range[] =;

static const struct mtk_pin_field_calc mt7981_pin_pd_range[] =;

static const struct mtk_pin_field_calc mt7981_pin_drv_range[] =;

static const struct mtk_pin_field_calc mt7981_pin_pupd_range[] =;

static const struct mtk_pin_field_calc mt7981_pin_r0_range[] =;

static const struct mtk_pin_field_calc mt7981_pin_r1_range[] =;

static const unsigned int mt7981_pull_type[] =;

static const struct mtk_pin_reg_calc mt7981_reg_cals[] =;

static const struct mtk_pin_desc mt7981_pins[] =;

/* List all groups consisting of these pins dedicated to the enablement of
 * certain hardware block and the corresponding mode for all of the pins.
 * The hardware probably has multiple combinations of these pinouts.
 */

/* WA_AICE */
static int mt7981_wa_aice1_pins[] =;
static int mt7981_wa_aice1_funcs[] =;

static int mt7981_wa_aice2_pins[] =;
static int mt7981_wa_aice2_funcs[] =;

static int mt7981_wa_aice3_pins[] =;
static int mt7981_wa_aice3_funcs[] =;

static int mt7981_wm_aice1_pins[] =;
static int mt7981_wm_aice1_funcs[] =;

static int mt7981_wm_aice2_pins[] =;
static int mt7981_wm_aice2_funcs[] =;

/* WM_UART */
static int mt7981_wm_uart_0_pins[] =;
static int mt7981_wm_uart_0_funcs[] =;

static int mt7981_wm_uart_1_pins[] =;
static int mt7981_wm_uart_1_funcs[] =;

static int mt7981_wm_uart_2_pins[] =;
static int mt7981_wm_uart_2_funcs[] =;

/* DFD */
static int mt7981_dfd_pins[] =;
static int mt7981_dfd_funcs[] =;

/* SYS_WATCHDOG */
static int mt7981_watchdog_pins[] =;
static int mt7981_watchdog_funcs[] =;

static int mt7981_watchdog1_pins[] =;
static int mt7981_watchdog1_funcs[] =;

/* PCIE_PERESET_N */
static int mt7981_pcie_pereset_pins[] =;
static int mt7981_pcie_pereset_funcs[] =;

/* JTAG */
static int mt7981_jtag_pins[] =;
static int mt7981_jtag_funcs[] =;

/* WM_JTAG */
static int mt7981_wm_jtag_0_pins[] =;
static int mt7981_wm_jtag_0_funcs[] =;

static int mt7981_wm_jtag_1_pins[] =;
static int mt7981_wm_jtag_1_funcs[] =;

/* WO0_JTAG */
static int mt7981_wo0_jtag_0_pins[] =;
static int mt7981_wo0_jtag_0_funcs[] =;

static int mt7981_wo0_jtag_1_pins[] =;
static int mt7981_wo0_jtag_1_funcs[] =;

/* UART2 */
static int mt7981_uart2_0_pins[] =;
static int mt7981_uart2_0_funcs[] =;

static int mt7981_uart2_0_tx_rx_pins[] =;
static int mt7981_uart2_0_tx_rx_funcs[] =;

/* GBE_LED0 */
static int mt7981_gbe_led0_pins[] =;
static int mt7981_gbe_led0_funcs[] =;

/* PTA_EXT */
static int mt7981_pta_ext_0_pins[] =;
static int mt7981_pta_ext_0_funcs[] =;

static int mt7981_pta_ext_1_pins[] =;
static int mt7981_pta_ext_1_funcs[] =;

/* PWM2 */
static int mt7981_pwm2_pins[] =;
static int mt7981_pwm2_funcs[] =;

/* NET_WO0_UART_TXD */
static int mt7981_net_wo0_uart_txd_0_pins[] =;
static int mt7981_net_wo0_uart_txd_0_funcs[] =;

static int mt7981_net_wo0_uart_txd_1_pins[] =;
static int mt7981_net_wo0_uart_txd_1_funcs[] =;

static int mt7981_net_wo0_uart_txd_2_pins[] =;
static int mt7981_net_wo0_uart_txd_2_funcs[] =;

/* SPI1 */
static int mt7981_spi1_0_pins[] =;
static int mt7981_spi1_0_funcs[] =;

/* I2C */
static int mt7981_i2c0_0_pins[] =;
static int mt7981_i2c0_0_funcs[] =;

static int mt7981_i2c0_1_pins[] =;
static int mt7981_i2c0_1_funcs[] =;

static int mt7981_i2c0_2_pins[] =;
static int mt7981_i2c0_2_funcs[] =;

static int mt7981_u2_phy_i2c_pins[] =;
static int mt7981_u2_phy_i2c_funcs[] =;

static int mt7981_u3_phy_i2c_pins[] =;
static int mt7981_u3_phy_i2c_funcs[] =;

static int mt7981_sgmii1_phy_i2c_pins[] =;
static int mt7981_sgmii1_phy_i2c_funcs[] =;

static int mt7981_sgmii0_phy_i2c_pins[] =;
static int mt7981_sgmii0_phy_i2c_funcs[] =;

/* DFD_NTRST */
static int mt7981_dfd_ntrst_pins[] =;
static int mt7981_dfd_ntrst_funcs[] =;

/* PWM0 */
static int mt7981_pwm0_0_pins[] =;
static int mt7981_pwm0_0_funcs[] =;

static int mt7981_pwm0_1_pins[] =;
static int mt7981_pwm0_1_funcs[] =;

/* PWM1 */
static int mt7981_pwm1_0_pins[] =;
static int mt7981_pwm1_0_funcs[] =;

static int mt7981_pwm1_1_pins[] =;
static int mt7981_pwm1_1_funcs[] =;

/* GBE_LED1 */
static int mt7981_gbe_led1_pins[] =;
static int mt7981_gbe_led1_funcs[] =;

/* PCM */
static int mt7981_pcm_pins[] =;
static int mt7981_pcm_funcs[] =;

/* UDI */
static int mt7981_udi_pins[] =;
static int mt7981_udi_funcs[] =;

/* DRV_VBUS */
static int mt7981_drv_vbus_pins[] =;
static int mt7981_drv_vbus_funcs[] =;

/* EMMC */
static int mt7981_emmc_reset_pins[] =;
static int mt7981_emmc_reset_funcs[] =;

static int mt7981_emmc_4_pins[] =;
static int mt7981_emmc_4_funcs[] =;

static int mt7981_emmc_8_pins[] =;
static int mt7981_emmc_8_funcs[] =;

static int mt7981_emmc_45_pins[] =;
static int mt7981_emmc_45_funcs[] =;

/* SNFI */
static int mt7981_snfi_pins[] =;
static int mt7981_snfi_funcs[] =;

/* SPI0 */
static int mt7981_spi0_pins[] =;
static int mt7981_spi0_funcs[] =;

/* SPI0 */
static int mt7981_spi0_wp_hold_pins[] =;
static int mt7981_spi0_wp_hold_funcs[] =;

/* SPI1 */
static int mt7981_spi1_1_pins[] =;
static int mt7981_spi1_1_funcs[] =;

/* SPI2 */
static int mt7981_spi2_pins[] =;
static int mt7981_spi2_funcs[] =;

/* SPI2 */
static int mt7981_spi2_wp_hold_pins[] =;
static int mt7981_spi2_wp_hold_funcs[] =;

/* UART1 */
static int mt7981_uart1_0_pins[] =;
static int mt7981_uart1_0_funcs[] =;

static int mt7981_uart1_1_pins[] =;
static int mt7981_uart1_1_funcs[] =;

static int mt7981_uart1_2_pins[] =;
static int mt7981_uart1_2_funcs[] =;

static int mt7981_uart1_3_pins[] =;
static int mt7981_uart1_3_funcs[] =;

/* UART2 */
static int mt7981_uart2_1_pins[] =;
static int mt7981_uart2_1_funcs[] =;

/* UART0 */
static int mt7981_uart0_pins[] =;
static int mt7981_uart0_funcs[] =;

/* PCIE_CLK_REQ */
static int mt7981_pcie_clk_pins[] =;
static int mt7981_pcie_clk_funcs[] =;

/* PCIE_WAKE_N */
static int mt7981_pcie_wake_pins[] =;
static int mt7981_pcie_wake_funcs[] =;

/* MDC_MDIO */
static int mt7981_smi_mdc_mdio_pins[] =;
static int mt7981_smi_mdc_mdio_funcs[] =;

static int mt7981_gbe_ext_mdc_mdio_pins[] =;
static int mt7981_gbe_ext_mdc_mdio_funcs[] =;

/* WF0_MODE1 */
static int mt7981_wf0_mode1_pins[] =;
static int mt7981_wf0_mode1_funcs[] =;

/* WF0_MODE3 */
static int mt7981_wf0_mode3_pins[] =;
static int mt7981_wf0_mode3_funcs[] =;

/* WF2G_LED */
static int mt7981_wf2g_led0_pins[] =;
static int mt7981_wf2g_led0_funcs[] =;

static int mt7981_wf2g_led1_pins[] =;
static int mt7981_wf2g_led1_funcs[] =;

/* WF5G_LED */
static int mt7981_wf5g_led0_pins[] =;
static int mt7981_wf5g_led0_funcs[] =;

static int mt7981_wf5g_led1_pins[] =;
static int mt7981_wf5g_led1_funcs[] =;

/* MT7531_INT */
static int mt7981_mt7531_int_pins[] =;
static int mt7981_mt7531_int_funcs[] =;

/* ANT_SEL */
static int mt7981_ant_sel_pins[] =;
static int mt7981_ant_sel_funcs[] =;

static const struct group_desc mt7981_groups[] =;

/* Joint those groups owning the same capability in user point of view which
 * allows that people tend to use through the device tree.
 */
static const char *mt7981_wa_aice_groups[] =;
static const char *mt7981_uart_groups[] =;
static const char *mt7981_dfd_groups[] =;
static const char *mt7981_wdt_groups[] =;
static const char *mt7981_pcie_groups[] =;
static const char *mt7981_jtag_groups[] =;
static const char *mt7981_led_groups[] =;
static const char *mt7981_pta_groups[] =;
static const char *mt7981_pwm_groups[] =;
static const char *mt7981_spi_groups[] =;
static const char *mt7981_i2c_groups[] =;
static const char *mt7981_pcm_groups[] =;
static const char *mt7981_udi_groups[] =;
static const char *mt7981_usb_groups[] =;
static const char *mt7981_flash_groups[] =;
static const char *mt7981_ethernet_groups[] =;
static const char *mt7981_ant_groups[] =;

static const struct function_desc mt7981_functions[] =;

static const struct mtk_eint_hw mt7981_eint_hw =;

static const char * const mt7981_pinctrl_register_base_names[] =;

static struct mtk_pin_soc mt7981_data =;

static const struct of_device_id mt7981_pinctrl_of_match[] =;

static int mt7981_pinctrl_probe(struct platform_device *pdev)
{}

static struct platform_driver mt7981_pinctrl_driver =;

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