--- linux-old/Documentation/i2c/dev-interface Mon Mar 25 15:25:33 CET 2002 +++ linux/Documentation/i2c/dev-interface Mon Mar 25 15:25:33 CET 2002 --- linux-old/Documentation/i2c/functionality Mon Mar 25 15:25:33 CET 2002 +++ linux/Documentation/i2c/functionality Mon Mar 25 15:25:33 CET 2002 --- linux-old/Documentation/i2c/i2c-protocol Mon Mar 25 15:25:33 CET 2002 +++ linux/Documentation/i2c/i2c-protocol Mon Mar 25 15:25:33 CET 2002 --- linux-old/Documentation/i2c/i2c-velleman Mon Mar 25 15:25:33 CET 2002 +++ linux/Documentation/i2c/i2c-velleman Mon Mar 25 15:25:33 CET 2002 @@ -0,0 +1,27 @@ +i2c-velleman driver +------------------- +This is a driver for i2c-hw access for Velleman K9000 and other adapters. + +Useful links +------------ +Velleman: + http://www.velleman.be/ + +Velleman K8000 Howto: + http://howto.htlw16.ac.at/k8000-howto.html + + +K8000 and K8005 libraries +------------------------- +The project has lead to new libs for the Velleman K8000 and K8005.. +LIBK8000 v1.99.1 and LIBK8005 v0.21 + +With these libs you can control the K8000 and K8005 with the original +simple commands which are in the original Velleman software. +Like SetIOchannel, ReadADchannel, SendStepCCWFull and many more. +Via i2c kernel device /dev/velleman + +The libs can be found on http://groups.yahoo.com/group/k8000/files/linux/ + +The Velleman K8000 interface card on http://www.velleman.be/kits/k8000.htm +The Velleman K8005 steppermotorcard on http://www.velleman.be/kits/k8005.htm --- linux-old/Documentation/i2c/proc-interface Mon Mar 25 15:25:33 CET 2002 +++ linux/Documentation/i2c/proc-interface Mon Mar 25 15:25:33 CET 2002 --- linux-old/Documentation/i2c/smbus-protocol Mon Mar 25 15:25:33 CET 2002 +++ linux/Documentation/i2c/smbus-protocol Mon Mar 25 15:25:33 CET 2002 @@ -1,2 +1,9 @@ +SMBus Protocol Summary +====================== +The following is a summary of the SMBus protocol. It applies to +all revisions of the protocol (1.0, 1.1, and 2.0). +Certain protocol features which are not supported by +this package are briefly described at the end of this document. + Some adapters understand only the SMBus (System Management Bus) protocol, which is a subset from the I2C protocol. Fortunately, many devices use @@ -126,2 +133,22 @@ S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P + + +Packet Error Checking (PEC) +=========================== +Packet Error Checking was introduced in Revision 1.1 of the specification. +It is optional, and is not supported by the Linux kernel (this package) +at the present time. + +PEC adds a CRC-8 error-checking byte to all transfers. + + +Address Resolution Protocol (ARP) +================================= +The Address Resolution Protocol was introduced in Revision 2.0 of +the specification. It is optional, and is not supported by the +Linux kernel (this package) at the present time. + +ARP adds device enumeration and dynamic address assignment to +the protocol. All ARP communications use slave address 0x61 and +require PEC checksums. --- linux-old/Documentation/i2c/summary Mon Mar 25 15:25:33 CET 2002 +++ linux/Documentation/i2c/summary Mon Mar 25 15:25:33 CET 2002 @@ -67,5 +67,5 @@ i2c-elektor: Elektor ISA card (uses i2c-algo-pcf) i2c-elv: ELV parallel port adapter (uses i2c-algo-bit) -i2c-pcf-epp: PCF8584 on a EPP parallel port (uses i2c-algo-pcf) (BROKEN - missing i2c-pcf-epp.h) +i2c-pcf-epp: PCF8584 on a EPP parallel port (uses i2c-algo-pcf) (NOT mkpatched) i2c-philips-par: Philips style parallel port adapter (uses i2c-algo-bit) i2c-ppc405: IBM 405xx processor I2C device (uses i2c-algo-ppc405) (NOT BUILT BY DEFAULT) --- linux-old/Documentation/i2c/ten-bit-addresses Mon Mar 25 15:25:33 CET 2002 +++ linux/Documentation/i2c/ten-bit-addresses Mon Mar 25 15:25:33 CET 2002 --- linux-old/Documentation/i2c/writing-clients Mon Mar 25 15:25:34 CET 2002 +++ linux/Documentation/i2c/writing-clients Mon Mar 25 15:25:34 CET 2002 @@ -366,5 +366,5 @@ The detect client function is called by i2c_probe or i2c_detect. The `kind' parameter contains 0 if this call is due to a `force' -parameter, and 0 otherwise (for i2c_detect, it contains 0 if +parameter, and -1 otherwise (for i2c_detect, it contains 0 if this call is due to the generic `force' parameter, and the chip type number if it is due to a specific `force' parameter). --- linux-old/drivers/i2c/i2c-algo-bit.c Mon Mar 25 15:25:34 CET 2002 +++ linux/drivers/i2c/i2c-algo-bit.c Mon Mar 25 15:25:34 CET 2002 @@ -22,5 +22,5 @@ Frodo Looijaard */ -/* $Id: i2c-algo-bit.c,v 1.30 2001/07/29 02:44:25 mds Exp $ */ +/* $Id: i2c-algo-bit.c,v 1.34 2001/11/19 18:45:02 mds Exp $ */ #include @@ -34,5 +34,4 @@ #include #include - #include #include @@ -124,5 +123,5 @@ schedule(); } - DEBSTAT(printk("needed %ld jiffies\n", jiffies-start)); + DEBSTAT(printk(KERN_DEBUG "needed %ld jiffies\n", jiffies-start)); #ifdef SLO_IO SLO_IO @@ -180,10 +179,10 @@ /* assert: scl is low */ - DEB2(printk(" i2c_outb:%2.2X\n",c&0xff)); + DEB2(printk(KERN_DEBUG " i2c_outb:%2.2X\n",c&0xff)); for ( i=7 ; i>=0 ; i-- ) { sb = c & ( 1 << i ); setsda(adap,sb); udelay(adap->udelay); - DEBPROTO(printk("%d",sb!=0)); + DEBPROTO(printk(KERN_DEBUG "%d",sb!=0)); if (sclhi(adap)<0) { /* timed out */ sdahi(adap); /* we don't want to block the net */ @@ -202,8 +201,8 @@ /* read ack: SDA should be pulled down by slave */ ack=getsda(adap); /* ack: sda is pulled low ->success. */ - DEB2(printk(" i2c_outb: getsda() = 0x%2.2x\n", ~ack )); + DEB2(printk(KERN_DEBUG " i2c_outb: getsda() = 0x%2.2x\n", ~ack )); - DEBPROTO( printk("[%2.2x]",c&0xff) ); - DEBPROTO(if (0==ack){ printk(" A ");} else printk(" NA ") ); + DEBPROTO( printk(KERN_DEBUG "[%2.2x]",c&0xff) ); + DEBPROTO(if (0==ack){ printk(KERN_DEBUG " A ");} else printk(KERN_DEBUG " NA ") ); scllo(adap); return 0==ack; /* return 1 if device acked */ @@ -221,5 +220,5 @@ /* assert: scl is low */ - DEB2(printk("i2c_inb.\n")); + DEB2(printk(KERN_DEBUG "i2c_inb.\n")); sdahi(adap); @@ -234,5 +233,5 @@ } /* assert: scl is low */ - DEBPROTO(printk(" %2.2x", indata & 0xff)); + DEBPROTO(printk(KERN_DEBUG " %2.2x", indata & 0xff)); return (int) (indata & 0xff); } @@ -246,67 +245,67 @@ sda=getsda(adap); if (adap->getscl==NULL) { - printk("i2c-algo-bit.o: Warning: Adapter can't read from clock line - skipping test.\n"); + printk(KERN_WARNING "i2c-algo-bit.o: Warning: Adapter can't read from clock line - skipping test.\n"); return 0; } scl=getscl(adap); - printk("i2c-algo-bit.o: Adapter: %s scl: %d sda: %d -- testing...\n", + printk(KERN_INFO "i2c-algo-bit.o: Adapter: %s scl: %d sda: %d -- testing...\n", name,getscl(adap),getsda(adap)); if (!scl || !sda ) { - printk("i2c-algo-bit.o: %s seems to be busy.\n",name); + printk(KERN_INFO " i2c-algo-bit.o: %s seems to be busy.\n",name); goto bailout; } sdalo(adap); - printk("i2c-algo-bit.o:1 scl: %d sda: %d \n",getscl(adap), + printk(KERN_DEBUG "i2c-algo-bit.o:1 scl: %d sda: %d \n",getscl(adap), getsda(adap)); if ( 0 != getsda(adap) ) { - printk("i2c-algo-bit.o: %s SDA stuck high!\n",name); + printk(KERN_WARNING "i2c-algo-bit.o: %s SDA stuck high!\n",name); sdahi(adap); goto bailout; } if ( 0 == getscl(adap) ) { - printk("i2c-algo-bit.o: %s SCL unexpected low while pulling SDA low!\n", + printk(KERN_WARNING "i2c-algo-bit.o: %s SCL unexpected low while pulling SDA low!\n", name); goto bailout; } sdahi(adap); - printk("i2c-algo-bit.o:2 scl: %d sda: %d \n",getscl(adap), + printk(KERN_DEBUG "i2c-algo-bit.o:2 scl: %d sda: %d \n",getscl(adap), getsda(adap)); if ( 0 == getsda(adap) ) { - printk("i2c-algo-bit.o: %s SDA stuck low!\n",name); + printk(KERN_WARNING "i2c-algo-bit.o: %s SDA stuck low!\n",name); sdahi(adap); goto bailout; } if ( 0 == getscl(adap) ) { - printk("i2c-algo-bit.o: %s SCL unexpected low while SDA high!\n", + printk(KERN_WARNING "i2c-algo-bit.o: %s SCL unexpected low while SDA high!\n", name); goto bailout; } scllo(adap); - printk("i2c-algo-bit.o:3 scl: %d sda: %d \n",getscl(adap), + printk(KERN_DEBUG "i2c-algo-bit.o:3 scl: %d sda: %d \n",getscl(adap), getsda(adap)); if ( 0 != getscl(adap) ) { - printk("i2c-algo-bit.o: %s SCL stuck high!\n",name); + printk(KERN_WARNING "i2c-algo-bit.o: %s SCL stuck high!\n",name); sclhi(adap); goto bailout; } if ( 0 == getsda(adap) ) { - printk("i2c-algo-bit.o: %s SDA unexpected low while pulling SCL low!\n", + printk(KERN_WARNING "i2c-algo-bit.o: %s SDA unexpected low while pulling SCL low!\n", name); goto bailout; } sclhi(adap); - printk("i2c-algo-bit.o:4 scl: %d sda: %d \n",getscl(adap), + printk(KERN_DEBUG "i2c-algo-bit.o:4 scl: %d sda: %d \n",getscl(adap), getsda(adap)); if ( 0 == getscl(adap) ) { - printk("i2c-algo-bit.o: %s SCL stuck low!\n",name); + printk(KERN_WARNING "i2c-algo-bit.o: %s SCL stuck low!\n",name); sclhi(adap); goto bailout; } if ( 0 == getsda(adap) ) { - printk("i2c-algo-bit.o: %s SDA unexpected low while SCL high!\n", + printk(KERN_WARNING "i2c-algo-bit.o: %s SDA unexpected low while SCL high!\n", name); goto bailout; } - printk("i2c-algo-bit.o: %s passed test.\n",name); + printk(KERN_INFO "i2c-algo-bit.o: %s passed test.\n",name); return 0; bailout: @@ -342,5 +341,5 @@ udelay(adap->udelay); } - DEB2(if (i) printk("i2c-algo-bit.o: needed %d retries for %d\n", + DEB2(if (i) printk(KERN_DEBUG "i2c-algo-bit.o: needed %d retries for %d\n", i,addr)); return ret; @@ -357,5 +356,5 @@ while (count > 0) { c = *temp; - DEB2(printk("i2c-algo-bit.o: %s i2c_write: writing %2.2X\n", + DEB2(printk(KERN_DEBUG "i2c-algo-bit.o: %s i2c_write: writing %2.2X\n", i2c_adap->name, c&0xff)); retval = i2c_outb(i2c_adap,c); @@ -365,5 +364,5 @@ wrcount++; } else { /* arbitration or no acknowledge */ - printk("i2c-algo-bit.o: %s i2c_write: error - bailout.\n", + printk(KERN_ERR "i2c-algo-bit.o: %s i2c_write: error - bailout.\n", i2c_adap->name); i2c_stop(adap); @@ -393,5 +392,5 @@ rdcount++; } else { /* read timed out */ - printk("i2c-algo-bit.o: i2c_read: i2c_inb timed out.\n"); + printk(KERN_ERR "i2c-algo-bit.o: i2c_read: i2c_inb timed out.\n"); break; } @@ -406,5 +405,5 @@ if (sclhi(adap)<0) { /* timeout */ sdahi(adap); - printk("i2c-algo-bit.o: i2c_read: Timeout at ack\n"); + printk(KERN_ERR "i2c-algo-bit.o: i2c_read: Timeout at ack\n"); return -ETIMEDOUT; }; @@ -436,9 +435,9 @@ /* a ten bit address */ addr = 0xf0 | (( msg->addr >> 7) & 0x03); - DEB2(printk("addr0: %d\n",addr)); + DEB2(printk(KERN_DEBUG "addr0: %d\n",addr)); /* try extended address code...*/ ret = try_address(i2c_adap, addr, retries); if (ret!=1) { - printk("died at extended address code.\n"); + printk(KERN_ERR "died at extended address code.\n"); return -EREMOTEIO; } @@ -447,5 +446,5 @@ if (ret != 1) { /* the chip did not ack / xmission error occurred */ - printk("died at 2nd address code.\n"); + printk(KERN_ERR "died at 2nd address code.\n"); return -EREMOTEIO; } @@ -456,5 +455,5 @@ ret = try_address(i2c_adap, addr, retries); if (ret!=1) { - printk("died at extended address code.\n"); + printk(KERN_ERR "died at extended address code.\n"); return -EREMOTEIO; } @@ -491,5 +490,5 @@ ret = bit_doAddress(i2c_adap,pmsg,i2c_adap->retries); if (ret != 0) { - DEB2(printk("i2c-algo-bit.o: NAK from device adr %#2x msg #%d\n" + DEB2(printk(KERN_DEBUG "i2c-algo-bit.o: NAK from device adr %#2x msg #%d\n" ,msgs[i].addr,i)); return (ret<0) ? ret : -EREMOTEIO; @@ -499,5 +498,5 @@ /* read bytes into buffer*/ ret = readbytes(i2c_adap,pmsg->buf,pmsg->len); - DEB2(printk("i2c-algo-bit.o: read %d bytes.\n",ret)); + DEB2(printk(KERN_DEBUG "i2c-algo-bit.o: read %d bytes.\n",ret)); if (ret < pmsg->len ) { return (ret<0)? ret : -EREMOTEIO; @@ -506,5 +505,5 @@ /* write bytes from buffer */ ret = sendbytes(i2c_adap,pmsg->buf,pmsg->len); - DEB2(printk("i2c-algo-bit.o: wrote %d bytes.\n",ret)); + DEB2(printk(KERN_DEBUG "i2c-algo-bit.o: wrote %d bytes.\n",ret)); if (ret < pmsg->len ) { return (ret<0) ? ret : -EREMOTEIO; @@ -556,5 +555,5 @@ } - DEB2(printk("i2c-algo-bit.o: hw routines for %s registered.\n", + DEB2(printk(KERN_DEBUG "i2c-algo-bit.o: hw routines for %s registered.\n", adap->name)); @@ -600,5 +599,5 @@ return res; - DEB2(printk("i2c-algo-bit.o: adapter unregistered: %s\n",adap->name)); + DEB2(printk(KERN_DEBUG "i2c-algo-bit.o: adapter unregistered: %s\n",adap->name)); #ifdef MODULE @@ -610,5 +609,5 @@ int __init i2c_algo_bit_init (void) { - printk("i2c-algo-bit.o: i2c bit algorithm module\n"); + printk(KERN_INFO "i2c-algo-bit.o: i2c bit algorithm module version %s (%s)\n", I2C_VERSION, I2C_DATE); return 0; } @@ -622,5 +621,7 @@ MODULE_AUTHOR("Simon G. Vogl "); MODULE_DESCRIPTION("I2C-Bus bit-banging algorithm"); +#ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); +#endif MODULE_PARM(bit_test, "i"); --- linux-old/include/linux/i2c-algo-bit.h Mon Mar 25 15:25:34 CET 2002 +++ linux/include/linux/i2c-algo-bit.h Mon Mar 25 15:25:34 CET 2002 --- linux-old/drivers/i2c/i2c-algo-pcf.c Mon Mar 25 15:25:35 CET 2002 +++ linux/drivers/i2c/i2c-algo-pcf.c Mon Mar 25 15:25:35 CET 2002 @@ -38,5 +38,4 @@ #include #include - #include #include @@ -100,5 +99,5 @@ #endif if (timeout <= 0) { - printk("Timeout waiting for Bus Busy\n"); + printk(KERN_ERR "Timeout waiting for Bus Busy\n"); } @@ -145,5 +144,5 @@ unsigned char temp; - DEB3(printk("i2c-algo-pcf.o: PCF state 0x%02x\n", get_pcf(adap, 1))); + DEB3(printk(KERN_DEBUG "i2c-algo-pcf.o: PCF state 0x%02x\n", get_pcf(adap, 1))); /* S1=0x80: S0 selected, serial interface off */ @@ -151,7 +150,6 @@ /* check to see S1 now used as R/W ctrl - PCF8584 does that when ESO is zero */ - /* PCF also resets PIN bit */ - if ((temp = get_pcf(adap, 1)) != (0)) { - DEB2(printk("i2c-algo-pcf.o: PCF detection failed -- can't select S0 (0x%02x).\n", temp)); + if (((temp = get_pcf(adap, 1)) & 0x7f) != (0)) { + DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S0 (0x%02x).\n", temp)); return -ENXIO; /* definetly not PCF8584 */ } @@ -161,5 +159,5 @@ /* check it's realy writen */ if ((temp = i2c_inb(adap)) != get_own(adap)) { - DEB2(printk("i2c-algo-pcf.o: PCF detection failed -- can't set S0 (0x%02x).\n", temp)); + DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't set S0 (0x%02x).\n", temp)); return -ENXIO; } @@ -168,6 +166,6 @@ set_pcf(adap, 1, I2C_PCF_PIN | I2C_PCF_ES1); /* check to see S2 now selected */ - if ((temp = get_pcf(adap, 1)) != I2C_PCF_ES1) { - DEB2(printk("i2c-algo-pcf.o: PCF detection failed -- can't select S2 (0x%02x).\n", temp)); + if (((temp = get_pcf(adap, 1)) & 0x7f) != I2C_PCF_ES1) { + DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S2 (0x%02x).\n", temp)); return -ENXIO; } @@ -177,5 +175,5 @@ /* check it's realy writen, the only 5 lowest bits does matter */ if (((temp = i2c_inb(adap)) & 0x1f) != get_clock(adap)) { - DEB2(printk("i2c-algo-pcf.o: PCF detection failed -- can't set S2 (0x%02x).\n", temp)); + DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't set S2 (0x%02x).\n", temp)); return -ENXIO; } @@ -186,9 +184,9 @@ /* check to see PCF is realy idled and we can access status register */ if ((temp = get_pcf(adap, 1)) != (I2C_PCF_PIN | I2C_PCF_BB)) { - DEB2(printk("i2c-algo-pcf.o: PCF detection failed -- can't select S1` (0x%02x).\n", temp)); + DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S1` (0x%02x).\n", temp)); return -ENXIO; } - printk("i2c-algo-pcf.o: deteted and initialized PCF8584.\n"); + printk(KERN_DEBUG "i2c-algo-pcf.o: deteted and initialized PCF8584.\n"); return 0; @@ -216,5 +214,5 @@ udelay(adap->udelay); } - DEB2(if (i) printk("i2c-algo-pcf.o: needed %d retries for %d\n",i, + DEB2(if (i) printk(KERN_DEBUG "i2c-algo-pcf.o: needed %d retries for %d\n",i, addr)); return ret; @@ -229,5 +227,5 @@ for (wrcount=0; wrcountname, buf[wrcount]&0xff)); i2c_outb(adap, buf[wrcount]); @@ -235,5 +233,5 @@ if (timeout) { i2c_stop(adap); - printk("i2c-algo-pcf.o: %s i2c_write: " + printk(KERN_ERR "i2c-algo-pcf.o: %s i2c_write: " "error - timeout.\n", i2c_adap->name); return -EREMOTEIO; /* got a better one ?? */ @@ -242,5 +240,5 @@ if (status & I2C_PCF_LRB) { i2c_stop(adap); - printk("i2c-algo-pcf.o: %s i2c_write: " + printk(KERN_ERR "i2c-algo-pcf.o: %s i2c_write: " "error - no ack.\n", i2c_adap->name); return -EREMOTEIO; /* got a better one ?? */ @@ -270,5 +268,5 @@ if (wait_for_pin(adap, &status)) { i2c_stop(adap); - printk("i2c-algo-pcf.o: pcf_readbytes timed out.\n"); + printk(KERN_ERR "i2c-algo-pcf.o: pcf_readbytes timed out.\n"); return (-1); } @@ -277,5 +275,5 @@ if ((status & I2C_PCF_LRB) && (i != count)) { i2c_stop(adap); - printk("i2c-algo-pcf.o: i2c_read: i2c_inb, No ack.\n"); + printk(KERN_ERR "i2c-algo-pcf.o: i2c_read: i2c_inb, No ack.\n"); return (-1); } @@ -313,9 +311,9 @@ /* a ten bit address */ addr = 0xf0 | (( msg->addr >> 7) & 0x03); - DEB2(printk("addr0: %d\n",addr)); + DEB2(printk(KERN_DEBUG "addr0: %d\n",addr)); /* try extended address code...*/ ret = try_address(adap, addr, retries); if (ret!=1) { - printk("died at extended address code.\n"); + printk(KERN_ERR "died at extended address code.\n"); return -EREMOTEIO; } @@ -324,5 +322,5 @@ /* Status check comes here */ if (ret != 1) { - printk("died at 2nd address code.\n"); + printk(KERN_ERR "died at 2nd address code.\n"); return -EREMOTEIO; } @@ -333,5 +331,5 @@ ret = try_address(adap, addr, retries); if (ret!=1) { - printk("died at extended address code.\n"); + printk(KERN_ERR "died at extended address code.\n"); return -EREMOTEIO; } @@ -361,5 +359,5 @@ timeout = wait_for_bb(adap); if (timeout) { - DEB2(printk("i2c-algo-pcf.o: " + DEB2(printk(KERN_ERR "i2c-algo-pcf.o: " "Timeout waiting for BB in pcf_xfer\n");) return -EIO; @@ -369,5 +367,5 @@ pmsg = &msgs[i]; - DEB2(printk("i2c-algo-pcf.o: Doing %s %d bytes to 0x%02x - %d of %d messages\n", + DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: Doing %s %d bytes to 0x%02x - %d of %d messages\n", pmsg->flags & I2C_M_RD ? "read" : "write", pmsg->len, pmsg->addr, i + 1, num);) @@ -384,5 +382,5 @@ if (timeout) { i2c_stop(adap); - DEB2(printk("i2c-algo-pcf.o: Timeout waiting " + DEB2(printk(KERN_ERR "i2c-algo-pcf.o: Timeout waiting " "for PIN(1) in pcf_xfer\n");) return (-EREMOTEIO); @@ -393,10 +391,10 @@ if (status & I2C_PCF_LRB) { i2c_stop(adap); - DEB2(printk("i2c-algo-pcf.o: No LRB(1) in pcf_xfer\n");) + DEB2(printk(KERN_ERR "i2c-algo-pcf.o: No LRB(1) in pcf_xfer\n");) return (-EREMOTEIO); } #endif - DEB3(printk("i2c-algo-pcf.o: Msg %d, addr=0x%x, flags=0x%x, len=%d\n", + DEB3(printk(KERN_DEBUG "i2c-algo-pcf.o: Msg %d, addr=0x%x, flags=0x%x, len=%d\n", i, msgs[i].addr, msgs[i].flags, msgs[i].len);) @@ -408,8 +406,8 @@ if (ret != pmsg->len) { - DEB2(printk("i2c-algo-pcf.o: fail: " + DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: fail: " "only read %d bytes.\n",ret)); } else { - DEB2(printk("i2c-algo-pcf.o: read %d bytes.\n",ret)); + DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: read %d bytes.\n",ret)); } } else { /* Write */ @@ -418,8 +416,8 @@ if (ret != pmsg->len) { - DEB2(printk("i2c-algo-pcf.o: fail: " + DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: fail: " "only wrote %d bytes.\n",ret)); } else { - DEB2(printk("i2c-algo-pcf.o: wrote %d bytes.\n",ret)); + DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: wrote %d bytes.\n",ret)); } } @@ -462,5 +460,5 @@ struct i2c_algo_pcf_data *pcf_adap = adap->algo_data; - DEB2(printk("i2c-algo-pcf.o: hw routines for %s registered.\n", + DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: hw routines for %s registered.\n", adap->name)); @@ -515,5 +513,5 @@ if ((res = i2c_del_adapter(adap)) < 0) return res; - DEB2(printk("i2c-algo-pcf.o: adapter unregistered: %s\n",adap->name)); + DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: adapter unregistered: %s\n",adap->name)); #ifdef MODULE @@ -525,5 +523,5 @@ int __init i2c_algo_pcf_init (void) { - printk("i2c-algo-pcf.o: i2c pcf8584 algorithm module\n"); + printk(KERN_INFO "i2c-algo-pcf.o: i2c pcf8584 algorithm module version %s (%s)\n", I2C_VERSION, I2C_DATE); return 0; } @@ -536,5 +534,7 @@ MODULE_AUTHOR("Hans Berglund "); MODULE_DESCRIPTION("I2C-Bus PCF8584 algorithm"); +#ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); +#endif MODULE_PARM(pcf_scan, "i"); --- linux-old/include/linux/i2c-algo-pcf.h Mon Mar 25 15:25:35 CET 2002 +++ linux/include/linux/i2c-algo-pcf.h Mon Mar 25 15:25:35 CET 2002 --- linux-old/drivers/i2c/i2c-core.c Mon Mar 25 15:25:36 CET 2002 +++ linux/drivers/i2c/i2c-core.c Mon Mar 25 15:25:36 CET 2002 @@ -21,5 +21,5 @@ All SMBus-related things are written by Frodo Looijaard */ -/* $Id: i2c-core.c,v 1.64 2001/08/13 01:35:56 mds Exp $ */ +/* $Id: i2c-core.c,v 1.73 2002/03/03 17:37:44 mds Exp $ */ #include @@ -29,5 +29,4 @@ #include #include - #include @@ -37,5 +36,5 @@ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif @@ -73,5 +72,5 @@ /**** debug level */ -static int i2c_debug=1; +static int i2c_debug=0; /* --------------------------------------------------- @@ -159,5 +158,5 @@ proc_entry = create_proc_entry(name,0,proc_bus); if (! proc_entry) { - printk("i2c-core.o: Could not create /proc/bus/%s\n", + printk(KERN_ERR "i2c-core.o: Could not create /proc/bus/%s\n", name); res = -ENOENT; @@ -189,5 +188,5 @@ DRV_UNLOCK(); - DEB(printk("i2c-core.o: adapter %s registered as adapter %d.\n", + DEB(printk(KERN_DEBUG "i2c-core.o: adapter %s registered as adapter %d.\n", adap->name,i)); @@ -215,5 +214,5 @@ break; if (I2C_ADAP_MAX == i) { - printk( "i2c-core.o: unregister_adapter adap [%s] not found.\n", + printk( KERN_WARNING "i2c-core.o: unregister_adapter adap [%s] not found.\n", adap->name); res = -ENODEV; @@ -230,5 +229,5 @@ if (drivers[j] && (drivers[j]->flags & I2C_DF_DUMMY)) if ((res = drivers[j]->attach_adapter(adap))) { - printk("i2c-core.o: can't detach adapter %s " + printk(KERN_WARNING "i2c-core.o: can't detach adapter %s " "while detaching driver %s: driver not " "detached!",adap->name,drivers[j]->name); @@ -248,5 +247,5 @@ */ if ((res=client->driver->detach_client(client))) { - printk("i2c-core.o: adapter %s not " + printk(KERN_ERR "i2c-core.o: adapter %s not " "unregistered, because client at " "address %02x can't be detached. ", @@ -267,5 +266,5 @@ ADAP_UNLOCK(); - DEB(printk("i2c-core.o: adapter unregistered: %s\n",adap->name)); + DEB(printk(KERN_DEBUG "i2c-core.o: adapter unregistered: %s\n",adap->name)); return 0; @@ -306,5 +305,5 @@ DRV_UNLOCK(); /* driver was successfully added */ - DEB(printk("i2c-core.o: driver %s registered.\n",driver->name)); + DEB(printk(KERN_DEBUG "i2c-core.o: driver %s registered.\n",driver->name)); ADAP_LOCK(); @@ -341,5 +340,5 @@ * afterwards. */ - DEB2(printk("i2c-core.o: unregister_driver - looking for clients.\n")); + DEB2(printk(KERN_DEBUG "i2c-core.o: unregister_driver - looking for clients.\n")); /* removing clients does not depend on the notify flag, else * invalid operation might (will!) result, when using stale client @@ -351,5 +350,5 @@ if (adap == NULL) /* skip empty entries. */ continue; - DEB2(printk("i2c-core.o: examining adapter %s:\n", + DEB2(printk(KERN_DEBUG "i2c-core.o: examining adapter %s:\n", adap->name)); if (driver->flags & I2C_DF_DUMMY) { @@ -360,5 +359,5 @@ */ if ((res = driver->attach_adapter(adap))) { - printk("i2c-core.o: while unregistering " + printk(KERN_WARNING "i2c-core.o: while unregistering " "dummy driver %s, adapter %s could " "not be detached properly; driver " @@ -373,5 +372,5 @@ if (client != NULL && client->driver == driver) { - DEB2(printk("i2c-core.o: " + DEB2(printk(KERN_DEBUG "i2c-core.o: " "detaching client %s:\n", client->name)); @@ -379,11 +378,9 @@ detach_client(client))) { - printk("i2c-core.o: while " + printk(KERN_ERR "i2c-core.o: while " "unregistering driver " "`%s', the client at " - "address %02x of - adapter `%s' could not - be detached; driver - not unloaded!", + "address %02x of adapter `%s' could not be " + "detached; driver not unloaded!", driver->name, client->addr, @@ -401,5 +398,5 @@ DRV_UNLOCK(); - DEB(printk("i2c-core.o: driver unregistered: %s\n",driver->name)); + DEB(printk(KERN_DEBUG "i2c-core.o: driver unregistered: %s\n",driver->name)); return 0; } @@ -437,8 +434,8 @@ if (adapter->client_register) if (adapter->client_register(client)) - printk("i2c-core.o: warning: client_register seems " + printk(KERN_DEBUG "i2c-core.o: warning: client_register seems " "to have failed for client %02x at adapter %s\n", client->addr,adapter->name); - DEB(printk("i2c-core.o: client [%s] registered to adapter [%s](pos. %d).\n", + DEB(printk(KERN_DEBUG "i2c-core.o: client [%s] registered to adapter [%s](pos. %d).\n", client->name, adapter->name,i)); @@ -471,5 +468,5 @@ if (adapter->client_unregister != NULL) if ((res = adapter->client_unregister(client))) { - printk("i2c-core.o: client_unregister [%s] failed, " + printk(KERN_ERR "i2c-core.o: client_unregister [%s] failed, " "client not detached",client->name); return res; @@ -479,5 +476,5 @@ adapter->client_count--; - DEB(printk("i2c-core.o: client [%s] unregistered.\n",client->name)); + DEB(printk(KERN_DEBUG "i2c-core.o: client [%s] unregistered.\n",client->name)); return 0; } @@ -660,10 +657,10 @@ int order[I2C_CLIENT_MAX]; - if (count > 4000) + if (count > 4096) return -EINVAL; len_total = file->f_pos + count; /* Too bad if this gets longer (unlikely) */ - if (len_total > 4000) - len_total = 4000; + if (len_total > 4096) + len_total = 4096; for (i = 0; i < I2C_ADAP_MAX; i++) if (adapters[i]->inode == inode->i_ino) { @@ -721,5 +718,5 @@ if (! proc_bus) { - printk("i2c-core.o: /proc/bus/ does not exist"); + printk(KERN_ERR "i2c-core.o: /proc/bus/ does not exist"); i2cproc_cleanup(); return -ENOENT; @@ -727,5 +724,5 @@ proc_bus_i2c = create_proc_entry("i2c",0,proc_bus); if (!proc_bus_i2c) { - printk("i2c-core.o: Could not create /proc/bus/i2c"); + printk(KERN_ERR "i2c-core.o: Could not create /proc/bus/i2c"); i2cproc_cleanup(); return -ENOENT; @@ -764,5 +761,5 @@ if (adap->algo->master_xfer) { - DEB2(printk("i2c-core.o: master_xfer: %s with %d msgs.\n", + DEB2(printk(KERN_DEBUG "i2c-core.o: master_xfer: %s with %d msgs.\n", adap->name,num)); @@ -773,5 +770,5 @@ return ret; } else { - printk("i2c-core.o: I2C adapter %04x: I2C level transfers not supported\n", + printk(KERN_ERR "i2c-core.o: I2C adapter %04x: I2C level transfers not supported\n", adap->id); return -ENOSYS; @@ -791,5 +788,5 @@ (const char *)msg.buf = buf; - DEB2(printk("i2c-core.o: master_send: writing %d bytes on %s.\n", + DEB2(printk(KERN_DEBUG "i2c-core.o: master_send: writing %d bytes on %s.\n", count,client->adapter->name)); @@ -803,5 +800,5 @@ return (ret == 1 )? count : ret; } else { - printk("i2c-core.o: I2C adapter %04x: I2C level transfers not supported\n", + printk(KERN_ERR "i2c-core.o: I2C adapter %04x: I2C level transfers not supported\n", client->adapter->id); return -ENOSYS; @@ -821,5 +818,5 @@ msg.buf = buf; - DEB2(printk("i2c-core.o: master_recv: reading %d bytes on %s.\n", + DEB2(printk(KERN_DEBUG "i2c-core.o: master_recv: reading %d bytes on %s.\n", count,client->adapter->name)); @@ -828,5 +825,5 @@ I2C_UNLOCK(adap); - DEB2(printk("i2c-core.o: master_recv: return:%d (count:%d, addr:0x%02x)\n", + DEB2(printk(KERN_DEBUG "i2c-core.o: master_recv: return:%d (count:%d, addr:0x%02x)\n", ret, count, client->addr)); @@ -836,5 +833,5 @@ return (ret == 1 )? count : ret; } else { - printk("i2c-core.o: I2C adapter %04x: I2C level transfers not supported\n", + printk(KERN_DEBUG "i2c-core.o: I2C adapter %04x: I2C level transfers not supported\n", client->adapter->id); return -ENOSYS; @@ -849,5 +846,5 @@ struct i2c_adapter *adap = client->adapter; - DEB2(printk("i2c-core.o: i2c ioctl, cmd: 0x%x, arg: %#lx\n", cmd, arg)); + DEB2(printk(KERN_DEBUG "i2c-core.o: i2c ioctl, cmd: 0x%x, arg: %#lx\n", cmd, arg)); switch ( cmd ) { case I2C_RETRIES: @@ -894,5 +891,5 @@ (address_data->force[i] == ANY_I2C_BUS)) && (addr == address_data->force[i+1])) { - DEB2(printk("i2c-core.o: found force parameter for adapter %d, addr %04x\n", + DEB2(printk(KERN_DEBUG "i2c-core.o: found force parameter for adapter %d, addr %04x\n", adap_id,addr)); if ((err = found_proc(adapter,addr,0,0))) @@ -912,5 +909,5 @@ ((address_data->ignore[i] == ANY_I2C_BUS))) && (addr == address_data->ignore[i+1])) { - DEB2(printk("i2c-core.o: found ignore parameter for adapter %d, " + DEB2(printk(KERN_DEBUG "i2c-core.o: found ignore parameter for adapter %d, " "addr %04x\n", adap_id ,addr)); found = 1; @@ -924,5 +921,5 @@ (addr >= address_data->ignore_range[i+1]) && (addr <= address_data->ignore_range[i+2])) { - DEB2(printk("i2c-core.o: found ignore_range parameter for adapter %d, " + DEB2(printk(KERN_DEBUG "i2c-core.o: found ignore_range parameter for adapter %d, " "addr %04x\n", adap_id,addr)); found = 1; @@ -939,5 +936,5 @@ if (addr == address_data->normal_i2c[i]) { found = 1; - DEB2(printk("i2c-core.o: found normal i2c entry for adapter %d, " + DEB2(printk(KERN_DEBUG "i2c-core.o: found normal i2c entry for adapter %d, " "addr %02x", adap_id,addr)); } @@ -950,5 +947,5 @@ (addr <= address_data->normal_i2c_range[i+1])) { found = 1; - DEB2(printk("i2c-core.o: found normal i2c_range entry for adapter %d, " + DEB2(printk(KERN_DEBUG "i2c-core.o: found normal i2c_range entry for adapter %d, " "addr %04x\n", adap_id,addr)); } @@ -962,5 +959,5 @@ (addr == address_data->probe[i+1])) { found = 1; - DEB2(printk("i2c-core.o: found probe parameter for adapter %d, " + DEB2(printk(KERN_DEBUG "i2c-core.o: found probe parameter for adapter %d, " "addr %04x\n", adap_id,addr)); } @@ -974,5 +971,5 @@ (addr <= address_data->probe_range[i+2])) { found = 1; - DEB2(printk("i2c-core.o: found probe_range parameter for adapter %d, " + DEB2(printk(KERN_DEBUG "i2c-core.o: found probe_range parameter for adapter %d, " "addr %04x\n", adap_id,addr)); } @@ -1111,4 +1108,21 @@ } +/* Returns the number of read bytes */ +extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, + u8 command, u8 *values) +{ + union i2c_smbus_data data; + int i; + if (i2c_smbus_xfer(client->adapter,client->addr,client->flags, + I2C_SMBUS_READ,command, + I2C_SMBUS_I2C_BLOCK_DATA,&data)) + return -1; + else { + for (i = 1; i <= data.block[0]; i++) + values[i-1] = data.block[i]; + return data.block[0]; + } +} + extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, u8 command, u8 length, u8 *values) @@ -1186,5 +1200,5 @@ case I2C_SMBUS_BLOCK_DATA: if (read_write == I2C_SMBUS_READ) { - printk("i2c-core.o: Block read not supported under " + printk(KERN_ERR "i2c-core.o: Block read not supported under " "I2C emulation!\n"); return -1; @@ -1192,7 +1206,7 @@ msg[0].len = data->block[0] + 2; if (msg[0].len > 34) { - printk("i2c-core.o: smbus_access called with " + printk(KERN_ERR "i2c-core.o: smbus_access called with " "invalid block write size (%d)\n", - msg[0].len); + data->block[0]); return -1; } @@ -1201,6 +1215,21 @@ } break; + case I2C_SMBUS_I2C_BLOCK_DATA: + if (read_write == I2C_SMBUS_READ) { + msg[1].len = 32; + } else { + msg[0].len = data->block[0] + 2; + if (msg[0].len > 34) { + printk("i2c-core.o: i2c_smbus_xfer_emulated called with " + "invalid block write size (%d)\n", + data->block[0]); + return -1; + } + for (i = 0; i < data->block[0]; i++) + msgbuf0[i] = data->block[i+1]; + } + break; default: - printk("i2c-core.o: smbus_access called with invalid size (%d)\n", + printk(KERN_ERR "i2c-core.o: smbus_access called with invalid size (%d)\n", size); return -1; @@ -1222,4 +1251,10 @@ data->word = msgbuf1[0] | (msgbuf1[1] << 8); break; + case I2C_SMBUS_I2C_BLOCK_DATA: + /* fixed at 32 for now */ + data->block[0] = 32; + for (i = 0; i < 32; i++) + data->block[i+1] = msgbuf1[i]; + break; } return 0; @@ -1264,5 +1299,5 @@ static int __init i2c_init(void) { - printk("i2c-core.o: i2c core module\n"); + printk(KERN_INFO "i2c-core.o: i2c core module version %s (%s)\n", I2C_VERSION, I2C_DATE); memset(adapters,0,sizeof(adapters)); memset(drivers,0,sizeof(drivers)); @@ -1285,11 +1320,11 @@ extern int i2c_algo_bit_init(void); #endif -#ifdef CONFIG_I2C_PHILIPSPAR +#ifdef CONFIG_I2C_BITLP extern int i2c_bitlp_init(void); #endif -#ifdef CONFIG_I2C_ELV +#ifdef CONFIG_I2C_BITELV extern int i2c_bitelv_init(void); #endif -#ifdef CONFIG_I2C_VELLEMAN +#ifdef CONFIG_I2C_BITVELLE extern int i2c_bitvelle_init(void); #endif @@ -1301,5 +1336,5 @@ extern int i2c_algo_pcf_init(void); #endif -#ifdef CONFIG_I2C_ELEKTOR +#ifdef CONFIG_I2C_PCFISA extern int i2c_pcfisa_init(void); #endif @@ -1330,11 +1365,11 @@ i2c_algo_bit_init(); #endif -#ifdef CONFIG_I2C_PHILIPSPAR +#ifdef CONFIG_I2C_BITLP i2c_bitlp_init(); #endif -#ifdef CONFIG_I2C_ELV +#ifdef CONFIG_I2C_BITELV i2c_bitelv_init(); #endif -#ifdef CONFIG_I2C_VELLEMAN +#ifdef CONFIG_I2C_BITVELLE i2c_bitvelle_init(); #endif @@ -1344,5 +1379,5 @@ i2c_algo_pcf_init(); #endif -#ifdef CONFIG_I2C_ELEKTOR +#ifdef CONFIG_I2C_PCFISA i2c_pcfisa_init(); #endif @@ -1402,4 +1437,6 @@ EXPORT_SYMBOL(i2c_smbus_read_block_data); EXPORT_SYMBOL(i2c_smbus_write_block_data); +EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data); +EXPORT_SYMBOL(i2c_smbus_write_i2c_block_data); EXPORT_SYMBOL(i2c_get_functionality); @@ -1411,5 +1448,7 @@ MODULE_PARM(i2c_debug, "i"); MODULE_PARM_DESC(i2c_debug,"debug level"); +#ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); +#endif int init_module(void) --- linux-old/drivers/i2c/i2c-dev.c Mon Mar 25 15:25:36 CET 2002 +++ linux/drivers/i2c/i2c-dev.c Mon Mar 25 15:25:36 CET 2002 @@ -29,5 +29,5 @@ */ -/* $Id: i2c-dev.c,v 1.40 2001/08/25 01:28:01 mds Exp $ */ +/* $Id: i2c-dev.c,v 1.44 2001/11/19 18:45:02 mds Exp $ */ #include @@ -50,5 +50,4 @@ #include #include - #include #include @@ -141,5 +140,5 @@ #ifdef DEBUG struct inode *inode = file->f_dentry->d_inode; - printk("i2c-dev.o: i2c-%d lseek to %ld bytes relative to %d.\n", + printk(KERN_DEBUG "i2c-dev.o: i2c-%d lseek to %ld bytes relative to %d.\n", MINOR(inode->i_rdev),(long) offset,origin); #endif /* DEBUG */ @@ -166,5 +165,5 @@ #ifdef DEBUG - printk("i2c-dev.o: i2c-%d reading %d bytes.\n",MINOR(inode->i_rdev), + printk(KERN_DEBUG "i2c-dev.o: i2c-%d reading %d bytes.\n",MINOR(inode->i_rdev), count); #endif @@ -198,5 +197,5 @@ #ifdef DEBUG - printk("i2c-dev.o: i2c-%d writing %d bytes.\n",MINOR(inode->i_rdev), + printk(KERN_DEBUG "i2c-dev.o: i2c-%d writing %d bytes.\n",MINOR(inode->i_rdev), count); #endif @@ -218,5 +217,5 @@ #ifdef DEBUG - printk("i2c-dev.o: i2c-%d ioctl, cmd: 0x%x, arg: %lx.\n", + printk(KERN_DEBUG "i2c-dev.o: i2c-%d ioctl, cmd: 0x%x, arg: %lx.\n", MINOR(inode->i_rdev),cmd, arg); #endif /* DEBUG */ @@ -316,5 +315,5 @@ (data_arg.size != I2C_SMBUS_I2C_BLOCK_DATA)) { #ifdef DEBUG - printk("i2c-dev.o: size out of range (%x) in ioctl I2C_SMBUS.\n", + printk(KERN_DEBUG "i2c-dev.o: size out of range (%x) in ioctl I2C_SMBUS.\n", data_arg.size); #endif @@ -326,5 +325,5 @@ (data_arg.read_write != I2C_SMBUS_WRITE)) { #ifdef DEBUG - printk("i2c-dev.o: read_write out of range (%x) in ioctl I2C_SMBUS.\n", + printk(KERN_DEBUG "i2c-dev.o: read_write out of range (%x) in ioctl I2C_SMBUS.\n", data_arg.read_write); #endif @@ -346,5 +345,5 @@ if (data_arg.data == NULL) { #ifdef DEBUG - printk("i2c-dev.o: data is NULL pointer in ioctl I2C_SMBUS.\n"); + printk(KERN_DEBUG "i2c-dev.o: data is NULL pointer in ioctl I2C_SMBUS.\n"); #endif return -EINVAL; @@ -388,5 +387,5 @@ if ((minor >= I2CDEV_ADAPS_MAX) || ! (i2cdev_adaps[minor])) { #ifdef DEBUG - printk("i2c-dev.o: Trying to open unattached adapter i2c-%d\n", + printk(KERN_DEBUG "i2c-dev.o: Trying to open unattached adapter i2c-%d\n", minor); #endif @@ -409,5 +408,5 @@ #ifdef DEBUG - printk("i2c-dev.o: opened i2c-%d\n",minor); + printk(KERN_DEBUG "i2c-dev.o: opened i2c-%d\n",minor); #endif return 0; @@ -420,5 +419,5 @@ file->private_data=NULL; #ifdef DEBUG - printk("i2c-dev.o: Closed: i2c-%d\n", minor); + printk(KERN_DEBUG "i2c-dev.o: Closed: i2c-%d\n", minor); #endif #if LINUX_KERNEL_VERSION < KERNEL_VERSION(2,4,0) @@ -441,9 +440,9 @@ if ((i = i2c_adapter_id(adap)) < 0) { - printk("i2c-dev.o: Unknown adapter ?!?\n"); + printk(KERN_DEBUG "i2c-dev.o: Unknown adapter ?!?\n"); return -ENODEV; } if (i >= I2CDEV_ADAPS_MAX) { - printk("i2c-dev.o: Adapter number too large?!? (%d)\n",i); + printk(KERN_DEBUG "i2c-dev.o: Adapter number too large?!? (%d)\n",i); return -ENODEV; } @@ -458,5 +457,5 @@ &i2cdev_fops, NULL); #endif - printk("i2c-dev.o: Registered '%s' as minor %d\n",adap->name,i); + printk(KERN_DEBUG "i2c-dev.o: Registered '%s' as minor %d\n",adap->name,i); } else { /* This is actually a detach_adapter call! */ @@ -466,5 +465,5 @@ i2cdev_adaps[i] = NULL; #ifdef DEBUG - printk("i2c-dev.o: Adapter unregistered: %s\n",adap->name); + printk(KERN_DEBUG "i2c-dev.o: Adapter unregistered: %s\n",adap->name); #endif } @@ -488,5 +487,5 @@ int res; - printk("i2c-dev.o: i2c /dev entries driver module\n"); + printk(KERN_INFO "i2c-dev.o: i2c /dev entries driver module version %s (%s)\n", I2C_VERSION, I2C_DATE); i2cdev_initialized = 0; @@ -496,5 +495,5 @@ if (register_chrdev(I2C_MAJOR,"i2c",&i2cdev_fops)) { #endif - printk("i2c-dev.o: unable to get major %d for i2c bus\n", + printk(KERN_ERR "i2c-dev.o: unable to get major %d for i2c bus\n", I2C_MAJOR); return -EIO; @@ -506,5 +505,5 @@ if ((res = i2c_add_driver(&i2cdev_driver))) { - printk("i2c-dev.o: Driver registration failed, module not inserted.\n"); + printk(KERN_ERR "i2c-dev.o: Driver registration failed, module not inserted.\n"); i2cdev_cleanup(); return res; @@ -520,5 +519,5 @@ if (i2cdev_initialized >= 2) { if ((res = i2c_del_driver(&i2cdev_driver))) { - printk("i2c-dev.o: Driver deregistration failed, " + printk(KERN_ERR "i2c-dev.o: Driver deregistration failed, " "module not removed.\n"); return res; @@ -534,5 +533,5 @@ if ((res = unregister_chrdev(I2C_MAJOR,"i2c"))) { #endif - printk("i2c-dev.o: unable to release major %d for i2c bus\n", + printk(KERN_ERR "i2c-dev.o: unable to release major %d for i2c bus\n", I2C_MAJOR); return res; @@ -549,5 +548,7 @@ MODULE_AUTHOR("Frodo Looijaard and Simon G. Vogl "); MODULE_DESCRIPTION("I2C /dev entries driver"); +#ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); +#endif int init_module(void) --- linux-old/include/linux/i2c-dev.h Mon Mar 25 15:25:37 CET 2002 +++ linux/include/linux/i2c-dev.h Mon Mar 25 15:25:37 CET 2002 @@ -20,5 +20,5 @@ */ -/* $Id: i2c-dev.h,v 1.9 2001/08/15 03:04:58 mds Exp $ */ +/* $Id: i2c-dev.h,v 1.10 2001/11/19 19:01:46 mds Exp $ */ #ifndef I2C_DEV_H @@ -161,4 +161,20 @@ return i2c_smbus_access(file,I2C_SMBUS_WRITE,command, I2C_SMBUS_BLOCK_DATA, &data); +} + +/* Returns the number of read bytes */ +static inline __s32 i2c_smbus_read_i2c_block_data(int file, __u8 command, + __u8 *values) +{ + union i2c_smbus_data data; + int i; + if (i2c_smbus_access(file,I2C_SMBUS_READ,command, + I2C_SMBUS_I2C_BLOCK_DATA,&data)) + return -1; + else { + for (i = 1; i <= data.block[0]; i++) + values[i-1] = data.block[i]; + return data.block[0]; + } } --- linux-old/drivers/i2c/i2c-elektor.c Mon Mar 25 15:25:37 CET 2002 +++ linux/drivers/i2c/i2c-elektor.c Mon Mar 25 15:25:37 CET 2002 @@ -36,5 +36,4 @@ #include #include - #include #include @@ -75,9 +74,10 @@ int address = ctl ? (base + 1) : base; - if (ctl && irq) { + /* enable irq if any specified for serial operation */ + if (ctl && irq && (val & I2C_PCF_ESO)) { val |= I2C_PCF_ENI; } - DEB3(printk("i2c-elektor.o: Write 0x%X 0x%02X\n", address, val & 255)); + DEB3(printk(KERN_DEBUG "i2c-elektor.o: Write 0x%X 0x%02X\n", address, val & 255)); switch (mmapped) { @@ -100,5 +100,5 @@ int val = mmapped ? readb(address) : inb(address); - DEB3(printk("i2c-elektor.o: Read 0x%X 0x%02X\n", address, val)); + DEB3(printk(KERN_DEBUG "i2c-elektor.o: Read 0x%X 0x%02X\n", address, val)); return (val); @@ -143,5 +143,5 @@ if (!mmapped) { if (check_region(base, 2) < 0 ) { - printk("i2c-elektor.o: requested I/O region (0x%X:2) is in use.\n", base); + printk(KERN_ERR "i2c-elektor.o: requested I/O region (0x%X:2) is in use.\n", base); return -ENODEV; } else { @@ -151,5 +151,5 @@ if (irq > 0) { if (request_irq(irq, pcf_isa_handler, 0, "PCF8584", 0) < 0) { - printk("i2c-elektor.o: Request irq%d failed\n", irq); + printk(KERN_ERR "i2c-elektor.o: Request irq%d failed\n", irq); irq = 0; } else @@ -160,5 +160,5 @@ -static void __exit pcf_isa_exit(void) +static void pcf_isa_exit(void) { if (irq > 0) { @@ -239,5 +239,5 @@ if (!pci_read_config_byte(cy693_dev, 0x47, &config)) { - DEB3(printk("i2c-elektor.o: found cy82c693, config register 0x47 = 0x%02x.\n", config)); + DEB3(printk(KERN_DEBUG "i2c-elektor.o: found cy82c693, config register 0x47 = 0x%02x.\n", config)); /* UP2000 board has this register set to 0xe1, @@ -261,5 +261,5 @@ (this can be read from cypress) */ clock = I2C_PCF_CLK | I2C_PCF_TRNS90; - printk("i2c-elektor.o: found API UP2000 like board, will probe PCF8584 later.\n"); + printk(KERN_INFO "i2c-elektor.o: found API UP2000 like board, will probe PCF8584 later.\n"); } } @@ -270,9 +270,9 @@ /* sanity checks for mmapped I/O */ if (mmapped && base < 0xc8000) { - printk("i2c-elektor.o: incorrect base address (0x%0X) specified for mmapped I/O.\n", base); + printk(KERN_ERR "i2c-elektor.o: incorrect base address (0x%0X) specified for mmapped I/O.\n", base); return -ENODEV; } - printk("i2c-elektor.o: i2c pcf8584-isa adapter module\n"); + printk(KERN_INFO "i2c-elektor.o: i2c pcf8584-isa adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE); if (base == 0) { @@ -284,11 +284,13 @@ #endif if (pcf_isa_init() == 0) { - if (i2c_pcf_add_bus(&pcf_isa_ops) < 0) + if (i2c_pcf_add_bus(&pcf_isa_ops) < 0) { + pcf_isa_exit(); return -ENODEV; + } } else { return -ENODEV; } - printk("i2c-elektor.o: found device at %#x.\n", base); + printk(KERN_ERR "i2c-elektor.o: found device at %#x.\n", base); return 0; @@ -301,5 +303,7 @@ MODULE_AUTHOR("Hans Berglund "); MODULE_DESCRIPTION("I2C-Bus adapter routines for PCF8584 ISA bus adapter"); +#ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); +#endif MODULE_PARM(base, "i"); --- linux-old/include/linux/i2c-elektor.h Mon Mar 25 15:25:37 CET 2002 +++ linux/include/linux/i2c-elektor.h Mon Mar 25 15:25:37 CET 2002 --- linux-old/drivers/i2c/i2c-elv.c Mon Mar 25 15:25:37 CET 2002 +++ linux/drivers/i2c/i2c-elv.c Mon Mar 25 15:25:37 CET 2002 @@ -22,5 +22,5 @@ Frodo Looijaard */ -/* $Id: i2c-elv.c,v 1.17 2001/07/29 02:44:25 mds Exp $ */ +/* $Id: i2c-elv.c,v 1.21 2001/11/19 18:45:02 mds Exp $ */ #include @@ -30,7 +30,5 @@ #include #include - #include - #include #include @@ -96,5 +94,5 @@ /* test for ELV adap. */ if (inb(base+1) & 0x80) { /* BUSY should be high */ - DEBINIT(printk("i2c-elv.o: Busy was low.\n")); + DEBINIT(printk(KERN_DEBUG "i2c-elv.o: Busy was low.\n")); return -ENODEV; } else { @@ -103,5 +101,5 @@ if ( !(inb(base+1) && 0x10) ) { outb(0x04,base+2); - DEBINIT(printk("i2c-elv.o: Select was high.\n")); + DEBINIT(printk(KERN_DEBUG "i2c-elv.o: Select was high.\n")); return -ENODEV; } @@ -116,5 +114,5 @@ } -static void __exit bit_elv_exit(void) +static void bit_elv_exit(void) { release_region( base , (base == 0x3bc)? 3 : 8 ); @@ -171,5 +169,5 @@ int __init i2c_bitelv_init(void) { - printk("i2c-elv.o: i2c ELV parallel port adapter module\n"); + printk(KERN_INFO "i2c-elv.o: i2c ELV parallel port adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE); if (base==0) { /* probe some values */ @@ -191,5 +189,5 @@ } } - printk("i2c-elv.o: found device at %#x.\n",base); + printk(KERN_DEBUG "i2c-elv.o: found device at %#x.\n",base); return 0; } @@ -201,5 +199,7 @@ MODULE_AUTHOR("Simon G. Vogl "); MODULE_DESCRIPTION("I2C-Bus adapter routines for ELV parallel port adapter"); +#ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); +#endif --- linux-old/include/linux/i2c-id.h Mon Mar 25 15:25:37 CET 2002 +++ linux/include/linux/i2c-id.h Mon Mar 25 15:25:37 CET 2002 @@ -21,5 +21,5 @@ /* ------------------------------------------------------------------------- */ -/* $Id: i2c-id.h,v 1.35 2001/08/12 17:22:20 mds Exp $ */ +/* $Id: i2c-id.h,v 1.41 2002/03/11 07:18:55 simon Exp $ */ #ifndef I2C_ID_H @@ -91,4 +91,8 @@ #define I2C_DRIVERID_SP5055 44 /* Satellite tuner */ #define I2C_DRIVERID_STV0030 45 /* Multipurpose switch */ +#define I2C_DRIVERID_SAA7108 46 /* video decoder, image scaler */ + + + #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ @@ -128,4 +132,7 @@ #define I2C_DRIVERID_IT87 1026 #define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */ +#define I2C_DRIVERID_FSCPOS 1028 +#define I2C_DRIVERID_FSCSCY 1029 +#define I2C_DRIVERID_PCF8591 1030 /* @@ -144,5 +151,6 @@ #define I2C_ALGO_SAA7146 0x060000 /* SAA 7146 video decoder bus */ #define I2C_ALGO_ACB 0x070000 /* ACCESS.bus algorithm */ - +#define I2C_ALGO_IIC 0x080000 /* ITE IIC bus */ +#define I2C_ALGO_SAA7134 0x090000 #define I2C_ALGO_EC 0x100000 /* ACPI embedded controller */ @@ -189,4 +197,7 @@ /* --- MPC8xx PowerPC adapters */ #define I2C_HW_MPC8XX_EPON 0x00 /* Eponymous MPC8xx I2C adapter */ + +/* --- ITE based algorithms */ +#define I2C_HW_I_IIC 0x00 /* controller on the ITE */ /* --- SMBus only adapters */ --- linux-old/drivers/i2c/i2c-pcf8584.h Mon Mar 25 15:25:37 CET 2002 +++ linux/drivers/i2c/i2c-pcf8584.h Mon Mar 25 15:25:37 CET 2002 @@ -22,5 +22,5 @@ /* With some changes from Frodo Looijaard */ -/* $Id: i2c-pcf8584.h,v 1.3 2000/01/18 23:54:07 frodo Exp $ */ +/* $Id: i2c-pcf8584.h,v 1.4 2001/10/02 00:07:37 mds Exp $ */ #ifndef I2C_PCF8584_H --- linux-old/drivers/i2c/i2c-philips-par.c Mon Mar 25 15:25:37 CET 2002 +++ linux/drivers/i2c/i2c-philips-par.c Mon Mar 25 15:25:37 CET 2002 @@ -22,5 +22,5 @@ Frodo Looijaard */ -/* $Id: i2c-philips-par.c,v 1.18 2000/07/06 19:21:49 frodo Exp $ */ +/* $Id: i2c-philips-par.c,v 1.23 2002/02/06 08:50:58 simon Exp $ */ #include @@ -30,5 +30,4 @@ #include #include - #include #include @@ -191,9 +190,9 @@ GFP_KERNEL); if (!adapter) { - printk("i2c-philips-par: Unable to malloc.\n"); + printk(KERN_ERR "i2c-philips-par: Unable to malloc.\n"); return; } - printk("i2c-philips-par.o: attaching to %s\n", port->name); + printk(KERN_DEBUG "i2c-philips-par.o: attaching to %s\n", port->name); adapter->pdev = parport_register_device(port, "i2c-philips-par", @@ -202,5 +201,5 @@ NULL); if (!adapter->pdev) { - printk("i2c-philips-par: Unable to register with parport.\n"); + printk(KERN_ERR "i2c-philips-par: Unable to register with parport.\n"); return; } @@ -211,6 +210,9 @@ adapter->bit_lp_data.data = port; + if (parport_claim_or_block(adapter->pdev) < 0 ) { + printk(KERN_ERR "i2c-philips-par: Could not claim parallel port.\n"); + return; + } /* reset hardware to sane state */ - parport_claim_or_block(adapter->pdev); bit_lp_setsda(port, 1); bit_lp_setscl(port, 1); @@ -219,5 +221,5 @@ if (i2c_bit_add_bus(&adapter->adapter) < 0) { - printk("i2c-philips-par: Unable to register with I2C.\n"); + printk(KERN_ERR "i2c-philips-par: Unable to register with I2C.\n"); parport_unregister_device(adapter->pdev); kfree(adapter); @@ -265,5 +267,5 @@ struct parport *port; #endif - printk("i2c-philips-par.o: i2c Philips parallel port adapter module\n"); + printk(KERN_INFO "i2c-philips-par.o: i2c Philips parallel port adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4) @@ -292,5 +294,7 @@ MODULE_AUTHOR("Simon G. Vogl "); MODULE_DESCRIPTION("I2C-Bus adapter routines for Philips parallel port adapter"); +#ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); +#endif MODULE_PARM(type, "i"); --- linux-old/drivers/i2c/i2c-proc.c Mon Mar 25 15:25:38 CET 2002 +++ linux/drivers/i2c/i2c-proc.c Mon Mar 25 15:25:38 CET 2002 @@ -33,14 +33,8 @@ #include #include - #include #include - #include -/* FIXME need i2c versioning */ -#define LM_DATE "20010825" -#define LM_VERSION "2.6.1" - #ifndef THIS_MODULE #define THIS_MODULE NULL @@ -56,8 +50,16 @@ struct file *filp, void *buffer, size_t * lenp); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,19)) && \ + (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)) +static int i2c_sysctl_chips(ctl_table * table, int *name, unsigned nlen, + void *oldval, size_t * oldlenp, + void *newval, size_t newlen, + void **context); +#else static int i2c_sysctl_chips(ctl_table * table, int *name, int nlen, void *oldval, size_t * oldlenp, void *newval, size_t newlen, void **context); +#endif /* 2.2.19+ */ int __init sensors_init(void); @@ -120,8 +122,4 @@ } *name = kmalloc(strlen(name_buffer) + 1, GFP_KERNEL); - if (!*name) { - printk (KERN_WARNING "i2c_create_name: not enough memory\n"); - return -ENOMEM; - } strcpy(*name, name_buffer); return 0; @@ -181,7 +179,8 @@ if (!(new_header = register_sysctl_table(new_table, 0))) { + printk(KERN_ERR "i2c-proc.o: error: sysctl interface not supported by kernel!\n"); kfree(new_table); kfree(name); - return -ENOMEM; + return -EPERM; } @@ -195,5 +194,5 @@ !new_header->ctl_table->child->child->de) { printk - ("i2c-proc.o: NULL pointer when trying to install fill_inode fix!\n"); + (KERN_ERR "i2c-proc.o: NULL pointer when trying to install fill_inode fix!\n"); return id; } @@ -248,5 +247,5 @@ #ifdef DEBUG if (!inode) { - printk("i2c-proc.o: Warning: inode NULL in fill_inode()\n"); + printk(KERN_ERR "i2c-proc.o: Warning: inode NULL in fill_inode()\n"); return; } @@ -259,5 +258,5 @@ if (i == SENSORS_ENTRY_MAX) { printk - ("i2c-proc.o: Warning: inode (%ld) not found in fill_inode()\n", + (KERN_ERR "i2c-proc.o: Warning: inode (%ld) not found in fill_inode()\n", inode->i_ino); return; @@ -309,7 +308,14 @@ } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,19)) && \ + (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)) +int i2c_sysctl_chips(ctl_table * table, int *name, unsigned nlen, + void *oldval, size_t * oldlenp, void *newval, + size_t newlen, void **context) +#else int i2c_sysctl_chips(ctl_table * table, int *name, int nlen, void *oldval, size_t * oldlenp, void *newval, size_t newlen, void **context) +#endif /* 2.2.19+ */ { struct i2c_chips_data data; @@ -416,7 +422,14 @@ /* This function is equivalent to i2c_proc_real, only it interacts with the sysctl(2) syscall, and returns no reals, but integers */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,19)) && \ + (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)) +int i2c_sysctl_real(ctl_table * table, int *name, unsigned nlen, + void *oldval, size_t * oldlenp, void *newval, + size_t newlen, void **context) +#else int i2c_sysctl_real(ctl_table * table, int *name, int nlen, void *oldval, size_t * oldlenp, void *newval, size_t newlen, void **context) +#endif /* 2.2.19+ */ { long results[MAX_RESULTS]; @@ -685,5 +698,5 @@ #ifdef DEBUG printk - ("i2c-proc.o: found force parameter for adapter %d, addr %04x\n", + (KERN_DEBUG "i2c-proc.o: found force parameter for adapter %d, addr %04x\n", adapter_id, addr); #endif @@ -715,5 +728,5 @@ #ifdef DEBUG printk - ("i2c-proc.o: found ignore parameter for adapter %d, " + (KERN_DEBUG "i2c-proc.o: found ignore parameter for adapter %d, " "addr %04x\n", adapter_id, addr); #endif @@ -735,5 +748,5 @@ #ifdef DEBUG printk - ("i2c-proc.o: found ignore_range parameter for adapter %d, " + (KERN_DEBUG "i2c-proc.o: found ignore_range parameter for adapter %d, " "addr %04x\n", adapter_id, addr); #endif @@ -754,5 +767,5 @@ #ifdef DEBUG printk - ("i2c-proc.o: found normal isa entry for adapter %d, " + (KERN_DEBUG "i2c-proc.o: found normal isa entry for adapter %d, " "addr %04x\n", adapter_id, addr); @@ -776,5 +789,5 @@ #ifdef DEBUG printk - ("i2c-proc.o: found normal isa_range entry for adapter %d, " + (KERN_DEBUG "i2c-proc.o: found normal isa_range entry for adapter %d, " "addr %04x", adapter_id, addr); #endif @@ -790,5 +803,5 @@ #ifdef DEBUG printk - ("i2c-proc.o: found normal i2c entry for adapter %d, " + (KERN_DEBUG "i2c-proc.o: found normal i2c entry for adapter %d, " "addr %02x", adapter_id, addr); #endif @@ -806,5 +819,5 @@ #ifdef DEBUG printk - ("i2c-proc.o: found normal i2c_range entry for adapter %d, " + (KERN_DEBUG "i2c-proc.o: found normal i2c_range entry for adapter %d, " "addr %04x\n", adapter_id, addr); #endif @@ -823,5 +836,5 @@ #ifdef DEBUG printk - ("i2c-proc.o: found probe parameter for adapter %d, " + (KERN_DEBUG "i2c-proc.o: found probe parameter for adapter %d, " "addr %04x\n", adapter_id, addr); #endif @@ -842,5 +855,5 @@ #ifdef DEBUG printk - ("i2c-proc.o: found probe_range parameter for adapter %d, " + (KERN_DEBUG "i2c-proc.o: found probe_range parameter for adapter %d, " "addr %04x\n", adapter_id, addr); #endif @@ -863,9 +876,12 @@ int __init sensors_init(void) { - printk("i2c-proc.o version %s (%s)\n", LM_VERSION, LM_DATE); + printk(KERN_INFO "i2c-proc.o version %s (%s)\n", I2C_VERSION, I2C_DATE); i2c_initialized = 0; if (! (i2c_proc_header = - register_sysctl_table(i2c_proc, 0))) return -ENOMEM; + register_sysctl_table(i2c_proc, 0))) { + printk(KERN_ERR "i2c-proc.o: error: sysctl interface not supported by kernel!\n"); + return -EPERM; + } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1)) i2c_proc_header->ctl_table->child->de->owner = THIS_MODULE; @@ -888,5 +904,7 @@ MODULE_AUTHOR("Frodo Looijaard "); MODULE_DESCRIPTION("i2c-proc driver"); +#ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); +#endif int i2c_cleanup(void) @@ -908,3 +926,4 @@ return i2c_cleanup(); } + #endif /* MODULE */ --- linux-old/include/linux/i2c-proc.h Mon Mar 25 15:25:38 CET 2002 +++ linux/include/linux/i2c-proc.h Mon Mar 25 15:25:38 CET 2002 @@ -1,5 +1,6 @@ /* - sensors.h - Part of lm_sensors, Linux kernel modules for hardware - monitoring + i2c-proc.h - Part of the i2c package + was originally sensors.h - Part of lm_sensors, Linux kernel modules + for hardware monitoring Copyright (c) 1998, 1999 Frodo Looijaard @@ -56,8 +57,16 @@ In all cases, client points to the client we wish to interact with, and ctl_name is the SYSCTL id of the file we are accessing. */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,19)) && \ + (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)) +extern int i2c_sysctl_real(ctl_table * table, int *name, unsigned nlen, + void *oldval, size_t * oldlenp, + void *newval, size_t newlen, + void **context); +#else extern int i2c_sysctl_real(ctl_table * table, int *name, int nlen, void *oldval, size_t * oldlenp, void *newval, size_t newlen, void **context); +#endif /* 2.2.19+ */ extern int i2c_proc_real(ctl_table * ctl, int write, struct file *filp, void *buffer, size_t * lenp); --- linux-old/drivers/i2c/i2c-velleman.c Mon Mar 25 15:25:39 CET 2002 +++ linux/drivers/i2c/i2c-velleman.c Mon Mar 25 15:25:39 CET 2002 @@ -19,5 +19,5 @@ /* ------------------------------------------------------------------------- */ -/* $Id: i2c-velleman.c,v 1.19 2000/01/24 02:06:33 mds Exp $ */ +/* $Id: i2c-velleman.c,v 1.23 2001/11/19 18:45:02 mds Exp $ */ #include @@ -28,5 +28,4 @@ #include /* for 2.0 kernels to get ENODEV */ #include - #include #include @@ -92,5 +91,5 @@ { if (check_region(base,(base == 0x3bc)? 3 : 8) < 0 ) { - DEBE(printk("i2c-velleman.o: Port %#x already in use.\n", + DEBE(printk(KERN_DEBUG "i2c-velleman.o: Port %#x already in use.\n", base)); return -ENODEV; @@ -104,5 +103,5 @@ } -static void __exit bit_velle_exit(void) +static void bit_velle_exit(void) { release_region( base , (base == 0x3bc)? 3 : 8 ); @@ -161,5 +160,5 @@ int __init i2c_bitvelle_init(void) { - printk("i2c-velleman.o: i2c Velleman K8000 adapter module\n"); + printk(KERN_INFO "i2c-velleman.o: i2c Velleman K8000 adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE); if (base==0) { /* probe some values */ @@ -181,5 +180,5 @@ } } - printk("i2c-velleman.o: found device at %#x.\n",base); + printk(KERN_DEBUG "i2c-velleman.o: found device at %#x.\n",base); return 0; } @@ -190,5 +189,7 @@ MODULE_AUTHOR("Simon G. Vogl "); MODULE_DESCRIPTION("I2C-Bus adapter routines for Velleman K8000 adapter"); +#ifdef MODULE_LICENSE MODULE_LICENSE("GPL"); +#endif MODULE_PARM(base, "i"); --- linux-old/include/linux/i2c.h Mon Mar 25 15:25:39 CET 2002 +++ linux/include/linux/i2c.h Mon Mar 25 15:25:39 CET 2002 @@ -24,11 +24,11 @@ Frodo Looijaard */ -/* $Id: i2c.h,v 1.46 2001/08/31 00:04:07 phil Exp $ */ +/* $Id: i2c.h,v 1.50 2002/03/23 00:53:38 phil Exp $ */ #ifndef I2C_H #define I2C_H -#define I2C_DATE "20010830" -#define I2C_VERSION "2.6.1" +#define I2C_DATE "20020322" +#define I2C_VERSION "2.6.3" #include /* id values of adapters et. al. */ @@ -124,4 +124,6 @@ u8 command, u8 length, u8 *values); +extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, + u8 command, u8 *values); extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, u8 command, u8 length, @@ -407,6 +409,8 @@ #define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 -#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* New I2C-like block */ -#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* transfer */ +#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */ +#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ +#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ +#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */ #define I2C_FUNC_SMBUS_BYTE I2C_FUNC_SMBUS_READ_BYTE | \ @@ -420,4 +424,6 @@ #define I2C_FUNC_SMBUS_I2C_BLOCK I2C_FUNC_SMBUS_READ_I2C_BLOCK | \ I2C_FUNC_SMBUS_WRITE_I2C_BLOCK +#define I2C_FUNC_SMBUS_I2C_BLOCK_2 I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \ + I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 #define I2C_FUNC_SMBUS_EMUL I2C_FUNC_SMBUS_QUICK | \ @@ -426,5 +432,7 @@ I2C_FUNC_SMBUS_WORD_DATA | \ I2C_FUNC_SMBUS_PROC_CALL | \ - I2C_FUNC_SMBUS_WRITE_BLOCK_DATA + I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ + I2C_FUNC_SMBUS_I2C_BLOCK | \ + I2C_FUNC_SMBUS_I2C_BLOCK_2 /* --- linux-old/drivers/i2c/Config.in Mon Mar 25 15:25:39 CET 2002 +++ linux/drivers/i2c/Config.in Mon Mar 25 15:25:39 CET 2002 @@ -11,20 +11,14 @@ dep_tristate 'I2C bit-banging interfaces' CONFIG_I2C_ALGOBIT $CONFIG_I2C if [ "$CONFIG_I2C_ALGOBIT" != "n" ]; then - dep_tristate ' Philips style parallel port adapter' CONFIG_I2C_PHILIPSPAR $CONFIG_I2C_ALGOBIT $CONFIG_PARPORT - dep_tristate ' ELV adapter' CONFIG_I2C_ELV $CONFIG_I2C_ALGOBIT - dep_tristate ' Velleman K9000 adapter' CONFIG_I2C_VELLEMAN $CONFIG_I2C_ALGOBIT + dep_tristate ' Philips style parallel port adapter' CONFIG_I2C_BITLP $CONFIG_I2C_ALGOBIT $CONFIG_PARPORT + dep_tristate ' ELV adapter' CONFIG_I2C_BITELV $CONFIG_I2C_ALGOBIT + dep_tristate ' Velleman K9000 adapter' CONFIG_I2C_BITVELLE $CONFIG_I2C_ALGOBIT fi dep_tristate 'I2C PCF 8584 interfaces' CONFIG_I2C_ALGOPCF $CONFIG_I2C if [ "$CONFIG_I2C_ALGOPCF" != "n" ]; then - dep_tristate ' Elektor ISA card' CONFIG_I2C_ELEKTOR $CONFIG_I2C_ALGOPCF + dep_tristate ' Elektor ISA card' CONFIG_I2C_PCFISA $CONFIG_I2C_ALGOPCF fi - if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then - dep_tristate 'ITE I2C Algorithm' CONFIG_ITE_I2C_ALGO $CONFIG_I2C - if [ "$CONFIG_ITE_I2C_ALGO" != "n" ]; then - dep_tristate ' ITE I2C Adapter' CONFIG_ITE_I2C_ADAP $CONFIG_ITE_I2C_ALGO - fi - fi if [ "$CONFIG_8xx" = "y" ]; then dep_tristate 'MPC8xx CPM I2C interface' CONFIG_I2C_ALGO8XX $CONFIG_I2C @@ -33,4 +27,5 @@ fi fi + if [ "$CONFIG_405" = "y" ]; then dep_tristate 'PPC 405 I2C Algorithm' CONFIG_I2C_PPC405_ALGO $CONFIG_I2C @@ -40,13 +35,10 @@ fi - if [ "$CONFIG_ALL_PPC" = "y" ] ; then - dep_tristate 'Keywest I2C interface in Apple Core99 machines' CONFIG_I2C_KEYWEST $CONFIG_I2C - fi - # This is needed for automatic patch generation: sensors code starts here # This is needed for automatic patch generation: sensors code ends here dep_tristate 'I2C device interface' CONFIG_I2C_CHARDEV $CONFIG_I2C - dep_tristate 'I2C /proc interface (required for hardware sensors)' CONFIG_I2C_PROC $CONFIG_I2C + + dep_tristate 'I2C /proc interface (required for hardware sensors)' CONFIG_I2C_PROC $CONFIG_I2C $CONFIG_SYSCTL fi --- linux-old/Makefile Mon Mar 25 15:25:39 CET 2002 +++ linux/Makefile Mon Mar 25 15:25:39 CET 2002 --- linux-old/drivers/Makefile Mon Mar 25 15:25:39 CET 2002 +++ linux/drivers/Makefile Mon Mar 25 15:25:39 CET 2002 --- linux-old/drivers/i2c/Makefile Mon Mar 25 15:25:39 CET 2002 +++ linux/drivers/i2c/Makefile Mon Mar 25 15:25:39 CET 2002 @@ -5,19 +5,15 @@ O_TARGET := i2c.o -export-objs := i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o \ - i2c-algo-ite.o i2c-proc.o +export-objs := i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o i2c-proc.o obj-$(CONFIG_I2C) += i2c-core.o obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o obj-$(CONFIG_I2C_ALGOBIT) += i2c-algo-bit.o -obj-$(CONFIG_I2C_PHILIPSPAR) += i2c-philips-par.o -obj-$(CONFIG_I2C_ELV) += i2c-elv.o -obj-$(CONFIG_I2C_VELLEMAN) += i2c-velleman.o +obj-$(CONFIG_I2C_BITLP) += i2c-philips-par.o +obj-$(CONFIG_I2C_BITELV) += i2c-elv.o +obj-$(CONFIG_I2C_BITVELLE) += i2c-velleman.o obj-$(CONFIG_I2C_ALGOPCF) += i2c-algo-pcf.o -obj-$(CONFIG_I2C_ELEKTOR) += i2c-elektor.o -obj-$(CONFIG_ITE_I2C_ALGO) += i2c-algo-ite.o -obj-$(CONFIG_ITE_I2C_ADAP) += i2c-adap-ite.o +obj-$(CONFIG_I2C_PCFISA) += i2c-elektor.o obj-$(CONFIG_I2C_PROC) += i2c-proc.o -obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest.o # This is needed for automatic patch generation: sensors code starts here --- linux-old/drivers/char/Config.in Mon Mar 25 15:25:39 CET 2002 +++ linux/drivers/char/Config.in Mon Mar 25 15:25:39 CET 2002 --- linux-old/drivers/char/mem.c Mon Mar 25 15:25:39 CET 2002 +++ linux/drivers/char/mem.c Mon Mar 25 15:25:39 CET 2002 --- linux-old/Documentation/Configure.help Mon Mar 25 15:25:39 CET 2002 +++ linux/Documentation/Configure.help Mon Mar 25 15:25:39 CET 2002 @@ -16395,4 +16395,13 @@ unless you are absolutely sure. +UltraSPARC-III bootbus i2c controller driver +CONFIG_BBC_I2C + The BBC devices on the UltraSPARC III have two I2C controllers. The + first I2C controller connects mainly to configuration PROMs (NVRAM, + CPU configuration, DIMM types, etc.). The second I2C controller + connects to environmental control devices such as fans and + temperature sensors. The second controller also connects to the + smartcard reader, if present. Say Y to enable support for these. + I2C support CONFIG_I2C @@ -16418,13 +16427,4 @@ . The module will be called i2c-core.o. - -UltraSPARC-III bootbus i2c controller driver -CONFIG_BBC_I2C - The BBC devices on the UltraSPARC III have two I2C controllers. The - first I2C controller connects mainly to configuration PROMs (NVRAM, - CPU configuration, DIMM types, etc.). The second I2C controller - connects to environmental control devices such as fans and - temperature sensors. The second controller also connects to the - smartcard reader, if present. Say Y to enable support for these. I2C bit-banging interfaces --- linux-old/MAINTAINERS Mon Mar 25 15:25:39 CET 2002 +++ linux/MAINTAINERS Mon Mar 25 15:25:39 CET 2002