[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240815071651.3645949-3-ye.zhang@rock-chips.com>
Date: Thu, 15 Aug 2024 15:16:48 +0800
From: Ye Zhang <ye.zhang@...k-chips.com>
To: linus.walleij@...aro.org,
brgl@...ev.pl,
heiko@...ech.de,
linux-gpio@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Cc: linux-rockchip@...ts.infradead.org,
linux-kernel@...r.kernel.org,
tao.huang@...k-chips.com,
finley.xiao@...k-chips.com,
tim.chen@...k-chips.com,
elaine.zhang@...k-chips.com,
Ye Zhang <ye.zhang@...k-chips.com>
Subject: [PATCH v1 2/5] gpio: rockchip: support GPIO_TYPE_V2_2
Support GPIO_TYPE_V2_2
Signed-off-by: Ye Zhang <ye.zhang@...k-chips.com>
---
drivers/gpio/gpio-rockchip.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
index 251961a876a9..b2f26a16b1f6 100644
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -32,6 +32,7 @@
#define GPIO_TYPE_V1 (0) /* GPIO Version ID reserved */
#define GPIO_TYPE_V2 (0x01000C2B) /* GPIO Version ID 0x01000C2B */
#define GPIO_TYPE_V2_1 (0x0101157C) /* GPIO Version ID 0x0101157C */
+#define GPIO_TYPE_V2_2 (0x010219C8) /* GPIO Version ID 0x010219C8 */
#define GPIO_MAX_PINS (32)
@@ -624,13 +625,17 @@ static void rockchip_gpio_get_ver(struct rockchip_pin_bank *bank)
{
int id = readl(bank->reg_base + gpio_regs_v2.version_id);
- /* If not gpio v2, that is default to v1. */
- if (id == GPIO_TYPE_V2 || id == GPIO_TYPE_V2_1) {
+ switch (id) {
+ case GPIO_TYPE_V2:
+ case GPIO_TYPE_V2_1:
+ case GPIO_TYPE_V2_2:
bank->gpio_regs = &gpio_regs_v2;
bank->gpio_type = GPIO_TYPE_V2;
- } else {
+ break;
+ default:
bank->gpio_regs = &gpio_regs_v1;
bank->gpio_type = GPIO_TYPE_V1;
+ pr_info("Note: Use default GPIO_TYPE_V1!\n");
}
}
--
2.34.1
Powered by blists - more mailing lists