// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Pin controller and GPIO driver for Amlogic Meson A1 SoC.
*
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
* Author: Qianggui Song <qianggui.song@amlogic.com>
*/
#include <dt-bindings/gpio/meson-a1-gpio.h>
#include "pinctrl-meson.h"
#include "pinctrl-meson-axg-pmx.h"
static const struct pinctrl_pin_desc meson_a1_periphs_pins[] = {
MESON_PIN(GPIOP_0),
MESON_PIN(GPIOP_1),
MESON_PIN(GPIOP_2),
MESON_PIN(GPIOP_3),
MESON_PIN(GPIOP_4),
MESON_PIN(GPIOP_5),
MESON_PIN(GPIOP_6),
MESON_PIN(GPIOP_7),
MESON_PIN(GPIOP_8),
MESON_PIN(GPIOP_9),
MESON_PIN(GPIOP_10),
MESON_PIN(GPIOP_11),
MESON_PIN(GPIOP_12),
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(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(GPIOX_14),
MESON_PIN(GPIOX_15),
MESON_PIN(GPIOX_16),
MESON_PIN(GPIOF_0),
MESON_PIN(GPIOF_1),
MESON_PIN(GPIOF_2),
MESON_PIN(GPIOF_3),
MESON_PIN(GPIOF_4),
MESON_PIN(GPIOF_5),
MESON_PIN(GPIOF_6),
MESON_PIN(GPIOF_7),
MESON_PIN(GPIOF_8),
MESON_PIN(GPIOF_9),
MESON_PIN(GPIOF_10),
MESON_PIN(GPIOF_11),
MESON_PIN(GPIOF_12),
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(GPIOA_6),
MESON_PIN(GPIOA_7),
MESON_PIN(GPIOA_8),
MESON_PIN(GPIOA_9),
MESON_PIN(GPIOA_10),
MESON_PIN(GPIOA_11),
};
/* psram */
static const unsigned int psram_clkn_pins[] = { GPIOP_0 };
static const unsigned int psram_clkp_pins[] = { GPIOP_1 };
static const unsigned int psram_ce_n_pins[] = { GPIOP_2 };
static const unsigned int psram_rst_n_pins[] = { GPIOP_3 };
static const unsigned int psram_adq0_pins[] = { GPIOP_4 };
static const unsigned int psram_adq1_pins[] = { GPIOP_5 };
static const unsigned int psram_adq2_pins[] = { GPIOP_6 };
static const unsigned int psram_adq3_pins[] = { GPIOP_7 };
static const unsigned int psram_adq4_pins[] = { GPIOP_8 };
static const unsigned int psram_adq5_pins[] = { GPIOP_9 };
static const unsigned int psram_adq6_pins[] = { GPIOP_10 };
static const unsigned int psram_adq7_pins[] = { GPIOP_11 };
static const unsigned int psram_dqs_dm_pins[] = { GPIOP_12 };
/* sdcard */
static const unsigned int sdcard_d0_b_pins[] = { GPIOB_0 };
static const unsigned int sdcard_d1_b_pins[] = { GPIOB_1 };
static const unsigned int sdcard_d2_b_pins[] = { GPIOB_2 };
static const unsigned int sdcard_d3_b_pins[] = { GPIOB_3 };
static const unsigned int sdcard_clk_b_pins[] = { GPIOB_4 };
static const unsigned int sdcard_cmd_b_pins[] = { GPIOB_5 };
static const unsigned int sdcard_d0_x_pins[] = { GPIOX_0 };
static const unsigned int sdcard_d1_x_pins[] = { GPIOX_1 };
static const unsigned int sdcard_d2_x_pins[] = { GPIOX_2 };
static const unsigned int sdcard_d3_x_pins[] = { GPIOX_3 };
static const unsigned int sdcard_clk_x_pins[] = { GPIOX_4 };
static const unsigned int sdcard_cmd_x_pins[] = { GPIOX_5 };
/* spif */
static const unsigned int spif_mo_pins[] = { GPIOB_0 };
static const unsigned int spif_mi_pins[] = { GPIOB_1 };
static const unsigned int spif_wp_n_pins[] = { GPIOB_2 };
static const unsigned int spif_hold_n_pins[] = { GPIOB_3 };
static const unsigned int spif_clk_pins[] = { GPIOB_4 };
static const unsigned int spif_cs_pins[] = { GPIOB_5 };
/* i2c0 */
static const unsigned int i2c0_sck_f9_pins[] = {