git: 59c2babcabdc - main - mv_twsi: Use the clock API on armv7

From: Kornel Dulęba <kd_at_FreeBSD.org>
Date: Wed, 07 Sep 2022 07:59:42 UTC
The branch main has been updated by kd:

URL: https://cgit.FreeBSD.org/src/commit/?id=59c2babcabdc646f9429d795612a40ea6b32d75e

commit 59c2babcabdc646f9429d795612a40ea6b32d75e
Author:     Albert Jakieła <aja@semihalf.com>
AuthorDate: 2022-07-11 13:45:28 +0000
Commit:     Kornel Dulęba <kd@FreeBSD.org>
CommitDate: 2022-09-07 07:44:59 +0000

    mv_twsi: Use the clock API on armv7
    
    With the addition of clkgen devices to the Armada38x, there is
    no longer any need to use the get_tclk() hack.
    
    Reviewed by:    manu
    Obtained from:  Semihalf
    Differential Revision: https://reviews.freebsd.org/D36456
---
 sys/dev/iicbus/twsi/mv_twsi.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/sys/dev/iicbus/twsi/mv_twsi.c b/sys/dev/iicbus/twsi/mv_twsi.c
index 2b4724d266cc..b2bd73a7df65 100644
--- a/sys/dev/iicbus/twsi/mv_twsi.c
+++ b/sys/dev/iicbus/twsi/mv_twsi.c
@@ -157,11 +157,7 @@ mv_twsi_cal_baud_rate(struct twsi_softc *sc, const uint32_t target,
 	/* Calculate baud rate. */
 	m0 = n0 = 4;	/* Default values on reset */
 	diff0 = 0xffffffff;
-#ifdef __aarch64__
 	clk_get_freq(sc->clk_core, &clk);
-#else
-	clk = get_tclk();
-#endif
 
 	for (n = 0; n < 8; n++) {
 		for (m = 0; m < 16; m++) {
@@ -184,14 +180,11 @@ static int
 mv_twsi_attach(device_t dev)
 {
 	struct twsi_softc *sc;
-#ifdef __aarch64__
 	int error;
-#endif
 
 	sc = device_get_softc(dev);
 	sc->dev = dev;
 
-#ifdef __aarch64__
 	/* Activate clock */
 	error = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_core);
 	if (error != 0) {
@@ -211,7 +204,6 @@ mv_twsi_attach(device_t dev)
 			return (error);
 		}
 	}
-#endif
 
 	mv_twsi_cal_baud_rate(sc, TWSI_BAUD_RATE_SLOW, &sc->baud_rate[IIC_SLOW]);
 	mv_twsi_cal_baud_rate(sc, TWSI_BAUD_RATE_FAST, &sc->baud_rate[IIC_FAST]);