Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2798509lqo; Mon, 20 May 2024 18:25:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXRmw3qrfHcpwkE4lzub78RUpvDk0fAx3N/p1wPRToMEu3Xf5TYhoencMgp1YEqqcd5psufMTbtsO2jQgxEv/5jiqgx4ab7mHH4K4DAPA== X-Google-Smtp-Source: AGHT+IG5mKFa2onkQEw9Sd0R0NjOZzG6kHuGRX5m5z6jr1OQYYF/pyX/xhignnn/0zOi2F2XnPBx X-Received: by 2002:ac8:5a0a:0:b0:43e:3943:4379 with SMTP id d75a77b69052e-43f7a2b550bmr127991441cf.19.1716254705035; Mon, 20 May 2024 18:25:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716254705; cv=pass; d=google.com; s=arc-20160816; b=RORMi422T+iGt/g1PhRC+ok8I2d55gU5oYQrS67b/sZ9Bs2ppGlnAkQgy5jasM0sfC j62+96T9mmuslKNRVU5f0jJiGBXxSAXb0o8Dom8yuWkaSkf7PlksUfENAokYd6L70Xgg 2NyRB5xI0qBEGc60t/Zte/SLgLtwkdvFstMEmsC/YHWQ3iMG9GZ4AbF8KufLbvExs58f LcsCcSNGfyOqlFACzeSxJVzjiRguLDGdXGbVCVYme4Ujg27dhWihUY0Am/WpfaVxn4eu 4/uS+k5jZUzQ8cSR4X2zEB6FyyDXycPxXOr3G9jEsbEAtzsD7X9uDYYbh77UDWK3B59P n3LA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=0+4CFDABta5FvIV2tRRbFSIuE3j1iSrR6GdVOPZVmLQ=; fh=IGjhW0M8SHWg6SyJYtE2RtR2CFn6wFpew2vMh6RcIDg=; b=YR+xXSahutQJDuvUq0oXWtC2bzX8v/vZpc3ZH9yxMRmjZo3q8veSfWyRoWprxI2qfw QoJwyADtO9hWlYJRieQ7LMOp5w6AdZzfqp/S5QmsoUZDRoPflgSM7zVckayE+XmL4VPM 3CPto3Rc+rT3iapfN1Q79hvw99F/LekTGrrKLkWjhZ0A2XlAUox7l69pgwwqubh25GJ/ YWfhRCyU1x/TkLIPROYgVbOXXHjek1zyf2qq00ZKAbJ9Tb3jJGimCm0/l7TEfCX8AXfb mDFFm83F5MIZ3rWydFo2kTpjLUYV9VkFLJe6PC+561zFN0buByH3qgBbh+yUIagYucQV QC+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YTQ3YY2L; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-184342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184342-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43e0729555bsi60424331cf.515.2024.05.20.18.25.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 18:25:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YTQ3YY2L; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-184342-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184342-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B24891C20F65 for ; Tue, 21 May 2024 01:25:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9862CBA53; Tue, 21 May 2024 01:24:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YTQ3YY2L" Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5340323B1; Tue, 21 May 2024 01:24:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716254696; cv=none; b=ZBrxSves006OvEJlqdkD/N7vI2xg5v5yCi7dnIJOSvIl6vP4cuZEcqqFdWIeszWw1oWO41t9xYoE6mQWftopmSbFYc5NG8TYEXEi849mNFZeHgUKsMgJ+zzbjc6D5+v30e54FGDVdWr5Tf9g2aEpuOJ9UNMKm0UoBrEOHBne/Pc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716254696; c=relaxed/simple; bh=mlKHlNHeRZJ1JNKcVo4YtnQWkRNUTKol1zsZTyOmgl4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=osv4D0KPBdzoBBSQUI9RFsUtKt9dET9qs/Hc/sH9faDuIwz3/1xT73+e9oAlBMz4xQhqjpc30IHtFVEgpg0loogIWfNlKYFJ4lt9mjE5RfxtixNm+0DxB1B3A+FxPDC5b9gJ3QufJisjSJzRPqmgpFNIvs/Qa6pVAQ3/OcTmDOI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YTQ3YY2L; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6f6b1ac1e90so968078b3a.1; Mon, 20 May 2024 18:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716254694; x=1716859494; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0+4CFDABta5FvIV2tRRbFSIuE3j1iSrR6GdVOPZVmLQ=; b=YTQ3YY2LHzulL8a9VOE48Q3sGh8KE30egQMHtmiVoKtNoDNiofwsPjrourH4BB46JN 58l3wL/dP9Z9ZQaFBy+Qsu/nFWRBQu4+GE4IB+Vh5ld20QdMxbyv3b0agn2Fbsl6T8nc 44ovb340h2ojawko8cm0rHf6a357LOTR12BfTdggPWlhLR/Xi+sL3OfkeF/NXpEofPU2 wDrGLleJwmdAbOzqK48TXdftw5MZelonBO3zmUqPSAajIjD3rn94TP7/kkndLml1+cic lGXZM7CsGcVSOMcLMXSk40iMbu2QwOZNS0AJ78hGzqFuJJRHjDgUKY1DxchqCkAqDve5 nJ2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716254694; x=1716859494; 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=0+4CFDABta5FvIV2tRRbFSIuE3j1iSrR6GdVOPZVmLQ=; b=KBRcZoqSkVRRTpLgliU4tHm/usggfXEb7J6tZzcXwNQ7YBJ7QApNtAQ5+SOBv7kmxb xk8tovh0s9EUPMygsSNUzS42ChaErrFUQdg74kJKWJWOcLABcmV8QN7ojdpR6qlmLeoD RDyaibncogfmubEGUiPUPpl7MaArDrAB8twrGa3RKSQnSmRMUhE5sEcLq/yZ3ZiSuO7T LQQ+Fa+J3MEZrKUZgUNzNu5QR2c/2oTzi2UGMZMCUzPzo6OLIh+F0fMhIzp+hd9kFthp FNfo6WI5qNoLI+vIxgsKcnQqREqN65JqjvOiyAV01kZa22GiNlW1Z9xpnv7cq3v4zcwN HO1Q== X-Forwarded-Encrypted: i=1; AJvYcCVUwmBiHngbeGu2N9Ftuz/ggsmFhDKUqe3pzW989czox3gzCroQ69+PPGxyyu0r/4Uy4SVNTmcEJuihk4HEvmd/cXeyC9oPHX7HphcfCDCpJE67Qdk9QEu4BJIVJiqzNcr6l4GaOo2oP0zBFA5pVfdOjo8/ZHVAggnEIKes9GtIkiA789A= X-Gm-Message-State: AOJu0YzaASb5AMbJUHsb978jKn+Dpd7zGIEdqFH2Y5KLSExQ3EOC+/VQ 3/FuTMG+As/V4BiAyhEemOsGsMZeXxnXxyyy+UU3+zZ5wQqkki/9 X-Received: by 2002:a05:6a20:734e:b0:1af:6914:1154 with SMTP id adf61e73a8af0-1b1ca3b8f77mr11150075637.7.1716254694395; Mon, 20 May 2024 18:24:54 -0700 (PDT) Received: from a28aa0606c51.. (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-65e149dd925sm6477563a12.58.2024.05.20.18.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 18:24:54 -0700 (PDT) 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 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 v9 0/3] Add support for nuvoton ma35d1 pin control Date: Tue, 21 May 2024 01:24:44 +0000 Message-Id: <20240521012447.42211-1-ychuang570808@gmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Jacky Huang This patch series adds the pin control and GPIO driver for the nuvoton ma35d1 ARMv8 SoC. It includes DT binding documentation and the ma35d1 pin control driver. This pin control driver has been tested on the ma35d1 som board with Linux 6.9.0-rc7. v9: - Update pinctrl driver: - Fixed a compilation warning reported by testrobot. - Removed unnecessary gpiochip_remove(). - Made other minor fixes. v8: - Update pinctrl driver: - Utilize macros wherever possible for managing register bit fields. - Revise the usage of 'hwirq'. - Transition to fwnode-based operations instead of device_node as possible. - Refactor function ma35_pinctrl_parse_groups(). - Adopt new PM macros. - Implement other minor fixes. - Update dt-binding docuemnt: - Add property 'reg' to this pinctrl node. - Correct the patternProperties name from "pins-" to "-pins" and relocate it under "-grp". v7: - Replace the magic numbers appearing in the driver with defined constants, or provide comments to explain them. - Update the ma35_irq_irqtype() - irq_set_handler_locked(d, handle_edge_irq) and irq_set_handler_locked(d, handle_level_irq) - add case IRQ_TYPE_EDGE_BOTH - Use handle_bad_irq for girq->handler, instead of handle_level_irq v6: - Remove DTS from this patchset. The DTS will be submitted in another patchset. v5: - Update the pinctrl driver header file pinctrl-ma35.h - Include platform_device.h to fix compile issues. 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 (3): dt-bindings: reset: Add syscon to nuvoton ma35d1 system-management node dt-bindings: pinctrl: Document nuvoton ma35d1 pin control pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver .../pinctrl/nuvoton,ma35d1-pinctrl.yaml | 178 ++ .../bindings/reset/nuvoton,ma35d1-reset.yaml | 3 +- drivers/pinctrl/nuvoton/Kconfig | 19 + drivers/pinctrl/nuvoton/Makefile | 2 + drivers/pinctrl/nuvoton/pinctrl-ma35.c | 1187 +++++++++++ drivers/pinctrl/nuvoton/pinctrl-ma35.h | 52 + drivers/pinctrl/nuvoton/pinctrl-ma35d1.c | 1799 +++++++++++++++++ 7 files changed, 3239 insertions(+), 1 deletion(-) 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 -- 2.34.1