Am Mittwoch, den 30.06.2010, 14:12 +0200 schrieb Carl-Daniel Hailfinger:
-static const struct winbond_chip *
+uint8_t probe_id_winbond(uint16_t port)
+ chipid = sio_read(port, 0x20);
+ return chipid;
If this code is to be run on any board, I would like some more checking
in it. For example, you could check that sio_read(port, 0x20) returns
0xFF after the w836xx_ext_leave(). There are ECs that don't need any
enables, so they will respond after the Winbond enable although they are
not Winbond chips. But they still respond after the disable, so they can
be told apart.
I think the kernel has Super I/O detection in the parport-pc driver.
Maybe one could also peek there for safe detection code that has been
tested on thousands of boxes.
+static const struct winbond_chip
const struct winbond_chip * chip = NULL;
- chipid = sio_read(base, 0x20);
for (i = 0; i < ARRAY_SIZE(winbond_chips); i++)
- if (winbond_chips[i].device_id == chipid)
+ if (winbond_chips[i].device_id == superio.model)
chip = &winbond_chips[i];
Hmm. Shouldn't you check that superio.vendor is in fact