On 30.06.2010 14:51, Michael Karcher wrote:
> Am Mittwoch, den 30.06.2010, 14:35 +0200 schrieb Carl-Daniel Hailfinger:
>   
>> This patch is the first step towards libsuperiodetect, and more will
>> have to follow.
>>     
> I don't like the millions of ifdefs here. Would it be possible to
> approach it like the B() macro for the board URLs in flashrom instead?
>   

Sure. It doesn't look pretty, though. And it confuses vim syntax
highlighting to no end.
An alternative (which might look cleaner or not) would be to wrap the
whole struct superio_registers in REGDEF() instead of wrapping only the
LDN part.

Comments welcome.

Signed-off-by: Carl-Daniel Hailfinger <[email protected]>

Index: superiotool_libsuperiodetect/via.c
===================================================================
--- superiotool_libsuperiodetect/via.c  (Revision 5651)
+++ superiotool_libsuperiodetect/via.c  (Arbeitskopie)
@@ -24,8 +24,9 @@
 #define DEVICE_REV_VT82C686_REG        0xe1
 
 static const struct superio_registers reg_table[] = {
-       {0x3c, "VT82C686A/VT82C686B", {
-               {EOT}}},
+       {0x3c, "VT82C686A/VT82C686B",
+               LDNDEF({
+               {EOT}})},
        {EOT}
 };
 
Index: superiotool_libsuperiodetect/fintek.c
===================================================================
--- superiotool_libsuperiodetect/fintek.c       (Revision 5651)
+++ superiotool_libsuperiodetect/fintek.c       (Arbeitskopie)
@@ -30,8 +30,9 @@
 #define FINTEK_VENDOR_ID       0x3419
 
 static const struct superio_registers reg_table[] = {
-       {0x0106, "F71862FG / F71863FG", {       /* Same ID? Datasheet typo? */
+       {0x0106, "F71862FG / F71863FG", /* Same ID? Datasheet typo? */
                /* We assume reserved bits are read as 0. */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,
                         0x2b,0x2c,0x2d,EOT},
@@ -75,11 +76,13 @@
                {0xa, "PME, ACPI",
                        {0x30,0xf0,0xf1,0xf4,0xf5,0xf7,EOT},
                        {0x00,0x00,NANA,0x06,0x1c,0x01,EOT}},
-               {EOT}}},
-       {0x4103, "F71872F/FG / F71806F/FG", {   /* Same ID? Datasheet typo? */
-               {EOT}}},
-       {0x4105, "F71882FG/F71883FG", {         /* Same ID? Datasheet typo? */
+               {EOT}})},
+       {0x4103, "F71872F/FG / F71806F/FG",     /* Same ID? Datasheet typo? */
+               LDNDEF({
+               {EOT}})},
+       {0x4105, "F71882FG/F71883FG",           /* Same ID? Datasheet typo? */
                /* We assume reserved bits are read as 0. */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,
                         0x2b,0x2c,0x2d,EOT},
@@ -121,9 +124,10 @@
                {0xa, "PME, ACPI",
                        {0x30,0xf0,0xf1,0xf4,0xf5,EOT},
                        {0x00,0x00,0x01,0x06,0x1c,EOT}},
-               {EOT}}},
-       {0x0604, "F71805F/FG", {
+               {EOT}})},
+       {0x0604, "F71805F/FG", 
                /* We assume reserved bits are read as 0. */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x23,0x24,0x25,0x26,0x27,0x28,0x29,EOT},
                        {0x04,0x06,0x19,0x34,0x00,0x00,0x3f,0x08,0x00,EOT}},
@@ -150,9 +154,10 @@
                {0xa, "PME",
                        {0x30,0xf0,0xf1,EOT},
                        {0x00,0x00,0x00,EOT}},
-               {EOT}}},
-       {0x0581, "F8000", {     /* Fintek/ASUS F8000 */
-               {EOT}}},
+               {EOT}})},
+       {0x0581, "F8000",       /* Fintek/ASUS F8000 */
+               LDNDEF({
+               {EOT}})},
        {EOT}
 };
 
@@ -181,7 +186,9 @@
               get_superio_name(reg_table, did), vid, did, port);
        chip_found = 1;
 
+#ifndef LIBSUPERIODETECT
        dump_superio("Fintek", reg_table, port, did, LDN_SEL);
+#endif /* ! LIBSUPERIODETECT */
 
        exit_conf_mode_winbond_fintek_ite_8787(port);
 }
Index: superiotool_libsuperiodetect/winbond.c
===================================================================
--- superiotool_libsuperiodetect/winbond.c      (Revision 5651)
+++ superiotool_libsuperiodetect/winbond.c      (Arbeitskopie)
@@ -37,9 +37,11 @@
  */
 static const struct superio_registers reg_table[] = {
        /* ID and rev[3..0] */
-       {0x527, "W83977CTF", {  /* TODO: Not yet in sensors-detect */
-               {EOT}}},
-       {0x52f, "W83977EF/EG", {
+       {0x527, "W83977CTF",    /* TODO: Not yet in sensors-detect */
+               LDNDEF({
+               {EOT}})},
+       {0x52f, "W83977EF/EG", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x2a,
                         0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -78,10 +80,12 @@
                         0xf0,0xf1,0xf3,0xf4,0xf6,0xf7,0xf9,0xfe,0xff,EOT},
                        {0x00,0x00,0x00,0x00,MISC,MISC,MISC,0x00,0x00,0x00,
                         0x00,0x00,0x00,0x00,0x00,0x00,0x00,RSVD,RSVD,EOT}},
-               {EOT}}},
-       {0x595, "W83627SF", {   /* TODO: Not yet in sensors-detect */
-               {EOT}}},
-       {0x601, "W83697HF/F/HG", { /* No G version? */
+               {EOT}})},
+       {0x595, "W83627SF",     /* TODO: Not yet in sensors-detect */
+               LDNDEF({
+               {EOT}})},
+       {0x601, "W83697HF/F/HG",  /* No G version? */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x29,
                         0x2a,EOT},
@@ -126,12 +130,15 @@
                {0xb, "Hardware monitor",
                        {0x30,0x60,0x61,0x70,EOT},
                        {0x00,0x00,0x00,0x00,EOT}},
-               {EOT}}},
-       {0x610, "W83L517D/D-F", {
-               {EOT}}},
-       {0x708, "W83637HF/HG", {
-               {EOT}}},
-       {0x828, "W83627THF/THG", { /* We assume rev is bits 3..0 of 0x21. */
+               {EOT}})},
+       {0x610, "W83L517D/D-F", 
+               LDNDEF({
+               {EOT}})},
+       {0x708, "W83637HF/HG", 
+               LDNDEF({
+               {EOT}})},
+       {0x828, "W83627THF/THG",  /* We assume rev is bits 3..0 of 0x21. */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x29,0x2a,
                         0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -175,12 +182,14 @@
                {0xb, "Hardware monitor",
                        {0x30,0x60,0x61,0x70,EOT},
                        {0x00,0x00,0x00,0x00,EOT}},
-               {EOT}}},
+               {EOT}})},
 #if 0
