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.h>
#include <dev/ofw/ofw_bus_subr.h> #include <dev/ofw/ofw_bus_subr.h>
#ifdef EXT_RESOURCES
#include <dev/extres/clk/clk.h> #include <dev/extres/clk/clk.h>
#endif
#include <arm/mv/mvreg.h> #include <arm/mv/mvreg.h>
#include <arm/mv/mvvar.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); return (IIC_NOERR);
} }
#ifdef EXT_RESOURCES
#define TWSI_BAUD_RATE_RAW(C,M,N) ((C)/((10*(M+1))<<(N))) #define TWSI_BAUD_RATE_RAW(C,M,N) ((C)/((10*(M+1))<<(N)))
#define ABSSUB(a,b) (((a) > (b)) ? (a) - (b) : (b) - (a)) #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); return (0);
} }
#endif /* EXT_RESOURCES */
/* /*
* Only slave mode supported, disregard [old]addr * 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; struct twsi_softc *sc;
uint32_t param; uint32_t param;
#ifdef EXT_RESOURCES
u_int busfreq; u_int busfreq;
#endif
sc = device_get_softc(dev); sc = device_get_softc(dev);
#ifdef EXT_RESOURCES
busfreq = IICBUS_GET_FREQUENCY(sc->iicbus, speed); busfreq = IICBUS_GET_FREQUENCY(sc->iicbus, speed);
if (twsi_calc_baud_rate(sc, busfreq, &param) == -1) { if (twsi_calc_baud_rate(sc, busfreq, &param) == -1) {
#endif
switch (speed) { switch (speed) {
case IIC_SLOW: case IIC_SLOW:
case IIC_FAST: 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); debugf(sc, "Using IIC_FASTEST/UNKNOWN mode with speed param=%x\n", param);
break; break;
} }
#ifdef EXT_RESOURCES
} }
#endif
debugf(sc, "Using clock param=%x\n", param); debugf(sc, "Using clock param=%x\n", param);

View File

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