From patchwork Wed Jan 15 06:41:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xianwei Zhao via B4 Relay X-Patchwork-Id: 13939881 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 CD0D4C02180 for ; Wed, 15 Jan 2025 06:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=7koPjQu8m74dromDbd3AnXy6MqAGD3Y4lCmVOYiLCGA=; b=GepdFleiIiNB7+OShU1oKUK0Wi 46J36N1pg9TAfO16zkdaw11a+NE535swVtnTbLTUycK9G/M2Z4xFoVSJfRGHqG6i0A2EYBbx/A8Ss imU7tHfaIVcji3C832BKRxSak9aYi9SIZDlW5BaSiDwvJLTA2IMYaQ9MLRpCJA9fz1Hs1UXAIkGn4 tSTuqTalxh5XsSF+Dwo9xwgMflNHr0SpwPj3pYNcCFWOI9TitO4R0xV5BzHGaIaYLxTCC/FFBK02k 9dbpPq8SdPGsXqVpnckX7gIuMIUB1KAuHeun+1UPBdnryHxoIBrNqNgnMDN0G4sYaBVSgY8pPbYLB cpJR0VoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXx7Z-0000000Aq01-3qen; Wed, 15 Jan 2025 06:43:21 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXx6J-0000000Apfl-2aJR; Wed, 15 Jan 2025 06:42:05 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D63435C59B4; Wed, 15 Jan 2025 06:41:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 45047C4CEE1; Wed, 15 Jan 2025 06:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736923322; bh=yAzz8DVv15VnfgafeklHW7SZXuVzWgf+QTN4jS3Z664=; h=From:Subject:Date:To:Cc:Reply-To:From; b=dV5O3ZPaW+Evdnz7DrdLFujPTNgjEib+dakvMRgxXZsBqwKc8PZauufuOPONWSxZ7 9v5PVXALZyzDgDtzxxGpCQwamFuyPUtkFPXrI/1lEcfLTap82Yk6Sn/7kh9R+KwtXr pNflNa4d/izvnj/FVcHTHksCTMR6hnBfqLeFcWTal158+A70aINO0bB1Px9bAUzVJf /JPg5UIMt4rB26yfh0Tuk2WtQKThi9UiZuKikWf2QWHORrauazEHtFp+ezlROwEHAk oMcmtbURStwrMsn1qihG9whXrCuJJLE1fVtWuVKk7AupzdkmKRobW0GZCfJ22Npsuy x2hz5Zu0WiKQQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A51FC02180; Wed, 15 Jan 2025 06:42:02 +0000 (UTC) From: Xianwei Zhao via B4 Relay Subject: [PATCH v3 0/5] Pinctrl: Add Amlogic pinctrl driver Date: Wed, 15 Jan 2025 14:41:58 +0800 Message-Id: <20250115-amlogic-pinctrl-v3-0-2b8536457aba@amlogic.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIALZYh2cC/3XNwQ6CMAyA4VchOzuzFtyUk+9hPMxtQhNgZCOLh vDuDuJBYzz+Tft1ZtEFcpHVxcyCSxTJDznKXcFMq4fGcbK5GQqsAAG47jvfkOEjDWYKHUd0WsI RhRWW5asxuDs9NvFyzd1SnHx4bg8SrNP/VgIueAVCoSrLA8Dp/N7YG9+zVUv4IaD8FTALxmpXo ZbqpuS3sCzLCw4DEJXyAAAA To: Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Xianwei Zhao X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1736923319; l=2866; i=xianwei.zhao@amlogic.com; s=20231208; h=from:subject:message-id; bh=yAzz8DVv15VnfgafeklHW7SZXuVzWgf+QTN4jS3Z664=; b=Oh4+tcghBMmFd5b0eO2G34Vd5bpa0jqVva6QPVtlL8HxmBP8pu8kSegvKUbjSZ8xaorNRArsH ngIHUTxMgMuBKPPJnxZxwuogTfB0TtIvh4c9BE5fLTChkfLbxc/YDOy X-Developer-Key: i=xianwei.zhao@amlogic.com; a=ed25519; pk=o4fDH8ZXL6xQg5h17eNzRljf6pwZHWWjqcOSsj3dW24= X-Endpoint-Received: by B4 Relay for xianwei.zhao@amlogic.com/20231208 with auth_id=107 X-Original-From: Xianwei Zhao X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250114_224203_747190_0C1DFCF5 X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: xianwei.zhao@amlogic.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add pinctrl driver support for Amloigc SoCs Base on the previous discussion, https://lore.kernel.org/r/20241113-a4_pinctrl-v6-0-35ba2401ee35@amlogic.com The existed meson driver failed to meet the requirement of the current dt-binding. So we start this new pinctrl driver to solve problem. The advantage of this version: Once the source file and binding document are added, adding dts node will be only operation for subsequent Amlogic SoCs (such as A4, A5). The code in DTS file is also readable when using GPIO, as below: reset-gpios = <&gpiob 6 GPIO_ACTIVE_LOW>; Signed-off-by: Xianwei Zhao --- Changes in v3: - Move reg and reg-name from pin controller node into gpio-controller node and drop mask property. - Use gpio-range instead of ngpios property. - Some little modifications were made to bindings according to Rob's suggestions. - Fix bug reported by kernel test robot. - Two pin controller node compressed into one because of register address defined in gpio-controller. - Link to v2: https://lore.kernel.org/r/20241226-amlogic-pinctrl-v2-0-cdae42a67b76@amlogic.com Changes in v2: - Some modifications and optimizations were made to bindings according to Rob's suggestions. - Refined some details on functions node for bindings. - Some source code optimizations were made according to Linus's suggestions. - Add stand API to generic to deal pinmux propertity. - Add private reg data to deal with for future SoCs. - Simplified some unused processing (previously used for extension). - Sync add to MAINTAINERS files. - Link to v1: https://lore.kernel.org/r/20241211-amlogic-pinctrl-v1-0-410727335119@amlogic.com --- Xianwei Zhao (5): dt-bindings: pinctrl: Add support for Amlogic SoCs pinctrl: pinconf-generic: Add API for pinmux propertity in DTS file pinctrl: Add driver support for Amlogic SoCs arm64: dts: amlogic: a4: add pinctrl node MAINTAINERS: Add an entry for Amlogic pinctrl driver .../bindings/pinctrl/amlogic,pinctrl-a4.yaml | 132 +++ MAINTAINERS | 8 + arch/arm64/boot/dts/amlogic/amlogic-a4.dtsi | 133 +++ drivers/pinctrl/Kconfig | 18 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinconf-generic.c | 130 +++ drivers/pinctrl/pinconf.h | 4 + drivers/pinctrl/pinctrl-amlogic.c | 1040 ++++++++++++++++++++ include/dt-bindings/pinctrl/amlogic,pinctrl.h | 46 + include/linux/pinctrl/pinconf-generic.h | 4 + 10 files changed, 1516 insertions(+) --- base-commit: 4de5110762b94b9978fb8182a568572fb2194f8b change-id: 20241211-amlogic-pinctrl-22ea61820d0d Best regards,