-       {0x85x, "W83687THF", {  /* TODO: sensors-detect: 0x85 */
-               {EOT}}},
+       {0x85x, "W83687THF",    /* TODO: sensors-detect: 0x85 */
+               LDNDEF({
+               {EOT}})},
 #endif
-       {0xa02, "W83627DHG", {
+       {0xa02, "W83627DHG", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
                         0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -232,24 +241,29 @@
                         EOT},
                        {0x00,0x48,0x48,0x48,0x48,0x00,0x00,0x48,0x00,0x00,
                         EOT}},
-               {EOT}}},
-       {0xa23, "W83627UHG", {/* TODO: Not yet in sensors-detect */
-               {EOT}}},
-       {0xa51, "W83667HG", {
+               {EOT}})},
+       {0xa23, "W83627UHG", /* TODO: Not yet in sensors-detect */
+               LDNDEF({
+               {EOT}})},
+       {0xa51, "W83667HG", 
                /* See also: 
http://lists.lm-sensors.org/pipermail/lm-sensors/2008-July/023683.html */
-               {EOT}}},
+               LDNDEF({
+               {EOT}})},
 
        /* ID and rev */
-       {0x9771, "W83977F-A/G-A/AF-A/AG-A", {
-               {EOT}}},
-       {0x9777, "W83977AF", {
+       {0x9771, "W83977F-A/G-A/AF-A/AG-A", 
+               LDNDEF({
+               {EOT}})},
+       {0x9777, "W83977AF", 
                /*
                 * W83977AF as found on the Advantech PCM-5820. We weren't able
                 * to find a datasheet (so far) which lists the 0x77 revision,
                 * but the hardware is there in the wild, so detect it...
                 */
-               {EOT}}},
-       {0x9773, "W83977TF", {
+               LDNDEF({
+               {EOT}})},
+       {0x9773, "W83977TF", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x2a,0x2b,
                         0x2c,0x2d,0x2e,0x2f,EOT},
@@ -294,12 +308,14 @@
                        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                         NANA,MISC,RSVD,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                         0x00,RSVD,RSVD,EOT}},
-               {EOT}}},
-       {0x9774, "W83977ATF", {
-               {EOT}}},
+               {EOT}})},
+       {0x9774, "W83977ATF", 
+               LDNDEF({
+               {EOT}})},
 
        /* ID only */
-       {0x52, "W83627HF/F/HG/G", {
+       {0x52, "W83627HF/F/HG/G", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x29,
                         0x2a,0x2b,0x2c,0x2e,0x2f,EOT},
@@ -342,13 +358,14 @@
                {0xb, "Hardware monitor",
                        {0x30,0x60,0x61,0x70,0xf0,EOT},
                        {0x00,0x00,0x00,0x00,0x00,EOT}},
-               {EOT}}},
-       {0x68, "W83697SF/UF/UG", {
+               {EOT}})},
+       {0x68, "W83697SF/UF/UG", 
                /* ID:  0x68 (for W83697SF/UF/UG)
                 * Rev: 0x1X (for W83697SF)
                 *      0x0X (for W83697SF) -- sic!
                 *      0x1X (for W83697UF/UG)
                 */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x28,0x29,0x2a,
                         0x2b,0x2c,EOT},
@@ -405,8 +422,8 @@
                {0xf, "GPIO 8",
                        {0x30,0x60,0x61,0xf0,0xf1,0xf2,EOT},
                        {0x00,0x00,0x00,0xff,0x00,0x00,EOT}},
-               {EOT}}},
-       {0x88, "W83627EHF/EF/EHG/EG", {
+               {EOT}})},
+       {0x88, "W83627EHF/EF/EHG/EG", 
                /*
                 * As per datasheet the ID should be 0x886? here.
                 * Not mentioned in the datasheet, but sensors-detect says
@@ -414,6 +431,7 @@
                 * (W83627EHF) has an ID of 0x8854 (verified on hardware).
                 * So we now assume all 0x88?? IDs to mean W83627EHF/EF/EHG/EG.
                 */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
                         0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -460,12 +478,14 @@
                {0xb, "Hardware monitor",
                        {0x30,0x60,0x61,0x70,0xf0,0xf1,EOT},
                        {0x00,0x00,0x00,0x00,0xc1,0x00,EOT}},
-               {EOT}}},
+               {EOT}})},
 
        /* ID[3..0] */
-       {0xa, "W83877F", {
-               {EOT}}},
-       {0xb, "W83877AF", {
+       {0xa, "W83877F", 
+               LDNDEF({
+               {EOT}})},
+       {0xb, "W83877AF", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
                         0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,
@@ -475,14 +495,17 @@
                         0x1f,0x0c,0x28,0xa3,RSVD,RSVD,0x00,0x00,0x00,0x00,
                         0x00,0x00,0x0e,0x00,MISC,MISC,MISC,MISC,MISC,MISC,
                         MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,MISC,EOT}},
-               {EOT}}},
-       {0xc, "W83877TF", {
-               {EOT}}},
-       {0xd, "W83877ATF/ATG", {
-               {EOT}}},
+               {EOT}})},
+       {0xc, "W83877TF", 
+               LDNDEF({
+               {EOT}})},
+       {0xd, "W83877ATF/ATG", 
+               LDNDEF({
+               {EOT}})},
        {EOT}
 };
 
