diff mbox series

[RFC,net-next,v3,12/15] net: dsa: mt7530: add support for single-chip reset line

Message ID 0f696278bd8d13121a500f80cfe2f806debe4da5.1680105013.git.daniel@makrotopia.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: add support for MT7988 | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 18 this patch: 18
netdev/cc_maintainers success CCed 16 of 16 maintainers
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Daniel Golle March 29, 2023, 4 p.m. UTC
Similar to multi-chip-module MT7530 also MT7988 uses an internal
reset line instead of using an optional reset GPIO like it is the
case for external MT7530 and MT7531 ICs.
Add support for internal but non-MCM reset line in preparation for
adding support for MT7988.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/net/dsa/mt7530.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Andrew Lunn March 29, 2023, 4:44 p.m. UTC | #1
On Wed, Mar 29, 2023 at 05:00:06PM +0100, Daniel Golle wrote:
> Similar to multi-chip-module MT7530 also MT7988 uses an internal
> reset line instead of using an optional reset GPIO like it is the
> case for external MT7530 and MT7531 ICs.
> Add support for internal but non-MCM reset line in preparation for
> adding support for MT7988.
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
>  drivers/net/dsa/mt7530.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> index c6fad2d156160..fd55ddc2d1eb3 100644
> --- a/drivers/net/dsa/mt7530.c
> +++ b/drivers/net/dsa/mt7530.c
> @@ -3066,6 +3066,12 @@ mt7530_probe_common(struct mt7530_priv *priv)
>  			dev_err(dev, "Couldn't get our reset line\n");
>  			return PTR_ERR(priv->rstc);
>  		}
> +	} else if (!priv->bus) {

!priv->bus is being used as a proxy here for MT7988. Maybe it would be
better to unconditionally use devm_reset_control_get_optional()? Or
move the reset out of mt7530_probe_common() because it is not
actually common?

	Andrew
diff mbox series

Patch

diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index c6fad2d156160..fd55ddc2d1eb3 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3066,6 +3066,12 @@  mt7530_probe_common(struct mt7530_priv *priv)
 			dev_err(dev, "Couldn't get our reset line\n");
 			return PTR_ERR(priv->rstc);
 		}
+	} else if (!priv->bus) {
+		priv->rstc = devm_reset_control_get(dev, NULL);
+		if (IS_ERR(priv->rstc)) {
+			dev_err(dev, "Couldn't get our reset line\n");
+			return PTR_ERR(priv->rstc);
+		}
 	} else {
 		priv->reset = devm_gpiod_get_optional(dev, "reset",
 						      GPIOD_OUT_LOW);