// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
/*
* Pin controller and GPIO driver for Amlogic C3 SoC.
*
* Copyright (c) 2021 Amlogic, Inc. All rights reserved.
* Author: Huqiang Qin <huqiang.qin@amlogic.com>
*/
#include <dt-bindings/gpio/amlogic-c3-gpio.h>
#include "pinctrl-meson.h"
#include "pinctrl-meson-axg-pmx.h"
static const struct pinctrl_pin_desc c3_periphs_pins[] = {
MESON_PIN(GPIOE_0),
MESON_PIN(GPIOE_1),
MESON_PIN(GPIOE_2),
MESON_PIN(GPIOE_3),
MESON_PIN(GPIOE_4),
MESON_PIN(GPIOB_0),
MESON_PIN(GPIOB_1),
MESON_PIN(GPIOB_2),
MESON_PIN(GPIOB_3),
MESON_PIN(GPIOB_4),
MESON_PIN(GPIOB_5),
MESON_PIN(GPIOB_6),
MESON_PIN(GPIOB_7),
MESON_PIN(GPIOB_8),
MESON_PIN(GPIOB_9),
MESON_PIN(GPIOB_10),
MESON_PIN(GPIOB_11),
MESON_PIN(GPIOB_12),
MESON_PIN(GPIOB_13),
MESON_PIN(GPIOB_14),
MESON_PIN(GPIOC_0),
MESON_PIN(GPIOC_1),
MESON_PIN(GPIOC_2),
MESON_PIN(GPIOC_3),
MESON_PIN(GPIOC_4),
MESON_PIN(GPIOC_5),
MESON_PIN(GPIOC_6),
MESON_PIN(GPIOX_0),
MESON_PIN(GPIOX_1),
MESON_PIN(GPIOX_2),
MESON_PIN(GPIOX_3),
MESON_PIN(GPIOX_4),
MESON_PIN(GPIOX_5),
MESON_PIN(GPIOX_6),
MESON_PIN(GPIOX_7),
MESON_PIN(GPIOX_8),
MESON_PIN(GPIOX_9),
MESON_PIN(GPIOX_10),
MESON_PIN(GPIOX_11),
MESON_PIN(GPIOX_12),
MESON_PIN(GPIOX_13),
MESON_PIN(GPIOD_0),
MESON_PIN(GPIOD_1),
MESON_PIN(GPIOD_2),
MESON_PIN(GPIOD_3),
MESON_PIN(GPIOD_4),
MESON_PIN(GPIOD_5),
MESON_PIN(GPIOD_6),
MESON_PIN(GPIOA_0),
MESON_PIN(GPIOA_1),
MESON_PIN(GPIOA_2),
MESON_PIN(GPIOA_3),
MESON_PIN(GPIOA_4),
MESON_PIN(GPIOA_5),
MESON_PIN(GPIO_TEST_N),
};
/* Bank E func1 */
static const unsigned int pwm_a_pins[] = { GPIOE_0 };
static const unsigned int pwm_b_pins[] = { GPIOE_1 };
static const unsigned int i2c2_sda_pins[] = { GPIOE_2 };
static const unsigned int i2c2_scl_pins[] = { GPIOE_3 };
static const unsigned int gen_clk_e_pins[] = { GPIOE_4 };
/* Bank E func2 */
static const unsigned int i2c0_sda_e_pins[] = { GPIOE_0 };
static const unsigned int i2c0_scl_e_pins[] = { GPIOE_1 };
static const unsigned int clk_32k_in_pins[] = { GPIOE_4 };
/* Bank E func3 */
static const unsigned int i2c_slave_scl_pins[] = { GPIOE_0 };
static const unsigned int i2c_slave_sda_pins[] = { GPIOE_1 };
static const unsigned int clk12_24_e_pins[] = { GPIOE_4 };
/* Bank B func1 */
static const unsigned int emmc_nand_d0_pins[] = { GPIOB_0 };
static const unsigned int emmc_nand_d1_pins[] = { GPIOB_1 };
static const unsigned int emmc_nand_d2_pins[] = { GPIOB_2 };
static const unsigned int emmc_nand_d3_pins[] = { GPIOB_3 };
static const unsigned int emmc_nand_d4_pins[] = { GPIOB_4 };
static const unsigned int emmc_nand_d5_pins[] = { GPIOB_5 };
static const unsigned int emmc_nand_d6_pins[] = { GPIOB_6 };
static const unsigned int emmc_nand_d7_pins[] = { GPIOB_7 };
static const unsigned int emmc_clk_pins[] = { GPIOB_8 };
static const unsigned int emmc_rst_pins[] = { GPIOB_9 };
static const unsigned int emmc_cmd_pins[] = { GPIOB_10 };
static const unsigned int emmc_nand_ds_pins[] = { GPIOB_11 };
/* Bank B func2 */
static const unsigned int nand_wen_clk_pins[] = { GPIOB_8 };
static const unsigned int nand_ale_pins[] = { GPIOB_9 };
static const unsigned int nand_ren_wr_pins[] = { GPIOB_10 };
static const unsigned int nand_cle_pins[] = { GPIOB_11 };
static const unsigned int nand_ce0_pins[] = { GPIOB_12 };
/* Bank B func3 */
static const unsigned int pwm_g_b_pins[] = { GPIOB_0 };
static const unsigned int pwm_h_b_pins[] = { GPIOB_1 };
static const unsigned int pwm_i_b_pins[] = { GPIOB_2 };
static const unsigned int spif_hold_pins[] = { GPIOB_3 };
static const unsigned int spif_mo_pins[] = { GPIOB_4 };
static const unsigned int spif_mi_pins[] = { GPIOB_5 };
static const unsigned int spif_clk_pins[] = { GPIOB_6 };
static const unsigned int spif_wp_pins[] = { GPIOB_7 };
static const unsigned int pwm_j_b_pins[] = { GPIOB_8 };
static const unsigned int pwm_k_b_pins[] = { GPIOB_9 };
static const unsigned int pwm_l_b_pins[]