+#ifndef LIBSUPERIODETECT
 static const struct superio_registers hwm_table[] = {
        {0x828, "W83627THF/THG", {
                {NOLDN, NULL,
@@ -531,6 +554,7 @@
                {EOT}}},
        {EOT}
 };
+#endif /* ! LIBSUPERIODETECT */
 
 static void enter_conf_mode_winbond_88(uint16_t port)
 {
@@ -550,7 +574,10 @@
 
 static void probe_idregs_winbond_helper(const char *init, uint16_t port)
 {
-       uint16_t id, hwmport;
+       uint16_t id;
+#ifndef LIBSUPERIODETECT
+       uint16_t hwmport;
+#endif /* LIBSUPERIODETECT */
        uint8_t devid, rev, olddevid;
 
        probing_for("Winbond", init, port);
@@ -586,6 +613,7 @@
                       get_superio_name(reg_table, id), devid, rev, port);
        chip_found = 1;
 
+#ifndef LIBSUPERIODETECT
        dump_superio("Winbond", reg_table, port, id, LDN_SEL);
 
        if (extra_dump) {
@@ -607,6 +635,7 @@
                dump_superio("Winbond-HWM", hwm_table, hwmport, id,
                             WINBOND_HWM_SEL);
        }
+#endif /* ! LIBSUPERIODETECT */
 }
 
 void probe_idregs_winbond(uint16_t port)
@@ -631,5 +660,7 @@
 void print_winbond_chips(void)
 {
        print_vendor_chips("Winbond", reg_table);
+#ifndef LIBSUPERIODETECT
        print_vendor_chips("Winbond-HWM", hwm_table);
+#endif /* ! LIBSUPERIODETECT */
 }
Index: superiotool_libsuperiodetect/ite.c
===================================================================
--- superiotool_libsuperiodetect/ite.c  (Revision 5651)
+++ superiotool_libsuperiodetect/ite.c  (Arbeitskopie)
@@ -27,9 +27,11 @@
 #define ISA_PNP_ADDR           0x279
 
 static const struct superio_registers reg_table[] = {
-       {0x8228, "IT8228E", {
-               {EOT}}},
-       {0x8502, "IT8502E/TE/G", {
+       {0x8228, "IT8228E", 
+               LDNDEF({
+               {EOT}})},
+       {0x8502, "IT8502E/TE/G", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
                         0x2A,0x2B,0x2C,0x2D,0x2E,EOT},
@@ -67,10 +69,12 @@
                {0x17, "Power Channel 3",
                        {0x30,0x60,0x61,0x62,0x63,0x70,0x71,EOT},
                        {0x00,0x00,0x6a,0x00,0x6e,0x01,0x01,EOT}},
-               {EOT}}},
-       {0x8510, "IT8510E/TE/G", {
-               {EOT}}},
-       {0x8511, "IT8511E/TE/G", {
+               {EOT}})},
+       {0x8510, "IT8510E/TE/G", 
+               LDNDEF({
+               {EOT}})},
+       {0x8511, "IT8511E/TE/G", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
                         0x2A,0x2B,0x2C,0x2D,0x2E,EOT},
@@ -101,8 +105,9 @@
                {0x12, "Power Channel 2",
                        {0x30,0x60,0x61,0x62,0x63,0x70,0x71,EOT},
                        {0x00,0x00,0x68,0x00,0x6c,0x01,0x03,EOT}},
-               {EOT}}},
-       {0x8512, "IT8512E/F/G", {
+               {EOT}})},
+       {0x8512, "IT8512E/F/G", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
                         0x2A,0x2B,0x2C,0x2D,0x2E,EOT},
@@ -133,10 +138,12 @@
                {0x12, "Power Channel 2",
                        {0x30,0x60,0x61,0x62,0x63,0x70,0x71,EOT},
                        {0x00,0x00,0x68,0x00,0x6c,0x01,0x03,EOT}},
-               {EOT}}},
-       {0x8513, "IT8513E/F/G", {
-               {EOT}}},
-       {0x8661, "IT8661F/IT8770F", {
+               {EOT}})},
+       {0x8513, "IT8513E/F/G", 
+               LDNDEF({
+               {EOT}})},
+       {0x8661, "IT8661F/IT8770F", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x20,0x21,0x22,
                         0x23,0x24,EOT},
@@ -168,10 +175,12 @@
                        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                         0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                         0x00,0x00,0x00,0x00,EOT}},
-               {EOT}}},
-       {0x8673, "IT8673F", {
-               {EOT}}},
-       {0x8681, "IT8671F/IT8687R", {
+               {EOT}})},
+       {0x8673, "IT8673F", 
+               LDNDEF({
+               {EOT}})},
+       {0x8681, "IT8671F/IT8687R", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x20,0x21,0x22,
                         0x23,0x24,0x25,0x26,0x2e,0x2f,EOT},
@@ -211,8 +220,9 @@
                         0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                         0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                         0x00,0x00,0x00,0x00,0x00,EOT}},
-               {EOT}}},
-       {0x8701, "IT8703F", {
+               {EOT}})},
+       {0x8701, "IT8703F", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x23,0x24,0x26,0x29,0x2a,0x2b,EOT},
                        {0x87,0x00,0x00,0x80,0x00,0x00,0x7c,0xc0,EOT}},
@@ -253,10 +263,12 @@
                {0xc, "GPIO set 5, 6 and 7",
                        {0x30,0x60,0x61,0xf0,0xf3,0xf6,EOT},
                        {0x00,0x03,0x70,0x00,0xff,0xff,EOT}},
-               {EOT}}},
-       {0x8702, "IT8702F", {
-               {EOT}}},
-       {0x8705, "IT8705F/AF / IT8700F", {
+               {EOT}})},
+       {0x8702, "IT8702F", 
+               LDNDEF({
+               {EOT}})},
+       {0x8705, "IT8705F/AF / IT8700F", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,EOT},
                        {0x87,0x05,0x00,0x00,NANA,EOT}},
@@ -303,11 +315,13 @@
                {0x8, "MIDI port",
                        {0x30,0x60,0x61,0x70,0xf0,EOT},
                        {0x00,0x03,0x00,0x0a,0x00,EOT}},
-               {EOT}}},
-       {0x8706, "IT8706R", {   /* TODO: Not yet in sensors-detect */
+               {EOT}})},
+       {0x8706, "IT8706R",     /* TODO: Not yet in sensors-detect */
                /* This is a "Special General Purpose I/O chip". */
-               {EOT}}},
-       {0x8708, "IT8708F", {
+               LDNDEF({
+               {EOT}})},
+       {0x8708, "IT8708F", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
                         0x2a,0x2e,0x2f,EOT},
@@ -361,12 +375,15 @@
                {0xa, "MIDI port",
                        {0x30,0x60,0x61,0x70,0xf0,EOT},
                        {0x00,0x03,0x00,0x0a,0x00,EOT}},
-               {EOT}}},
-       {0x8710, "IT8710F", {   /* TODO: Not yet in sensors-detect */
-               {EOT}}},
-       {0x8711, "IT8711F", {   /* 0x8711 is a guess, not found in datasheet. */
-               {EOT}}},
-       {0x8712, "IT8712F", {
+               {EOT}})},
+       {0x8710, "IT8710F",     /* TODO: Not yet in sensors-detect */
+               LDNDEF({
+               {EOT}})},
+       {0x8711, "IT8711F",     /* 0x8711 is a guess, not found in datasheet. */
+               LDNDEF({
+               {EOT}})},
+       {0x8712, "IT8712F", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x2b,EOT},
                        {0x87,0x12,0x08,0x00,0x00,0x00,EOT}},
@@ -416,8 +433,9 @@
                {0xa, "Consumer IR",
                        {0x30,0x60,0x61,0x70,0xf0,EOT},
                        {0x00,0x03,0x10,0x0b,0x00,EOT}},
-               {EOT}}},
-       {0x8716, "IT8716F", {
+               {EOT}})},
+       {0x8716, "IT8716F", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x2b,EOT},
                        {0x87,0x16,0x01,0x00,0x00,0x00,EOT}},
@@ -466,8 +484,9 @@
                {0xa, "Consumer IR",
                        {0x30,0x60,0x61,0x70,0xf0,EOT},
                        {0x00,0x03,0x10,0x0b,0x00,EOT}},
