From patchwork Sun Feb 25 16:29:53 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: 13570940 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) (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 6B5D418E2A; Sun, 25 Feb 2024 16:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708878609; cv=none; b=cqwPvr7BvE2P3kYHWT/D17Ll8mBqsdxTnOvripFX8e3mFCMev5m+83l4HMHDCSj0o+25T92wWM2QAytDMMUAwPwF4BdR8jZXrwojlQxB+YQJtKFU/q1kQSkgTJGSefstcBvOV9PzryIzqJEs50rZOs1rrUpJ16Z4EooH6tYrabQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708878609; 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=jPfNYSs5Add2hrlJ6nxpLFZojRmhEPfltNoc0NQKAudkiISw4EB4eU90hE1BhER8HwrXEvH2QNqSQ1qYAm5Sxmgqet1pSH+XV401uo2M/tzd1S6Viw0c3Bl/ZrfQun4AmgUZxzWRgcI2zVMiKF3Qhu5uYLpUUl5gKNO/dqMRCjo= 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=P4Qk8ird; arc=none smtp.client-ip=209.85.215.176 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="P4Qk8ird" Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-5dbf7b74402so1949298a12.0; Sun, 25 Feb 2024 08:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708878608; x=1709483408; 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=P4Qk8irdjcNn74S2NNP5QBVuJtCuM1f19KrMTE7EcCG/y/HV4rG1diMl/IDjhcCR8n AVLNox/zLun9AD3HodmLpFZO6QpC101iDtIob4xzYHRuHnxAZE9XgSzsDqg2sq7kvoqN m2ZkpLkbLOVTr0eleVnnZGdH/4ZyOftoXefYrJeavPwCDi3nBUi4Ov2FeaOyXC9H80dG yFE5j0eFUzDd9jXXxQDoqOxpiXeN4al5IMw4AynByZOcTxB3jayZdAL7S2lZuMfrvPTq kWK3uhSw4CS6pRt+SAnHizd5+/qb0t25Ckie7Fv3kZdnWOXJCz2HFvzVngNEVmdKnBoC tXsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708878608; x=1709483408; 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=ps3Uq37SnfOQ+suXRBjy2zXJEddwH1qM4RDyS5b+DMEqnITQVkQZO194n4i9iaF0aP sv4DVFqXFbi0kU9HC8FaMWzXPowdMioCqVYMSJ9mrPx1T6FhKoif+qHeB/5438wSxeCV r2SuP5+Z7RCFKgk3z4vKyyJIFNC7lozo6aERnOglBvybSHqQHSx3iMfipOyWJBHirgEV gyVfX7cYZ3cjZig0X+DbcKAjUL+ZlNhN4pllVafbSzq8K8VFMRXevdmmrE8NyT6ETQPu i5EBhx3Bf9dZzlmm/wz8f3tNIxqfmHyIMiLjLtHzGzFwvJU5mym+GU1MBXrySibatt5m B/5Q== X-Forwarded-Encrypted: i=1; AJvYcCXeDZUDkmceoVYg3SL3gtr+WhTVlejY/Nnw9zDdIAG1UvCZ1tQ65yKmkQU7nDwvARJYUm+ZNJDz9CSdZFwgfg6M2t26jTaUbP76L9F6gKQeJvF1Ci/Bz2ttfvr1kOOsmWLjwg0z0gKeUw== X-Gm-Message-State: AOJu0YzQOR5u4fs1f9XwoDgt4qP2FGfYKYP8KsKLuiC2tfwYxU9liQsK 93bwwp2FlaqMtdCmJPwh8SdMq25SNwR8O/OUuSMZyyPZM+oaksnp X-Google-Smtp-Source: AGHT+IExp+MBHria1an1Fsmu+96LzSZ8nMI4ZxS5Ag/wXJBQVTgkNXHqN3pORj9Ct/bw35199N3j6w== X-Received: by 2002:a05:6a21:3988:b0:1a0:e9ad:7f29 with SMTP id ad8-20020a056a21398800b001a0e9ad7f29mr4129943pzc.6.1708878607737; Sun, 25 Feb 2024 08:30:07 -0800 (PST) Received: from tresc054937.tre-sc.gov.br (177-131-126-82.acessoline.net.br. [177.131.126.82]) by smtp.gmail.com with ESMTPSA id a12-20020a17090acb8c00b0029a4089fbf0sm2838367pju.16.2024.02.25.08.30.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 08:30:07 -0800 (PST) From: Luiz Angelo Daros de Luca Date: Sun, 25 Feb 2024 13:29:53 -0300 Subject: [PATCH net-next v5 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: <20240225-realtek-reset-v5-1-5a4dc0879dfb@gmail.com> References: <20240225-realtek-reset-v5-0-5a4dc0879dfb@gmail.com> In-Reply-To: <20240225-realtek-reset-v5-0-5a4dc0879dfb@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/pANAwAIAbsR27rRBztWAcsmYgBl22sEGQvYrPkoL751LFYsDfZ9gBJNCqd+RGELj qvgpAcnDz+JATMEAAEIAB0WIQQRByhHhc1bOhL6L/i7Edu60Qc7VgUCZdtrBAAKCRC7Edu60Qc7 VtR1B/0bmfzeIZCXMxGxpitA50keV6HopEA/e08HFuLx1ZzDL9KSEWD2JEudxzjDxnS43C/XYlq IQBZ2ysKfgzL+06MNSJ64lHIics39NJboFviQXznwQ00glXRaBEWT/DTWSdvWDaqBRH6q6IWUyy G42/UPt1gbJdQ19t66Y39lNbC3wSnMpmdYijPABfMY+otVZ7Z9bAWzKt+nZ3CjATuAJL20Npx50 x4j1xFCSS/2sLNtNqKTvkprR5FFLVc9rfeM/Yd3j1i854I80LO8SFr4iQWtOVK2koGXWGbc9yZs Omwmdmvgcso50044ze+cVAuf2scy+T2sFCyUdEOUQvG7EpWr 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 Sun Feb 25 16:29:54 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: 13570941 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.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 47F3013AEE; Sun, 25 Feb 2024 16:30:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708878615; cv=none; b=MZUzntLffKQkvjAZ0AicpCSmWX/+l0k5OvPN9fNil/eOz1SkI+tfcXMa28a7qzTIY0wvuYi1M/JWpWMsrIZzQbzhemVg6vuGnH6Kmftw94B1ITvTWmESeTKca/UA/xNihv6hB/nCy/KxEXG3FiRDa30TbEBBnMDJ0FIn5a0PyqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708878615; c=relaxed/simple; bh=jaE58dVT+Z5BQAhxxugZAsJOr197wav/S9cgS2l1Mj4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hFd6SFgCH2TL6S8EYMjMN71NC/91kH8p9LfbfpRFEJ13K+AMDiaLjNq/UHmnsM3cf8U+sDEHJYVkHw6z5exoY39U2ejraI8U4cGh+pTczj4wn7WX/c4U4pC3Vef8U/mFpQud6ApO6PZgcSOPHIvm/iTCn5C9EBeS7GbynIZ1FII= 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=WgjW9rFc; arc=none smtp.client-ip=209.85.216.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="WgjW9rFc" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-29a8911d11cso1025403a91.1; Sun, 25 Feb 2024 08:30:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708878613; x=1709483413; 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=WgjW9rFcPfw6ZlI2n0WkyBN6PidCBCpkuBDxfvDH5tpjbZKh99Pxl6O5taAEpVIhIR KGkaV8dRsTy6KbWFIlwWaqg3L0HS6/enF5AH8wny4B5M2nCb+zxQrwApFStT4jgyBXi8 rtWUKyS3RJgLVAmL5IVbiHP0Rjpvsv4curNuWv9ZJowPl9R3iwzttNXdH5gOHUMYq7jO XM7Co0ik1JJNERjlAouYTQPPBGcizcyaITLR0CaBEHE+z68+elMEasV4ZFzEMbhvWCa8 WmVp7/QSRFWQx6Kb520sGmWQvt0sVc3oe0kMzhfheNCDUv/yDO3tx3wv806/od03SRuw fgUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708878613; x=1709483413; 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=JhEt+l/83VNbXw2y2w8qQu7GSWQS4iKZQf6T7vOpimAiZwDODD5LU5IvhIhktZCWFd oKZDWtZ05+ksJGSp6v0M7N3UHqqagm2QDv7kYIC576jbG+XiR5pHniChP6DR0jUqCTxP hunE/dRZOhNeiUF6zgpHJIKfmW8cJ8hvXWnl+1ejR5f9hONrD2IQMbw/3PXCtJ1lyX9h sB5qSNJPNSJDdSd5PFa8YQDu/pCfqpAG13/A/vnvlWbahx7bZqN8mb0sZbsUkQBcYsdQ daXdb/6SyQY70IhPvkBKTlAbossoCZ+rfyEe6f4IfHoX2JV3XxWLd0CO+4OTeKuuUdHR pa7w== X-Forwarded-Encrypted: i=1; AJvYcCUJxOlA6yNZJeFtFiICbkWFTtkbIff75Y3gs/rZU/jq/88Shv0566xTZ/nTvBbbd6KskNOdbQ4Y5Ti2EZ5cTT42UDOg4Y5g+KWZOfsk3Oo9qgEl9JjWW2rdUoVnN+wdqdO4+V8wyxNdZA== X-Gm-Message-State: AOJu0YyOzPlsC0o00U1f84PVP54TTaSXGRwLRSqgQ4GPGPGo02Wb40nW ydhVm340wrIzKUCm4IYtSFFDSXTrv/6zPGIwi/M6cD+pzfHiRTsg X-Google-Smtp-Source: AGHT+IHf/lXHhNv15L3Do33iLmHjyiKle0EvwF+z8mZN9vHVEv1VX6Yq+iak1DO7b3vnc5lu72bs5Q== X-Received: by 2002:a17:90a:d489:b0:299:4fba:7434 with SMTP id s9-20020a17090ad48900b002994fba7434mr3351823pju.0.1708878612962; Sun, 25 Feb 2024 08:30:12 -0800 (PST) Received: from tresc054937.tre-sc.gov.br (177-131-126-82.acessoline.net.br. [177.131.126.82]) by smtp.gmail.com with ESMTPSA id a12-20020a17090acb8c00b0029a4089fbf0sm2838367pju.16.2024.02.25.08.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 08:30:12 -0800 (PST) From: Luiz Angelo Daros de Luca Date: Sun, 25 Feb 2024 13:29:54 -0300 Subject: [PATCH net-next v5 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: <20240225-realtek-reset-v5-2-5a4dc0879dfb@gmail.com> References: <20240225-realtek-reset-v5-0-5a4dc0879dfb@gmail.com> In-Reply-To: <20240225-realtek-reset-v5-0-5a4dc0879dfb@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/pANAwAIAbsR27rRBztWAcsmYgBl22sEYGX+z/PhrhYfnjofFhucvtWG8ORnJsHba AAHa2AQeh+JATMEAAEIAB0WIQQRByhHhc1bOhL6L/i7Edu60Qc7VgUCZdtrBAAKCRC7Edu60Qc7 VogSB/wIJaGuL2BghBFVgVt3mIPLnElBrMmnmuq1jmu4V7sNRwONwVFmgx9vWh1YrZ91ywKHEvh oizRJpvPFX5y3P4VesmFqwwMBwMC3UcLMlLMFlnMGncqvd86V3Zi1C5zJDcWPP4TlhLDfg2jePr C1zwXt7fFj9I7PYxsJ/zS734O+zNx8RASm5OG00DoG6Hdt1Gi3IAIzSior16KcgG/Qttl3UdbwM MAfBUnoG16rW8S+N09dmEK61krRwcvUqPtwu2hbY7FNK+kgjl5oA4cZTOw6rJefZHBoyVtZDy0g FlgqxXQt3TjWStc9haqZXOLR4ij76BzB6KARyWn7stMp8B4u 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 Sun Feb 25 16:29:55 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: 13570942 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 98F591B952; Sun, 25 Feb 2024 16:30:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708878620; cv=none; b=DWfQBvzuVUyhFJWiBqGyfYTzskUYOzqzng4+NgCyenSa8KmN4Afxq9Che+eFHAnhqfIm3GCmN8zjQPFX40Ead9irYfPbxp8lKEd6rJlko4sGxCSzzVOHyZarFKP1/D2imy9rPBgpIAzxXVIcUecahSy0E46b2QD+iHlD1MNXmz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708878620; c=relaxed/simple; bh=aGWDkl0VRtjUH4DVSrzqDOTU++PRn1TEKNwyTCV6XsU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qFsNVRfaxl/UFptsSeFFEeWKDDbgL5Tujs4fESh9OkPHtJvanME6C41vRJxQrFPw+gWS1yP2uiYzybpGenuTSExoPYsYoQHWHDsutclhp5Yu6KFrS9jMJGycTdyVLelU8vRLj7nA9PpI8cDPlY3QAiSwBhBnrQukFaOSYRlozI8= 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=nRNgzJVt; arc=none smtp.client-ip=209.85.210.179 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="nRNgzJVt" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6e4de4fae2cso1328261b3a.3; Sun, 25 Feb 2024 08:30:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708878618; x=1709483418; 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=TId9cCS3A8DzD3QTIhlXdJucUWK6LQfPWKtp7ssfcho=; b=nRNgzJVtH4Dy1Ybomy40BfgyqjA4luiIOZQA77YGUBdxkg86fxI6WN+5yr/LGgDZwK BnEhhhtlI6HcZka6hWLptjD5R69x/Lduf3xuwD9zFFjRFaTbqGt8mmmokX7L3bLf/jGV Ew4PbR42eLLp7X2xuTGBz/FrVA1eY5KzcyqXZygPBboUzYmI1+0pXW2qz2RpL9UnOwrt EMHYVDGacwOzdQxeT0H0JKcxVlGH0WOF9iqJYigPznaZtj/3DeFx8hUD7T1pm6oRGBf8 MYPg/YjnmQ8/G6/VS10lvR+uHwWgL6r/GQhrHgIa0zB3uhKn7pL/TdK8OEHihPAlcwLw IhOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708878618; x=1709483418; 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=TId9cCS3A8DzD3QTIhlXdJucUWK6LQfPWKtp7ssfcho=; b=sWGW4cGwkuhCJLoqVs63gqyqmfQUeiIbKFyDWo1RZDRQcyBoc7gJ8h+gcYzKihlJUz zFiZ2kFZmKNRC8IYgW6kZ7HKU58nacnN4+CaFlbB+lnJGsg5Ab2ID1+P2qD6XgxLFMSM H4mC7ZgXN/fJo+PE5BsDrb5F3ArqjOVlqg2hEb7+86DqbzPuXcPDn+PqpOBboNBl3qrq bLHG2bjgmx1Om+e0U1VjKAyqLKtNf3b1iYt1kZBDgFWQ5NUA/CtC02edZcbBL5KJpYgY xZROBMozouJmCE/uHAphOz3COjwDPjvd1OrcpgzehqD1yWfMJTGxN6ueGoVMxdWFXqIH dN7A== X-Forwarded-Encrypted: i=1; AJvYcCWf5355ZYD0/bzMKmfzRwVB5V3lBnhLe71T46hfaYiB0cVcpv6qN73PKgF1VekQZE3S1LETa//TZFgEY7QGEDGe4W3vA3P7sLEHxNwou0hdrohRoRqe5d9Kga1p7/TTP+Jy/dV9gdlX3w== X-Gm-Message-State: AOJu0Yz6khaeH12X8hg6VPQwXJwmPoZmn6kz2bsIOrBJjPY9CNOKV0PB QVVnBFu7V3OZGv94qgvgEf80yvDwnUaxXKGYRifcAE9den3ANqUj X-Google-Smtp-Source: AGHT+IFCOus17MZvuTa65D5oy8sSkk4x9Ymnv0HwhdN6PvdAgw5kJGudtmL8cwlBV8rwWx7nOoG04w== X-Received: by 2002:a05:6a21:1014:b0:1a0:e86d:ee6a with SMTP id nk20-20020a056a21101400b001a0e86dee6amr3616045pzb.20.1708878617870; Sun, 25 Feb 2024 08:30:17 -0800 (PST) Received: from tresc054937.tre-sc.gov.br (177-131-126-82.acessoline.net.br. [177.131.126.82]) by smtp.gmail.com with ESMTPSA id a12-20020a17090acb8c00b0029a4089fbf0sm2838367pju.16.2024.02.25.08.30.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 08:30:17 -0800 (PST) From: Luiz Angelo Daros de Luca Date: Sun, 25 Feb 2024 13:29:55 -0300 Subject: [PATCH net-next v5 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: <20240225-realtek-reset-v5-3-5a4dc0879dfb@gmail.com> References: <20240225-realtek-reset-v5-0-5a4dc0879dfb@gmail.com> In-Reply-To: <20240225-realtek-reset-v5-0-5a4dc0879dfb@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=4254; i=luizluca@gmail.com; h=from:subject:message-id; bh=aGWDkl0VRtjUH4DVSrzqDOTU++PRn1TEKNwyTCV6XsU=; b=owGbwMvMwMG4W/D2rovs1mGMp9WSGFJvZ7OaabhY9TKm+G74qRF5119CWjDkkvmFmKkJ9mHN8 Y+iPA92MhqzMDByMMiKKbIIsmu4t56NthL6pf8DZhArE8gUBi5OAZjIwgwOhvY5vP7l2S1bZzfu WyoSNzlDYX/ZjYxQuV/fvp7x+rNiZRXH9gNrrEsbDAxELPK+dma9nNhRIHQ9tObyIrX4hiNMUhO /r91x6tTEb9cDYnmPhNZE7WpiS27Lkjvur337YFXPlHeTLvm4hG5RzUlmfP6XjUGL89vSFvW7D0 rCV9m7y+58Y/HKI+md/oLD/BLFPs0uus9XLljGesXxyRd7vfnqKZXGXzSXOLzi/cM62ZLpxy2vk hrxTzIxD7d+F1PKTHwwYfnM28s2fWfa/8fv1a6FoqcYY4s/Nl7TN8mf+MhFJjRf5pfmRan6U+qv 2YHGbPxZwL9Jaeq78+uXp1vL5kd4XzRRtytcHdl0z0obAA== X-Developer-Key: i=luizluca@gmail.com; a=openpgp; fpr=1107284785CD5B3A12FA2FF8BB11DBBAD1073B56 X-Patchwork-Delegate: kuba@kernel.org Add support for resetting the device using a reset controller, complementing the existing GPIO reset functionality (reset-gpios). Although the reset is optional and the driver performs a soft reset during setup, if the initial reset pin state was asserted, the driver will not detect the device until the reset is deasserted. Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Linus Walleij Reviewed-by: Alvin Šipraga --- drivers/net/dsa/realtek/realtek.h | 2 ++ drivers/net/dsa/realtek/rtl83xx.c | 42 ++++++++++++++++++++++++++++++++++----- drivers/net/dsa/realtek/rtl83xx.h | 2 ++ 3 files changed, 41 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..d2e876805393 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,36 @@ 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; + + ret = reset_control_assert(priv->reset_ctl); + if (ret) + dev_warn(priv->dev, + "Failed to assert the switch reset control: %pe\n", + ERR_PTR(ret)); + + gpiod_set_value(priv->reset, true); +} + +void rtl83xx_reset_deassert(struct realtek_priv *priv) +{ + int ret; + + ret = reset_control_deassert(priv->reset_ctl); + if (ret) + dev_warn(priv->dev, + "Failed to deassert the switch reset control: %pe\n", + ERR_PTR(ret)); + + 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 */