From patchwork Wed Feb 14 00:54:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luiz Angelo Daros de Luca X-Patchwork-Id: 13555870 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (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 B70A579E4; Wed, 14 Feb 2024 00:54:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707872074; cv=none; b=GxFrnsZzXjFk+5E615QhjY5kmYrsTIss8wxT/L/hzBGJBnFgh/Q2ITuuRCZiThjT4rK92K27OwegowRSnYBbmcsXU8uiHPImhDFw3SGw5yEPr0Uxyzxge+NXA+aQxxgPcampVA3Sy7JCQ4QD+CDvNKOu7gtYRV+UciRnokFGkCg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707872074; c=relaxed/simple; bh=H+V3H/pUojjUDeW+Drln+Q8pnAl3NAhUesryrOUfrE8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G+nvIU/wnGvsszkK0Dj1ipiW91wzmuNWkiSg/lS+biYr2Sxz2Iiwa0VJ9tTmpvAZuuIRZHG8ELKdVdWkKxi5/cgNPQ+yDpyDZlIuDiiqOlwGTiarOYX2dU9P5ypWyD1gROtr3tEfyMGKOUUF0rrCla17YIg6ze1vk4fUVGm9KSc= 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=dPwsNyUW; arc=none smtp.client-ip=209.85.215.169 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="dPwsNyUW" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-5d4a1e66750so3301850a12.0; Tue, 13 Feb 2024 16:54:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707872072; x=1708476872; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=LueoYuZoj0tdtI/F/x4411lJmW0/7TmefZQEZfrpPmg=; b=dPwsNyUWR2Rus1zqntGck5QsBHrReqNEIoi9B2FVi0az7nAYEdJDN9/wD6hijMWG8b 3LZnxOok5OMhCHBfDYp+njV23J0JmtZl1nKva3rpOgsGOkRiqGz+uu9GjJOffzDg73L7 gw6yGAXqHijTx1shRq5QRNNMQd04nYdvdGNOpIKcMAT15GTGuKsGfQIhV9LuD2dViJyY zTgKCKDNewId1iGy4L5odhgJnY75hDB4NyJODTy1QlaGFImUvp4LSp5KPu2B50m7kM9A 2OBcr3v8ctliz5ZSpmNS9yCNKs/T4mZWkHZLwbSMGvZdql/dA6AgrkxLg9LZ9zUbbWne /zqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707872072; x=1708476872; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LueoYuZoj0tdtI/F/x4411lJmW0/7TmefZQEZfrpPmg=; b=OYtGS/77fDp4IKgYuNF67OEyP/Q0lHlxXYueyE7LEfOptc0BVruGARouyNrJNm8Y53 vGZzYmMTUYJjhiEe6tcgEC4ieW1sEJ7aYDyHhBta5PToKorn9BB8jUeKbD915b8pQ/Df rXuGIOP8WNdvOsq7XvKqDsUrFwFfb2tihqNyL1w7Df6e/YnI4TpaMhGZ0m9cYKRes0jl 8pr4yYqjFEN+dvVrAENksxj1QW7WXdSMWnbPHJoPy9OnXpg2NxLQCFpyjyGZC9wr84V/ 7xUUD4MsdLUsfce7xlLGlmQS1jAaNkVtvM86ds8sk9bCVKQYoI7Fv3kah2b2WEweEr+M uJdA== X-Forwarded-Encrypted: i=1; AJvYcCW+P4pS+seXBuhjtdro539omeXpp6wvkJEnBTgXj4h0WmBFjG2LGcHBVzZbGNH2EUhTv2YJi/kSBFkm0q9n523N7NLXoLxibiTVEMKLuxIjIL/O/cLBGVz28eVnUM83JYAWRqvHRJsLMA== X-Gm-Message-State: AOJu0YzumLQCaOMz1d8lkQTxB5p2md0hkqTfmRI9gHKd4G6slLF0EloX uTLEnDijMaf1LNbMQiRPFn15jpAoAzAWevyvBG6Hlspmrr/QXl4e X-Google-Smtp-Source: AGHT+IGRKwM5VgclU7DYD5F3eTHEzMXSzHHdrPnUCPg7As1kOCrsB7/0iMm8yLZho2DQy+fBzDIdUw== X-Received: by 2002:a05:6a20:43ab:b0:19c:6a9c:2c76 with SMTP id i43-20020a056a2043ab00b0019c6a9c2c76mr1565963pzl.10.1707872071933; Tue, 13 Feb 2024 16:54:31 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV71m1vw6BMjX8z5onBCo7okiJvy33cyAb6RJotJfj51XKB4dQodLyii4kJzrvz9aqPfjrPZxRx0LmpcnXkgM5JGW1DLxizBkS+9ZTAdoNKYBySTiXePgOpIiUiuYycx9rfBsIIotOpQ0Xnhj/wYOhgYRUNHZIGo0wuMOGL1DP+Z0X8Ov5t1x0m9ItP5QMgpWS+MaBMMYll+gv3b38N1EAMarTaS6Vxg8fO1JKLhbrjTE1/1utJS6eVbUr7N2b8wSHsX308vpC2rB+ZueonKL5aWttC2nWSc9L0co1RIKzSFwXzADRgTxL8DRcJW0ENZK86prt8l0SUR3qg52q0s7mtf7FfsLqKG7k8eRuDD4lyxA+qElBHLAOiTsQzJYUIAf/0dSURhcqgOnSojFjybQyo7x9pNgYw5EI7v6h7BSXZDED39hKcZ5JHroGRnVkXPotjjTEXeMvQ1mzdN+O6ViNyJ1TFx7nz62HDe0v7I4UXwjeZo/pyZ28GNE5MXtzArOe+sSWSPc9u2LCdLNgYK1hPr1vsoEMz9dctrc1IPciQqRTmuanr Received: from tresc054937.tre-sc.gov.br ([2804:c:204:200:2be:43ff:febc:c2fb]) by smtp.gmail.com with ESMTPSA id q10-20020aa7982a000000b006e094bf05f4sm8005694pfl.213.2024.02.13.16.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 16:54:31 -0800 (PST) From: Luiz Angelo Daros de Luca Date: Tue, 13 Feb 2024 21:54:15 -0300 Subject: [PATCH net-next v3 1/3] dt-bindings: net: dsa: realtek: reset-gpios is not required Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240213-realtek-reset-v3-1-37837e574713@gmail.com> References: <20240213-realtek-reset-v3-0-37837e574713@gmail.com> In-Reply-To: <20240213-realtek-reset-v3-0-37837e574713@gmail.com> To: Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luiz Angelo Daros de Luca , =?utf-8?b?QXLEsW7DpyDDnE5B?= =?utf-8?b?TA==?= , Rob Herring X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1010; i=luizluca@gmail.com; h=from:subject:message-id; bh=H+V3H/pUojjUDeW+Drln+Q8pnAl3NAhUesryrOUfrE8=; b=owEBbQGS/pANAwAIAbsR27rRBztWAcsmYgBlzA89CzCn2LhoEdVuY8Dx2HQjw6UsZEIg1Rpk+ 1OapDXN78yJATMEAAEIAB0WIQQRByhHhc1bOhL6L/i7Edu60Qc7VgUCZcwPPQAKCRC7Edu60Qc7 VvCFB/0Q3Gzprs8PlbF2QJvKVhs4I/uSh3llF/mUsc6lCLFaYSpSjBckdEvNQwTZZk4ksuo/Kcd eJJ0a1NfzeUM95NEOjopCL2CH6Q7l+RSNUKTYubdVPhla0exbjN4PeKKtNwJ7HpkoEoczYWdhOJ h92+HucGDsqIHtI8c123zck1/Vh41OVvpusw45IP18CtiNCvURrpk6jgug7s09X4Lr6kYAGNVkR Qai96D3/tWnIErecl5A/ULcJfe25558Dt95LSZUuLbWYXxSvZxDuvSzg25VqCswlif+h/kw8kud fSrQP77PMXWHg2L3GXYT653FWApFoI69AoFPdnTVpy763gUD X-Developer-Key: i=luizluca@gmail.com; a=openpgp; fpr=1107284785CD5B3A12FA2FF8BB11DBBAD1073B56 X-Patchwork-Delegate: kuba@kernel.org The 'reset-gpios' should not be mandatory. although they might be required for some devices if the switch reset was left asserted by a previous driver, such as the bootloader. Signed-off-by: Luiz Angelo Daros de Luca Cc: devicetree@vger.kernel.org Acked-by: Arınç ÜNAL Acked-by: Rob Herring Reviewed-by: Linus Walleij Reviewed-by: Alvin Šipraga --- Documentation/devicetree/bindings/net/dsa/realtek.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml index cce692f57b08..46e113df77c8 100644 --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml @@ -127,7 +127,6 @@ else: - mdc-gpios - mdio-gpios - mdio - - reset-gpios required: - compatible From patchwork Wed Feb 14 00:54:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luiz Angelo Daros de Luca X-Patchwork-Id: 13555871 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 DA537AD32; Wed, 14 Feb 2024 00:54:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707872079; cv=none; b=VIW4G9f/KWOnBuCHw5aF/TkSN4K5tgBBL7BI8DVp3Df+aiYqvnQuQBc4BsYaBPqzw6b7QNaLApIx1gRtNQBT92Yhb1y4C5zeDpjPAbJYFnt1zCwFNhU1QNSqGwiaU4qvCY/Eh1QyloZp4qgYpThs94ZPn6WgfZTJNHMq9V1KzmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707872079; c=relaxed/simple; bh=jaE58dVT+Z5BQAhxxugZAsJOr197wav/S9cgS2l1Mj4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=blMnutjZ8vKhzv2RDb2/F6zj+tmVXYPAaKX13E8UbKosIGsRUws0wcMj4CKevyvvq8DRnlT6ih0kI9PeakDOoqlqysO0+qhIGUXpzpnlpQ63p64n0ax1WiWR6MBxhJEc3Y+IinKzkHje5QKq7YP4pzIMQN2rLBAYjpq7ibvDH/A= 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=RkjvLLHn; arc=none smtp.client-ip=209.85.210.169 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="RkjvLLHn" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6e10303de41so898991b3a.1; Tue, 13 Feb 2024 16:54:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707872077; x=1708476877; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ik8qJ3aCWPUVoqq8sIut4tSoLjkKaRHYoxxij3VGIi8=; b=RkjvLLHn4ebk2FttF+X1uItRF28lx0H32/zablDRIiLLohRjmYemIIb579u9WJ56+f SVWiPzQUFIgkmgMLSvzkFkozi3NXEzZL2ijplZmWPXg0ScpBxXUtocRuSyLvjcOARD+F VDZKIPdrVH/pgNkEcssfInTKmxNm10+jazYptQ+SplxYp1Zk2KEJ8pMlMcoQ+1A8Vgel QUtQgR0qEkI2rNA1AoluFp5niX6gSLgZk6BYyscjumxBU6df7+UKUetvvYx2cnLWV32p KmG+3ZN4srXg4pEJpQPFFI5FkO89m0c+ZY50mEb+rJuvYWASuc1cHwWt+RdDxq70pSx9 JwKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707872077; x=1708476877; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ik8qJ3aCWPUVoqq8sIut4tSoLjkKaRHYoxxij3VGIi8=; b=f0nLXV5z/LpFV65nl61g2Sa8iIOVg7DgLlcWlcfzXv7rAT9gGblcdqkKhCfeoqXVLc OsBJgY/dkTnr3PW+5OE1AUNjWK+dIwNK1zG0LiuvqHFDcLKPt6bnE5qBtJ0Xsc2zRFig z9l/dgY+gMAXfKQnbl51dHigHq6wfR9pGUWf/UpQDqbHXMB+aW3TnmhbaU1wZJGamMCV jOMQ9jvDk9xxoHvRbjnEBPlPHmE/nwe88SvjvLXEj8HaW8TGTOhOoEtyJgqvJvOplRHF /rTro2qUnUjpzRWx/fQWP1IjFd6vUQ8xRU3lvGk/F1Ly/OmzDmeENNo4oqnEneuvFLil oYSw== X-Forwarded-Encrypted: i=1; AJvYcCVxhx7RysmrotPqyRIhAwmIOI4Z0gZjsHpNOH11EdU7iw6BT/xNx60p9KB6kaMcWxEEjzLYWLtZDC3xKFTbwf3g0Jgqa7H3y/iefiP3Y3xJ8ChLF7spMnH0dKvwYpD4xbbUjFBOg+u45w== X-Gm-Message-State: AOJu0Yz8oo3FshoMIPlF6gDUk90K7QKU36yGfMl2LjH5/9GkwheYG9XG MN/CvQb3agwMRgjKfr9FFVtgJuBwSWhdE6sGrLo3TRU83IWzXj5c X-Google-Smtp-Source: AGHT+IGpheeiLwW//SBsF14UYTSlU7EveP7OitIBf6UHm6rJL6jNa50vvPvgf2w9aWjJPiG/glY0iQ== X-Received: by 2002:a05:6a00:b48:b0:6e0:46ac:edf1 with SMTP id p8-20020a056a000b4800b006e046acedf1mr1080028pfo.18.1707872077120; Tue, 13 Feb 2024 16:54:37 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXnguT6OkIVGW4ggbpKGoTxK6L71qamsSxSdUvwF10mdNemEO3vq3tzJobZU0X0OmLn3C0iLtIabscqBfxR6GzTb6CGOUYhhzJ9h2kGKYcsiSLRfkTMLMK4Ry8JuQyPiTS+feBipj4Hj5SPLlBPW0TyWfJJDRJUAG2Yza7DTJKkhZdcEOHwQpDqnG50PT8/sphnoMGU1jzTEUHJChWsXB2cwFGIvie6d5EKXUvXt7kLULSprAhy8w39U0JgrtYvNh55j+xyoLeJISh8EFpbrJQ/tKMsEZ/yUZl8xC6yKLQL/A/AMI18Gev/F+iEt4T4+4XSPLyz9EW230ZlWwUNxLoj1SaQrjYdgaFLLekRH72UibWl17XBXIn4zt15L6b4VdU3d2DiQ3oKamkbB2QeUY3t1SqeHySc9/9NZeLO9fstBmJyxnwdjc9hpAGeSRd0C0bQ1OJ0QkIEqne6oUhxgH+XQeWl0sN4BHl26kEcB+s+ts8DGwIFXvw7D7MAB27seF0ijRAtg4Z9YpyQzyJ2GxJcuM4P9c9Fn0DPIbN0/kCn9aPLjVin Received: from tresc054937.tre-sc.gov.br ([2804:c:204:200:2be:43ff:febc:c2fb]) by smtp.gmail.com with ESMTPSA id q10-20020aa7982a000000b006e094bf05f4sm8005694pfl.213.2024.02.13.16.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 16:54:36 -0800 (PST) From: Luiz Angelo Daros de Luca Date: Tue, 13 Feb 2024 21:54:16 -0300 Subject: [PATCH net-next v3 2/3] dt-bindings: net: dsa: realtek: add reset controller Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240213-realtek-reset-v3-2-37837e574713@gmail.com> References: <20240213-realtek-reset-v3-0-37837e574713@gmail.com> In-Reply-To: <20240213-realtek-reset-v3-0-37837e574713@gmail.com> To: Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luiz Angelo Daros de Luca , =?utf-8?b?QXLEsW7DpyDDnE5B?= =?utf-8?b?TA==?= , Rob Herring X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=988; i=luizluca@gmail.com; h=from:subject:message-id; bh=jaE58dVT+Z5BQAhxxugZAsJOr197wav/S9cgS2l1Mj4=; b=owEBbQGS/pANAwAIAbsR27rRBztWAcsmYgBlzA89Q7luKADGUZgWZiYNYPeWfYp8lZxwi1pYK ZvAahwWkNiJATMEAAEIAB0WIQQRByhHhc1bOhL6L/i7Edu60Qc7VgUCZcwPPQAKCRC7Edu60Qc7 VsygB/9QsXTLWrMn1RGvjQYh6cgiaF1WDeOWERyUSibltZi2OzMOrvRr/Tfh2Ukq691Eb2b/2fn ngwPywiDNS7BHIBunNBcW7gytMw/5PgMYsEAErJV7vW5Yca/L2cJJ7pI8VMSZm/8jXgC9qNZwRW nj82KgqUKHipADDnjihiBb8LVFuLiFgdVTKaCKuOS2xbgaHeWin1aG1aN4QIFCnZB8Ct4MFpIq4 MB351/swWgGEQV96ape6P6VlXvFd5WlpfSm/w6o6bXNmt9PNyktZF/V9x8IiCua0rIXId0HnnAd rBAbwPyPyFS/S6YqQ+a5Bp122pRXGBah9QnEp4HoHb1VzrYm X-Developer-Key: i=luizluca@gmail.com; a=openpgp; fpr=1107284785CD5B3A12FA2FF8BB11DBBAD1073B56 X-Patchwork-Delegate: kuba@kernel.org Realtek switches can use a reset controller instead of reset-gpios. Signed-off-by: Luiz Angelo Daros de Luca Cc: devicetree@vger.kernel.org Acked-by: Arınç ÜNAL Reviewed-by: Linus Walleij Reviewed-by: Alvin Šipraga Acked-by: Rob Herring --- Documentation/devicetree/bindings/net/dsa/realtek.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml index 46e113df77c8..70b6bda3cf98 100644 --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml @@ -59,6 +59,9 @@ properties: description: GPIO to be used to reset the whole device maxItems: 1 + resets: + maxItems: 1 + realtek,disable-leds: type: boolean description: | From patchwork Wed Feb 14 00:54:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Angelo Daros de Luca X-Patchwork-Id: 13555872 X-Patchwork-Delegate: kuba@kernel.org 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 A8E7CBA45; Wed, 14 Feb 2024 00:54:42 +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=1707872084; cv=none; b=JxJS2D1MQIDKJD2NuMk1JexpibEV41fPyk6KEV4ICxj/mAtXLktLPMj35LbkrJPi8wc9KC5QfT4ldUc9K5h0cTmj9SuDOusyCqzqUioAOmuaVlqufgjNGTt5MK/jlXygjmNAIaJWMXvTpayFA8aCBu7F2iVltjb+Ir8xY2lOauw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707872084; c=relaxed/simple; bh=hOaFIyeFEphFhH4pYBV+V5h0EBz50ziLoFCM4ZqhWfU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ODZ8C4Nk7uM9QdbCGoMkreXypYUuqstArOGBOK9/qhLS3c1R0IvLkEtXN2lkENQvGOSEKmYJ7+wa5UInoEVEbYVSmJWKai063uxY3Y+uMQVLtLHV6qaMiUtMYk/aXLPr5YCzrWRmO1SglsVamUHen1WQ/IH5L77vYeqVa7Izi3I= 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=nU0+MDQS; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nU0+MDQS" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6e0a4823881so2071851b3a.0; Tue, 13 Feb 2024 16:54:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707872082; x=1708476882; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NIKXDBK00dVi+0QWmrTHbh/l72GcdDhpXRjOOpOYJHk=; b=nU0+MDQSL6sZDGWEpqpSr7qZtSgd4mFA64DOpfT+IQ8F2wfW5Y1tgY+wPpVqrhT7lM T2/TynesMAjeQ2Pd3xXmAqKDBhPl1Wr8dtw74GCWEhHn+FSrk2DRY5pvgponGOIc2OGk xEsRciGIsdl7/2EuJa1i/ZNseI8aLzje/ePgzlUvk0ddGZA4G4K4yXiv7gh1iyrM96V0 yvFp2DF6NpAZbtbcpzLF7nyBC/UjRXBH91gURp09/csQ9owP0m6Kq5UaektOXRTp0KCj kujS2raiPNLrRIVg5m/F5KsYipcIR71ykKnW995Qjl9qJy1JL785sk0vjKOA35S0kWJm VReg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707872082; x=1708476882; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NIKXDBK00dVi+0QWmrTHbh/l72GcdDhpXRjOOpOYJHk=; b=v5B8+Toe6gmlqlW2Eq4ULcy2y9jy1F+sWayindzQDNvimiqrMoyEq2WthN/wmmeBBL PosQvLxJyLoijOQq2UOuuuxwx1aM5K+zGXbhSr3nAVD0NWJ2wxXeJHS9F8WnsGaps8nW bITgk4fmqBkZVrcf9M6hNaAtWFaaEHBpG5nmD2n3d2/Pp4+QC+7eBkBJK0P+uoNbN+L4 ToWQXsTeK6s/z63X6vLkwVCiEvsEqZ0HEmBcztGXaUZ4EbOu3ignAiFEWNDzSsHsFm5i 0SxILun3qSpJJiuKKKiwT8LlOTz0KaFFwMOqSlu8chFZw8ONgFq7OhpbeYUFe/FU+va8 BSDQ== X-Forwarded-Encrypted: i=1; AJvYcCVY+rTq8gobwAoVwSg2fhiNvcn+2f827Gyi/0/VE/yWKSLq8qgqyz9nqGmitJcBS84RTcQdFO8WGJNqi41fQG1niJS7Rj6i8Pwj7nYu/r6TLzp7VfPGoG2jib4KlvCBMoGs9ZhOIn7+/w== X-Gm-Message-State: AOJu0YzO0+3qfCHUII6WUtx8nC54/9wP+bi5kQQoUX3o4g7omCgb/DmJ OWtVtYCEC8e20FHxVnEf23sOKHYguOQLJ66SEJXVgbZE/uQVCCM7 X-Google-Smtp-Source: AGHT+IE9249CS1p/Wjj2hfUPTG+PlFRkt8Gmr/jd6ZbSfmuQvzCIgCGbxeUshLdCBmL8AXhCq7M5dg== X-Received: by 2002:a05:6a00:2d81:b0:6dd:e398:2a84 with SMTP id fb1-20020a056a002d8100b006dde3982a84mr1103792pfb.7.1707872081909; Tue, 13 Feb 2024 16:54:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVornoi0FNm3lIOcWTmePAO9Su7SuL2vx44bdYyxQnKpQSMuSKtXeF4CQ55Rz//zn+tEVJ3BfpH2PSY6kbaPsW64qJzS4+Dqa11lm+SQJfwmeZv/+tXYgkxnZAjB9g++VIuXrgO8yz7OQVT8cNHZ1rCpeaXXhdt613P9/vBwX6X4Ca8aKFYtSI7Ve0787c90rUptFDU8hH8Ql4NFyrvQB8fdmhtWK7cJMCVsNRCuO7DMgf+XOFLvIh6/Xz74n80g+eBqpff9PkWU7JK5hXoq1PtOxK4ZQQ98vf+5/iWmM6GTxFIWEGgwp01YNgd2JupqbIEU/kYWWdISHEyHdnI7p2RVp2Cca7GkSwdMM2nT6pqy0zHzw6UnLtp7uAeAF7ld732W4daj31E9c+7HtaYG44oDRGzO5IOz7tpUVaKUktdZn2L3wONoAoeI1Iv5xtwrzzTRfkLib+jER5jWPA5O7X+X/aSMzwRiy1SutVirpHi/E3n8OXbv2i8W1CkIFA= Received: from tresc054937.tre-sc.gov.br ([2804:c:204:200:2be:43ff:febc:c2fb]) by smtp.gmail.com with ESMTPSA id q10-20020aa7982a000000b006e094bf05f4sm8005694pfl.213.2024.02.13.16.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 16:54:41 -0800 (PST) From: Luiz Angelo Daros de Luca Date: Tue, 13 Feb 2024 21:54:17 -0300 Subject: [PATCH net-next v3 3/3] net: dsa: realtek: support reset controller Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240213-realtek-reset-v3-3-37837e574713@gmail.com> References: <20240213-realtek-reset-v3-0-37837e574713@gmail.com> In-Reply-To: <20240213-realtek-reset-v3-0-37837e574713@gmail.com> To: Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luiz Angelo Daros de Luca X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=4326; i=luizluca@gmail.com; h=from:subject:message-id; bh=hOaFIyeFEphFhH4pYBV+V5h0EBz50ziLoFCM4ZqhWfU=; b=owEBbQGS/pANAwAIAbsR27rRBztWAcsmYgBlzA89+ufvAP4Ps9YpHGyvpsXt5yLU0XYlvyQLQ IXybpnxTPuJATMEAAEIAB0WIQQRByhHhc1bOhL6L/i7Edu60Qc7VgUCZcwPPQAKCRC7Edu60Qc7 VpL3B/97jc0w6iKhquAMcFrpzlFXBQP455yQ28HMDQygCsm1joeSSt7cyE+lZrBskt4XQTBuXzV nfoZFBz38ri/2t6nPDicl9DR4UxgeojekHgNOuN9lCtSA1doBTFKFMAOASN/fZwkPsvbMsGUJGk Rz0zTOgGrz8btgWLaqJoANL7hBwSAR1lZb8d0bAL51Ej1JvRGqxnjd8N++MD1mzjTDlYSFPUpYD OLXSkiK1iGgyh/pdP210EF+b6qLdTd+U0Rs+0PW5Squs2SCIVZW71SEYriswc5/IUldYTyaqzbA 3BLb9B9bb8PvViXGmyctnltINiju0GaID5yKsP3xCcznD5HV X-Developer-Key: i=luizluca@gmail.com; a=openpgp; fpr=1107284785CD5B3A12FA2FF8BB11DBBAD1073B56 X-Patchwork-Delegate: kuba@kernel.org The 'reset-gpios' will not work when the switch reset is controlled by a reset controller. Although the reset is optional and the driver performs a soft reset during setup, if the initial reset state was asserted, the driver will not detect it. The reset controller will take precedence over the reset GPIO. Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Linus Walleij --- drivers/net/dsa/realtek/realtek.h | 2 ++ drivers/net/dsa/realtek/rtl83xx.c | 52 +++++++++++++++++++++++++++++++++++---- drivers/net/dsa/realtek/rtl83xx.h | 2 ++ 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/realtek/realtek.h b/drivers/net/dsa/realtek/realtek.h index b80bfde1ad04..e0b1aa01337b 100644 --- a/drivers/net/dsa/realtek/realtek.h +++ b/drivers/net/dsa/realtek/realtek.h @@ -12,6 +12,7 @@ #include #include #include +#include #define REALTEK_HW_STOP_DELAY 25 /* msecs */ #define REALTEK_HW_START_DELAY 100 /* msecs */ @@ -48,6 +49,7 @@ struct rtl8366_vlan_4k { struct realtek_priv { struct device *dev; + struct reset_control *reset_ctl; struct gpio_desc *reset; struct gpio_desc *mdc; struct gpio_desc *mdio; diff --git a/drivers/net/dsa/realtek/rtl83xx.c b/drivers/net/dsa/realtek/rtl83xx.c index 801873754df2..3d1f541936b8 100644 --- a/drivers/net/dsa/realtek/rtl83xx.c +++ b/drivers/net/dsa/realtek/rtl83xx.c @@ -184,6 +184,13 @@ rtl83xx_probe(struct device *dev, "realtek,disable-leds"); /* TODO: if power is software controlled, set up any regulators here */ + priv->reset_ctl = devm_reset_control_get_optional(dev, NULL); + if (IS_ERR(priv->reset_ctl)) { + ret = PTR_ERR(priv->reset_ctl); + dev_err_probe(dev, ret, "failed to get reset control\n"); + return ERR_CAST(priv->reset_ctl); + } + priv->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(priv->reset)) { dev_err(dev, "failed to get RESET GPIO\n"); @@ -192,11 +199,11 @@ rtl83xx_probe(struct device *dev, dev_set_drvdata(dev, priv); - if (priv->reset) { - gpiod_set_value(priv->reset, 1); + if (priv->reset_ctl || priv->reset) { + rtl83xx_reset_assert(priv); dev_dbg(dev, "asserted RESET\n"); msleep(REALTEK_HW_STOP_DELAY); - gpiod_set_value(priv->reset, 0); + rtl83xx_reset_deassert(priv); msleep(REALTEK_HW_START_DELAY); dev_dbg(dev, "deasserted RESET\n"); } @@ -292,11 +299,46 @@ EXPORT_SYMBOL_NS_GPL(rtl83xx_shutdown, REALTEK_DSA); void rtl83xx_remove(struct realtek_priv *priv) { /* leave the device reset asserted */ - if (priv->reset) - gpiod_set_value(priv->reset, 1); + rtl83xx_reset_assert(priv); } EXPORT_SYMBOL_NS_GPL(rtl83xx_remove, REALTEK_DSA); +void rtl83xx_reset_assert(struct realtek_priv *priv) +{ + int ret; + + if (priv->reset_ctl) { + ret = reset_control_assert(priv->reset_ctl); + if (!ret) + return; + + dev_warn(priv->dev, + "Failed to assert the switch reset control: %pe\n", + ERR_PTR(ret)); + } + + if (priv->reset) + gpiod_set_value(priv->reset, true); +} + +void rtl83xx_reset_deassert(struct realtek_priv *priv) +{ + int ret; + + if (priv->reset_ctl) { + ret = reset_control_deassert(priv->reset_ctl); + if (!ret) + return; + + dev_warn(priv->dev, + "Failed to deassert the switch reset control: %pe\n", + ERR_PTR(ret)); + } + + if (priv->reset) + gpiod_set_value(priv->reset, false); +} + MODULE_AUTHOR("Luiz Angelo Daros de Luca "); MODULE_AUTHOR("Linus Walleij "); MODULE_DESCRIPTION("Realtek DSA switches common module"); diff --git a/drivers/net/dsa/realtek/rtl83xx.h b/drivers/net/dsa/realtek/rtl83xx.h index 0ddff33df6b0..c8a0ff8fd75e 100644 --- a/drivers/net/dsa/realtek/rtl83xx.h +++ b/drivers/net/dsa/realtek/rtl83xx.h @@ -18,5 +18,7 @@ int rtl83xx_register_switch(struct realtek_priv *priv); void rtl83xx_unregister_switch(struct realtek_priv *priv); void rtl83xx_shutdown(struct realtek_priv *priv); void rtl83xx_remove(struct realtek_priv *priv); +void rtl83xx_reset_assert(struct realtek_priv *priv); +void rtl83xx_reset_deassert(struct realtek_priv *priv); #endif /* _RTL83XX_H */