From nobody Sat Jul 25 17:33:31 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 0D8604508F8 for ; Wed, 15 Jul 2026 12:29:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118577; cv=none; b=fBq8Rvb8RqIGzkbDwxgG39Y3nyliBe5HhXwCU4bstj9bwm/t9FraGx8g0sYop/aciabkvKw+lOppbd+75Fg6SvMrmyjzsY7qfXBlvXvAZOkq/9dvtBAwpndOV+MFTrZbfVnBesAjZMb2kN7veJGy1zAAG7P5dlLiUMwDGBBrh4I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118577; c=relaxed/simple; bh=MlVPvpJnOzb34zOzPdQbWz4nrno9/JBgCsgLJAS+p/o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dMOhkDpmRl+rUaesM6cCqv1titHlzcYdMBtLoZGnKR8z0LpwqTcww1QzbBSWMV43QccV6oSx0u/JKlUBhNwJpQv9+sjn0FDI2bowe1JLB7vgNXajH+TArF6S3F0jZ1hsT6ZYCDlzviJm5fMQvuWjB0SBLX/3+6txBMVjxgh1Oyk= 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=on4sGSpZ; arc=none smtp.client-ip=209.85.128.47 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="on4sGSpZ" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-493ba701891so16884565e9.3 for ; Wed, 15 Jul 2026 05:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784118573; x=1784723373; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=+2HhYmHPpN2k6gv+cX337Z0vUPpech30HlfXZ14MwxY=; b=on4sGSpZW6/TRI3K4r8aO11JA/vwuM5xkVAJKofiSnqbQl5vcV6/VCK7QW930EEJjg 4eIUpNrTg66H2a3gtbeBXjtUAblsp1uNtLbRuRceu5lWPkhU2DoJ6EhKqsVpZEXMoyVv w6kKWGx/+QVfIJkUzl/ZgEfdSO9MxoJBdchkqNYiW7ZGTd+tCt0MBnXjs6pldZQaPlcc 0it/ahkv4MLDJk7+7EaZPRl5Na4rAQKHLR+UYJ1jNiip5zhk6JzB88ilUZb2tTCYBNJN hatzLk9Ca2iDdlMl4q8LAVNF8nm/JTT3mk5InpyGMJkZmrFFOw37FdSIfi2vI0NTaIDv wKww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784118573; x=1784723373; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=+2HhYmHPpN2k6gv+cX337Z0vUPpech30HlfXZ14MwxY=; b=n4NET+WEC0YR4k0MIde7Z2gMbpiSW2l1/O2omwGeF1gJeDzJGxzXPNHIDrZW5dCKs7 jfhnilZ3f4B8YrCzli33oWcH8Ua0cdvg39kIlpXe6+TN2JYmBgAbsd8JIQ/g8GX+NUpD z+/FjaGsklWJ53jL7NIth6iwoy2ZBeihQ6oL2BbvYPARx8mleuGp1P0FT4yFGX2SXrSe x6geICqIkogNB3B9XMGcCo0ildW3gyMNH/faZ+dc9B6+KM/fM3ZdmECy0WnS+1a30s0U 3FPtv2t83qoiDDiW/ywvHcfew2X++hqRJrI2htrSvfJOtrx5KwI1BqE+ztA0pFFhq6aq 2LCA== X-Forwarded-Encrypted: i=1; AHgh+Rr/rgg3A74fJl8WPWq6hG93RpUbOtIA78Ly37sBbw1uajc7ibTfUI44m1PcEX4sEKNXl67pbCwemV5QMoE=@vger.kernel.org X-Gm-Message-State: AOJu0Yyu6i9jdj1gNe3b2hQ1q/pmP7yJtQ908chxVPqY2umZZ1Yr9zem EO0lshEok8eQGy6wGTtQz+fk9gzM3MqHRGPqMQYbJR4O2e8WWKptFmaL X-Gm-Gg: AfdE7ckPrUeNQY4apcZTqTMWuFhWvA33YRatLE4CE4IIxuvJ9uHW5DHEmAIEGbvM8cD mVHAQcIOC8oQVF4zeh2ttBQoT9ntdARQpaCNVeNuE/g3QtNpiT1sNf10WnHf74pHsTW6eEGdBk2 awjPrgeT9lvUu0jltYqKxuRNyTTkYm6RaHhKQbwjBUPpcAxPiTDeBx0DPovZavASvQeVoDxXB+l Hd9AVHRUY6KkKkthfTcbfuO8Y4WGcVJx7IgtpNUvAsHSjT7mTZfl0srCm3DTNNmcMizLM8dBPqo H4idYXv5iWFlp9DCBVPkbQ9MfYLQaVt1WXPsOpMUVUQSSwRe0MPvzG/yHbQ+qYZiDVAxsAnS5Te 4BepgygAagfyNwnbJ66zSNj22eV5qNaF8z7XFOSft2F99zycZM15nLVL1jEnS/PXwkCaA3IsyMz S/Ydps/IOSNRr85SO0ZAgU8vs= X-Received: by 2002:a05:600c:1f87:b0:493:f870:fbf0 with SMTP id 5b1f17b1804b1-493f88b3693mr214909345e9.34.1784118572456; Wed, 15 Jul 2026 05:29:32 -0700 (PDT) Received: from taln60.nuvoton.co.il ([212.199.177.18]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950a32a2casm216770715e9.12.2026.07.15.05.29.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 05:29:30 -0700 (PDT) From: Tomer Maimon To: andrew@codeconstruct.com.au, linusw@kernel.org, brgl@kernel.org Cc: openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com Subject: [PATCH v1 1/8] pinctrl: npcm8xx: drop RTS/CTS pins from bmcuart1 Date: Wed, 15 Jul 2026 15:29:16 +0300 Message-Id: <20260715122923.1938327-2-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260715122923.1938327-1-tmaimon77@gmail.com> References: <20260715122923.1938327-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The bmcuart1 group currently claims BU1_RTS and BU1_CTS in addition to TXD and RXD. That prevents boards from using the modem-control pins independently through the dedicated nbu1crts function. Limit bmcuart1 to the TXD/RXD pair and let users opt into BU1_RTS and BU1_CTS explicitly through the nbu1crts group when those signals are needed. Signed-off-by: Tomer Maimon --- drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nu= voton/pinctrl-npcm8xx.c index 0aae1a253..c859dca4b 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -538,7 +538,7 @@ static const int wdog2_pins[] =3D { 219 }; =20 static const int bmcuart0a_pins[] =3D { 41, 42 }; static const int bmcuart0b_pins[] =3D { 48, 49 }; -static const int bmcuart1_pins[] =3D { 43, 44, 62, 63 }; +static const int bmcuart1_pins[] =3D { 43, 63 }; =20 static const int scipme_pins[] =3D { 169 }; static const int smi_pins[] =3D { 170 }; --=20 2.34.1 From nobody Sat Jul 25 17:33:31 2026 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 394EE478842 for ; Wed, 15 Jul 2026 12:29:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118579; cv=none; b=SXjEGi6cNAMkK6g7J+lusBZuiUi1SvYTdVGINOvgJ+3mO1ImmPBpa1Rm0VYEmyvdPkdEHpMDI1iYrHe8/c//nzSEJVMlUEefZIfgIxfBsgc2i6YzIlGpZQNqeiUL8ur4IHvGOKTmDVBjV0nF7Cfercnsk4B1GKfWX0b0XkBpADE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118579; c=relaxed/simple; bh=7llQApEnqRUf+y2HW6MDlK9YjCFwPMY/ybzG2yeXDo0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TsEVhlhbY/ptphSGuiz1tdLyQIRRMOhHtuKyAECjWMv78EBOBBaqG4NPgXR0KVcFWibZx9bK6PTM+vApgoV7KomwbJrTePNJACGRT47J0vOvfW1Yv7RzuWuBE1s6IobPYU621X5BmTHf0bUMPVZkULn3valTfd//D0F57DGL2e0= 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=g3LXj/0N; arc=none smtp.client-ip=209.85.128.44 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g3LXj/0N" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-493c19bad03so48086305e9.2 for ; Wed, 15 Jul 2026 05:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784118575; x=1784723375; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hGjJScr/bxpJuGG5Tma4ac3F09jinueH/67kipY/w2k=; b=g3LXj/0NCWmbARhwAEQZcK2gY0s1UZYCXc7wrAZfXdZnYKE3hmoGGGFlZ+mu98cEC7 ieRkYbUqynfgtIsSAW+3siQt/6dj+x724lzWamWhG1RlO7jToxoOcwDtsg7irBOe49h+ EBUlM6TNLPa3QF7shS2eFbcAUeWgxYoT2MLP3492uNljHeLMiPKj6AALcG9v7VDb0OoO jfSQH3kiL1sBlfar0e8TcEzZDjnk7EZYtAcTOztfiYdn03YM8YSh0w9Sb5lFk0y6skeB SbITDURaSYzlrVRkJVZLscDq6Y6h5+NsdzG6r6RAhkEIIMBhSLWHORkDS68hEPAtxFGP RuAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784118575; x=1784723375; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=hGjJScr/bxpJuGG5Tma4ac3F09jinueH/67kipY/w2k=; b=TldaY8Bfo8AOBtH4xFBpyJSPHUFr66GyBfVmK01HtKAYvCQKe9vVliaGfyRGE+F0qZ r0W3qwLGgPfSByvVf0ncHqucPZly1aETCGwcut8JnMJG7j/bjcaID5zPF3XSPL2XNVM0 IEkyTjtFGu2o85loLH30gqL0ClsheYfvBhz0CG346FT2LQoqJeL4AGYqhv44r60NihMH 8LhdB2+Y2xPqOiaAQXQ9D8EnhL0N6sJmNnkHjPpMKP7jOFTZz36ezUgHDYN1pugQYYyS esodKatCYTJped99gxppfIQF6/3DQBXu/mBC9nJoV1MItQuqg02c91SFS+zYooWxaG2l H3WQ== X-Forwarded-Encrypted: i=1; AHgh+Roxln51mMFiWr4tCxLXNOJpNYKkWycmDbsV2qsRIRzdt8NNomYU17rSHlK27ZtdtYvU2dwDkGAOXZQ/3ws=@vger.kernel.org X-Gm-Message-State: AOJu0YxIfojOCcPAgu3h5W3INaDUrGIp+AYbR+GLO4fKWm6mIXHYHVuW oulAIt0fECoVPOan8jF1+2+YVJYeNb14jNaZhB2/c2M176bCpx42btRr X-Gm-Gg: AfdE7clr2AyTx/3sfK4bs17SGEFH9wkK43YvN3GTaFCT2WMhbN7KJkwMuHRDnAzZrKn iREc7QwPHoLm5n8DZ6gWdTGefXGgbZyeUn5J8EpSpl9hbHNWQidjmG1Wxo2j5Ot1EqglA9k4IsK eTc92o5xiweOtUTMs7rHVXwB7u6OZZkqQQ8aKCaHIWzp9PZRHlvFxe39ttqZjFtSOSEIPcacWX7 KqaP7Lcsnb1J7EejUjoN5unkm9AG7SqJxbN/MjBiHbxaSTE1JWKa0cAoqXdlCJkXlmmLOzbRYTR Cgy9sJA8GUpR4GPT3F59z2PTgaDNevMVzVzOU4RkwkuaeqRglP3SdbgBnsixU/ZPUfzRp7JXZUr 9L2cy0jmOhWP/uVgaNWxxcqTfU/raiCUSEIgWazWVm/7mMGkDB9LRXE3rgncdj90VGP7u+1Nv+0 ObUYFkODfcdyJz3BuugfUyCzFObrCBt5Cp/g== X-Received: by 2002:a05:600c:3b20:b0:493:e974:41ac with SMTP id 5b1f17b1804b1-4953c168d09mr28802015e9.16.1784118574883; Wed, 15 Jul 2026 05:29:34 -0700 (PDT) Received: from taln60.nuvoton.co.il ([212.199.177.18]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950a32a2casm216770715e9.12.2026.07.15.05.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 05:29:33 -0700 (PDT) From: Tomer Maimon To: andrew@codeconstruct.com.au, linusw@kernel.org, brgl@kernel.org Cc: openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com Subject: [PATCH v1 2/8] pinctrl: npcm8xx: enable RMII outputs from RMII groups Date: Wed, 15 Jul 2026 15:29:17 +0300 Message-Id: <20260715122923.1938327-3-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260715122923.1938327-1-tmaimon77@gmail.com> References: <20260715122923.1938327-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" NPCM8xx uses GCR_INTCR4 bits to release the R1, R2 and RMII3 transmit outputs from Hi-Z. Those bits need to follow the mandatory r1, r2 and rmii3 pin groups. The R1_OEn, R2_OEn and R3_OEn side groups are optional and should not be required just to enable RMII transmit outputs. Program the INTCR4 bits when the corresponding RMII groups are selected and clear them again when those pins switch back to GPIO or another shared function. Signed-off-by: Tomer Maimon --- drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 61 +++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nu= voton/pinctrl-npcm8xx.c index c859dca4b..1d5b3c648 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -26,6 +26,7 @@ #define NPCM8XX_GCR_SRCNT 0x068 #define NPCM8XX_GCR_FLOCKR1 0x074 #define NPCM8XX_GCR_DSCNT 0x078 +#define NPCM8XX_GCR_INTCR4 0x0c0 #define NPCM8XX_GCR_I2CSEGSEL 0x0e0 #define NPCM8XX_GCR_MFSEL1 0x260 #define NPCM8XX_GCR_MFSEL2 0x264 @@ -78,6 +79,9 @@ #define NPCM8XX_GPIO_PER_BANK 32 #define NPCM8XX_GPIO_BANK_NUM 8 #define NPCM8XX_GCR_NONE 0 +#define NPCM8XX_INTCR4_R1_RMII_EN BIT(12) +#define NPCM8XX_INTCR4_R2_RMII_EN BIT(13) +#define NPCM8XX_INTCR4_RMII3_EN BIT(14) =20 #define NPCM8XX_DEBOUNCE_MAX 4 #define NPCM8XX_DEBOUNCE_NSEC 40 @@ -1796,6 +1800,61 @@ static const struct pinctrl_pin_desc npcm8xx_pins[] = =3D { PINCTRL_PIN(251, "JM2/CP1_GPIO"), }; =20 +static u32 npcm8xx_rmii_output_enable_mask(unsigned int pin) +{ + switch (pin) { + case 178: + case 179: + case 180: + case 181: + case 182: + case 193: + case 201: + return NPCM8XX_INTCR4_R1_RMII_EN; + case 84: + case 85: + case 86: + case 87: + case 88: + case 89: + case 200: + return NPCM8XX_INTCR4_R2_RMII_EN; + case 110: + case 111: + case 209: + case 210: + case 211: + case 214: + case 215: + return NPCM8XX_INTCR4_RMII3_EN; + default: + return 0; + } +} + +static void npcm8xx_set_rmii_output_enable(struct regmap *gcr_regmap, + const unsigned int *pin, + int pin_number, int mode) +{ + u32 mask =3D 0; + u32 val =3D 0; + u32 bit; + int i; + + for (i =3D 0; i < pin_number; i++) { + bit =3D npcm8xx_rmii_output_enable_mask(pin[i]); + mask |=3D bit; + + if ((mode =3D=3D fn_r1 && bit =3D=3D NPCM8XX_INTCR4_R1_RMII_EN) || + (mode =3D=3D fn_r2 && bit =3D=3D NPCM8XX_INTCR4_R2_RMII_EN) || + (mode =3D=3D fn_rmii3 && bit =3D=3D NPCM8XX_INTCR4_RMII3_EN)) + val |=3D bit; + } + + if (mask) + regmap_update_bits(gcr_regmap, NPCM8XX_GCR_INTCR4, mask, val); +} + /* Enable mode in pin group */ static void npcm8xx_setfunc(struct regmap *gcr_regmap, const unsigned int = *pin, int pin_number, int mode) @@ -1834,6 +1893,8 @@ static void npcm8xx_setfunc(struct regmap *gcr_regmap= , const unsigned int *pin, BIT(cfg->bit4) : 0); } } + + npcm8xx_set_rmii_output_enable(gcr_regmap, pin, pin_number, mode); } =20 static int npcm8xx_get_slew_rate(struct npcm8xx_gpio *bank, --=20 2.34.1 From nobody Sat Jul 25 17:33:31 2026 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 A6BD8478E57 for ; Wed, 15 Jul 2026 12:29:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118584; cv=none; b=UQYfQp2lWbzVyp56+CAXehafOVFOGfa1RwdtY03P3up/TAEHsd5TjrXS5va43rZOUayQRhprIfvaHUbJjfUWWYUpyX7YI/CmVGX6Gn9485+c2SovQxicErRaZWScr//ujwz1oClmNBheBke7GNAEYnOCyvsYfszrOFuwg7LK1Kk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118584; c=relaxed/simple; bh=KY8T9GZ0q7wGAoC2CqLDc1Ng1zwHtvMAIUMn0uKmUko=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tiih6muEKJE7MVlIqRYcwk3IJ+U1yi0AWLhiBR3k3z40nkUyCNVxBZaMJUEqoyGdWSbXklomOavaSVvneX6bPWz+dCVMAucNbEwZiq3GH86WhrbRIznn6sYtVG8ugCycbSr2cRyW0wEwJZ+J4rizkjk4tuXYV5DpS7E0jLLoxns= 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=KOe2Bz3P; arc=none smtp.client-ip=209.85.128.45 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KOe2Bz3P" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-493f6de72faso11317685e9.0 for ; Wed, 15 Jul 2026 05:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784118578; x=1784723378; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=+ffpOVmxEgLoaCWkah67vyuTnecgePb6qoQjLtT9PDs=; b=KOe2Bz3PFqwuUxq9Nd2YZders41XCYGAxnEk22UdkJ9P5rpQhg0jSNTgNu87sLEO2I fAWK1ON5mo/6nMsGB4CAdVIqAN29JNJfKCP3wZ8SJBIjDotQg7fBBGkmvIpJbVjKCt7Y Dh4VGJQruFxRL7IDfqzPSMPSewhSOSPRJp/A1hEKzxChtik0qvAs9q3Lc40CtvCfBbxO ng86BzcMT9i2rkODe62TfxXKb0XZhkACZEvDW9L25Lb+cVdTO9L+M21rBE2fRGAl/J59 IFqRoSyRhnrB+rnASS4FqTGuf1CfvIPcUIdutzTWSjpSHEeCCV72sFXJQrCz04kjwL8K G3yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784118578; x=1784723378; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=+ffpOVmxEgLoaCWkah67vyuTnecgePb6qoQjLtT9PDs=; b=EO8VuVW2L4FmqMqM/EjUI/7jOVMa/vT//WCE3qSISqfciFvBZG4RgXRxtZZwbNVAdp YpdG8gDoElGJr5Y1MMkH+LDA2cWWaqjJGKzaQchPcX9Mr37furmOErRrDU8W/vonvd0b xg2zi94wXQ5PsoIcRE5+q7yfbqrS6BwLB9ODAla+8OYb4oddKVkJc5MfWi6/VkpuAGZU JJMMlNj3TbvEXLHAGS18as+ApONZ1zDOmkIfxe0jJJG7Z+sJwUHd+oaMLCMTLPJ8p3T9 nrGSuRyyS7m7fwhunlBO/kXCOYnOtV0Z2412nIsK9TkSBJM4+EV915kCpf8YgcsUaDPR gCSQ== X-Forwarded-Encrypted: i=1; AHgh+Rq7SCs4qN9vBMtMIvr1dhZJjyzG9cjAi1NiQPRgjbbRwFR+2Gb3xkB713IV6M0fyOyEMA+9mRBQBvM6xpE=@vger.kernel.org X-Gm-Message-State: AOJu0YxXSOgWzy4YUgn2ihKakmeBrO+5Ka1yedAg+6+TeHib7ZdJyon8 Zt0xXMWncbJQnBDJ+zannsAK+VGA/nJlC3vFv0msBbPuC2ftNXZUQpucnLNInA== X-Gm-Gg: AfdE7cmplfgtchhd9dCwj++jEKhje+gQEGvmZ7DKwdyv0S/5Grh92tgZQhHdfZejPfh JUYfHvfMYYPn67tbi7s+Yld0EIv6D0dLIGb6TvBnTqxNRUc/0horWUGdey9gm5xN+794F818ce3 iXmY/H612cpBkmj1qtE5PJktp95EU2WYzR3m+m6w3p04KLzJcgBDZQPjbrnmooLS+TOn3t9Mt7t W6EVcTlwiKgdt6j+601ybN8eTic1cH7c5qfU9s4722rceF3cnSQ1U/XNjDh2zMBXOFr2dw+i+fJ 1MdgaIQq9OKUH2CUGfvY3ZGlbCD53mg2ESX/Jzz/CT5Mz2ucFVeULmrQwisOdzCpff02lGU67Wg e9/OKzKBrbrDLWvd9Dpm61ic5LyHli/9iDPy+wq6FOu3Nfc7NTXH/WHoDe83GK2/ZVjw9eTMlgA hiKTN4yC4LpF4tITRKWkUcxO8= X-Received: by 2002:a05:600c:8b65:b0:493:f478:4c71 with SMTP id 5b1f17b1804b1-493f8885308mr177231885e9.7.1784118577373; Wed, 15 Jul 2026 05:29:37 -0700 (PDT) Received: from taln60.nuvoton.co.il ([212.199.177.18]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950a32a2casm216770715e9.12.2026.07.15.05.29.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 05:29:36 -0700 (PDT) From: Tomer Maimon To: andrew@codeconstruct.com.au, linusw@kernel.org, brgl@kernel.org Cc: openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com Subject: [PATCH v1 3/8] pinctrl: npcm8xx: support RG2 drive strength selection Date: Wed, 15 Jul 2026 15:29:18 +0300 Message-Id: <20260715122923.1938327-4-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260715122923.1938327-1-tmaimon77@gmail.com> References: <20260715122923.1938327-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" RG2 pins 110-113 and 208-209 do not use the per-bank ODSC bit that the driver relies on for the rest of the drive-strength handling. Their strength is encoded in GCR_DSCNT[7:6] and supports four values: 8, 12, 16 and 24mA. Mark those pins as a dedicated drive-strength class and translate the pinconf get/set operations to the shared GCR_DSCNT field so the full hardware range becomes available. Signed-off-by: Tomer Maimon --- drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 75 ++++++++++++++++++++--- 1 file changed, 67 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nu= voton/pinctrl-npcm8xx.c index 1d5b3c648..8d7dfb326 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -82,6 +82,8 @@ #define NPCM8XX_INTCR4_R1_RMII_EN BIT(12) #define NPCM8XX_INTCR4_R2_RMII_EN BIT(13) #define NPCM8XX_INTCR4_RMII3_EN BIT(14) +#define NPCM8XX_GCR_DSCNT_RG2DS_SHIFT 6 +#define NPCM8XX_GCR_DSCNT_RG2DS_MASK GENMASK(7, 6) =20 #define NPCM8XX_DEBOUNCE_MAX 4 #define NPCM8XX_DEBOUNCE_NSEC 40 @@ -1287,6 +1289,7 @@ static struct pinfunction npcm8xx_funcs[] =3D { #define DRIVE_STRENGTH_LO_SHIFT 8 #define DRIVE_STRENGTH_HI_SHIFT 12 #define DRIVE_STRENGTH_MASK GENMASK(15, 8) +#define DSTR_RG2 BIT(16) =20 #define DSTR(lo, hi) (((lo) << DRIVE_STRENGTH_LO_SHIFT) | \ ((hi) << DRIVE_STRENGTH_HI_SHIFT)) @@ -1419,10 +1422,10 @@ static const struct npcm8xx_pincfg pincfg[] =3D { NPCM8XX_PINCFG(107, i3c5, MFSEL3, 22, none, NONE, 0, none, NONE, 0, non= e, NONE, 0, none, NONE, 0, SLEW), NPCM8XX_PINCFG(108, sg1mdio, MFSEL4, 21, none, NONE, 0, none, NONE, 0, = none, NONE, 0, none, NONE, 0, SLEW), NPCM8XX_PINCFG(109, sg1mdio, MFSEL4, 21, none, NONE, 0, none, NONE, 0, = none, NONE, 0, none, NONE, 0, SLEW), - NPCM8XX_PINCFG(110, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, = none, NONE, 0, none, NONE, 0, SLEW), - NPCM8XX_PINCFG(111, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, = none, NONE, 0, none, NONE, 0, SLEW), - NPCM8XX_PINCFG(112, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, non= e, NONE, 0, none, NONE, 0, SLEW), - NPCM8XX_PINCFG(113, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, non= e, NONE, 0, none, NONE, 0, SLEW), + NPCM8XX_PINCFG(110, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, = none, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW), + NPCM8XX_PINCFG(111, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, = none, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW), + NPCM8XX_PINCFG(112, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, non= e, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW), + NPCM8XX_PINCFG(113, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, non= e, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW), NPCM8XX_PINCFG(114, smb0, MFSEL1, 6, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, 0), NPCM8XX_PINCFG(115, smb0, MFSEL1, 6, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, 0), NPCM8XX_PINCFG(116, smb1, MFSEL1, 7, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, 0), @@ -1513,8 +1516,8 @@ static const struct npcm8xx_pincfg pincfg[] =3D { NPCM8XX_PINCFG(201, r1, MFSEL3, 9, none, NONE, 0, none, NONE, 0, none,= NONE, 0, none, NONE, 0, GPO), NPCM8XX_PINCFG(202, smb0c, I2CSEGSEL, 1, fm0, MFSEL6, 16, none, NONE, 0, = none, NONE, 0, none, NONE, 0, SLEW), NPCM8XX_PINCFG(203, faninx, MFSEL3, 3, spi1cs0, MFSEL3, 4, fm1, MFSEL6, 1= 7, none, NONE, 0, none, NONE, 0, DSTR(8, 12)), - NPCM8XX_PINCFG(208, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, non= e, NONE, 0, none, NONE, 0, SLEW), /* DSCNT */ - NPCM8XX_PINCFG(209, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, = none, NONE, 0, none, NONE, 0, SLEW), /* DSCNT */ + NPCM8XX_PINCFG(208, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, non= e, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW), + NPCM8XX_PINCFG(209, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, = none, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW), NPCM8XX_PINCFG(210, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, = none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW), NPCM8XX_PINCFG(211, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, = none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW), NPCM8XX_PINCFG(212, rg2, MFSEL4, 24, ddr, MFSEL3, 26, r3rxer, MFSEL6, 30,= none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW), @@ -1954,6 +1957,56 @@ static int npcm8xx_set_slew_rate(struct npcm8xx_gpio= *bank, return 0; } =20 +static int npcm8xx_get_rg2_drive_strength(struct npcm8xx_pinctrl *npcm) +{ + u32 val; + int ret; + + ret =3D regmap_read(npcm->gcr_regmap, NPCM8XX_GCR_DSCNT, &val); + if (ret) + return ret; + + switch ((val & NPCM8XX_GCR_DSCNT_RG2DS_MASK) >> + NPCM8XX_GCR_DSCNT_RG2DS_SHIFT) { + case 0: + return 8; + case 1: + return 12; + case 2: + return 16; + case 3: + return 24; + default: + return -EINVAL; + } +} + +static int npcm8xx_set_rg2_drive_strength(struct npcm8xx_pinctrl *npcm, in= t nval) +{ + u32 val; + + switch (nval) { + case 8: + val =3D 0; + break; + case 12: + val =3D 1; + break; + case 16: + val =3D 2; + break; + case 24: + val =3D 3; + break; + default: + return -EOPNOTSUPP; + } + + return regmap_update_bits(npcm->gcr_regmap, NPCM8XX_GCR_DSCNT, + NPCM8XX_GCR_DSCNT_RG2DS_MASK, + val << NPCM8XX_GCR_DSCNT_RG2DS_SHIFT); +} + static int npcm8xx_get_drive_strength(struct pinctrl_dev *pctldev, unsigned int pin) { @@ -1962,10 +2015,13 @@ static int npcm8xx_get_drive_strength(struct pinctr= l_dev *pctldev, &npcm->gpio_bank[pin / NPCM8XX_GPIO_PER_BANK]; int gpio =3D pin % bank->chip.gc.ngpio; unsigned long pinmask =3D BIT(gpio); - int flg, val; - u32 ds =3D 0; + int flg, ds; + u32 val; =20 flg =3D pincfg[pin].flag; + if (flg & DSTR_RG2) + return npcm8xx_get_rg2_drive_strength(npcm); + if (!(flg & DRIVE_STRENGTH_MASK)) return -EINVAL; =20 @@ -1984,6 +2040,9 @@ static int npcm8xx_set_drive_strength(struct npcm8xx_= pinctrl *npcm, int gpio =3D BIT(pin % bank->chip.gc.ngpio); int v; =20 + if (pincfg[pin].flag & DSTR_RG2) + return npcm8xx_set_rg2_drive_strength(npcm, nval); + v =3D pincfg[pin].flag & DRIVE_STRENGTH_MASK; =20 if (DSLO(v) =3D=3D nval) --=20 2.34.1 From nobody Sat Jul 25 17:33:31 2026 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 C598A4779A1 for ; Wed, 15 Jul 2026 12:29:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118585; cv=none; b=YddpR30BmDDER9NWxPvoZeCEgSgoJSIZhGs1O8d4QPUW8BUzE8To6HOkk1/E41sqyazghaaUdJG2EZI0QcEEwkpkedCekCOHARwdq+0dJrrJ+qwPsgg4iCgD9bdm+yIipZGt3LqQs74WsN7TkQp/G6TUp9bL3ieiaZdS8zJ1Wy4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118585; c=relaxed/simple; bh=tb6VVpndxV1WisXM8GvWuIHPq6saMoF/pm1lAK1wGqY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JOfgleNmSgSyWsAO/l07qerrzKpCYZY9NSlIsbuCjn8FP7d33KPm7PZKZKkS2BplTtFf3mw6EbOSF/aJg4oj8oHBPo+NDMV7tpFnXdfURW7hD5CJdxpv8VC92utiacGajH6rj1K27b3UZysCACbw6Hi2NH8y5otAefPPTsmZ9XI= 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=P6g554fH; arc=none smtp.client-ip=209.85.128.45 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="P6g554fH" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-493b27c7451so7622595e9.0 for ; Wed, 15 Jul 2026 05:29:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784118580; x=1784723380; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=PTAx7TYBkRxSJa6QqLMtR87q/GzHDKuudoBFd1PCFdQ=; b=P6g554fHIjC54HIS57uTIlMSUJpJgxUf4GfqgnS2AyvZRs0ARLk64Q0bsLUPNDOMUj IYGj7cppKTTUPvUax4r9d+96P1QUQtFyCGukuIpZV+gglkXwSpct81lm92oaip/kd5gd 6mzC0oBU68x8Zv3NK2P30ay4L1LNjpg0lUqWMeRIrryvrxFxJmiwRHQAcbuXN+gpJr0f yF6Kx6Aq73YXe8K8EP5ck7XBmptYPVpKm5jvC4YGTUBeM5ciNd6cd5iWTty1PpxLm4ZM JgJFB/igm0rqCo0YhrRMHfw6FxfB94v//5rR8bhnj3op6RNbWaOOaGlpGJqg4r651Z5v RQvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784118580; x=1784723380; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=PTAx7TYBkRxSJa6QqLMtR87q/GzHDKuudoBFd1PCFdQ=; b=Kd6AcdrEi2YSyv/xPwIXXe+9lcV/jeKE3rj8B1SX8pWMg0afa9E2+j67tzp9T9ECpA hQqn7Bw0q6Nb8UCwM1mJJ3Q08Z+3CH80qCI20NK0TpmRGZvZnJ/n9WRYWmQYm1Uv6ApU 3aBAUkbNR0CrdKbxiGkizk8QNJL49roRh1P2xuQlwQYmx/rSd4lsg3hX2ceQwveNBEbF 5MlRyk1maa/vLPu3H1icUiQp68TT2QR8Jt4Lzg+kS9fITWXBJrchqXcNbgKxw3sE10Yj FwFspQj89OWaaWVqo2j1IoFmvwqJDl/5cG+45J3Hgm0NWVWOdB0FRjPYNEu3nehZzWt7 rPow== X-Forwarded-Encrypted: i=1; AHgh+RoptI5JYISbpicTOA0YV2pnSS5n/Y6XW46jqnOds+SmDnxMgmHGvo269Pba56UiqIU/SMwiIoJ20M01VUI=@vger.kernel.org X-Gm-Message-State: AOJu0YwdigEEWu3MHTHC15x4pEbExjoAz8toms1vu0akoSgbbZ0tPb2m nVSpDjSlzjjLWPhx6fJWeFcRfnX+RYNYAYL+vq2sgLZP2B4IXzcl3oWB X-Gm-Gg: AfdE7cnv2NNWPLM5yXxnPAuJzpK7FbjjNPFPQuzJhRqjwad3UxKjq7cjyuqYKsynGf/ nwf/+4/uu7r14U5yDyhg9pocaGW096YTKUqxgJC1xza5EvyzE3CEUzNvBMKvNP5dJDCarXsChPB 5AHXFC+hysfqUTuXHwvQSs+MxzZ3TP9qBPAy367RpRvHt3UwBEtv5FLFZc6fqoLYqdWseZLq/Ju 9vDxACyB6r0Trcc5qIbh3BW2fNC24RlTIOHDIOkrzn52krzopcEWFIw76cnP0hGOTet+MpEE4mX Re7AcpzO5oloe/V390Tj5z1zVK0AJV/CeM4JOb+lOvNGlml6/JnbHkn1iqp59FHzy9KUx4Ipna8 E8J/N3vI+QTMswl1TqCBDG+Iqt4NkuTANVWGFJMnHUgw2werJy5vXdmq4DfrWiSU51sUyPDovtU /AQB4b0SskRO00O6rDGw3Z7TM= X-Received: by 2002:a05:600c:3b0e:b0:493:f806:fc4d with SMTP id 5b1f17b1804b1-493f88268e9mr161675915e9.0.1784118579463; Wed, 15 Jul 2026 05:29:39 -0700 (PDT) Received: from taln60.nuvoton.co.il ([212.199.177.18]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950a32a2casm216770715e9.12.2026.07.15.05.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 05:29:38 -0700 (PDT) From: Tomer Maimon To: andrew@codeconstruct.com.au, linusw@kernel.org, brgl@kernel.org Cc: openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com Subject: [PATCH v1 4/8] pinctrl: npcm8xx: clear pending GPIO events during init Date: Wed, 15 Jul 2026 15:29:19 +0300 Message-Id: <20260715122923.1938327-5-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260715122923.1938327-1-tmaimon77@gmail.com> References: <20260715122923.1938327-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" A bank may retain pending event status across resets of the GPIO block. If probe leaves the old state in place, the chained IRQ handler can see spurious events as soon as the irqchip is registered. Disable event generation and clear EVST before wiring each GPIO bank into gpiolib so the driver starts from a known state. Signed-off-by: Tomer Maimon --- drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nu= voton/pinctrl-npcm8xx.c index 8d7dfb326..5dcb01923 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -2471,6 +2471,9 @@ static int npcm8xx_gpio_fw(struct npcm8xx_pinctrl *pc= trl) if (ret < 0) return dev_err_probe(dev, ret, "Failed to retrieve IRQ for bank %u\n", = id); =20 + iowrite32(0, pctrl->gpio_bank[id].base + NPCM8XX_GP_N_EVEN); + iowrite32(0xffffffff, pctrl->gpio_bank[id].base + NPCM8XX_GP_N_EVST); + pctrl->gpio_bank[id].irq =3D ret; pctrl->gpio_bank[id].irq_chip =3D npcmgpio_irqchip; pctrl->gpio_bank[id].irqbase =3D id * NPCM8XX_GPIO_PER_BANK; --=20 2.34.1 From nobody Sat Jul 25 17:33:31 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 7427047B401 for ; Wed, 15 Jul 2026 12:29:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118587; cv=none; b=l6joN5vew/UpcUbBWtAT6Ty3wNhZ7DTFDu5uFIQie3T13GQYxTJDWsaZNMdQMRUII/47LPs9JMO1Dr+kj8m/u0rxUxpQXPIaxlQeM4Oc5Yd+uRhkDvnyMRF8vtkdEXrpgCqQl8LyJXZTDnvjyUUXp4him25xzbNxd6XevmfYdKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118587; c=relaxed/simple; bh=RX7w0OSVzfzzf1CFJAfpJPLCkH2eThTHQR4MzyZBWug=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DS5rUOCYJqnkPCDTJuJCMG8lqzgi/OiMzhtXb3gV6HW2DhQhdId7dbciRcgquMtnp6w9BeEAeb9LM92oLKMoTNOT3mYn20ThswFDq06d5DVMygTTl4rlP8qosvZkxl0dngPOwYq/sgQLtWBZ2IGoPh9pbPkh6Q0hpVX2mOetfO8= 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=GuUlKBtB; arc=none smtp.client-ip=209.85.128.53 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GuUlKBtB" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-490cf322ed0so38522725e9.1 for ; Wed, 15 Jul 2026 05:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784118582; x=1784723382; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=h4K/cnuGCD4SqoFpFIygfSYw1RzHhIhX97jhSaVlU8w=; b=GuUlKBtBR0tQiHFGjyoNzQcR57/pO4QUjmucZhBTVlQSFxdvMEOrD7xgsXRcrj+58p HFk4oNl3oSD/K3lZF/Q6XvhMC00u/0CLxzPMZRxPog4VbuWQ8gKEJqWqpdGdZlpi0oAW OnCsyO+vA+r4jXG1JdEyxE02K/0zOyuYrcgQCVJEM3bxkOlsXYdZgk3S62nNcqS8gPO8 kGA1JBLizhoYDyL5vcwVxufm2c98YdC6UdRqkeTFdN0s61pLZD4LCCLo4DVMkqdRlqDK ZtwcL1QOciUGEHNRgpVwC2LOOoxbUOLY7qk8x4K1zrB8utaflq6ZCDuMsTh+EAvtlGej YWkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784118582; x=1784723382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=h4K/cnuGCD4SqoFpFIygfSYw1RzHhIhX97jhSaVlU8w=; b=PP+VzC+vclAAHXZQaH911e7ZcSbT4cNwmRFq31F6uqKFqGVlW9t1x+9VcmcAcReIuO +KUH9MYN8v1I7us/kWHBmksD+A9XvWf53bwsLRPOXai8Ys0vTOsD4VuoRDdyivh/4BdA 5YpFLMWNunL+5DScMCXISxSpJ8fVtSfLAiH4upw3TCpJoJ1Eb4FgGclrGm1KGmhqoV/M caC+3vC7PwZuxph3TBvJJ5pik83RcBLanmTCPwdk03tEU3n5GF4Bd+/mwZMHbrEzjegz iKATXIoNtIGfRztipS8UdTL9UQHAA84T+KvLnMshj6OzZqNHd+WtV1JBkJNoeBl48wkl QenA== X-Forwarded-Encrypted: i=1; AHgh+RremUXf06ALShyBKn8dWRSAQqw6ZbbuHUjkF51cgEQ8cL8kTCMY41rJwcMjuHkG2UFjZmmGOujJOv4mmSY=@vger.kernel.org X-Gm-Message-State: AOJu0YwWEngcstW2WorA+EN0dmO5dt3MWFlymz4gOO2rGoIXNEjnQb+P pSJSzCmXVJOUQG/Pq+LwpUYNipe+M/1xx8HhjOw0TubMtjTZYlXBBZ4X X-Gm-Gg: AfdE7ckA8ocS/PijScbzYmSNyzFefwYNV7uqun865GRTMviahP2eRxOhxfTbk//mSBc WGs2V7RzdEQDA+NfF8jNVvfMeQVE9PA4Fj6nyQMWEjRQ3l73ZLSagQOX4xBEi/IzNnu7P++WGPE hz2cwQ6sGsqVqdhCpphtnw0bD9Z7yWwF+MEvkAqu1R3b7pOehdXpPJ3Hxilr9dkldS4y2JGzPoe TXud7Cajx2+4x2K/i0ron1okaA10P9yvnhPMI5frrsMuY8tmzty21xM5d63cHNPrEoP8Rz+LZyH BsVjOKkm/mp3VsdZIrxSPMnpPieaZsGuPo4Ev7ggTbvnWYOAlX75qnzZCnbs4tzAYbTLYxDY555 TjxDMPGDq496Sr3QtJm63EhY5RVTUSHuRzrttV0A/CJXfYQmn6QsKxDDN1iJU1FHZy1xEY7uwTm FPbCKXnjgo6coBPc64iGrEZfg= X-Received: by 2002:a05:600c:a20a:b0:492:40a1:1e16 with SMTP id 5b1f17b1804b1-4953c1451d5mr20729785e9.8.1784118582082; Wed, 15 Jul 2026 05:29:42 -0700 (PDT) Received: from taln60.nuvoton.co.il ([212.199.177.18]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950a32a2casm216770715e9.12.2026.07.15.05.29.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 05:29:40 -0700 (PDT) From: Tomer Maimon To: andrew@codeconstruct.com.au, linusw@kernel.org, brgl@kernel.org Cc: openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com Subject: [PATCH v1 5/8] pinctrl: npcm8xx: rename GPIO7 IOX2 signal to DO Date: Wed, 15 Jul 2026 15:29:20 +0300 Message-Id: <20260715122923.1938327-6-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260715122923.1938327-1-tmaimon77@gmail.com> References: <20260715122923.1938327-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The pin description for GPIO7 spells the IOX2 output signal as D0. The datasheet names that signal IOX2_DO, matching the rest of the IOX naming scheme. Rename the pin description accordingly. Signed-off-by: Tomer Maimon --- drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nu= voton/pinctrl-npcm8xx.c index 5dcb01923..1c95d7cbd 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -1567,7 +1567,7 @@ static const struct pinctrl_pin_desc npcm8xx_pins[] = =3D { PINCTRL_PIN(4, "GPIO4/IOX2_DI/SMB1D_SDA"), PINCTRL_PIN(5, "GPIO5/IOX2_LD/SMB1D_SCL"), PINCTRL_PIN(6, "GPIO6/IOX2_CK/SMB2D_SDA"), - PINCTRL_PIN(7, "GPIO7/IOX2_D0/SMB2D_SCL"), + PINCTRL_PIN(7, "GPIO7/IOX2_DO/SMB2D_SCL"), PINCTRL_PIN(8, "GPIO8/LKGPO1/TP_GPIO0"), PINCTRL_PIN(9, "GPIO9/LKGPO2/TP_GPIO1"), PINCTRL_PIN(10, "GPIO10/IOXH_LD/SMB6D_SCL/SMB16_SCL"), --=20 2.34.1 From nobody Sat Jul 25 17:33:31 2026 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 54A8D47D949 for ; Wed, 15 Jul 2026 12:29:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118588; cv=none; b=DcWkxM1AO7K55NC2+NrhPfqY05azXEYDR+KUAz6FKCj/MkRZOh9J93Js3Xal/Vc7zcgclVEo0Gvyl1jbdqYW+hABl1lhuemiwgJ89J7LTJnLGCWYT9GeMVpxHmIco7CgtrpFB6mbk+suBZHEikUqMcxrhrh/otadZEMJQJ78TuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118588; c=relaxed/simple; bh=RPnGMYwpuu4Q9PjKZXlMk8TL7x4tqKXbmEB39sWYnXQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X8SN7oUaAcmK7dVSYGgoHNyvdRYkC5W0+XL/9S7FtwHrJMUetX/CNyc8U5dsx4hHCaG222+TI9g6P/fXzPjolvurJz8WaqCo0eQJwrcI+mZ8g91U3epO17f9iIFxLCvbboUt22Xiz0UjYcbdhXhJXfgSlNOtGzIIosvquCz1398= 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=DC0hei1N; arc=none smtp.client-ip=209.85.221.42 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DC0hei1N" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-47d70879764so3660465f8f.2 for ; Wed, 15 Jul 2026 05:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784118584; x=1784723384; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Xg6K9BOVyTm0sW/3T39sG2O2ploAdMhQq+0sGRnM+RE=; b=DC0hei1N/Q/5G1HVgokD5cVUaDDnRvyaWAyTOXbBAigTkQBbVuULiTog2pTH1twZgg 6SR2IEo6g7GuwRsgSpwxEdCpTPdRkm7oQA5mKBUgmcgzocaouVNjuo53hAxyR4D7OHtP rTYrzgkwphABpml9yEWohY3+Q6wa6RsOCd35z70saxBxlnrL8OkrtDku65s9CxqvdPWC lWVub9j0mwA85rZ88SWbF2bWtSAGV8bSvxBZ7ireeKD2GGzsqADMEqy7+M5SfDyZYTqS jI8t+WSobzCRNRwBd/NxCQJTAoC9liimy//Th+oQvbEeba60lR8J56iqzZ9wXuy0wkQf 7xFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784118584; x=1784723384; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Xg6K9BOVyTm0sW/3T39sG2O2ploAdMhQq+0sGRnM+RE=; b=JaGSToS9k2StRWu3A+eUJKXZOoRjoKxCrbrdZI4kscIiyAyYHB90sX9/FZZbWCfP5p d8e1hh5UG2C0RGqBkXoZzBo7ElWkEM5WmEu53Vupt9i2FhnsLeGSDPO248xaEc3Twojn KBxeG5ClyvzW0sNriQI+Kx59ZE9Nbx5JVYrQt6pbgw97xNBTIKt5uv7p0hXWTproc6wB I+Mwr8KguCzbDQeHaX6kT6aRHe83DRwaueaobnSdrZjHB8BXAnxCh7gOAZ9UL0PvLtay ODj/02GTlSGBrNglgvptgunJzez32tZiEqlW7sewf3JY010RsuxKwTMOASspmZsVDs3V B3Sw== X-Forwarded-Encrypted: i=1; AHgh+RqAHYcOTvZr/0B+XT0dZTA6RNzL8A9kT5yJ1pG6uCni+036XF6L09QSFm1NFkPcD0vy5DqcY+DVdelEzL4=@vger.kernel.org X-Gm-Message-State: AOJu0YywasCmGV7167Zon113mesYctJm8bMWhuWwXtFrykWt1AS3pkKy JtA5zG1Ti3Wwu6djNDcNAxZG8KfwZy0e90KEpwzLWTc9sKiQNEYGypmr X-Gm-Gg: AfdE7clmdykWsNOA36Qdx3PVsxXHm0nYcHEi8mJZaewWi3BkIaQInoqaigf0yYvdaaY 8PyVZJ2l7OfIpt2Aly1cdGOrdtITHOnMjISPluNtD9OPiPjvPUCLAKVTcXI3ie0bPVpVtWdkQI4 O6TOhqMp6g3X4k2nuRkbetUNjPi/W7YRMQP+svqvBPbJWNDl301Lpvmp7FZlZ7DduKNZZx+Gg7s jjW3PLyeYINp98rTh4kf3dnB+IzWF5muAVwoqd3JxAHh+RxAg3KnBcT6ubYIf6LPiOJVdQB1WQN LxESodjuUsgwVpyMU3BDQGUa+GgaXRhxgIC3lyfttItial1N5VakBc3eX+8l/FwqcMc8j7YjfED uJs/LDEy+LznDV6PIjqiq1BtwzPeAgnaVCIcsMZ/YIDv66R2yyLFeABBKs4/hTBmI8vAhOpa3ln aQu1pn/RcIxr5at9207w1e98z5AnZ0HIU9QQ== X-Received: by 2002:a05:600c:3487:b0:493:bacb:1341 with SMTP id 5b1f17b1804b1-4953c144adamr29207275e9.4.1784118584084; Wed, 15 Jul 2026 05:29:44 -0700 (PDT) Received: from taln60.nuvoton.co.il ([212.199.177.18]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950a32a2casm216770715e9.12.2026.07.15.05.29.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 05:29:43 -0700 (PDT) From: Tomer Maimon To: andrew@codeconstruct.com.au, linusw@kernel.org, brgl@kernel.org Cc: openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com Subject: [PATCH v1 6/8] pinctrl: npcm8xx: move GPIO IRQ setup into request_resources Date: Wed, 15 Jul 2026 15:29:21 +0300 Message-Id: <20260715122923.1938327-7-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260715122923.1938327-1-tmaimon77@gmail.com> References: <20260715122923.1938327-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" npcmgpio_irq_startup() calls pinctrl_gpio_direction_input(), which may sleep while taking the pinctrl core mutex. That makes IRQ startup trip lockdep when CONFIG_PROVE_LOCKING is enabled. Move the direction change into irq_request_resources() and keep startup limited to the ack and unmask operations that are safe in atomic context. Signed-off-by: Tomer Maimon --- drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 29 ++++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nu= voton/pinctrl-npcm8xx.c index 1c95d7cbd..e21ccdb5d 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -297,17 +297,33 @@ static void npcmgpio_irq_unmask(struct irq_data *d) =20 static unsigned int npcmgpio_irq_startup(struct irq_data *d) { - struct gpio_chip *gc =3D irq_data_get_irq_chip_data(d); - unsigned int gpio =3D irqd_to_hwirq(d); - - /* active-high, input, clear interrupt, enable interrupt */ - npcmgpio_direction_input(gc, gpio); npcmgpio_irq_ack(d); npcmgpio_irq_unmask(d); =20 return 0; } =20 +static int npcmgpio_irq_request_resources(struct irq_data *d) +{ + struct gpio_chip *gc =3D irq_data_get_irq_chip_data(d); + unsigned int gpio =3D irqd_to_hwirq(d); + int ret; + + ret =3D npcmgpio_direction_input(gc, gpio); + if (ret) + return ret; + + return gpiochip_reqres_irq(gc, gpio); +} + +static void npcmgpio_irq_release_resources(struct irq_data *d) +{ + struct gpio_chip *gc =3D irq_data_get_irq_chip_data(d); + unsigned int gpio =3D irqd_to_hwirq(d); + + gpiochip_relres_irq(gc, gpio); +} + static struct irq_chip npcmgpio_irqchip =3D { .name =3D "NPCM8XX-GPIO-IRQ", .irq_ack =3D npcmgpio_irq_ack, @@ -315,8 +331,9 @@ static struct irq_chip npcmgpio_irqchip =3D { .irq_mask =3D npcmgpio_irq_mask, .irq_set_type =3D npcmgpio_set_irq_type, .irq_startup =3D npcmgpio_irq_startup, + .irq_request_resources =3D npcmgpio_irq_request_resources, + .irq_release_resources =3D npcmgpio_irq_release_resources, .flags =3D IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_IMMUTABLE, - GPIOCHIP_IRQ_RESOURCE_HELPERS, }; =20 static const int gpi36_pins[] =3D { 36 }; --=20 2.34.1 From nobody Sat Jul 25 17:33:31 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 D4ECD47DFAB for ; Wed, 15 Jul 2026 12:29:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118589; cv=none; b=rnQE9+eiWzk9BXrRV562mNgGByf4Er/2atp31yMkXdDWccQhNHazW1O2sAUWRtLOykukEYLxzXB2o4+7vN3LyMa+s/Ykw1rkl9gfP7vd3EN+nTVJqCYU4qDIxSvhKlCzY2eO39LOudbJnrVlO/B2z+k2c5NwKCfEV14vrTTvfn4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118589; c=relaxed/simple; bh=JiXkwn8rL8DZczeduXfneZiovUxhytzrzDz2zK/MkoI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NdFa+yD1bhQTV7bygOJ7dTUxz+gKbOOR4gilU4U3MC2T+RUulb9Ex8hYIsjW1acbqV+sHClQL/rWLrXcrolAh0nGuWYaHzGrxcsV5cWkATMCtGnS4qYdPCuI4C5eVeOyEqCW/BXq8FgiBLrul4yBujWDCQo+X+kDvX7nRxtuB54= 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=HnZvlZPX; arc=none smtp.client-ip=209.85.128.49 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HnZvlZPX" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4953e04ef16so3764215e9.2 for ; Wed, 15 Jul 2026 05:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784118586; x=1784723386; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=UoytU0F027gfAJU2q59F2/SIdHK+cPMMg+f9Ec707W8=; b=HnZvlZPXc77/VbkysPO+W48HeFP+V3JmfswUxaF7v8NXRE7hAKY0Lj7gwelaq9J1Q4 XUw77tx02jLEQOiC8qBYfqpxdtBTPBOqjtZ/3JVPq9GzTey+WAf5HvoS0yRXDUPU6qDj Jr506INuOg8rjpVmSytypm1TEKu7bdZEVCenQittANLrO5N8UywDyDpu3LzaIgKoIcS0 KX/u1hvQCWFxmmr1THcbu7jxdXZuIBm7Ui+sMgG/Rzl214M/XhX64tDXlpBBcj5Mosd4 3gr+GQzom3qflv4Ix4snJt130ZbMsyDldjTJoxYGmAluNEDv/3cOQ1wNxRzpoz1BtNXc QsWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784118586; x=1784723386; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=UoytU0F027gfAJU2q59F2/SIdHK+cPMMg+f9Ec707W8=; b=AsHhAE54NNMu8J75neRyY5UJua8T0JYq84Pt4prVOiHnmApD3yUlPJso34Oj6B8EMw T/NNrHcjQjkp1Cftx+2QMwmNCq068rz80Bpm9JwhK5ggSE+BlglwAMC/4sQdHX6Y7k9M WbgBYqATepYAonykdUklRwlPxPSlAvU17Or7fVYi0/NRMqbQJYLee2fcTfBcR5jbh6O+ CVmHVEktnUza9b+aJW4fyFd9gbowz4tShe5iEhyp00ozQA2YM21rt4A4qthihQi4lAqt FedkAXrm2nchGbZrU+R8Te3CJ1AePBgyV1q0mw1IL/+Tz3pAtN+SwH38YPwFa4kEh4TG BFng== X-Forwarded-Encrypted: i=1; AHgh+RrfsMLzUEd5GQEu8e0KsxyvDnvpOto2gG6Zgz/sfXw0ZKpLI1CLE3FOOkk4iTOVN5r52mMYhkhx8+oyFV0=@vger.kernel.org X-Gm-Message-State: AOJu0YyuEv0aATqXcBq6OwdrfBtkXi8bj7lzSSZN2MTqFiyTaBarqwxr DW0BEvFj4f785KEzGLr/NRUCz71m8agiXFU3rn7JFz7AsShEkJJ8sP6s X-Gm-Gg: AfdE7ckKINQN/fNqQNQdQuEq05ymUlCQ6LkDB4+P7eSGc1J8aJ6pNaW1k5zhHlnTSl2 yFVODflhYtvBWAirc2nxleetDE/7NzMau4sA1VRhrFXZrEtf/Wcr4vc71x/BJoy3BjpVlUSUJNj Gs0Dx42lT5mHJjjZ0xgdJazp1N+fymM3vO1TaqYE+l+u5jRep4xe4UWCMRQcTEk7YNRqtrCNCH5 uMpQk+nv4FnhS7On5bMiPxyC7lmx5Lf5lTSjyKo4fvjsvFQmFNn2n/Xx5DtqFcIXz7PeE4DZpa1 d5I5DDrBRF1vrr7Mf7t2ChxZQFlQRV3LXSpwPZwyHeWMPMX5Xa3US9+2j3QA7WcNFt82dKsHiGw r2QdGCYH0xXBo6WNdkB9Bn1NdqG/wvLYPymh5M3C6gbhCz6Y9wdj+Y24DK06qCuBFKWoffZwt5W gyRcBfmjZwzSsNyQqPJxyjSgQ= X-Received: by 2002:a05:600c:4c13:b0:490:e19b:bd99 with SMTP id 5b1f17b1804b1-493f8828635mr123345555e9.30.1784118585835; Wed, 15 Jul 2026 05:29:45 -0700 (PDT) Received: from taln60.nuvoton.co.il ([212.199.177.18]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950a32a2casm216770715e9.12.2026.07.15.05.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 05:29:45 -0700 (PDT) From: Tomer Maimon To: andrew@codeconstruct.com.au, linusw@kernel.org, brgl@kernel.org Cc: openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com Subject: [PATCH v1 7/8] pinctrl: npcm8xx: correct JM1 and SMB7 pin flags Date: Wed, 15 Jul 2026 15:29:22 +0300 Message-Id: <20260715122923.1938327-8-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260715122923.1938327-1-tmaimon77@gmail.com> References: <20260715122923.1938327-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Pins 136-140 and 142 are currently advertised as having both drive- strength and slew-rate controls, while pins 141 and 143 expose no slew control at all. According to the hardware description, those pins only support slew-rate configuration. Update the pin flags accordingly so pinconf exposes the capabilities that the hardware actually implements. Signed-off-by: Tomer Maimon --- drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nu= voton/pinctrl-npcm8xx.c index e21ccdb5d..f94494b67 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -1465,14 +1465,14 @@ static const struct npcm8xx_pincfg pincfg[] =3D { NPCM8XX_PINCFG(133, smb10, MFSEL4, 13, none, NONE, 0, none, NONE, 0, no= ne, NONE, 0, none, NONE, 0, 0), NPCM8XX_PINCFG(134, smb11, MFSEL4, 14, smb23b, MFSEL6, 0, none, NONE, 0, = none, NONE, 0, none, NONE, 0, 0), NPCM8XX_PINCFG(135, smb11, MFSEL4, 14, smb23b, MFSEL6, 0, none, NONE, 0, = none, NONE, 0, none, NONE, 0, 0), - NPCM8XX_PINCFG(136, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW), - NPCM8XX_PINCFG(137, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW), - NPCM8XX_PINCFG(138, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW), - NPCM8XX_PINCFG(139, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW), - NPCM8XX_PINCFG(140, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW), - NPCM8XX_PINCFG(141, smb7b, I2CSEGSEL, 27, none, NONE, 0, none, NONE, 0, = none, NONE, 0, none, NONE, 0, 0), - NPCM8XX_PINCFG(142, smb7d, I2CSEGSEL, 29, tp_smb1, MFSEL7, 11, none, NONE= , 0, none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW), - NPCM8XX_PINCFG(143, smb7d, I2CSEGSEL, 29, tp_smb1, MFSEL7, 11, none, NONE= , 0, none, NONE, 0, none, NONE, 0, 0), + NPCM8XX_PINCFG(136, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, SLEW), + NPCM8XX_PINCFG(137, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, SLEW), + NPCM8XX_PINCFG(138, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, SLEW), + NPCM8XX_PINCFG(139, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, SLEW), + NPCM8XX_PINCFG(140, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none= , NONE, 0, none, NONE, 0, SLEW), + NPCM8XX_PINCFG(141, smb7b, I2CSEGSEL, 27, none, NONE, 0, none, NONE, 0, = none, NONE, 0, none, NONE, 0, SLEW), + NPCM8XX_PINCFG(142, smb7d, I2CSEGSEL, 29, tp_smb1, MFSEL7, 11, none, NONE= , 0, none, NONE, 0, none, NONE, 0, SLEW), + NPCM8XX_PINCFG(143, smb7d, I2CSEGSEL, 29, tp_smb1, MFSEL7, 11, none, NONE= , 0, none, NONE, 0, none, NONE, 0, SLEW), NPCM8XX_PINCFG(144, pwm4, MFSEL2, 20, none, NONE, 0, none, NONE, 0, non= e, NONE, 0, none, NONE, 0, DSTR(4, 8)), NPCM8XX_PINCFG(145, pwm5, MFSEL2, 21, none, NONE, 0, none, NONE, 0, non= e, NONE, 0, none, NONE, 0, DSTR(4, 8)), NPCM8XX_PINCFG(146, pwm6, MFSEL2, 22, none, NONE, 0, none, NONE, 0, non= e, NONE, 0, none, NONE, 0, DSTR(4, 8)), --=20 2.34.1 From nobody Sat Jul 25 17:33:31 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 91DD347ECF1 for ; Wed, 15 Jul 2026 12:29:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118590; cv=none; b=QASYrfRzDVZbh26Q+NZVNRfWqDoppN+kEzTKMOKuGqggDARrdYFnM/2RcZlprUjjeS0mDCLl/K9QzD6KX+SVnqS9yzRuQPkBJGgICice+PwBdD0+fZCZGH0Mfkt8Wmpt9MMiEFXK+zY84lcYPytWQ/RosG8N4Khn/iDZoPLhWtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784118590; c=relaxed/simple; bh=5JpeSSwHgB0viqpbPWpiG9Gu01KdGoubtMmMSudpcgU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RJQsLME0QZ2sMglKIvMJsNVgRk9WlZpYXt8dNVhgwOkXi/TVNT8MfCKcgebItwt6o6RAXUBMCbkFjjX+eVBki33cATUjMkirR9xQSkksUgZBpj6/2oq+eYAmoiJGeRBgK6ViSY8wCPPGFPb283xZTyH7Uw87hCqdY8K6FWJ2FII= 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=dcRxVWc8; arc=none smtp.client-ip=209.85.128.53 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dcRxVWc8" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-493b7612475so40914325e9.3 for ; Wed, 15 Jul 2026 05:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784118588; x=1784723388; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wOCtAIRvCDRCzbr/NHWJUu3GPBu0x+R/AFbuRiWrlMg=; b=dcRxVWc88NiTdrc4qTNT0UBaknJKhByfrJjHGj6fnv7FBcs0NBXPytRhBby63al+/W z8v+2kIYn7XU7cShxXWlzpY5q9BkmVE6THQtKHzyzP2n1GClYSPT5GT7c161IXLAT/UL zCJZsNlZhwYI9uKBgIVYiU0w8NsBqLhfjljZhWEw2Oy4xqVpFWk5Vml7nzFgtepDDuC5 qmD/q+sExqk1m88MMSIxTu7op4wa2yINAsAWV5fkrSGTPf7qvuxE1VyT661wQ3TzSif2 JQvseBe6sdvCikRCJSrxPm12jqUQ0X/WCkFLA3RWCc3BIsH7/POfbcWIRjw8jwl7VS4W JhKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784118588; x=1784723388; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=wOCtAIRvCDRCzbr/NHWJUu3GPBu0x+R/AFbuRiWrlMg=; b=r89BF/fRPD6CaR/UZUBi5fSBui9cgkLyuRy2AEeAoNHBc6aq7NNJPVsKUYV9XtkwKm BGyV3FptLT5fEFswE2LiIwU7MwFXYutn7qS6vUw/RAjEFxdtT2Veal2UwL29Yd8Veh5u XtlyWI3RFLf+mqckwON4Ij8fXZxu+hbHTZIoC3fb3eJRySTV7U1STRSOsvvcw30g+0Js nGi80Q3T5wntcGlTC5pLfeuFYKw2K0xqzdcz+zXkI2EKk+nY3tD4UYFm+xmUhXHYjG0p hwcPVBguPVyY06HwR2TwOUw6p3nPd/QwzV3KOzd6wGVYcxhJpmC56BEFlioPvIBFtXgh 8Dlw== X-Forwarded-Encrypted: i=1; AHgh+RptA+NMQWQz5JSCRHxD1KQDB1vocZ+WFQW4JGPAYO1cnAs7mXX29K9fOgwQE2eNnTYUQiB8hboCxWHP9G4=@vger.kernel.org X-Gm-Message-State: AOJu0Ywb6rrrsHnz3PbHwtX2+P5Y9HQwmEThTxP3D1QE1D+VHtVr0Nmx 2laJPdMx7WdlL3P8AZTV8t8dZKbOLgDJ8tjCpbqOwxQmRjluJf0bgNxA X-Gm-Gg: AfdE7cmP3Xl7R8un1FquRbp3+Xq19xAbXv+yX4NfVhutynqHefAT9cXlkbPBV+Rizvo C7wdUtN5zK84UJ6Is0UhEsMrSuPNjpAOFdGI0SXhvuBq0RGY0KWEnpQlDjis4xnJZ63QYcTz83d KeNUoxtXbO7RT3lsZTRds83L4tLfcD19WKOYgBQShdFZvzVEHPutRYDQF2ZHBI6tsBiSF5Zh+gy j+9v8tojJqCS7IyW5/u4H0tiN+J6Fv7KPat2rKeepB9fhSgDWmwoDXWV9gib0qrs6/QBtA6eqXO S3Ykgnqd5H2bumT+8SGUAHpGUjql6rkQPxqRmYL1RikSL1CatsB6hGhnCZJrrvi99ex9XLk8F0D TBll1QmjmdXzObvyJ7qsMTk2u/G9yMJpuxmU7dMuXTU2aXWp2CNxdIln+KsFykt2dYE3dcVjBVO Ncm/6SSY2hnKIlB9t/JtXnbKc= X-Received: by 2002:a05:600d:6443:10b0:493:f762:45d4 with SMTP id 5b1f17b1804b1-495158c693bmr70101095e9.2.1784118587669; Wed, 15 Jul 2026 05:29:47 -0700 (PDT) Received: from taln60.nuvoton.co.il ([212.199.177.18]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950a32a2casm216770715e9.12.2026.07.15.05.29.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 05:29:47 -0700 (PDT) From: Tomer Maimon To: andrew@codeconstruct.com.au, linusw@kernel.org, brgl@kernel.org Cc: openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com Subject: [PATCH v1 8/8] pinctrl: npcm8xx: fix debounce register selection Date: Wed, 15 Jul 2026 15:29:23 +0300 Message-Id: <20260715122923.1938327-9-tmaimon77@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260715122923.1938327-1-tmaimon77@gmail.com> References: <20260715122923.1938327-1-tmaimon77@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Each DBNCS register programs debounce source selection for 16 GPIOs. The current offset calculation advances the register address every four GPIOs, so offsets 4-15 and 20-31 end up touching the wrong selector register. Advance the DBNCS offset per 16 GPIOs so each line uses the debounce selector bank that matches the hardware layout. Signed-off-by: Tomer Maimon --- drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nu= voton/pinctrl-npcm8xx.c index f94494b67..f9107f819 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -2211,7 +2211,8 @@ static const struct pinmux_ops npcm8xx_pinmux_ops =3D= { static int debounce_timing_setting(struct npcm8xx_gpio *bank, u32 gpio, u32 nanosecs) { - void __iomem *DBNCS_offset =3D bank->base + NPCM8XX_GP_N_DBNCS0 + (gpio /= 4); + void __iomem *DBNCS_offset =3D bank->base + NPCM8XX_GP_N_DBNCS0 + + (gpio / 16) * 4; int gpio_debounce =3D (gpio % 16) * 2, debounce_select, i; u32 dbncp_val, dbncp_val_mod; =20 --=20 2.34.1