Hi there,
I would like some advice about the pnp_dev_info structure. It's used in superio.c for it8716f, for instance.
This is what's currently in the tree:
static struct pnp_info pnp_dev_info[] = { { &ops, IT8716F_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07f8, 0}, }, { &ops, IT8716F_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, }, { &ops, IT8716F_SP2, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, }, { &ops, IT8716F_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07f8, 0}, }, { &ops, IT8716F_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7ff, 0 }, { 0x7ff, 0x4}, }, { &ops, IT8716F_KBCM, PNP_IRQ0, }, // No 7 { 0,}, { &ops, IT8716F_MIDI, PNP_IO0 | PNP_IRQ0, {0x7fe, 0x4}, }, { &ops, IT8716F_GAME, PNP_IO0, { 0x7ff, 0 }, }, { &ops, IT8716F_IR, }, };
The last 2 parameters on the KBCK line are structs of the type io_info:
struct io_info { unsigned mask, set; };
The io_info structure is used to calculate the size of the pci resource; putting 0x7f8 works out to 8 bytes if I understand this correctly; 0x7ff becomes 1 byte.
I added this line for the 'Environmental Controller' that deals with fans and temperature/voltage sensors:
{ &ops, IT8716F_EC, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
This seems to work, but I don't fully understand what the io_info values should be. I'm not sure how I can tell from the datasheet what the sizes should be. I think they apply to PNP_IO0 and PNP_IO1.
The calculation is done in pnp_get_ioresource in devices/pnp_device.c.
Also, the 'set' value seems to be unused in this context, which is confusing; I'm not sure why it is even there?
Thanks, Ward.
* Ward Vandewege ward@gnu.org [070427 23:06]:
The last 2 parameters on the KBCK line are structs of the type io_info:
struct io_info { unsigned mask, set; };
Also, the 'set' value seems to be unused in this context, which is confusing; I'm not sure why it is even there?
I dont think it was ever used. Or was it an obsolete import from v1?
I it's not used, it could be dropped and replaced by unsigned (int) mask instead of this nasty struct. Also, is it a mask, or is it a base address?