version 1.1, 2000/02/25 02:17:44 |
version 1.2, 2000/03/09 04:19:03 |
Line 83 lm_isa_match(parent, match, aux) |
|
Line 83 lm_isa_match(parent, match, aux) |
|
struct isa_attach_args *ia = aux; |
struct isa_attach_args *ia = aux; |
int iobase; |
int iobase; |
int rv; |
int rv; |
u_int8_t cr; |
|
|
|
/* Must supply an address */ |
/* Must supply an address */ |
if (ia->ia_iobase == ISACF_PORT_DEFAULT) |
if (ia->ia_iobase == ISACF_PORT_DEFAULT) |
Line 95 lm_isa_match(parent, match, aux) |
|
Line 94 lm_isa_match(parent, match, aux) |
|
if (bus_space_map(iot, iobase, 8, 0, &ioh)) |
if (bus_space_map(iot, iobase, 8, 0, &ioh)) |
return (0); |
return (0); |
|
|
/* Check for some power-on defaults */ |
|
bus_space_write_1(iot, ioh, LMC_ADDR, LMD_CONFIG); |
|
|
|
/* Perform LM78 reset */ |
/* Bus independent probe */ |
bus_space_write_1(iot, ioh, LMC_DATA, 0x80); |
rv = lm_probe(iot, ioh); |
|
|
/* XXX - Why do I have to reselect the register? */ |
|
bus_space_write_1(iot, ioh, LMC_ADDR, LMD_CONFIG); |
|
cr = bus_space_read_1(iot, ioh, LMC_DATA); |
|
|
|
/* XXX - spec says *only* 0x08! */ |
|
if ((cr == 0x08) || (cr == 0x01)) |
|
rv = 1; |
|
else |
|
rv = 0; |
|
|
|
DPRINTF(("lm: rv = %d, cr = %x\n", rv, cr)); |
|
|
|
bus_space_unmap(iot, ioh, 8); |
bus_space_unmap(iot, ioh, 8); |
|
|