Add method enabled() to the SCC interface. This method can be used
by driver backends to mark individual channels as enabled or not. The default implementation of this method always mark channels as enabled. This method is currently not used, but is added with the PowerQUICC in mind where the 2nd SCC channel can be disabled.
This commit is contained in:
parent
2e35504d71
commit
f1aad6d9b2
@ -92,6 +92,7 @@ struct scc_chan {
|
||||
struct scc_mode ch_mode[SCC_NMODES];
|
||||
|
||||
u_int ch_nr;
|
||||
int ch_enabled:1;
|
||||
int ch_sysdev:1;
|
||||
|
||||
uint32_t ch_ipend;
|
||||
|
@ -162,6 +162,10 @@ scc_bfe_attach(device_t dev)
|
||||
resource_list_init(&ch->ch_rlist);
|
||||
ch->ch_nr = c + 1;
|
||||
|
||||
if (!SCC_ENABLED(sc, ch))
|
||||
goto next;
|
||||
|
||||
ch->ch_enabled = 1;
|
||||
resource_list_add(&ch->ch_rlist, sc->sc_rtype, 0, start,
|
||||
start + sz - 1, sz);
|
||||
rle = resource_list_find(&ch->ch_rlist, sc->sc_rtype, 0);
|
||||
@ -192,6 +196,7 @@ scc_bfe_attach(device_t dev)
|
||||
}
|
||||
}
|
||||
|
||||
next:
|
||||
start += (cl->cl_range < 0) ? -size : size;
|
||||
sysdev |= ch->ch_sysdev;
|
||||
}
|
||||
|
@ -38,6 +38,15 @@
|
||||
|
||||
INTERFACE scc;
|
||||
|
||||
# Default implementations of some methods.
|
||||
CODE {
|
||||
static int
|
||||
default_enabled(struct scc_softc *this, struct scc_chan *ch)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
# attach() - attach hardware.
|
||||
# This method is called when the device is being attached. All resources
|
||||
# have been allocated. The intend of this method is to setup the hardware
|
||||
@ -50,6 +59,13 @@ METHOD int attach {
|
||||
int reset;
|
||||
};
|
||||
|
||||
# enabled()
|
||||
METHOD int enabled {
|
||||
struct scc_softc *this;
|
||||
struct scc_chan *chan;
|
||||
} DEFAULT default_enabled;
|
||||
|
||||
# iclear()
|
||||
METHOD void iclear {
|
||||
struct scc_softc *this;
|
||||
struct scc_chan *chan;
|
||||
|
Loading…
x
Reference in New Issue
Block a user