From patchwork Mon Feb 19 23:44:40 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: 13563221 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.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 8623F57307; Mon, 19 Feb 2024 23:44:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708386298; cv=none; b=qrobbavae21UORS026/bLPdGDEkRzJP6HbqmGX8icW5ttAAVrF61fLzyuEozBKDvg7uNR1INwUX3rwHgxlOSEcEz0vAinasNB8E5BStHhOlRdDaPTNemGx0B7ALtsuK7Tdo1vuN3EC/thylFL9Q6imoQiJxgGZQOQg6rymn9n+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708386298; 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=ObhvE2tr+B1UQ0n3mlwqRiUbY/+IFgEhYDPmUnpql8WqNaHBs97xi633qxfETCNlfZ9Y4X0FnT0s4Mp1jUjVIegQy+hbBemOh4650nFzfeW6fc9gP+bzTzRugR2OsYVXSHoUg50LiAWbIyt41kKcVhJOhdthBY+jKLIwnwEnlOo= 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=NQDU1EO2; arc=none smtp.client-ip=209.85.214.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="NQDU1EO2" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1d932f6ccfaso39708565ad.1; Mon, 19 Feb 2024 15:44:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708386296; x=1708991096; 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=NQDU1EO2cYD2pLu0BdeLvUBQsnmIKYzM6wSfCLhq81DVlOgKPYr8USnThVO+z0w855 PmYvCK5X9VKRdu09+1GBG3lxPzHU1JdZ2ZJV4FHzyZizncY/LHZQsAorpR1udEQ3UaNJ vV8Lq2Dg++yB6W2Hr2Dqt6SzWOI6lbx5RllGcs1NIjs/JlcLPaueAvHHfCz9j+2B+jVl hIXsChh/73upY3d1e9UF3gx1zZgjEzIQs0a4+83bV1DVYlUIVrAlePaNzgJJDSQTWbzk fdm3etg0G4QdDImUnasWdnMP1bWXz0VzDXmY3tyOfYhqyuiFs6NPzRYY1L5uZve4qv3K 3g0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708386296; x=1708991096; 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=fO65zlqHI9/Ec0Ypv0JYteni6ZvmssiCRDe1/HNWqipuAbJeUzzOnYNsFq/oj9XbQN gaYeS8ckRyo/8RsF4WJMKkd3DdvQNqW1LRvJkBnk0nAxWU0z+kNM9jmrcpAET8IAsWWx 9wJ1A1B6ls7voPwX4AqqAMEmwRKJM6m07x/CSl3QBPCgPQPXFHuGzi3WaL76aQe0UJX0 9H432ZaTTChHWDuywT5xzuWFdqKn5GKBplcwoxzzo4RKy7HQo75fUiBgsvWfVmeer/Ek Q/lfhex85+Q8mDsQEeYX0w/ago6LD0w8ePlMsOyQYq4rKpNvytKkD1BjMV2lQQZtIi3i aEiA== X-Forwarded-Encrypted: i=1; AJvYcCURNmqJrQFWsem19/SXF1ZFBrVm0FAvujlB1S4x2ekqV2dwKeF0IrSzz4RosQQjCQDgA5d2S7bKU2AonnLcKrMuZQ3JP5Cq2N6KGzc8QxbHc14raFsRq0mYEvRJd1LZdCOI+BYYzWtkvA== X-Gm-Message-State: AOJu0YxsRJys4okainPYvmN1edh2ijFhATRMpge2zuYDBHyj5OeOBJuy qEbvALQB8kP6VwYgL4eXow22xmlwqMYI+pCwCYzll1Jf18kZdlaH X-Google-Smtp-Source: AGHT+IF4lSUWw78zeKTcoUCUVkEL/5ACwhRIKgtKqWOdQ3saNXSreYNT+/FoR1Q5/x737j0nzbG9Uw== X-Received: by 2002:a17:902:ea04:b0:1db:cb13:6792 with SMTP id s4-20020a170902ea0400b001dbcb136792mr7385956plg.5.1708386295573; Mon, 19 Feb 2024 15:44:55 -0800 (PST) Received: from tresc054937.tre-sc.gov.br ([2804:c:204:200:2be:43ff:febc:c2fb]) by smtp.gmail.com with ESMTPSA id h4-20020a170902eec400b001db7ed7ac34sm4903477plb.297.2024.02.19.15.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 15:44:54 -0800 (PST) From: Luiz Angelo Daros de Luca Date: Mon, 19 Feb 2024 20:44:40 -0300 Subject: [PATCH net-next v4 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: <20240219-realtek-reset-v4-1-858b82a29503@gmail.com> References: <20240219-realtek-reset-v4-0-858b82a29503@gmail.com> In-Reply-To: <20240219-realtek-reset-v4-0-858b82a29503@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/pANAwAIAbsR27rRBztWAcsmYgBl0+ftFGwQ3f7Vc5ZoKQlIMQIGYdJ/7AUnuvqCz p1fm+RfWg6JATMEAAEIAB0WIQQRByhHhc1bOhL6L/i7Edu60Qc7VgUCZdPn7QAKCRC7Edu60Qc7 VkD8B/4pgClUom4bSS2DHLwU9JxSuQ3XLoyfKhTCoDJiW58dyarql/+fdrzFqnCa1LN/FWnMM0+ xgk8xSN53jNume5oIcKals2/sgEBr1YJARU44SJ4nrSf+mEvINPmrD1TJ+MFjAyWtb/xIyfxoOM pH8UTTXFkmVizWk5lk2GWc55sRDAZH+deLhT4AnCBgjoEbtZLiJiVOXdqDlZGlM1chUfe01pFWu /fJ1wjjxHPF88zbtEZHWTj5YHo8cnIRIt1u6ZZZ6EvWowA7rMT5B5yoPpYaZZ4XnXXb2C5dFWvp G7roQxbLz6cyLYEkRSN6p6J8LW2tk1Dzu9hy69PfEtP33wan 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 Mon Feb 19 23:44:41 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: 13563222 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 7E10658208; Mon, 19 Feb 2024 23:45:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708386302; cv=none; b=M1S2M6wknpMBxTw3kpH6N1O8+I534Uo454gcOKQeo8t7w1X5+clJW8mPLsLe+QinrpKofxSo6xzCc+IZi++531e0TFgN+JyaDp4oxzKMM6biJGHZyAiixJSMo0O+Dj1tbaK6hb6eWwMOYi1mO43Q+sCBZY/XPbkIYXtjAEhxIBk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708386302; c=relaxed/simple; bh=jaE58dVT+Z5BQAhxxugZAsJOr197wav/S9cgS2l1Mj4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KB+mL0yNv7/eomHhB+5YuS0hCDkpNJUGwwlA9FfxRWNchnePjUXCpzYo7eKRkyfw22B5gM0MkjA7f/kgC0Bp4WslomkLx4BkZxZUEtWQubVu7w9fRzOzNJvOutuPZPGnUSgq7GfkmtB+cuu4X+a3Rv1M0uQplrnlfQca5Iujhhk= 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=jz4Br7P0; arc=none smtp.client-ip=209.85.214.181 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="jz4Br7P0" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1dbf1fe91fcso12587645ad.3; Mon, 19 Feb 2024 15:45:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708386301; x=1708991101; 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=jz4Br7P0vfedlWnNgsrS0yFZNbYxqJdvLFq9GXrK+xkNwFMgl3bpsUmA0WKiApgnyd +oR6zTuGT+eF6jodh4Ib6U5Zw+4x/Z/i4//8E9A9Z9qjG6KK9VjDM0B/fTEx2PuWADlo 3WzioQPXhY7vR1nV04ZkeWuZtQ3YePKYlcjtYJ38MaMG/JYpLkxOIy2yFux/JZ45mbSc fH3rpJ/2Wt+lnczfp2d1/TzcU6c4e6QhTHDYE7pHC846pA2ATayc2i7z65qcfIxJyRZj RCiDVY7BHn+fbghK26D4oSj0OGfTJy91BryaM+Kzoc+4E02cVCNCKoeI24nQD3hK01HX pFGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708386301; x=1708991101; 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=oKSmkmOvpK8fEMgXaXvZVI2NRMrWwK2VH+ojr/PwAUml6zcUKHOSC9R1flyH5BMcHC oLM/jSF8BQ741ahYx+8OP1otcMWRbMj+gQmSq2IK32Gx7wsiYb48QWx0c13wpZAYSSUf 6mSyXc9Q+vyuPCa82Iu2chW0JNzgvss0voZH1w67MNoqWju3hgD2wGRuLEq00mYRQ3Oa JapfbmGStKGZsvRMURXmfmJD8Ap6ubrGz71YLsFtRTSUX2hg5x7EFPqtkwtGL0/zIqj9 ZT2lGwT/qysiMai4jMOh72nnP5Ogi7cDIcz7sQiW/nm9moJJ76JQ1AHRT91VvjX4m635 HMsw== X-Forwarded-Encrypted: i=1; AJvYcCV/mMnnTU8bpl42kU8poSA88BChqMm/ayEsudLxB69/2TN6ah0Dnfpsr1uos7GQajsY82bEqngjFtM8aHMqNN3AjSiARoJ90VuuYgQDjOfoM3JjGMjv50dXGt8F0qBigOanWbJvKJ5DiQ== X-Gm-Message-State: AOJu0Yx+PwGels+ke6hfEK051zABYD6yxO04PJPSqMRumwi6dmqQZilF vAfBIRCMQ8JbVcpHNDm54ZVEoqtWiBQ64H32Qga37F0Ei6NZcR4l81In2BgtedM= X-Google-Smtp-Source: AGHT+IGWVm0tSGse6IupEA7m175Dbk/r45hJ5ufpNhJrWBDRFcFErPgV2i19nHNj/gU/NXVKjqYxbg== X-Received: by 2002:a17:903:298b:b0:1db:be69:d02d with SMTP id lm11-20020a170903298b00b001dbbe69d02dmr12460913plb.32.1708386300772; Mon, 19 Feb 2024 15:45:00 -0800 (PST) Received: from tresc054937.tre-sc.gov.br ([2804:c:204:200:2be:43ff:febc:c2fb]) by smtp.gmail.com with ESMTPSA id h4-20020a170902eec400b001db7ed7ac34sm4903477plb.297.2024.02.19.15.44.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 15:45:00 -0800 (PST) From: Luiz Angelo Daros de Luca Date: Mon, 19 Feb 2024 20:44:41 -0300 Subject: [PATCH net-next v4 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: <20240219-realtek-reset-v4-2-858b82a29503@gmail.com> References: <20240219-realtek-reset-v4-0-858b82a29503@gmail.com> In-Reply-To: <20240219-realtek-reset-v4-0-858b82a29503@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/pANAwAIAbsR27rRBztWAcsmYgBl0+ftkjiEoXvpFVnpXCkvRmQquiU5SZV0hHlVS WeRjVQQVKmJATMEAAEIAB0WIQQRByhHhc1bOhL6L/i7Edu60Qc7VgUCZdPn7QAKCRC7Edu60Qc7 VsagCACx8ojiSnNf+uyqU0REcyFRzs7wXqxfLprPcer6OACCjy6Xr434XMrOSim5pK7vZSew1mk WR+Gu4Okx5DVji5bkKHTC/Dfcq3mQh/QO7rhukkV1OGGZEQ/iJnDCY4Pa4w7Xv+qTJV+6mn1Z3R PgMMP2Fz/lu4I/mYP76N2/HfppRALeWahNupQI5QGrlrt45wJV0OVGphYnBEosuqevVylXotQLd KEGXV2Rga+zS9GT2akTfNkDNJ2mcZGK3nqzQPsbMJb+K4pVNtLwdsYPMfDtPLYWLZPatqS8NOan YOREVlWUJDMKYNdrABosXQUb+v2QjX66kLnsmqVC/UAOlUXD 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 Mon Feb 19 23:44:42 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: 13563223 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.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 22CAD56B7F; Mon, 19 Feb 2024 23:45:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708386308; cv=none; b=NZquHmKhIW6MhQBqqMm89JpQou+7fwhdAcEYiSJ+DSh0lhBmuwSGCsDlfRfgzQXkxMEIpKcuMmu611ac5al4EpTYVdkKJ7j1vtmuNgmeFsQJgfFpD/UzEFdeNPFO0KJKP/mn3xVsAcoHYRQmcQ0LR6JbfrX7NU3XVRdXR70VIrk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708386308; c=relaxed/simple; bh=lFFtbhACJmztPPpr3pxi0hEjHTFow84caBqcjZJj8og=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iLvAHebfgHeX/4rhocx7R/BNH6FZ/DN9KFGzYiNni77JMbTSnzmXUOlZpSuYBvlYpdRqSnox/CSezgzTgoc/tkfmfJ2SBu00WuAOigKUCoPk8fAOn88OxBbV86izbVsl293sG377znlGGZhxp4NMKBc0/6UzwUpOxNFcyaFG5fU= 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=djz+7muT; arc=none smtp.client-ip=209.85.214.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="djz+7muT" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1dba94f9201so29530575ad.0; Mon, 19 Feb 2024 15:45:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708386306; x=1708991106; 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=4HwRlWfaCNPwM9GD0tDSwVZojM3ImHfFlaKA9xUSN8o=; b=djz+7muTDp/Fg5r40hkyvSNKb1zzNATD1hpFaSjv57aU4L1ZMcnSmVoWycXmpT19Ig wt7k1uZQ6b9by/Q5GNDJjhLOZVOCLLFMCXA8ZBbFXHMDFen6nriSHNCc+ttIEdz2NmyY yaDPK1s2eCray7HQujq1cgoTLlz91JlZs2FGmTkfHh60z66J9QeKBIaySSNHA9TbP4DH WyZ6RwaeEBgupgUj1gbkJG2K1NyNFJ7JYHlO2hQkDWtoOGJ4yt2VnLnso1LKZCAo0eUy Sn5Qmba8CTOFRDPjecFbNcN3mSOV0Auhb/M63iW/GrA594gZcsac2AVaAq2JqPBtdClH Bw1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708386306; x=1708991106; 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=4HwRlWfaCNPwM9GD0tDSwVZojM3ImHfFlaKA9xUSN8o=; b=fHp7I/wwQpjaY/g1gzQV5IMX24BOD1RqxLY4sfA4XvRBxbyaD5sW7121jGe8HnPvzw 3ccrWEn9x557gDoXLIOEOaoj1CvUCyN5hsWcKOlJGyeHlp5lRyNTm5sElItqqkrpjllh XKYnxGwhBPKUpX1BuHmFDZtlwC610oL5RGtDtHdwBf5xWyOaloyfRSq4Pwv4N1i7xp6X bfthe8ZAh3cs/n0+K2HrvB4j6ZXfYhtJLLD4D4LPS6U6PUqxomFvi8bwnWZlizestFun Kcfymk4ON3FgSXW2ZUmIHyppk1NeBxP+ZBxvCSl770Ew5RFzN3VSX9tLz+0dpRHACY05 Ri7A== X-Forwarded-Encrypted: i=1; AJvYcCXJRwcYi8zNk9hXXgQ1Ww0mPu6tWHO72UxsU/lw16qScne7h6Jdwthzb1tp6yTlEwil6UBNHn/kraXkuNfoDD+DA0GhpZ3pTVjKGEdHm1o2iTp3xIT/4C1rHrfy5TU4RGCNWece29/BYQ== X-Gm-Message-State: AOJu0YzfDRV4Qh3b1qm+XwQtVcYbqQs+Xl5KsJnc+2Rgd5qnXyV3Na+A Z94MOHATiH6XGcIDFWS8Qb0sXuLsB48jjXE5UeZM5BtOJja/8N/rt4kenWTzhsM= X-Google-Smtp-Source: AGHT+IGqnWwAjyCSoltIVO84hnuEhpGtrjqY10JbapIt9XKWcr/SbDKXvxDVFKvIFfU9XF9iAGy4qQ== X-Received: by 2002:a17:902:b944:b0:1d9:893f:cd06 with SMTP id h4-20020a170902b94400b001d9893fcd06mr12525368pls.60.1708386305530; Mon, 19 Feb 2024 15:45:05 -0800 (PST) Received: from tresc054937.tre-sc.gov.br ([2804:c:204:200:2be:43ff:febc:c2fb]) by smtp.gmail.com with ESMTPSA id h4-20020a170902eec400b001db7ed7ac34sm4903477plb.297.2024.02.19.15.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 15:45:04 -0800 (PST) From: Luiz Angelo Daros de Luca Date: Mon, 19 Feb 2024 20:44:42 -0300 Subject: [PATCH net-next v4 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: <20240219-realtek-reset-v4-3-858b82a29503@gmail.com> References: <20240219-realtek-reset-v4-0-858b82a29503@gmail.com> In-Reply-To: <20240219-realtek-reset-v4-0-858b82a29503@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=4280; i=luizluca@gmail.com; h=from:subject:message-id; bh=lFFtbhACJmztPPpr3pxi0hEjHTFow84caBqcjZJj8og=; b=owEBbQGS/pANAwAIAbsR27rRBztWAcsmYgBl0+ft1uzi91WMpRJ3ECBz5sXwj5Hc/Mhg4KxC1 KliBUhSIwKJATMEAAEIAB0WIQQRByhHhc1bOhL6L/i7Edu60Qc7VgUCZdPn7QAKCRC7Edu60Qc7 VueGB/4k7dGr5BUWCt+XUMcKX+WhyEhLtmzbmJ3IJ/MRp94Fn0aSfzon/UmfQ7CuFbKXFZHCje5 ro/vvNzWM1G74FKhdQs0mI64GlBfsO1XV29tikEEaMzfEQEOIKVybAi0AqA8g7plQCfG3ZN8hIZ LLdhFstkENlRyjqUcwHkE0KLTyFuYUv2nrk3FZztwuQXQjZ4DbE/jRyPQyWeaGTL9ntG7w8qwui PbNKSdX0KWILvEh8UCOghaMrYBE3NBCldf1hNphLYJNNj0rS2mky80N6bZLGs3NghGX59a+wG+Q AL3cZR3aRGKUgsnKmicYNyLHAJYXkhxwDx2lJ+sAlpyhuone 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 --- drivers/net/dsa/realtek/realtek.h | 2 ++ drivers/net/dsa/realtek/rtl83xx.c | 46 ++++++++++++++++++++++++++++++++++----- drivers/net/dsa/realtek/rtl83xx.h | 2 ++ 3 files changed, 45 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..8262ec5032a4 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,40 @@ 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) + return; + + 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) + return; + + 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 */