BTW, for proper functioning one requires following patches(acually one needs only sc.c.patch and sc.c.patch.1, others are just for sync). Please revew and comment. -- Evgeniy Polyakov ( s0mbre ) Crash is better than data corruption. -- Art Grabowski -------------- next part -------------- A non-text attachment was scrubbed... Name: chain.c.patch Type: text/x-patch Size: 176 bytes Desc: not available Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040830/234920f5/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: sc.c.patch Type: text/x-patch Size: 213 bytes Desc: not available Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040830/234920f5/attachment-0001.bin -------------- next part -------------- --- orig/sc.c +++ mod/sc.c @@ -82,7 +82,7 @@ { int err; struct logical_dev *ldev; - struct dev_chain *ch, *lch; + struct dev_chain *ch, *lch, *_ch; err = 0; @@ -92,7 +92,7 @@ err = -ENOMEM; goto err_out; } - + lch = chain_alloc(__ldev); if (!lch) { @@ -100,12 +100,11 @@ goto err_out_free_chain; } - spin_lock(&dev->chain_lock); - list_for_each_entry(ch, &dev->chain_list, chain_entry) + list_for_each_entry(_ch, &dev->chain_list, chain_entry) { - ldev = ch->ptr; + ldev = _ch->ptr; if (!strncmp(ldev->name, __ldev->name, SC_NAME_LEN)) { @@ -139,6 +138,7 @@ spin_lock(&__ldev->chain_lock); atomic_inc(&__ldev->refcnt); list_add_tail(&ch->chain_entry, &__ldev->chain_list); + spin_unlock(&__ldev->chain_lock); atomic_inc(&dev->refcnt); @@ -343,7 +343,7 @@ { if (!strncmp(sdev->name, __sdev->name, SC_NAME_LEN)) { - list_del(&__sdev->sdev_entry); + list_del(&sdev->sdev_entry); } break; } @@ -375,8 +375,8 @@ { printk(KERN_INFO "Deactivating logical device %s from SuperIO chip %s.\n", ldev->name, dev->name); - if (sdev->deactivate_one) - sdev->deactivate_one(ldev); + if (dev->deactivate_one) + dev->deactivate_one(ldev); } /* @@ -390,7 +390,6 @@ ldev->pdev = dev; err = dev->activate_one(ldev); - return err; } -------------- next part -------------- A non-text attachment was scrubbed... Name: sc_gpio.c.patch Type: text/x-patch Size: 399 bytes Desc: not available Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040830/234920f5/attachment-0002.bin -------------- next part -------------- --- orig/sc_gpio.c +++ mod/sc_gpio.c @@ -84,14 +84,13 @@ for (i=0; i<SIO_GPIO_NPINS; ++i) { - gpin[i].flags = 0; - gpin[i].mask &= ~(SIO_GPIO_CONF_OUTPUTEN | SIO_GPIO_CONF_PUSHPULL | - SIO_GPIO_CONF_PULLUP | SIO_GPIO_CONF_DEBOUNCE); + gpin[i].flags = SIO_GPIO_CONF_PULLUP; + gpin[i].mask &= ~(SIO_GPIO_CONF_DEBOUNCE); - sc_gpio_control(ldev, i, gpin[i].mask, gpin[i].flags); + //sc_gpio_control(ldev, i, gpin[i].mask, gpin[i].flags); - gpin[i].state = GPIO_PIN_HIGH; - sc_gpio_write(ldev, i, gpin[i].state); + //gpin[i].state = GPIO_PIN_HIGH; + //sc_gpio_write(ldev, i, gpin[i].state); } return 0; @@ -103,8 +102,6 @@ int port, pin; u8 val, reg = SIO_GPDI0; - sc_gpio_control(ldev, pin_number, ~(SIO_GPIO_CONF_OUTPUTEN | SIO_GPIO_CONF_PUSHPULL | SIO_GPIO_CONF_PULLUP), 0); - port = pin_number >> 3; pin = pin_number - (pin_number & (~7)); @@ -126,6 +123,8 @@ val = inb(ldev->base_addr + reg); + //printk("R: %02x [%d]\n", val, ((val>>pin)&1)); + return ((val >> pin) & 0x01) ; } @@ -133,7 +132,7 @@ { struct logical_dev *ldev = (struct logical_dev *)data; int port, pin; - u8 val, reg = SIO_GPDO0; + u8 val, reg = SIO_GPDO0, rreg = SIO_GPDI0; port = pin_number >> 3; pin = pin_number - (pin_number & (~7)); @@ -142,27 +141,32 @@ { case 0: reg = SIO_GPDO0; + rreg = SIO_GPDI0; break; case 1: reg = SIO_GPDO1; + rreg = SIO_GPDI1; break; case 2: reg = SIO_GPDO2; + rreg = SIO_GPDI2; break; case 3: reg = SIO_GPDO3; + rreg = SIO_GPDI3; break; } - val = inb(ldev->base_addr + reg); + //val = inb(ldev->base_addr + reg); + val = inb(ldev->base_addr + rreg); if (byte) val |= (1 << pin); else val &= ~(1 << pin); - sc_gpio_control(ldev, pin_number, ~0, - SIO_GPIO_CONF_OUTPUTEN); + //printk("W: %02x [%d]\n", val, ((val>>pin)&1)); + outb(val, ldev->base_addr + reg); } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040830/234920f5/attachment-0003.bin