-               {EOT}}},
-       {0x8718, "IT8718F", {
+               {EOT}})},
+       {0x8718, "IT8718F", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x2b,EOT},
                        {0x87,0x18,0x01,0x00,0x00,0x00,EOT}},
@@ -514,13 +533,16 @@
                {0xa, "Consumer IR",
                        {0x30,0x60,0x61,0x70,0xf0,EOT},
                        {0x00,0x03,0x10,0x0b,0x00,EOT}},
-               {EOT}}},
-       {0x8720, "IT8720F", {   /* From sensors-detect */
-               {EOT}}},
-       {0x8722, "IT8722F", {
-               {EOT}}},
-       {0x8726, "IT8726F", {
+               {EOT}})},
+       {0x8720, "IT8720F",     /* From sensors-detect */
+               LDNDEF({
+               {EOT}})},
+       {0x8722, "IT8722F", 
+               LDNDEF({
+               {EOT}})},
+       {0x8726, "IT8726F", 
                /* Datasheet wrongly says that the ID is 0x8716. */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x2b,EOT},
                        {0x87,0x26,0x01,0x00,MISC,0x00,EOT}},
@@ -571,14 +593,17 @@
                {0xa, "Consumer IR",
                        {0x30,0x60,0x61,0x70,0xf0,EOT},
                        {0x00,0x03,0x10,0x0b,0x00,EOT}},
-               {EOT}}},
-       {0x8761, "IT8761E", {
-               {EOT}}},
-       {0x8780, "IT8780F", {
-               {EOT}}},
+               {EOT}})},
+       {0x8761, "IT8761E", 
+               LDNDEF({
+               {EOT}})},
+       {0x8780, "IT8780F", 
+               LDNDEF({
+               {EOT}})},
        {EOT}
 };
 
+#ifndef LIBSUPERIODETECT
 static const struct superio_registers ec_table[] = {
        {0x8716, "IT8716F", {
                {NOLDN, NULL,
@@ -636,6 +661,7 @@
                {EOT}}},
        {EOT}
 };
+#endif /* ! LIBSUPERIODETECT */
 
 /* Works for: IT8661F/IT8770F */
 static const uint8_t initkey_it8661f[][4] = {
@@ -712,7 +738,10 @@
 
 static void probe_idregs_ite_helper(const char *init, uint16_t port)
 {
-       uint16_t id, chipver, ecport;
+       uint16_t id, chipver;
+#ifndef LIBSUPERIODETECT
+       uint16_t ecport;
+#endif /* ! LIBSUPERIODETECT */
 
        probing_for("ITE", init, port);
 
@@ -730,6 +759,7 @@
               get_superio_name(reg_table, id), id, chipver, port);
        chip_found = 1;
 
+#ifndef LIBSUPERIODETECT
        dump_superio("ITE", reg_table, port, id, LDN_SEL);
 
        if (extra_dump) {
@@ -745,6 +775,7 @@
                printf("Environment controller (0x%04x)\n", ecport);
                dump_superio("ITE-EC", ec_table, ecport, id, LDN_SEL);
        }
+#endif /* ! LIBSUPERIODETECT */
 }
 
 void probe_idregs_ite(uint16_t port)
@@ -783,5 +814,7 @@
 void print_ite_chips(void)
 {
        print_vendor_chips("ITE", reg_table);
+#ifndef LIBSUPERIODETECT
        print_vendor_chips("ITE-EC", ec_table);
+#endif /* ! LIBSUPERIODETECT */
 }
Index: superiotool_libsuperiodetect/nsc.c
===================================================================
--- superiotool_libsuperiodetect/nsc.c  (Revision 5651)
+++ superiotool_libsuperiodetect/nsc.c  (Arbeitskopie)
@@ -25,7 +25,8 @@
 #define CHIP_REV_REG   0x27    /* Super I/O revision ID (SRID) */
 
 static const struct superio_registers reg_table[] = {
-       {0xcf, "PC97307", {
+       {0xcf, "PC97307", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x27,EOT},
                        {0xcf,MISC,MISC,0x00,0x00,NANA,EOT}},
@@ -60,8 +61,9 @@
                {0x8, "Power management",
                        {0x30,0x31,0x60,0x61,0x74,0x75,EOT},
                        {0x00,0x00,0x00,0x00,0x04,0x04,EOT}},
-               {EOT}}},
-       {0xd0, "PC87317", {
+               {EOT}})},
+       {0xd0, "PC87317", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,EOT},
                        {0xd0,MISC,MISC,0x00,0x00,0x00,EOT}},
@@ -96,8 +98,9 @@
                {0x8, "Power management",
                        {0x30,0x31,0x60,0x61,0x74,0x75,EOT},
                        {0x00,0x00,0x00,0x00,0x04,0x04,EOT}},
-               {EOT}}},
-       {0xdf, "PC97317", {
+               {EOT}})},
+       {0xdf, "PC97317", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x27,EOT},
                        {0xdf,MISC,MISC,0x00,0x00,0x00,NANA,EOT}},
@@ -132,8 +135,9 @@
                {0x8, "Power management",
                        {0x30,0x31,0x60,0x61,0x74,0x75,EOT},
                        {0x00,0x00,0x00,0x00,0x04,0x04,EOT}},
-               {EOT}}},
-       {0xe0, "PC87309", {
+               {EOT}})},
+       {0xe0, "PC87309", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x27,0x2e,EOT},
                        {0xe0,MISC,0x00,NANA,RSVD,EOT}},
@@ -162,8 +166,9 @@
                         0xf0,EOT},
                        {0x01,0x00,0x00,0x60,0x00,0x64,0x01,0x02,0x04,0x04,
                         0x40,EOT}},
-               {EOT}}},
-       {0xe1, "PC87360", {
+               {EOT}})},
+       {0xe1, "PC87360", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x2a,
                         0x2b,0x2c,0x2d,0x2e,EOT},
@@ -206,8 +211,9 @@
                {0xa, "Watchdog timer",
                        {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
                        {0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x02,EOT}},
-               {EOT}}},
-       {0xe2, "PC87351", {
+               {EOT}})},
+       {0xe2, "PC87351", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x27,0x2e,EOT},
                        {0xe2,0x11,0xa1,0x00,MISC,NANA,RSVD,EOT}},
@@ -240,14 +246,18 @@
                {0x8, "Fan speed control",
                        {0x30,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
                        {0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x00,EOT}},
-               {EOT}}},
-       {0xe4, "PC87364", {
-               {EOT}}},
-       {0xe5, "PC87365", {     /* SRID[7..0] == chip revision */
-               {EOT}}},
-       {0xe8, "PC87363", {
-               {EOT}}},
-       {0xe9, "PC87366", {
+               {EOT}})},
+       {0xe4, "PC87364", 
+               LDNDEF({
+               {EOT}})},
+       {0xe5, "PC87365",       /* SRID[7..0] == chip revision */
+               LDNDEF({
+               {EOT}})},
+       {0xe8, "PC87363", 
+               LDNDEF({
+               {EOT}})},
+       {0xe9, "PC87366", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x27,0x28,0x2a,0x2b,
                         0x2c,0x2d,0x2e,EOT},
