Unbreak after struct resource was hidden. Tested with EBus front-end on

Sun AXe board.
This commit is contained in:
Marius Strobl 2004-08-11 21:19:31 +00:00
parent a4954466bd
commit 490a46bf68
4 changed files with 19 additions and 15 deletions

View File

@ -118,6 +118,8 @@ envctrl_attach(device_t dev)
device_printf(dev, "cannot reserve I/O port range\n");
goto error;
}
sc->bt_ioport = rman_get_bustag(sc->res_ioport);
sc->bh_ioport = rman_get_bushandle(sc->res_ioport);
sc->pcf_flags = device_get_flags(dev);

View File

@ -158,6 +158,8 @@ pcf_ebus_attach(device_t dev)
device_printf(dev, "cannot reserve I/O port range\n");
goto error;
}
sc->bt_ioport = rman_get_bustag(sc->res_ioport);
sc->bh_ioport = rman_get_bushandle(sc->res_ioport);
sc->pcf_flags = device_get_flags(dev);

View File

@ -132,6 +132,8 @@ pcf_isa_attach(device_t dev)
device_printf(dev, "cannot reserve I/O port range\n");
goto error;
}
sc->bt_ioport = rman_get_bustag(sc->res_ioport);
sc->bh_ioport = rman_get_bushandle(sc->res_ioport);
sc->pcf_flags = device_get_flags(dev);

View File

@ -66,11 +66,13 @@ struct pcf_softc {
device_t iicbus; /* the corresponding iicbus */
/* Resource handling stuff. */
void *intr_cookie;
int rid_ioport;
int rid_irq;
struct resource *res_ioport;
struct resource *res_irq;
struct resource *res_ioport;
int rid_ioport;
bus_space_tag_t bt_ioport;
bus_space_handle_t bh_ioport;
struct resource *res_irq;
int rid_irq;
void *intr_cookie;
};
#define DEVTOSOFTC(dev) ((struct pcf_softc *)device_get_softc(dev))
@ -89,18 +91,16 @@ struct pcf_softc {
static __inline void
pcf_set_S0(struct pcf_softc *sc, int data)
{
bus_space_write_1(sc->res_ioport->r_bustag,
sc->res_ioport->r_bushandle,
0, data);
bus_space_write_1(sc->bt_ioport, sc->bh_ioport, 0, data);
pcf_nops();
}
static __inline void
pcf_set_S1(struct pcf_softc *sc, int data)
{
bus_space_write_1(sc->res_ioport->r_bustag,
sc->res_ioport->r_bushandle,
1, data);
bus_space_write_1(sc->bt_ioport, sc->bh_ioport, 1, data);
pcf_nops();
}
@ -109,8 +109,7 @@ pcf_get_S0(struct pcf_softc *sc)
{
char data;
data = bus_space_read_1(sc->res_ioport->r_bustag,
sc->res_ioport->r_bushandle, 0);
data = bus_space_read_1(sc->bt_ioport, sc->bh_ioport, 0);
pcf_nops();
return (data);
@ -121,8 +120,7 @@ pcf_get_S1(struct pcf_softc *sc)
{
char data;
data = bus_space_read_1(sc->res_ioport->r_bustag,
sc->res_ioport->r_bushandle, 1);
data = bus_space_read_1(sc->bt_ioport, sc->bh_ioport, 1);
pcf_nops();
return (data);