2022-10-19 17:17:42

by Alexandru Tachici

[permalink] [raw]
Subject: [net-next 1/2] net: ethernet: adi: adin1110: add reset GPIO

Add an optional GPIO to be used for a hardware reset of the IC.

Signed-off-by: Alexandru Tachici <[email protected]>
---
drivers/net/ethernet/adi/adin1110.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

diff --git a/drivers/net/ethernet/adi/adin1110.c b/drivers/net/ethernet/adi/adin1110.c
index 78ded19dd8c1..3e090ff9b966 100644
--- a/drivers/net/ethernet/adi/adin1110.c
+++ b/drivers/net/ethernet/adi/adin1110.c
@@ -1082,9 +1082,30 @@ static void adin1110_adjust_link(struct net_device *dev)
*/
static int adin1110_check_spi(struct adin1110_priv *priv)
{
+ struct gpio_desc *reset_gpio;
int ret;
u32 val;

+ reset_gpio = devm_gpiod_get_optional(&priv->spidev->dev, "reset",
+ GPIOD_OUT_LOW);
+ if (reset_gpio) {
+ /* MISO pin is used for internal configuration, can't have
+ * anyone else disturbing the SDO line.
+ */
+ spi_bus_lock(priv->spidev->controller);
+
+ gpiod_set_value(reset_gpio, 1);
+ fsleep(10000);
+ gpiod_set_value(reset_gpio, 0);
+
+ /* Need to wait 90 ms before interacting with
+ * the MAC after a HW reset.
+ */
+ fsleep(90000);
+
+ spi_bus_unlock(priv->spidev->controller);
+ }
+
ret = adin1110_read_reg(priv, ADIN1110_PHY_ID, &val);
if (ret < 0)
return ret;
--
2.34.1


2022-10-19 17:55:39

by Alexandru Tachici

[permalink] [raw]
Subject: [net-next 2/2] dt-bindings: net: adin1110: Document reset

Document GPIO for HW reset.

Signed-off-by: Alexandru Tachici <[email protected]>
---
Documentation/devicetree/bindings/net/adi,adin1110.yaml | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/adi,adin1110.yaml b/Documentation/devicetree/bindings/net/adi,adin1110.yaml
index b6bd8ee38a18..9de865295d7a 100644
--- a/Documentation/devicetree/bindings/net/adi,adin1110.yaml
+++ b/Documentation/devicetree/bindings/net/adi,adin1110.yaml
@@ -46,6 +46,10 @@ properties:
interrupts:
maxItems: 1

+ reset-gpios:
+ maxItems: 1
+ description: GPIO connected to active low reset
+
required:
- compatible
- reg
--
2.34.1

2022-10-21 00:07:43

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [net-next 2/2] dt-bindings: net: adin1110: Document reset

On 19/10/2022 13:13, Alexandru Tachici wrote:
> Document GPIO for HW reset.
>
> Signed-off-by: Alexandru Tachici <[email protected]>
> ---

Acked-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2022-10-21 12:28:25

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [net-next 1/2] net: ethernet: adi: adin1110: add reset GPIO

Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <[email protected]>:

On Wed, 19 Oct 2022 20:13:13 +0300 you wrote:
> Add an optional GPIO to be used for a hardware reset of the IC.
>
> Signed-off-by: Alexandru Tachici <[email protected]>
> ---
> drivers/net/ethernet/adi/adin1110.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)

Here is the summary with links:
- [net-next,1/2] net: ethernet: adi: adin1110: add reset GPIO
https://git.kernel.org/netdev/net-next/c/36934cac7aaf
- [net-next,2/2] dt-bindings: net: adin1110: Document reset
https://git.kernel.org/netdev/net-next/c/3bd5549bd479

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html