Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp889802rbb; Sun, 25 Feb 2024 08:30:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUk5vq9mQD3omGpDry2ZayRhCt9PEmOZWaF3PlaiOge7b01goCBNGIGVF961kEw0vQqX0eaGAyGIf1FIF2id34eIkUUZJ95VDZ8HBUBaA== X-Google-Smtp-Source: AGHT+IECu7iZsm+uJMey3Yr618HSb7018TWRu1VNxlySISPqiqa7mbftwymRAsQuk6op4ARjHK85 X-Received: by 2002:a17:90a:4a8f:b0:299:b60:ff0e with SMTP id f15-20020a17090a4a8f00b002990b60ff0emr2794967pjh.13.1708878617034; Sun, 25 Feb 2024 08:30:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708878616; cv=pass; d=google.com; s=arc-20160816; b=fz+tc2HkoljC9xy9JaQsMIu5nYT/CI63CCGn9aObim5upKWbbwe+MOu1XYv5MYnPEH RsPeIuiWUlo9TbhRaQzl2WX/0v1rco5+3oPqYI7NQR2rxLeZS4s5zxrcSgI9VfuiKAli Az/aHUGahHMyufZ8IWKXlDdcc5EbYqfaJ6HN8Aa/kr/QvCRgauR0uvxJwjh7l6E8vf57 f0nPIQo/0/DpBZ4tPQV6ECn/QevkphIoEvZ2HvSFiVBtmpLSMdxqvNCNOzXfh3HhwTJr TE/0bg7m4pmdRrLsvj4ok8E0sacxYYMgBfPLqYxmn3LC6JQPdL0AAb63q+kzNa2XT4EE +x3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=uNJEXFGpk4yAstmGFnAIGxSja9Jjo+7NQAHRaWjDtYY=; fh=jXpIj3VhUNezBEKAV+b3LXnLBOi4ugxUj/8OCO9WaxU=; b=Ly5zdF0Og0gP4sKPQFQ9gpV9wGzbWIBOLqLkYKXe5cIlYT4Lq77V03fi8vId/w13UY /zLf7NXBY42pcehdQRDpNBLWzaXezPEsz5oU6eq94YvkwBl043Xj91w7st/ocTpU26gr i28C2CEHwwHU3ZX4CKHXDjEQCC9w9EZD7MFLjeA3H5GhF+Xl4gmKy1/LIqrTkQaea7M8 IgE3jgNtATOKHpmoCyr++8oLUggnrrdHQsmLiW+9WvjBCb923WKbAsvXYrxAg61oSfMI xgzfSswdO2PTLb4kOdYT42uu59Fz6b/W/1/C0U7PiXj5N+gFEH5z32fbWtYoBKepj0b9 5RPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Nhwlnri6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-80200-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80200-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y3-20020a17090a86c300b0029969c3dacfsi4241402pjv.110.2024.02.25.08.30.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 08:30:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80200-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Nhwlnri6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-80200-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80200-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A639F2815AB for ; Sun, 25 Feb 2024 16:30:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECF1C182A7; Sun, 25 Feb 2024 16:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nhwlnri6" Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.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 8C3B0175B1; Sun, 25 Feb 2024 16:30:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708878605; cv=none; b=CRY3kGuPko5Vk6ItDCsa4QNhbPAfnBRRa15E8v6xT1fWp1xzgcFqLd+5tY/RRrdWo3cTbIMOXCYBZdP5eULmnuZbfvKRR2elwUfYUcMBxBJj2bgKlfRG5nuS3xm/AluDRL8XvpC9iPC16uyjYLFOuySQu0aqGQTlRVMV1mbVOqI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708878605; c=relaxed/simple; bh=4guceXm7JqD7FE8mAp8QWs5E4MPeZjZ52K4eeMVUmQ0=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=mQEn+GGzlsbbjM2eBEDAaDhhjzKU4TdSqU0aiP99qO4IdfrHNcsoWMfzSvAdycsVQlOFnYBmV179Thr8GNgZU3d5FaDNCPiPMi272xu04xDErTu2Pla+TIn0wzc0fiBiL3b/hFqz78H6OCa8COX13dqqKRNt86xUG1Op5DNweh4= 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=Nhwlnri6; arc=none smtp.client-ip=209.85.167.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-3bd72353d9fso1525473b6e.3; Sun, 25 Feb 2024 08:30:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708878602; x=1709483402; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=uNJEXFGpk4yAstmGFnAIGxSja9Jjo+7NQAHRaWjDtYY=; b=Nhwlnri6R4Pyanw54mJmsQFnwttONHnVef2jgjfNyvFwUD/opwRGAxBo33++ExvHev L+vWP4VD2yAvxsQ9wOYs1Q5GmVkB9XXUJMn+OBW8tu/eTLxJhzMQjPhFeQUjD5aiLDV3 pyFkgRWtmSieOwLXQ5uiO9IfAe16DhActLDCT1vxFJbOByMc6SLc76khWu2rVm9a6cbD PKGkNYfVGHatIZjQqCTRfwficV265whbM2E8alXmfACn4TP5w/eskdqowwYAKnfHbiCm IBvMubeSZXOgNTQQLRPOBukkIY/zWBKqqYMSwb3+p1JOItuHtOSSZFBHv+hbkWxbdieD dntA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708878602; x=1709483402; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uNJEXFGpk4yAstmGFnAIGxSja9Jjo+7NQAHRaWjDtYY=; b=SQpQslZA/8cCxFv0inIo7VHwoUxWb9lqqkUfoO403aBeL1vQGYLcZJrf4C3U0i834t a9KydBpEqQd94WWf7BvIIwaC53uCBiWn6In0vVLct+pB1WF34kpbirQW8eP2xZ9wcEiP wL2lvf4lrjq+J3cVR2x5ovrCKtfMsrc70QoonjwcO42WmPI01HXXUat88hpQoCh92s1i UpUQH3f76o/9tzBVyThcMh7yD6gVYWy4pjDivmY1vhBKXG7xBrLXzEfDKZIZhTiADrhu /5eJb0oSSgYDKVP2GQyeT7zIXJUIh+EZjltm1Yf6am+uDG7gDT3om9zWC4ZkrXj8zLRh T9+A== X-Forwarded-Encrypted: i=1; AJvYcCXgF/XdR4pgReQxD5FUgRuRMiHAZnmCZNX9EGJ9DHVDdZMv41FWYGfWxalPyHkVrkTx6zqBk6bsCH+rbwjLDgJPjVcP/Ug57uxNLzejqj049GVyDdcnTa0RAfjl2RUX7I6CX1UxulkO2A== X-Gm-Message-State: AOJu0Yz5o6Vtk2y9ewBQvejcKZmHHFpD6XpaGvADcA/Go6/AjBNOuVJW A5hN03q+Wh5851my1YyRnaR0HGsgJAgcexmx6JP+gZJUaC0nbxpN X-Received: by 2002:a05:6358:5713:b0:17b:759:65c2 with SMTP id a19-20020a056358571300b0017b075965c2mr6448644rwf.10.1708878602442; Sun, 25 Feb 2024 08:30:02 -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.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 08:30:01 -0800 (PST) From: Luiz Angelo Daros de Luca Subject: [PATCH net-next v5 0/3] net: dsa: realtek: support reset controller and update docs Date: Sun, 25 Feb 2024 13:29:52 -0300 Message-Id: <20240225-realtek-reset-v5-0-5a4dc0879dfb@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAABr22UC/12NywrDIBBFfyW4rsWMiqar/kfpQtNJIs2jqEhKy L9XpIs2q+Fy7zmzkYDeYSCXaiMekwtumXOQp4q0g5l7pO6RMwEGgkEN1KMZIz7zDRip1obZDqS 1ACQzL4+dW4vvRuY8mHGN5J6bwYW4+Hd5lHjpv05+cCZOGeVKc4VSCVXzaz8ZN57bZSqmJH7p5 kiLTGuprQYDjWR/9L7vH30e59HyAAAA 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?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= , Rob Herring X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2610; i=luizluca@gmail.com; h=from:subject:message-id; bh=4guceXm7JqD7FE8mAp8QWs5E4MPeZjZ52K4eeMVUmQ0=; b=owEBbQGS/pANAwAIAbsR27rRBztWAcsmYgBl22sE78pocRCNweliEnVncfNS6DISWyKDWIhEn NpOVNKpPCKJATMEAAEIAB0WIQQRByhHhc1bOhL6L/i7Edu60Qc7VgUCZdtrBAAKCRC7Edu60Qc7 VpX+B/9isBfrtbMraz1QW795IvYv/0LY+myNfCe/ITKCi9fu+0tgKQTsmF+gn2xPbkRKOlUyaCK I7K8XRszVfHJwTSiCBlfJ+jhhehbD5BFGMnDIB489/80pmc0xpfjyXTxhh3v26FDvPohdvI8AHA K6w8Z+eOoztp3+pnHerQhsUrEQgt5qZ/9EKFyjh+bMnA0BGlUM3uk/jgFzPLOV6MulpdRFjGU8q V28TQOREZ5uWUEZGZzJDmGuXYe2MgfsVRQIwDGpBjjyXIl4u5+byJ3IEt8YGrq4iSmFQEhaUKka XTxRfQSiyrOrOyMdkOOV4bBH+2gFnbgnL/OBAabL7bb/5IMU X-Developer-Key: i=luizluca@gmail.com; a=openpgp; fpr=1107284785CD5B3A12FA2FF8BB11DBBAD1073B56 The driver previously supported reset pins using GPIO, but it lacked support for reset controllers. Although a reset method is generally not required, the driver fails to detect the switch if the reset was kept asserted by a previous driver. This series adds support to reset a Realtek switch using a reset controller. It also updates the binding documentation to remove the requirement of a reset method and to add the new reset controller property. It was tested on a TL-WR1043ND v1 router (rtl8366rb via SMI). Signed-off-by: Luiz Angelo Daros de Luca --- Changes in v5: - Fixed error checking logic when reset controller (de)assert fails - Link to v4: https://lore.kernel.org/r/20240219-realtek-reset-v4-0-858b82a29503@gmail.com Changes in v4: - do not test for priv->reset,priv->reset_ctl - updated commit message - Link to v3: https://lore.kernel.org/r/20240213-realtek-reset-v3-0-37837e574713@gmail.com Changes in v3: - Rebased on the Realtek DSA driver refactoring (08f627164126) - Dropped the reset controller example in bindings - Used %pe in error printing - Linked to v2: https://lore.kernel.org/r/20231027190910.27044-1-luizluca@gmail.com/ Changes in v2: - Introduced a dedicated commit for removing the reset-gpios requirement - Placed binding patches before code changes - Removed the 'reset-names' property - Moved the example from the commit message to realtek.yaml - Split the reset function into _assert/_deassert variants - Modified reset functions to return a warning instead of a value - Utilized devm_reset_control_get_optional to prevent failure when the reset control is missing - Used 'true' and 'false' for boolean values - Removed the CONFIG_RESET_CONTROLLER check as stub methods are sufficient when undefined - Linked to v1: https://lore.kernel.org/r/20231024205805.19314-1-luizluca@gmail.com/ --- Luiz Angelo Daros de Luca (3): dt-bindings: net: dsa: realtek: reset-gpios is not required dt-bindings: net: dsa: realtek: add reset controller net: dsa: realtek: support reset controller .../devicetree/bindings/net/dsa/realtek.yaml | 4 ++- drivers/net/dsa/realtek/realtek.h | 2 ++ drivers/net/dsa/realtek/rtl83xx.c | 42 +++++++++++++++++++--- drivers/net/dsa/realtek/rtl83xx.h | 2 ++ 4 files changed, 44 insertions(+), 6 deletions(-) --- base-commit: d1d77120bc2867b3e449e07ee656a26b2fb03d1e change-id: 20240212-realtek-reset-88a0bf25bb22 Best regards, -- Luiz Angelo Daros de Luca