@@ -304,10 +314,11 @@
                {0xe, "Temperature sensor (TMS)",
                        {0x30,0x60,0x61,0x70,0x71,0x74,0x75,EOT},
                        {0x00,0x00,0x00,0x00,0x03,0x04,0x04,EOT}},
-               {EOT}}},
+               {EOT}})},
 
        /* SID[7..0]: family, SRID[7..5]: ID, SRID[4..0]: rev. */
-       {0xea, "PC8739x", {
+       {0xea, "PC8739x", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
                         0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -344,12 +355,14 @@
                         0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,EOT},
                        {0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x00,0x00,0x00,
                         0x00,0x00,0x00,0x00,0x00,0x00,0x00,EOT}},
-               {EOT}}},
-       {0xec, "PC87591x", {
+               {EOT}})},
+       {0xec, "PC87591x", 
                /* SRID[7..5]: 000=PC87591E, 001=PC87591S, 100=PC87591L */
-               {EOT}}},
-       {0xee, "PC8741x", {
+               LDNDEF({
+               {EOT}})},
+       {0xee, "PC8741x", 
                /* SRID[7..5] is marked as "not applicable for the PC8741x". */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,
                         0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -397,10 +410,12 @@
                         0xf1,0xf2,0xf3,EOT},
                        {0x00,0x00,0x70,0x00,0x72,0x08,0x00,0x04,0x04,0x00,
                         0x00,0x00,0x00,EOT}},
-               {EOT}}},
-       {0xf0, "PC87372", {
-               {EOT}}},
-       {0x0f1, "PC8374L", {
+               {EOT}})},
+       {0xf0, "PC87372", 
+               LDNDEF({
+               {EOT}})},
+       {0x0f1, "PC8374L", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x10,0x12,0x13,0x20,0x21,0x22,0x23,0x24,0x25,0x26,
                         0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -441,8 +456,9 @@
                {0x8, "Health management",
                        {0x30,0x50,0x60,0x61,0x70,0x71,0x74,0x75,0xf0,EOT},
                        {0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x05,EOT}},
-               {EOT}}},
-       {0x8f1, "WPCD376I", {
+               {EOT}})},
+       {0x8f1, "WPCD376I", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x10,0x12,0x13,0x20,0x21,0x22,0x23,0x24,0x25,0x26,
                         0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -480,9 +496,10 @@
                         0xf2,0xf3,0xf8,EOT},
                        {0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,0x00,MISC,
                         0x00,MISC,0x01,EOT}},
-               {EOT}}},
-       {0xf2, "PC87427", {
+               {EOT}})},
+       {0xf2, "PC87427", 
                /* SRID[7..5] is marked as "not applicable for the PC87427". */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x10,0x12,0x13,0x1d,0x20,0x21,0x22,0x23,0x24,0x25,
                         0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
@@ -542,9 +559,10 @@
                         0xf0,EOT},
                        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x04,0x04,
                         0x05,EOT}},
-               {EOT}}},
-       {0xf3, "PC87373", {
-               {EOT}}},
+               {EOT}})},
+       {0xf3, "PC87373", 
+               LDNDEF({
+               {EOT}})},
        {EOT}
 };
 
@@ -592,8 +610,10 @@
               get_superio_name(reg_table, magic), id, rev, port);
        chip_found = 1;
 
+#ifndef LIBSUPERIODETECT
        dump_superio(magic == 0x8f1 ? "Winbond" : "NSC",
                     reg_table, port, magic, LDN_SEL);
+#endif /* ! LIBSUPERIODETECT */
 }
 
 void print_nsc_chips(void)
Index: superiotool_libsuperiodetect/superiotool.c
===================================================================
--- superiotool_libsuperiodetect/superiotool.c  (Revision 5651)
+++ superiotool_libsuperiodetect/superiotool.c  (Arbeitskopie)
@@ -81,6 +81,7 @@
        return "<unknown>";
 }
 
+#ifndef LIBSUPERIODETECT
 static void dump_regs(const struct superio_registers reg_table[],
                      int i, int j, uint16_t port, uint8_t ldn_sel)
 {
@@ -170,6 +171,7 @@
                printf("%02x ", INB(iobase + i));
        printf("\n");
 }
+#endif /* ! LIBSUPERIODETECT */
 
 void probing_for(const char *vendor, const char *info, uint16_t port)
 {
@@ -189,9 +191,11 @@
        for (i = 0; reg_table[i].superio_id != EOT; i++) {
                printf("%s %s", vendor, reg_table[i].name);
 
+#ifndef LIBSUPERIODETECT
                /* Unless the ldn is empty, assume this chip has a dump. */
                if (reg_table[i].ldn[0].ldn != EOT)
                        printf(" (dump available)");
+#endif /* ! LIBSUPERIODETECT */
 
                printf("\n");
        }
Index: superiotool_libsuperiodetect/ali.c
===================================================================
--- superiotool_libsuperiodetect/ali.c  (Revision 5651)
+++ superiotool_libsuperiodetect/ali.c  (Arbeitskopie)
@@ -27,7 +27,8 @@
 
 static const struct superio_registers reg_table[] = {
        /* TODO: M5113 doesn't seem to have ID registers? */
-       {0x5315, "M1535/M1535D/M1535+/M1535D+", {
+       {0x5315, "M1535/M1535D/M1535+/M1535D+",
+               LDNDEF({
                {NOLDN, NULL,
                        {0x1f,0x20,0x21,0x22,0x23,0x2c,0x2d,0x2e,EOT},
                        {NANA,0x53,0x15,0x00,0x00,RSVD,RSVD,RSVD,EOT}},
@@ -52,9 +53,10 @@
                {0xc, "Hotkey",
                        {0x30,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,EOT},
                        {0x00,0x35,0x14,0x11,0x71,RSVD,0x05,EOT}},
-               {EOT}}},
-       {0x2351, "M512x", {
-               {EOT}}},
+               {EOT}})},
+       {0x2351, "M512x",
+               LDNDEF({
+               {EOT}})},
        {EOT}
 };
 
@@ -95,7 +97,9 @@
               get_superio_name(reg_table, id), id, rev, port);
        chip_found = 1;
 
+#ifndef LIBSUPERIODETECT
        dump_superio("ALi", reg_table, port, id, LDN_SEL);
+#endif /* ! LIBSUPERIODETECT */
 
        exit_conf_mode_ali(port);
 }
