From patchwork Thu Jun 23 16:08:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 12892900 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A6B23CCA47C for ; Thu, 23 Jun 2022 16:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GqZMifhb8fkoTC8H3IDEnpZ+DINBUiSbN//5Uwkteug=; b=foWN9CeH3RdGfd fKplvkPe87P2WG3PZuwX6f7tYiy+jqRrHpl42nWETEUSZ6FIuhVdR1+/6WO/YsQrGbYG0egmgy9qM LNlR+OSVOiD17CkT8ZXtvIN+2VsfVSBb25IPxYmLXKNE8z5Gj+CrF53m+5dir1Fnpz/jJrP/ZfiUk T0+Z8TotjyxjzLm9Kb6vcexJezDaSarJre8+lcoXgqIeCZX13nLSn7IUuBoOAkJOYb3ivjmZRNxR2 kUYNBm7sZAXGP60uA6buZdF+Z9dLon80CXoTAGiQjEZpV4c6Rk5SCNS26zjoqe2iZ64/DzXaAtlys eKo9WYFyJcINRf+MVxLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4PNM-00Fox8-Lo; Thu, 23 Jun 2022 16:08:12 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o4PNH-00Fouk-Bi for linux-rockchip@lists.infradead.org; Thu, 23 Jun 2022 16:08:09 +0000 Received: from jupiter.universe (unknown [95.33.159.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madras.collabora.co.uk (Postfix) with ESMTPSA id F3DC166017E5; Thu, 23 Jun 2022 17:08:05 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1656000486; bh=w0CRHYNz9iSBQk/+ZmhinMEi7N+ofG9zMh6LCsa2h/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GgZqJNr0RkGxv+a+WG1xxHLCKnWgSRZb+NUCkJnJqjl1fE2TOZxa4wGdug6BqOtIS 6XRyVMG6SbA3FBygJeWidqqEXerGsrSRQpZBLh9udZXwtcj4G0Xn10KwUNWyNtph3P f8z1uxkhdRYtc57J+CsbQu6EYQSaZkdyAiSyqAk0EFZ5szb3YjySKc9ybHvQSwprq9 hWAmRhk0gb3P8EFxnjv9CQK0zMIBuHkD4j55l5+nI2HVbjLiGDaZUWkUF1l+O60Vh2 JaqEONWHzX8ea2UR2XM4i1LZ3e9mHg5RMB2DSPGA9X4GRGxhlJEzOen3LaMYDgVKVq ZxYJVjcpt2wEA== Received: by jupiter.universe (Postfix, from userid 1000) id A1499480126; Thu, 23 Jun 2022 18:08:03 +0200 (CEST) From: Sebastian Reichel To: Heiko Stuebner Cc: Rob Herring , Krzysztof Kozlowski , Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, Jianqun Xu , kernel@collabora.com, Sebastian Reichel Subject: [PATCH 2/2] gpio: rockchip: add support for rk3588 Date: Thu, 23 Jun 2022 18:08:01 +0200 Message-Id: <20220623160801.240779-3-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220623160801.240779-1-sebastian.reichel@collabora.com> References: <20220623160801.240779-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220623_090807_586837_383F1484 X-CRM114-Status: GOOD ( 13.34 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org From: Jianqun Xu Add V2.1 rockchip gpio controller type, which is part of the RK3588 SoC. Signed-off-by: Jianqun Xu Reviewed-by: Linus Walleij Signed-off-by: Sebastian Reichel Reviewed-by: Heiko Stuebner --- drivers/gpio/gpio-rockchip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c index e342a6dc4c6c..f91e876fd969 100644 --- a/drivers/gpio/gpio-rockchip.c +++ b/drivers/gpio/gpio-rockchip.c @@ -27,6 +27,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 */ static const struct rockchip_gpio_regs gpio_regs_v1 = { .port_dr = 0x00, @@ -664,7 +665,7 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank) id = readl(bank->reg_base + gpio_regs_v2.version_id); /* If not gpio v2, that is default to v1. */ - if (id == GPIO_TYPE_V2) { + if (id == GPIO_TYPE_V2 || id == GPIO_TYPE_V2_1) { bank->gpio_regs = &gpio_regs_v2; bank->gpio_type = GPIO_TYPE_V2; bank->db_clk = of_clk_get(bank->of_node, 1);