// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2017-2018 MediaTek Inc.
*
* Author: Sean Wang <sean.wang@mediatek.com>
*
*/
#include "pinctrl-moore.h"
#define MT7622_PIN(_number, _name) \
MTK_PIN(_number, _name, 1, _number, DRV_GRP0)
static const struct mtk_pin_field_calc mt7622_pin_mode_range[] = {
PIN_FIELD(0, 0, 0x320, 0x10, 16, 4),
PIN_FIELD(1, 4, 0x3a0, 0x10, 16, 4),
PIN_FIELD(5, 5, 0x320, 0x10, 0, 4),
PINS_FIELD(6, 7, 0x300, 0x10, 4, 4),
PIN_FIELD(8, 9, 0x350, 0x10, 20, 4),
PINS_FIELD(10, 13, 0x300, 0x10, 8, 4),
PIN_FIELD(14, 15, 0x320, 0x10, 4, 4),
PIN_FIELD(16, 17, 0x320, 0x10, 20, 4),
PIN_FIELD(18, 21, 0x310, 0x10, 16, 4),
PIN_FIELD(22, 22, 0x380, 0x10, 16, 4),
PINS_FIELD(23, 24, 0x300, 0x10, 24, 4),
PINS_FIELD(25, 36, 0x300, 0x10, 12, 4),
PINS_FIELD(37, 50, 0x300, 0x10, 20, 4),
PIN_FIELD(51, 70, 0x330, 0x10, 4, 4),
PINS_FIELD(71, 72, 0x300, 0x10, 16, 4),
PIN_FIELD(73, 76, 0x310, 0x10, 0, 4),
PIN_FIELD(77, 77, 0x320, 0x10, 28, 4),
PIN_FIELD(78, 78, 0x320, 0x10, 12, 4),
PIN_FIELD(79, 82, 0x3a0, 0x10, 0, 4),
PIN_FIELD(83, 83, 0x350, 0x10, 28, 4),
PIN_FIELD(84, 84, 0x330, 0x10, 0, 4),
PIN_FIELD(85, 90, 0x360, 0x10, 4, 4),
PIN_FIELD(91, 94, 0x390, 0x10, 16, 4),
PIN_FIELD(95, 97, 0x380, 0x10, 20, 4),
PIN_FIELD(98, 101, 0x390, 0x10, 0, 4),
PIN_FIELD(102, 102, 0x360, 0x10, 0, 4),
};
static const struct mtk_pin_field_calc mt7622_pin_dir_range[] = {
PIN_FIELD(0, 102, 0x0, 0x10, 0, 1),
};
static const struct mtk_pin_field_calc mt7622_pin_di_range[] = {
PIN_FIELD(0, 102, 0x200, 0x10, 0, 1),
};
static const struct mtk_pin_field_calc mt7622_pin_do_range[] = {
PIN_FIELD(0, 102, 0x100, 0x10, 0, 1),
};
static const struct mtk_pin_field_calc mt7622_pin_sr_range[] = {
PIN_FIELD(0, 31, 0x910, 0x10, 0, 1),
PIN_FIELD(32, 50, 0xa10, 0x10, 0, 1),
PIN_FIELD(51, 70, 0x810, 0x10, 0, 1),
PIN_FIELD(71, 72, 0xb10, 0x10, 0, 1),
PIN_FIELD(73, 86, 0xb10, 0x10, 4, 1),
PIN_FIELD(87, 90, 0xc10, 0x10, 0, 1),
PIN_FIELD(91, 102, 0xb10, 0x10, 18, 1),
};
static const struct mtk_pin_field_calc mt7622_pin_smt_range[] = {
PIN_FIELD(0, 31, 0x920, 0x10, 0, 1),
PIN_FIELD(32, 50, 0xa20, 0x10, 0, 1),
PIN_FIELD(51, 70, 0x820, 0x10, 0, 1),
PIN_FIELD(71, 72, 0xb20, 0x10, 0, 1),
PIN_FIELD(73, 86, 0xb20, 0x10, 4, 1),
PIN_FIELD(87, 90, 0xc20, 0x10, 0, 1),
PIN_FIELD(91, 102, 0xb20, 0x10, 18, 1),
};
static const struct mtk_pin_field_calc mt7622_pin_pu_range[] = {
PIN_FIELD(0, 31, 0x930, 0x10, 0, 1),
PIN_FIELD(32, 50, 0xa30, 0x10, 0, 1),
PIN_FIELD(51, 70, 0x830, 0x10, 0, 1),
PIN_FIELD(71, 72, 0xb30, 0x10, 0, 1),
PIN_FIELD(73, 86, 0xb30, 0x10, 4, 1),
PIN_FIELD(87, 90, 0xc30, 0x10, 0, 1),
PIN_FIELD(91, 102, 0xb30, 0x10, 18, 1),
};
static const struct mtk_pin_field_calc mt7622_pin_pd_range[] = {
PIN_FIELD(0, 31, 0x940, 0x10,