Index: superiotool_libsuperiodetect/smsc.c
===================================================================
--- superiotool_libsuperiodetect/smsc.c (Revision 5651)
+++ superiotool_libsuperiodetect/smsc.c (Arbeitskopie)
@@ -29,7 +29,8 @@
 
 static const struct superio_registers reg_table[] = {
        /* The following Super I/Os use the 0x20/0x21 ID registers. */
-       {0x02, "FDC37C932", {
+       {0x02, "FDC37C932", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x02,0x03,0x20,0x21,0x22,0x23,0x24,0x2d,0x2e,
                         0x2f,EOT},
@@ -68,11 +69,13 @@
                        {0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,
                         0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
                         0x00,0x00,0x00,MISC,EOT}},
-               {EOT}}},
-       {0x03, "FDC37C93xFR", {
+               {EOT}})},
+       {0x03, "FDC37C93xFR", 
                /* FIXME: There's another 0x03 but found on port 0x0d/0x0e! */
-               {EOT}}},
-       {0x0a, "FDC37N971", {
+               LDNDEF({
+               {EOT}})},
+       {0x0a, "FDC37N971", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
                         0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -109,8 +112,9 @@
                {0x9, "Mailbox",
                        {0x30,0x60,0x61,EOT},
                        {0x00,0x00,0x00,EOT}},
-               {EOT}}},
-       {0x0b, "FDC37N972", {
+               {EOT}})},
+       {0x0b, "FDC37N972", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x02,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
                         0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -147,8 +151,9 @@
                {0x9, "Mailbox",
                        {0x30,0x60,0x61,EOT},
                        {0x00,0x00,0x00,EOT}},
-               {EOT}}},
-       {0x0e, "LPC47N252", {   /* From sensors-detect */
+               {EOT}})},
+       {0x0e, "LPC47N252",     /* From sensors-detect */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,
                         0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -188,12 +193,15 @@
                {0xa, "LPC/8051 addressable GPIO (LGPIO)",
                        {0x30,0x60,0x61,EOT},
                        {0x00,0x00,0x00,EOT}},
-               {EOT}}},
-       {0x14, "LPC47M172", {
-               {EOT}}},
-       {0x30, "FDC37C93xAPM", {
-               {EOT}}},
-       {0x40, "FDC37C67x", {   /* E.g. FDC37C672. Chiprev: 0x01 */
+               {EOT}})},
+       {0x14, "LPC47M172", 
+               LDNDEF({
+               {EOT}})},
+       {0x30, "FDC37C93xAPM", 
+               LDNDEF({
+               {EOT}})},
+       {0x40, "FDC37C67x",     /* E.g. FDC37C672. Chiprev: 0x01 */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,0x2b,0x2c,
                         0x2d,0x2e,0x2f,EOT},
@@ -225,10 +233,12 @@
                        {0x00,NANA,NANA,NANA,NANA,0x06,0x03,NANA,NANA,NANA,
                         0x00,0x00,0x00,MISC,RSVD,RSVD,RSVD,RSVD,RSVD,RSVD,
                         EOT}},
-               {EOT}}},
-       {0x42, "FDC37B80x/FDC37M707", {
-               {EOT}}},
-       {0x09, "FDC37N958FR", { /* Found in e.g. Dell Latitude CPi A366XT. */
+               {EOT}})},
+       {0x42, "FDC37B80x/FDC37M707", 
+               LDNDEF({
+               {EOT}})},
+       {0x09, "FDC37N958FR",   /* Found in e.g. Dell Latitude CPi A366XT. */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,0x28,0x2b,
                         0x2c,0x2d,0x2e,0x2f,EOT},
@@ -270,10 +280,12 @@
                {0xa, "ACPI",
                        {0x30,0x60,0x61,0x70,0xf0,EOT},
                        {0x00,0x00,0x00,NANA,NANA,EOT}},
-               {EOT}}},
-       {0x43, "FDC37B77x", {
-               {EOT}}},
-       {0x44, "FDC37B78x", {
+               {EOT}})},
+       {0x43, "FDC37B77x", 
+               LDNDEF({
+               {EOT}})},
+       {0x44, "FDC37B78x", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,0x28,0x2b,
                         0x2c,0x2d,0x2e,0x2f,EOT},
@@ -315,12 +327,15 @@
                {0xa, "ACPI",
                        {0x30,0x60,0x61,0x70,0xf0,EOT},
                        {0x00,0x00,0x00,NANA,NANA,EOT}},
-               {EOT}}},
-       {0x46, "FDC37M602", {   /* Found in Biostar M6TLD. */
-               {EOT}}},
-       {0x47, "FDC37M60x", {   /* TODO: Not yet in sensors-detect */
-               {EOT}}},
-       {0x4c, "FDC37B72x", {
+               {EOT}})},
+       {0x46, "FDC37M602",     /* Found in Biostar M6TLD. */
+               LDNDEF({
+               {EOT}})},
+       {0x47, "FDC37M60x",     /* TODO: Not yet in sensors-detect */
+               LDNDEF({
+               {EOT}})},
+       {0x4c, "FDC37B72x", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,0x28,0x2b,
                         0x2c,0x2d,0x2e,0x2f,EOT},
@@ -357,8 +372,9 @@
                {0xa, "ACPI",
                        {0x30,0x60,0x61,0x70,0xf0,EOT},
                        {0x00,0x00,0x00,NANA,NANA,EOT}},
-               {EOT}}},
-       {0x4d, "FDC37M81x", {
+               {EOT}})},
+       {0x4d, "FDC37M81x", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,0x2b,0x2c,
                         0x2d,0x2e,0x2f,EOT},
@@ -389,8 +405,9 @@
                        {0x00,NANA,NANA,NANA,NANA,0x02,0x01,NANA,NANA,NANA,
                         NANA,NANA,NANA,NANA,0x00,0x00,0x00,0x00,RSVD,RSVD,
                         RSVD,RSVD,RSVD,RSVD,EOT}},
-               {EOT}}},
-       {0x51, "LPC47B27x", {
+               {EOT}})},
+       {0x51, "LPC47B27x", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,0x28,
                         0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -424,10 +441,12 @@
                {0xb, "MIDI port (MPU-401)",
                        {0x30,0x60,0x61,0x70,EOT},
                        {0x00,0x03,0x30,0x05,EOT}},
-               {EOT}}},
-       {0x52, "LPC47B37x", {
-               {EOT}}},
-       {0x54, "LPC47U33x", {
+               {EOT}})},
+       {0x52, "LPC47B37x", 
+               LDNDEF({
+               {EOT}})},
+       {0x54, "LPC47U33x", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,0x2a,0x2b,
                         0x2c,0x2d,0x2e,0x2f,EOT},
@@ -459,12 +478,15 @@
                {0xb, "SMBus",
                        {0x30,0x60,0x61,0x70,EOT},
                        {0x00,0x00,0x00,0x00,EOT}},
