From patchwork Tue Feb 6 02:52:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Huang X-Patchwork-Id: 13546545 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 A5D96C4828D for ; Tue, 6 Feb 2024 02:52:47 +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: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:In-Reply-To:References: List-Owner; bh=gMSFoqVwEcP9p1N4zTxBHx1mnUvFrjdHzGzw/SiLuA4=; b=ozsvc+OqC408hd KgGqAy6EkT5hxdxVCmLc3T6r5dK7+Hto1UbI9PR1pkdZDy1/AsyVGccaW3bD6dPpHaT/Aw/EIRxiG EkKzvQB1C9RWkXQGvUD5CJRtGdcBXOZO/hhPOswEpVQoZkMD9SZQLIZseleUFLVxaUE3qRvy/wBJQ /WvStP7PNZKYxi2fUmnOR9BnhzVZVPQPxQP/6e/DohuHpxdJx3CG3c2hC7wgrLQmhh/sH7VQ8C/O8 mtEypvXDNOGll2KVv4yJDYsMHLMu+nCXAHUp635wM7tFGTPxUpz6pHKyvRTEgeX0QiepJ8DCKq3yK il2iJzjixz4YbCfmJLZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXBZb-00000005qCc-2eT4; Tue, 06 Feb 2024 02:52:35 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXBZZ-00000005qBe-1qC1 for linux-arm-kernel@lists.infradead.org; Tue, 06 Feb 2024 02:52:34 +0000 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-5dc20645871so88562a12.1 for ; Mon, 05 Feb 2024 18:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707187951; x=1707792751; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ISGNh/R7KOPf4WD4INL9jBNwxYTfU9uVKM4TWwNiAak=; b=l2NaawF4Rf59OzM/Aa2zJP07pvWqqey//Kp1gVQgWkDtBn/ucc0UflLEfcsjnCCZKc hnJlsyhGJQDKqHpe7zVILVFCf4F8pxUm93S9yW+elJkVEnXgotAVe9C2sJA4LyoLUTW4 DsN8jnJE9oF2ZkTo+7qUkgemyyTgpipkqW0v1qn/XLBThlns0H2mEe6Ikt4bRHzmcIoe ztQwGd3iUHHrfcOz6PNz5GZyChe4+P7Qntae8VYoTSS58UM7VnRDjMGDKmu2xyE3i713 z4DSY0/yHbotNEi2+jec3QgOyxVWdVAit7DM+tusQtWelXICc1rP4oyeiDqtvS0V+JQr 02Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707187951; x=1707792751; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ISGNh/R7KOPf4WD4INL9jBNwxYTfU9uVKM4TWwNiAak=; b=ojYIWPnubdqUG4ZilWaremSq9eueRw4nrtcgGG/FkkqSN6r3nzTgp3ULmSCi0ldASx jbPjIH5tE7Ptm2ALPluU7KUJWXoqCf77YKig0ZV2FlfUi1mW+/ryvPfJlU0gxSVfM1ZL VPcLN5UqA7Zm1yA4zvw3qJlDRtdO3YzR9XzLYW2EJtW91tQAjFTJxUR4EqdHbzMnb9Hy xvLbdaBDpGdVZH32Z2phlLfarbvm6/baIbOMFr5viPwxlmhX4OJh3EPFx2CcSVLN6G5Y YnSSBPxNAi1SJA8zFToOik7K3k0xA94T873HEJgqsznbfuko9mO3vgrNkLYQ1MMGdsp+ X7HA== X-Gm-Message-State: AOJu0YyDyuUNKJqQL2L+7ZszbFM795IESZE0nncugbrHiiU8iNTVN25J EqflscA/9N1KSO5FzdeKA0ov8Q5JHHsYEWbRJC/nul88VNxaLm/p X-Google-Smtp-Source: AGHT+IHcz7hjFdYEduLcrpKjrNiierqBL1EIINAQvCoE+O54HnPZInn81NLvC2skbbIpiABC+oQX2w== X-Received: by 2002:a05:6a20:549e:b0:19c:95cc:1d47 with SMTP id i30-20020a056a20549e00b0019c95cc1d47mr707770pzk.6.1707187951157; Mon, 05 Feb 2024 18:52:31 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVaKhEroopJl8jNwSlu5JoFk1bbAHKcM0/61+X1Kd0DVgc3yAXdgaRARRU2iSAbBgG4YmY9Kd42uNXVzTgkSW+6N0iLPuFduZqzEKPt4fMUSQzB3fYA8en0PYXVZjmepuXpjgHXqZ3jKH51vMfrIfACVk2TgEB0V3GdUDl6vlqGnhccSAhyqL9VT5DZnG7YkrrYmKE4ob7f1Gldck/6FQSnKe6JFmo3rCMIKuuUaxy7e4MlJx8LG8GW3GJ9MoNE2qzR4NYNobS3djwBSrM9U4cNAJtIrX2EzdmitcwObPSsg4IJ0nU+V96MtdhJNaVOybpVo4ohQdB+P3/dBlkZfK07fMjTflKVJVC1wUH/mFnehPOUiApMo3devNoEHk1cP4N4vL+yM+nnY3s= Received: from a28aa0606c51.. (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id gx22-20020a056a001e1600b006d94291679asm622542pfb.78.2024.02.05.18.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 18:52:30 -0800 (PST) From: Jacky Huang To: linus.walleij@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, j.neuschaefer@gmx.net Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ychuang3@nuvoton.com, schung@nuvoton.com Subject: [PATCH v4 0/4] Add support for nuvoton ma35d1 pin control Date: Tue, 6 Feb 2024 02:52:19 +0000 Message-Id: <20240206025223.35147-1-ychuang570808@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240205_185233_508125_8F61286B X-CRM114-Status: GOOD ( 14.85 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jacky Huang This patch series adds the pin control and GPIO driver for the nuvoton ma35d1 ARMv8 SoC. It includes DT binding documentation, the ma35d1 pin control driver, and device tree updates. This pin control driver has been tested on the ma35d1 som board with Linux 6.8-rc1. v4: - Update the pinctrl driver Kconfig - Add depends to CONFIG_PINCTRL_MA35D1 to prevent compilation errors. - Update the pinctrl driver - Utilize devm_kcalloc() instead of devm_kzalloc(). - Employ ARRAY_SIZE() instead of sizeof()/sizeof(). v3: - Update DTS and YAML files - Corrected the unit address of nodes gpioa ~ gpion. - Removed the invalid "pin-default" node. - Removed the phandle entry from "nuvoton,pins". - Update pinctrl driver - Fixed the Kconfig by using "depend on" instead of "if". - Removed unused #include of header files. - Utilized immutable irq_chip instead of dynamic irq_chip. - Replaced ma35_dt_free_map() with pinconf_generic_dt_free_map(). - Implemented other minor fixes as suggested by the reviewer. v2: - Update nuvoton,ma35d1-pinctrl.yaml - Update the 'nuvoton,pins' to follow the style of rockchip pinctrl approch. - Use power-source to indicate the pin voltage selection which follow the realtek pinctrl approch. - Instead of integer, use drive-strength-microamp to specify the real driving strength capability of IO pins. - Update ma35d1 pinctrl driver - Add I/O drive strength lookup table for translating device tree setting into control register. - Remove ma35d1-pinfunc.h which is unused after update definition of 'nuvoton,pins'. Jacky Huang (4): dt-bindings: reset: Add syscon to nuvoton ma35d1 system-management node dt-bindings: pinctrl: Document nuvoton ma35d1 pin control arm64: dts: nuvoton: Add pinctrl support for ma35d1 pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver .../pinctrl/nuvoton,ma35d1-pinctrl.yaml | 163 ++ .../bindings/reset/nuvoton,ma35d1-reset.yaml | 3 +- .../boot/dts/nuvoton/ma35d1-iot-512m.dts | 80 +- .../boot/dts/nuvoton/ma35d1-som-256m.dts | 83 +- arch/arm64/boot/dts/nuvoton/ma35d1.dtsi | 150 +- drivers/pinctrl/nuvoton/Kconfig | 19 + drivers/pinctrl/nuvoton/Makefile | 2 + drivers/pinctrl/nuvoton/pinctrl-ma35.c | 1211 +++++++++++ drivers/pinctrl/nuvoton/pinctrl-ma35.h | 50 + drivers/pinctrl/nuvoton/pinctrl-ma35d1.c | 1797 +++++++++++++++++ 10 files changed, 3548 insertions(+), 10 deletions(-) create mode 100644 Documentation/devicetree/bindings/pinctrl/nuvoton,ma35d1-pinctrl.yaml create mode 100644 drivers/pinctrl/nuvoton/pinctrl-ma35.c create mode 100644 drivers/pinctrl/nuvoton/pinctrl-ma35.h create mode 100644 drivers/pinctrl/nuvoton/pinctrl-ma35d1.c