git: 7ebc4c9bf76d - main - Use hwreset_array in the Rockchip tsadc driver

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Wed, 21 Dec 2022 11:29:00 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=7ebc4c9bf76d1ea62e2ccd3020ff8e6e293b499c

commit 7ebc4c9bf76d1ea62e2ccd3020ff8e6e293b499c
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-11-11 08:58:34 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-12-21 11:25:27 +0000

    Use hwreset_array in the Rockchip tsadc driver
    
    The order of asserting/deasserting the resets doesn't matter so use
    the new hwreset_array to manage them all.
    
    Reviewed by:    manu
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D37358
---
 sys/arm64/rockchip/rk_tsadc.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sys/arm64/rockchip/rk_tsadc.c b/sys/arm64/rockchip/rk_tsadc.c
index 2fdf13a87d79..ca8af204343d 100644
--- a/sys/arm64/rockchip/rk_tsadc.c
+++ b/sys/arm64/rockchip/rk_tsadc.c
@@ -139,7 +139,7 @@ struct tsadc_softc {
 
 	clk_t			tsadc_clk;
 	clk_t			apb_pclk_clk;
-	hwreset_t		hwreset;
+	hwreset_array_t		hwreset;
 	struct syscon		*grf;
 
 	struct tsadc_conf	*conf;
@@ -736,9 +736,9 @@ tsadc_attach(device_t dev)
 	}
 
 	/* FDT resources */
-	rv = hwreset_get_by_ofw_name(dev, 0, "tsadc-apb", &sc->hwreset);
+	rv = hwreset_array_get_ofw(dev, 0, &sc->hwreset);
 	if (rv != 0) {
-		device_printf(dev, "Cannot get 'tsadc-apb' reset\n");
+		device_printf(dev, "Cannot get resets\n");
 		goto fail;
 	}
 	rv = clk_get_by_ofw_name(dev, 0, "tsadc", &sc->tsadc_clk);
@@ -775,7 +775,7 @@ tsadc_attach(device_t dev)
 		sc->shutdown_pol = sc->conf->shutdown_pol;
 
 	/* Wakeup controller */
-	rv = hwreset_assert(sc->hwreset);
+	rv = hwreset_array_assert(sc->hwreset);
 	if (rv != 0) {
 		device_printf(dev, "Cannot assert reset\n");
 		goto fail;
@@ -798,7 +798,7 @@ tsadc_attach(device_t dev)
 		device_printf(dev, "Cannot enable 'apb_pclk' clock: %d\n", rv);
 		goto fail;
 	}
-	rv = hwreset_deassert(sc->hwreset);
+	rv = hwreset_array_deassert(sc->hwreset);
 	if (rv != 0) {
 		device_printf(dev, "Cannot deassert reset\n");
 		goto fail;
@@ -832,7 +832,7 @@ fail:
 	if (sc->apb_pclk_clk != NULL)
 		clk_release(sc->apb_pclk_clk);
 	if (sc->hwreset != NULL)
-		hwreset_release(sc->hwreset);
+		hwreset_array_release(sc->hwreset);
 	if (sc->irq_res != NULL)
 		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res);
 	if (sc->mem_res != NULL)
@@ -855,7 +855,7 @@ tsadc_detach(device_t dev)
 	if (sc->apb_pclk_clk != NULL)
 		clk_release(sc->apb_pclk_clk);
 	if (sc->hwreset != NULL)
-		hwreset_release(sc->hwreset);
+		hwreset_array_release(sc->hwreset);
 	if (sc->irq_res != NULL)
 		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res);
 	if (sc->mem_res != NULL)