-               {EOT}}},
-       {0x56, "LPC47B34x", {
-               {EOT}}},
-       {0x57, "LPC47S42x", {
-               {EOT}}},
-       {0x59, "LPC47M10x/112/13x", {
+               {EOT}})},
+       {0x56, "LPC47B34x", 
+               LDNDEF({
+               {EOT}})},
+       {0x57, "LPC47S42x", 
+               LDNDEF({
+               {EOT}})},
+       {0x59, "LPC47M10x/112/13x", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,0x28,0x2a,
                         0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -498,12 +520,15 @@
                {0xb, "MPU-401",
                        {0x30,0x60,0x61,0x70,EOT},
                        {0x00,0x03,0x30,0x05,EOT}},
-               {EOT}}},
-       {0x5d, "LPC47B357", {   /* From sensors-detect (no datasheet) */
-               {EOT}}},
-       {0x5f, "LPC47M14x", {
-               {EOT}}},
-       {0x60, "LPC47M15x/192/997", {
+               {EOT}})},
+       {0x5d, "LPC47B357",     /* From sensors-detect (no datasheet) */
+               LDNDEF({
+               {EOT}})},
+       {0x5f, "LPC47M14x", 
+               LDNDEF({
+               {EOT}})},
+       {0x60, "LPC47M15x/192/997", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,0x28,0x2a,
                         0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -535,21 +560,27 @@
                {0xb, "MPU-401",
                        {0x30,0x60,0x61,0x70,EOT},
                        {0x00,0x03,0x30,0x05,EOT}},
-               {EOT}}},
-       {0x62, "LPC47S45x", {
-               {EOT}}},
-       {0x67, "EMC2700LPC", {  /* From sensors-detect */
-               {EOT}}},
-       {0x6b, "LPC47M292", {   /* From sensors-detect */
-               {EOT}}},
-       {0x6e, "LPC47B387", {   /* TODO: Not yet in sensors-detect */
+               {EOT}})},
+       {0x62, "LPC47S45x", 
+               LDNDEF({
+               {EOT}})},
+       {0x67, "EMC2700LPC",    /* From sensors-detect */
+               LDNDEF({
+               {EOT}})},
+       {0x6b, "LPC47M292",     /* From sensors-detect */
+               LDNDEF({
+               {EOT}})},
+       {0x6e, "LPC47B387",     /* TODO: Not yet in sensors-detect */
                /* Found in the HP Compaq Business Desktop d530 Series */
                /* http://article.gmane.org/gmane.linux.bios/27192 */
                /* We cannot find a public datasheet for this Super I/O. */
-               {EOT}}},
-       {0x6f, "LPC47B397", {
-               {EOT}}},
-       {0x74, "LPC47M182", { /* Only for LD_NUM = 0 */
+               LDNDEF({
+               {EOT}})},
+       {0x6f, "LPC47B397", 
+               LDNDEF({
+               {EOT}})},
+       {0x74, "LPC47M182",  /* Only for LD_NUM = 0 */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x02,0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,
                         0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -584,10 +615,12 @@
                {0xa, "Runtime registers",
                        {0x30,0x60,0x61,0x62,0x63,0xf0,0xf1,0xf2,EOT},
                        {0x00,0x00,0x00,0x00,0x00,NANA,RSVD,0x04,EOT}},
-               {EOT}}},
-       {0x76, "LPC47M584", {   /* From sensors-detect (no datasheet) */
-               {EOT}}},
-       {0x77, "A8000", {       /* ASUS A8000, a rebranded DME1737(?) */
+               {EOT}})},
+       {0x76, "LPC47M584",     /* From sensors-detect (no datasheet) */
+               LDNDEF({
+               {EOT}})},
+       {0x77, "A8000",         /* ASUS A8000, a rebranded DME1737(?) */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,0x28,0x2a,
                         0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -613,8 +646,9 @@
                {0xa, "Runtime registers",
                        {0x30,0x60,0x61,0x62,0x63,0xf0,0xf1,0xf2,EOT},
                        {0x00,0x00,0x00,0x00,0x00,NANA,RSVD,0x04,EOT}},
-               {EOT}}},
-       {0x78, "DME1737", {
+               {EOT}})},
+       {0x78, "DME1737", 
+               LDNDEF({
                {NOLDN, NULL,
                        {0x03,0x20,0x21,0x22,0x23,0x24,0x26,0x27,0x28,0x2a,
                         0x2b,0x2c,0x2d,0x2e,0x2f,EOT},
@@ -640,48 +674,64 @@
                {0xa, "Runtime registers",
                        {0x30,0x60,0x61,0x62,0x63,0xf0,0xf1,0xf2,EOT},
                        {0x00,0x00,0x00,0x00,0x00,NANA,RSVD,0x04,EOT}},
-               {EOT}}},
-       {0x79, "SCH5504", {     /* From sensors-detect (no datasheet) */
-               {EOT}}},
-       {0x7a, "LPC47N217", {   /* Found in Toshiba Satellite A80-117. */
-               {EOT}}},
-       {0x7c, "SCH3112", {
-               {EOT}}},
-       {0x7d, "SCH3114", {
-               {EOT}}},
-       {0x7f, "SCH3116", {
-               {EOT}}},
-       {0x81, "SCH5307", {
-               {EOT}}},
-       {0x83, "SCH5514D", {    /* From sensors-detect */
-               {EOT}}},
-       {0x85, "SCH5317", {     /* From sensors-detect */
+               {EOT}})},
+       {0x79, "SCH5504",       /* From sensors-detect (no datasheet) */
+               LDNDEF({
+               {EOT}})},
+       {0x7a, "LPC47N217",     /* Found in Toshiba Satellite A80-117. */
+               LDNDEF({
+               {EOT}})},
+       {0x7c, "SCH3112", 
+               LDNDEF({
+               {EOT}})},
+       {0x7d, "SCH3114", 
+               LDNDEF({
+               {EOT}})},
+       {0x7f, "SCH3116", 
+               LDNDEF({
+               {EOT}})},
+       {0x81, "SCH5307", 
+               LDNDEF({
+               {EOT}})},
+       {0x83, "SCH5514D",      /* From sensors-detect */
+               LDNDEF({
+               {EOT}})},
+       {0x85, "SCH5317",       /* From sensors-detect */
                /* The SCH5317 can have either 0x85 or 0x8c as device ID. */
-               {EOT}}},
-       {0x86, "SCH5127", {     /* From sensors-detect */
-               {EOT}}},
-       {0x89, "SCH5027", {     /* From sensors-detect (no public datasheet) */
-               {EOT}}},
-       {0x8c, "SCH5317", {     /* From sensors-detect */
+               LDNDEF({
+               {EOT}})},
+       {0x86, "SCH5127",       /* From sensors-detect */
+               LDNDEF({
+               {EOT}})},
+       {0x89, "SCH5027",       /* From sensors-detect (no public datasheet) */
+               LDNDEF({
+               {EOT}})},
+       {0x8c, "SCH5317",       /* From sensors-detect */
                /* The SCH5317 can have either 0x85 or 0x8c as device ID. */
-               {EOT}}},
-       {0x90, "SCH4307", {     /* From sensors-detect */
-               {EOT}}},
+               LDNDEF({
+               {EOT}})},
+       {0x90, "SCH4307",       /* From sensors-detect */
+               LDNDEF({
+               {EOT}})},
 
        /* The following Super I/Os use the 0x0d/0x0e ID registers. */
