twsi: Make ext_resources non-optional

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33823
This commit is contained in:
Emmanuel Vadot 2022-01-11 10:39:47 +01:00
parent b4cc0f7d28
commit 36498b1408
3 changed files with 0 additions and 14 deletions

View File

@ -61,9 +61,7 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
#ifdef EXT_RESOURCES
#include <dev/extres/clk/clk.h>
#endif
#include <arm/mv/mvreg.h>
#include <arm/mv/mvvar.h>

View File

@ -246,7 +246,6 @@ twsi_locked_start(device_t dev, struct twsi_softc *sc, int32_t mask,
return (IIC_NOERR);
}
#ifdef EXT_RESOURCES
#define TWSI_BAUD_RATE_RAW(C,M,N) ((C)/((10*(M+1))<<(N)))
#define ABSSUB(a,b) (((a) > (b)) ? (a) - (b) : (b) - (a))
@ -281,7 +280,6 @@ twsi_calc_baud_rate(struct twsi_softc *sc, const u_int target,
return (0);
}
#endif /* EXT_RESOURCES */
/*
* Only slave mode supported, disregard [old]addr
@ -291,17 +289,13 @@ twsi_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr)
{
struct twsi_softc *sc;
uint32_t param;
#ifdef EXT_RESOURCES
u_int busfreq;
#endif
sc = device_get_softc(dev);
#ifdef EXT_RESOURCES
busfreq = IICBUS_GET_FREQUENCY(sc->iicbus, speed);
if (twsi_calc_baud_rate(sc, busfreq, &param) == -1) {
#endif
switch (speed) {
case IIC_SLOW:
case IIC_FAST:
@ -315,9 +309,7 @@ twsi_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr)
debugf(sc, "Using IIC_FASTEST/UNKNOWN mode with speed param=%x\n", param);
break;
}
#ifdef EXT_RESOURCES
}
#endif
debugf(sc, "Using clock param=%x\n", param);

View File

@ -34,9 +34,7 @@
#ifndef _TWSI_H_
#define _TWSI_H_
#ifdef EXT_RESOURCES
#include <dev/extres/clk/clk.h>
#endif
struct twsi_baud_rate {
uint32_t raw;
@ -50,10 +48,8 @@ struct twsi_softc {
struct resource *res[2];
struct mtx mutex;
device_t iicbus;
#ifdef EXT_RESOURCES
clk_t clk_core;
clk_t clk_reg;
#endif
void * intrhand;
bool have_intr;