-       {0x03, "FDC37C669", {
+       {0x03, "FDC37C669", 
                /* Init: 0x55, 0x55. Exit: 0xaa. Ports: 0x3f0/0x370. */
                /* Chiprev: 0x02. */
                /* FIXME: There's another 0x03 but found on port 0x20/0x21! */
-               {EOT}}},
-       {0x04, "FDC37C669FR", { /* TODO: Not yet in sensors-detect. */
+               LDNDEF({
+               {EOT}})},
+       {0x04, "FDC37C669FR",   /* TODO: Not yet in sensors-detect. */
                /* Init: 0x55, 0x55. Exit: 0xaa. Ports: 0x3f0/0x370. */
-               {EOT}}},
-       {0x13, "LPC47N237", {
+               LDNDEF({
+               {EOT}})},
+       {0x13, "LPC47N237", 
                /* Init: 0x55. Exit: 0xaa. Ports: 0x2e/0x4e. */
-               {EOT}}},
-       {0x28, "FDC37N769", {
+               LDNDEF({
+               {EOT}})},
+       {0x28, "FDC37N769", 
                /* Init: 0x55. Exit: 0xaa. Ports: 0x3f0/0x370. */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
                         0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,
@@ -693,12 +743,14 @@
                         NANA,NANA,NANA,0x03,RSVD,RSVD,RSVD,RSVD,RSVD,RSVD,
                         0x80,0x00,0x3c,RSVD,RSVD,0x00,0x00,0x00,0x00,0x00,
                         0x00,0x00,RSVD,0x00,0x00,0x03,0x00,0x00,EOT}},
-               {EOT}}},
-       {0x29, "FDC37N3869/FDC37N869", {
+               {EOT}})},
+       {0x29, "FDC37N3869/FDC37N869", 
                /* Init: 0x55. Exit: 0xaa. Ports: 0x3f0/0x370. */
-               {EOT}}},
-       {0x5a, "LPC47N227", {
+               LDNDEF({
+               {EOT}})},
+       {0x5a, "LPC47N227", 
                /* Init: 0x55. Exit: 0xaa. Ports: 0x2e/0x4e. */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
                         0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,
@@ -712,9 +764,10 @@
                         RSVD,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                         0x00,0x80,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,
                         0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,EOT}},
-               {EOT}}},
-       {0x5b, "SIO10N268", {
+               {EOT}})},
+       {0x5b, "SIO10N268", 
                /* Init: 0x55. Exit: 0xaa. Ports: 0x2e/0x4e. */
+               LDNDEF({
                {NOLDN, NULL,
                        {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
                         0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,
@@ -734,14 +787,16 @@
                         0x00,0x00,0x00,0x00,NANA,NANA,NANA,NANA,NANA,0x50,
                         NANA,0x00,NANA,NANA,NANA,NANA,NANA,NANA,0x00,0x01,
                         0x00,0x01,0x00,0x8c,MISC,EOT}},
-               {EOT}}},
-       {0x65, "FDC37C665GT/IR", {
+               {EOT}})},
+       {0x65, "FDC37C665GT/IR", 
                /* Init: 0x55, 0x55. Exit: 0xaa. Port: 0x3f0. */
                /* Chiprev: 0x02 = FDC37C665GT, 0x82 = FDC37C665IR */
-               {EOT}}},
-       {0x66, "FDC37C666GT", {
+               LDNDEF({
+               {EOT}})},
+       {0x66, "FDC37C666GT", 
                /* Init: 0x55, 0x55. Exit: 0xaa. Port: 0x3f0. Chiprev: 0x02. */
-               {EOT}}},
+               LDNDEF({
+               {EOT}})},
        {EOT}
 };
 
@@ -765,7 +820,9 @@
                                     uint8_t revreg)
 {
        uint8_t id, rev;
+#ifndef LIBSUPERIODETECT
        uint16_t runtime_base;
+#endif /* ! LIBSUPERIODETECT */
        const char *info = (idreg == 0x20) ? "(idregs=0x20/0x21) "
                                           : "(idregs=0x0d/0x0e) ";
 
@@ -788,6 +845,7 @@
               id, rev, port);
        chip_found = 1;
 
+#ifndef LIBSUPERIODETECT
        dump_superio((id == 0x77 ? "ASUS" : "SMSC"), reg_table, port, id,
                     LDN_SEL);
 
@@ -804,6 +862,7 @@
                        printf("No extra registers known for this chip.\n");
                }
        }
+#endif /* ! LIBSUPERIODETECT */
 
        exit_conf_mode_smsc(port);
 }
Index: superiotool_libsuperiodetect/superiotool.h
===================================================================
--- superiotool_libsuperiodetect/superiotool.h  (Revision 5651)
+++ superiotool_libsuperiodetect/superiotool.h  (Arbeitskopie)
@@ -98,14 +98,22 @@
 struct superio_registers {
        int32_t superio_id;             /* Signed, as we need EOT. */
        const char *name;               /* Super I/O name */
+#ifndef LIBSUPERIODETECT
        struct {
                int8_t ldn;
                const char *name;       /* LDN name */
                int16_t idx[IDXSIZE];
                int16_t def[IDXSIZE];
        } ldn[LDNSIZE];
+#endif /* ! LIBSUPERIODETECT */
 };
 
+#ifdef LIBSUPERIODETECT
+#define LDNDEF(...)
+#else /* ! LIBSUPERIODETECT */
+#define LDNDEF(...) __VA_ARGS__
+#endif
+
 /* pci.c */
 #ifdef PCI_SUPPORT
 extern struct pci_access *pacc;
Index: superiotool_libsuperiodetect/Makefile
===================================================================
--- superiotool_libsuperiodetect/Makefile       (Revision 5651)
+++ superiotool_libsuperiodetect/Makefile       (Arbeitskopie)
@@ -30,8 +30,12 @@
           | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/")"'
 
 CFLAGS = -O2 -Wall -Werror -Wstrict-prototypes -Wundef -Wstrict-aliasing \
-         -Werror-implicit-function-declaration -ansi -pedantic $(SVNDEF)
+         -Werror-implicit-function-declaration -std=c99 -pedantic $(SVNDEF)
 
+ifeq ($(CONFIG_LIB), yes)
+CFLAGS += -D'LIBSUPERIODETECT=1'
+endif
+
 OBJS = superiotool.o ali.o fintek.o ite.o nsc.o smsc.o winbond.o
 
 OS_ARCH = $(shell uname)
@@ -44,7 +48,7 @@
 
 ifeq ($(CONFIG_PCI), yes)
 CFLAGS += -DPCI_SUPPORT
-LIBS += -lpci
+LIBS += -lpci -lz
 OBJS += pci.o via.o
 endif
 


-- 
http://www.hailfinger.org/


_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to