bk://kernel.bkbits.net/gregkh/linux/i2c-2.6
greg@kroah.com|ChangeSet|20041222235950|10881 greg

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/12/30 23:18:09-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-i2c
# 
# include/linux/pci_ids.h
#   2004/12/30 23:18:03-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/29 18:13:10-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-i2c
# 
# include/linux/pci_ids.h
#   2004/12/29 18:13:04-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/27 00:42:57-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-i2c
# 
# include/linux/pci_ids.h
#   2004/12/27 00:42:49-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/25 08:51:17-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-i2c
# 
# include/linux/pci_ids.h
#   2004/12/25 08:51:13-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/12/21 11:09:49-08:00 jmunsin@iki.fi 
#   [PATCH] I2C: it87.c update
#   
#    - adds manual PWM
#    - removes buggy "reset" module parameter
#    - fixes some whitespaces
#   
#   Signed-off-by: Jonas Munsin <jmunsin@iki.fi>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# drivers/i2c/chips/it87.c
#   2004/12/20 13:28:14-08:00 jmunsin@iki.fi +130 -17
#   I2C: it87.c update
# 
# ChangeSet
#   2004/12/21 11:09:21-08:00 khali@linux-fr.org 
#   [PATCH] I2C: Remove checksum code in eeprom driver
#   
#   As a follow-up to my earlier proposal to remove the checksum code from
#   the i2c eeprom driver, here is a patch that does just that. This shrinks
#   the driver size by around 5%, and paves the way for further fixes and
#   cleanups.
#   
#   Signed-off-by: Jean Delvare <khali@linux-fr.org>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# drivers/i2c/chips/eeprom.c
#   2004/12/19 10:57:19-08:00 khali@linux-fr.org +0 -19
#   I2C: Remove checksum code in eeprom driver
# 
# ChangeSet
#   2004/12/21 11:08:43-08:00 sjhill@realitydiluted.com 
#   [PATCH] I2C patch from MIPS tree...
#   
#   Here is a newer i2c patch from the mainline Linux/MIPS kernel
#   tree. Some more changes came in since yesterday. Please apply
#   this for inclusion in the next Linux release. Thanks.
#   
#   Signed-off-by: Steven J. Hill <sjhill@realitydiluted.com>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# include/linux/i2c-id.h
#   2004/11/18 20:42:15-08:00 sjhill@realitydiluted.com +11 -0
#   I2C patch from MIPS tree...
# 
# include/linux/i2c-algo-sibyte.h
#   2003/12/15 18:10:45-08:00 sjhill@realitydiluted.com +33 -0
#   I2C patch from MIPS tree...
# 
# include/linux/i2c-algo-sgi.h
#   2003/12/15 18:10:45-08:00 sjhill@realitydiluted.com +27 -0
#   I2C patch from MIPS tree...
# 
# drivers/i2c/busses/i2c-sibyte.c
#   2004/12/18 20:42:44-08:00 sjhill@realitydiluted.com +71 -0
#   I2C patch from MIPS tree...
# 
# drivers/i2c/busses/Makefile
#   2004/11/18 20:39:29-08:00 sjhill@realitydiluted.com +1 -0
#   I2C patch from MIPS tree...
# 
# drivers/i2c/busses/Kconfig
#   2004/12/05 09:25:02-08:00 sjhill@realitydiluted.com +6 -0
#   I2C patch from MIPS tree...
# 
# drivers/i2c/algos/i2c-algo-sibyte.c
#   2003/09/30 07:27:22-07:00 sjhill@realitydiluted.com +231 -0
#   I2C patch from MIPS tree...
# 
# drivers/i2c/algos/Makefile
#   2004/11/18 20:39:29-08:00 sjhill@realitydiluted.com +2 -0
#   I2C patch from MIPS tree...
# 
# include/linux/i2c-algo-sibyte.h
#   2003/12/15 18:10:45-08:00 sjhill@realitydiluted.com +0 -0
#   BitKeeper file /home/greg/linux/BK/i2c-2.6/include/linux/i2c-algo-sibyte.h
# 
# include/linux/i2c-algo-sgi.h
#   2003/12/15 18:10:45-08:00 sjhill@realitydiluted.com +0 -0
#   BitKeeper file /home/greg/linux/BK/i2c-2.6/include/linux/i2c-algo-sgi.h
# 
# drivers/i2c/busses/i2c-sibyte.c
#   2004/12/18 20:42:44-08:00 sjhill@realitydiluted.com +0 -0
#   BitKeeper file /home/greg/linux/BK/i2c-2.6/drivers/i2c/busses/i2c-sibyte.c
# 
# drivers/i2c/algos/i2c-algo-sibyte.c
#   2003/09/30 07:27:22-07:00 sjhill@realitydiluted.com +0 -0
#   BitKeeper file /home/greg/linux/BK/i2c-2.6/drivers/i2c/algos/i2c-algo-sibyte.c
# 
# drivers/i2c/algos/i2c-algo-sgi.c
#   2003/09/30 07:27:22-07:00 sjhill@realitydiluted.com +189 -0
#   I2C patch from MIPS tree...
# 
# drivers/i2c/algos/Kconfig
#   2004/11/18 20:39:29-08:00 sjhill@realitydiluted.com +13 -0
#   I2C patch from MIPS tree...
# 
# drivers/i2c/algos/i2c-algo-sgi.c
#   2003/09/30 07:27:22-07:00 sjhill@realitydiluted.com +0 -0
#   BitKeeper file /home/greg/linux/BK/i2c-2.6/drivers/i2c/algos/i2c-algo-sgi.c
# 
# ChangeSet
#   2004/12/21 11:08:03-08:00 khali@linux-fr.org 
#   [PATCH] I2C: Use PCI_DEVICE in bus drivers
#   
#   > Hint, the PCI_DEVICE() macro makes this a lot simpler :)
#   
#   What about this cleanup patch then? It generalizes the use of
#   PCI_DEVICE() among i2c/busses drivers (with some pci ids cleanups for
#   free).
#   
#   Signed-off-by: Jean Delvare <khali@linux-fr.org>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# include/linux/pci_ids.h
#   2004/12/18 08:38:47-08:00 khali@linux-fr.org +6 -0
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-viapro.c
#   2004/12/18 09:34:28-08:00 khali@linux-fr.org +16 -56
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-sis96x.c
#   2004/12/18 08:55:31-08:00 khali@linux-fr.org +1 -11
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-prosavage.c
#   2004/12/18 08:55:31-08:00 khali@linux-fr.org +0 -7
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-piix4.c
#   2004/12/18 09:30:22-08:00 khali@linux-fr.org +12 -42
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-nforce2.c
#   2004/12/18 08:55:31-08:00 khali@linux-fr.org +4 -8
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-i801.c
#   2004/12/18 08:55:31-08:00 khali@linux-fr.org +8 -48
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-hydra.c
#   2004/12/18 08:55:31-08:00 khali@linux-fr.org +1 -6
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-amd8111.c
#   2004/12/18 08:55:31-08:00 khali@linux-fr.org +1 -1
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-amd756.c
#   2004/12/18 08:55:31-08:00 khali@linux-fr.org +10 -5
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-ali15x3.c
#   2004/12/18 08:55:31-08:00 khali@linux-fr.org +1 -6
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-ali1563.c
#   2004/12/18 08:55:31-08:00 khali@linux-fr.org +1 -6
#   I2C: Use PCI_DEVICE in bus drivers
# 
# drivers/i2c/busses/i2c-ali1535.c
#   2004/12/18 08:55:31-08:00 khali@linux-fr.org +1 -6
#   I2C: Use PCI_DEVICE in bus drivers
# 
# ChangeSet
#   2004/12/17 15:30:27-08:00 khali@linux-fr.org 
#   [PATCH] I2C: Discard old driver porting documentation
#   
#   The Documentation/i2c/i2c-old-porting file is outdated. There are no
#   more drivers left to be ported from that old i2c model (from the times
#   of Linux 2.2). Let's simply delete that file.
#   
#   Signed-off-by: Jean Delvare <khali@linux-fr.org>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# BitKeeper/deleted/.del-i2c-old-porting~d27f4c2ae78bed8b
#   2004/12/17 15:30:09-08:00 khali@linux-fr.org +0 -0
#   Delete: Documentation/i2c/i2c-old-porting
# 
# ChangeSet
#   2004/12/17 13:32:32-08:00 khali@linux-fr.org 
#   [PATCH] I2C: i2c-nforce2 supports the nForce3 250Gb
#   
#   One more PCI ID for the i2c-nforce2 driver, this time for the nForce3
#   250Gb variant. Tested, works.
#   
#   (Also cleans up a duplicate define in pci_ids.h.)
#   
#   Signed-off-by: Jean Delvare <khali@linux-fr.org>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# include/linux/pci_ids.h
#   2004/12/17 10:45:43-08:00 khali@linux-fr.org +1 -1
#   I2C: i2c-nforce2 supports the nForce3 250Gb
# 
# drivers/i2c/busses/i2c-nforce2.c
#   2004/12/17 10:46:33-08:00 khali@linux-fr.org +3 -0
#   I2C: i2c-nforce2 supports the nForce3 250Gb
# 
# ChangeSet
#   2004/12/15 11:43:29-08:00 domen@coderock.org 
#   [PATCH] it87: /proc/ioports fix
#   
#   When request_region is called name is set to "", use module name.
#   
#   Signed-off-by: Domen Puncer <domen@coderock.org>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# drivers/i2c/chips/it87.c
#   2004/12/10 05:41:29-08:00 domen@coderock.org +1 -1
#   it87: /proc/ioports fix
# 
# ChangeSet
#   2004/12/15 11:37:45-08:00 khali@linux-fr.org 
#   [PATCH] I2C: i2c-algo-bit should support I2C_FUNC_I2C
#   
#   > Very few drivers seem to support the I2C_FUNC_I2C functionality, is
#   > there a reason for that?
#   
#   Yes, most bus drivers are for SMBus, not I2C, masters. SMBus is a subset
#   of I2C. These SMBus master are fully I2C-capable, although in most cases
#   it doesn't matter. Most chip drivers are for SMBus clients as well.
#   Almost all hardware monitoring chips are SMBus devices. So it's not
#   surprising not to see I2C_FUNC_I2C widely used.
#   
#   > I have an I2C bus on my platform constructed from a couple of GPIO lines
#   > using the i2c-algo-bit driver. The device on the bus is a DS1307 I2C RTC
#   > and the driver for that currently checks for
#   > 	I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_WRITE_BYTE
#   > however the datasheet suggests it is a simple i2c device with none of
#   > this smbus stuff, Russell King queried this here
#   > http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=2021/1
#   
#   First, note that all SMBus commands are valid I2C transfers. In fact,
#   the SMBus specification doesn't do much except put names on specific I2C
#   transfers, and sometimes give meanings to the data being transfered. As
#   a result, "I2C" clients, although not specifically SMBus-compatible, may
#   enjoy SMBus commands such as SMBUS_READ_BYTE, SMBUS_READ_BYTE_DATA and
#   SMBUS_WRITE_BYTE_DATA. One typical example of that are EEPROMs and the
#   eeprom driver. It relies on i2c_smbus_write_byte and i2c_smbus_read_byte
#   (BTW I just noticed that it doesn't properly check for these
#   functionalities... have to fix that) because it's so much easier to call
#   these standard functions than rewrite I2C code manually. Also, this let
#   us access the EEPROMs on SMBus (non-I2C) busses.
#   
#   Now, note that Russell is not quite correct in is assertion: "Do we
#   really require SMBUS functionality, or is i2c functionality sufficient?"
#   It's actually the other way around. SMBus puts restrictions on what a
#   valid I2C transfer is. "Do we need the full I2C functionality or is the
#   SMBus subset sufficient?" would make more sense.
#   
#   As for the exact functionality you need to check, let's just see how you
#   access the bus. As far as I can see (providing that the code below
#   Russell's comments is still valid), you rely on:
#    * i2c_smbus_write_byte_data
#    * i2c_smbus_read_byte_data
#    * i2c_transfer
#   
#   So yo *need* to check for the availability of I2C_FUNC_SMBUS_BYTE_DATA
#   on the adapter (which is part of I2C_FUNC_SMBUS_EMUL so any bus driver
#   using that, including any relying on i2c-algo-bit, will work with your
#   client driver) for the first two. And you also need to check for
#   I2C_FUNC_I2C for the third one.
#   
#   Of course, any adapter with I2C_FUNC_I2C will be able to do SMBus byte
#   data transfers, but since you do not use i2c_transfer to do them, you
#   need to check the functionality separately (I think).
#   
#   Also, I think that what you do with i2c_transfer is similar to
#   I2C_FUNC_SMBUS_READ_I2C_BLOCK, which is supported by some SMBus
#   (non-I2C) masters. If you convert your code to use
#   i2c_smbus_read_i2c_block_data, then you don't rely on the full I2C
#   capatbilities of the bus, which means that your chip driver will be
#   useable on more plateforms. That said, note that this feature is
#   unimplemented on most SMBus master drivers as of now, and broken on a
#   number of others (but I guess we would start paying more attention to
#   them if there were more users for this function).
#   
#   > If I change it to a check for I2C_FUNC_I2C and change the algo-bit
#   > driver to declare I2C_FUNC_I2C then the driver continues to work fine.
#   
#   You are right that i2c-algo-bit should declare itself I2C_FUNC_I2C
#   capable. I even think that every bus being I2C_FUNC_SMBUS_EMUL capable
#   is very likely to be I2C_FUNC_I2C capable. This means that other
#   algorithms (ite, pcf, maybe pca) could most probably be declared
#   I2C_FUNC_I2C capable as well. Can anyone confirm?
#   
#   > Given the above, is the following patch appropriate, or is there
#   > something about the relationship between i2c and smbus that I don't
#   > understand.
#   
#   I admit that the relationship between I2C and SMBus is somewhat tricky,
#   it took me some time to get it and even then I am sometimes not sure to
#   understand exactly what implies what ;) So we cannot blame you for not
#   getting it at first. I hope I helped make things a little clearer. If
#   not I welcome questions.
#   
#   Whether or not you change your code to use SMBus only in your driver to
#   make it more widely useable, your patch to i2c-algo-bit is valid, I am
#   signing it too and will apply it to the 2.4 version of the driver as
#   well.
#   
#   Signed-off-by: Ian Campbell <icampbell@arcom.com>
#   Signed-off-by: Jean Delvare <khali@linux-fr.org>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# drivers/i2c/algos/i2c-algo-bit.c
#   2004/11/30 01:26:27-08:00 khali@linux-fr.org +2 -2
#   I2C: i2c-algo-bit should support I2C_FUNC_I2C
# 
# ChangeSet
#   2004/12/15 11:37:22-08:00 icampbell@arcom.com 
#   [PATCH] I2C: i2c-algo-bit should support I2C_FUNC_I2C
#   
#   Signed-off-by: Ian Campbell <icampbell@arcom.com>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# drivers/i2c/algos/i2c-algo-pcf.c
#   2004/12/07 02:14:58-08:00 icampbell@arcom.com +2 -2
#   I2C: i2c-algo-bit should support I2C_FUNC_I2C
# 
# drivers/i2c/algos/i2c-algo-pca.c
#   2004/12/07 03:14:09-08:00 icampbell@arcom.com +2 -2
#   I2C: i2c-algo-bit should support I2C_FUNC_I2C
# 
# ChangeSet
#   2004/12/15 11:36:57-08:00 khali@linux-fr.org 
#   [PATCH] I2C: use chip driver name to request regions
#   
#   > Trivial patch against 2.6.10-rc3-bk2.
#   > When request_region is called name is set to "", use module name.
#   
#   Correct. I even think we should do the same for other chip drivers. For
#   now they all use an arbitrary string. Using the driver's name would be
#   both more consistent and more efficient (spares some bytes of memory).
#   
#   
#   Signed-off-by: Jean Delvare <khali@linux-fr.org>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# drivers/i2c/chips/w83781d.c
#   2004/12/10 10:38:41-08:00 khali@linux-fr.org +2 -1
#   I2C: use chip driver name to request regions
# 
# drivers/i2c/chips/w83627hf.c
#   2004/12/10 10:38:55-08:00 khali@linux-fr.org +1 -1
#   I2C: use chip driver name to request regions
# 
# drivers/i2c/chips/via686a.c
#   2004/12/10 10:39:07-08:00 khali@linux-fr.org +1 -1
#   I2C: use chip driver name to request regions
# 
# drivers/i2c/chips/smsc47m1.c
#   2004/12/10 10:39:17-08:00 khali@linux-fr.org +1 -1
#   I2C: use chip driver name to request regions
# 
# drivers/i2c/chips/pc87360.c
#   2004/12/10 10:39:34-08:00 khali@linux-fr.org +2 -1
#   I2C: use chip driver name to request regions
# 
# drivers/i2c/chips/lm78.c
#   2004/12/10 10:39:43-08:00 khali@linux-fr.org +1 -1
#   I2C: use chip driver name to request regions
# 
# ChangeSet
#   2004/12/15 11:29:09-08:00 johnpol@2ka.mipt.ru 
#   [PATCH] w1: Documentation bits for generic w1 behaviour.
#   
#   Documentation bits for generic w1 behaviour.
#   
#   Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
#   Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
# 
# Documentation/w1/w1.generic
#   2004/12/01 05:04:16-08:00 johnpol@2ka.mipt.ru +19 -0
#   w1: Documentation bits for generic w1 behaviour.
# 
# Documentation/w1/w1.generic
#   2004/12/01 05:04:16-08:00 johnpol@2ka.mipt.ru +0 -0
#   BitKeeper file /home/greg/linux/BK/i2c-2.6/Documentation/w1/w1.generic
# 
diff -Nru a/Documentation/i2c/i2c-old-porting b/Documentation/i2c/i2c-old-porting
--- a/Documentation/i2c/i2c-old-porting	2005-01-02 23:10:09 -08:00
+++ /dev/null	Wed Dec 31 16:00:00 196900
@@ -1,626 +0,0 @@
-I2C Conversion Guide for I2C-old to the current I2C API
-July 2002
-For Linux Kernel v2.5.x
-Frank Davis <fdavis@si.rr.com>
--------------------------------------------------------
-
-There exists several kernel drivers that are using an old version of the I2C
-API. These drivers need to be converted to the current (kernel 2.5.x) version.
-The following document provides a guideline to make the appropriate changes to
-the affected drivers. There maybe slight modifications to this guide that are 
-specific to the driver you are working on. If you see {driver_name}, replace 
-that with the respective name of the driver, such as saa7110.c , {driver_name} 
-= saa7110.
-
--------------------------------------------------------
-
-Step 1: Include the right header file
- 
-Perform the following change within the driver
- 
-#include <linux/i2c-old.h> --> #include <linux/i2c.h>
-
-Step 2: Add and set the i2c modes
-
-Add the following code near the top of the driver
-
-static unsigned short normal_i2c[] = {34>>1, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
-static unsigned short probe[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
-static unsigned short probe_range[2] = { I2C_CLIENT_END , I2C_CLIENT_END };	
-static unsigned short ignore[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
-
-static struct i2c_client_address_data addr_data  = {
-	normal_i2c , normal_i2c_range,
-	probe , probe_range,
-	ignore , ignore_range,
-	force
-};
-
-static struct i2c_client client_template;
-
-Step 3: Modify the driver info struct
-
-Within the struct for the driver , such as struct {driver_name}  ,  make the 
-following change ,
-struct i2c_bus *bus --> struct i2c_client *client
-
-Make changes where this change affects references within the file.
-
-Add a semaphore to the driver struct (as above)
-
-struct semaphore lock 
-
-Step 5: Remove specific read and write functions
-
-Remove the driver specific write and read functions, usually in the form:
-{driver_name}_write , {driver_name}_read , {driver_name}_write_block , etc.
-
-Step 6: Update the write and read functions for the current I2C API
-
-Replace all references of {driver_name}_write with i2c_smbus_write_byte_data
-Replace all references of {driver_name}_read with i2c_smbus_read_byte_data or
-i2c_smbus_read_byte , depending on args passed in.
-
-** Ensure that these functions pass in the i2c_client *client , NOT the
-decoder/encoder that was passed in the driver specific write and read
-functions. 
- 
-Step 7: Modify the driver's attach function
-
-Change the driver attach function prototype :
-{driver_name}_attach(struct i2c_device *device) --> {driver_name}_attach(struct 
-i2c_adapter *adap, int addr , unsigned short flags, int kind)
-
-Create a i2c_client client...
-Add the following (where "decoder" is a reference to a struct for the driver
-info:
-
-struct i2c_client *client;
-client = kmalloc(sizeof(*client), GFP_KERNEL);
-if(client == NULL)
-	return -ENOMEM;
-client_template.adapter = adap;
-client_template.addr  = addr;
-memcpy(client, &client_template, sizeof(*client));
-strcpy(client->name , "{driver_name}");
-decoder->client = client;
-client->data = decoder;
-decoder->addr = addr;
-
-Towards the end of the function, add:
-
-init_MUTEX(&decoder->lock);
-i2c_attach_client(client);
-
-
-Step 8: Modify the driver's detach function
-
-Change the driver detach function prototype :
-{driver_name}_detach(struct i2c_device *device) --> {driver_name}_detach(struct 
-i2c_client *client)
-
-In the beginning of the detach function, add:
-i2c_detach_client(client);
-
-Towards the end of the detach function, add:
-kfree(client->data);
-kfree(client);
-
-Step 9: Modify the driver's command function
-
-Change the driver command function prototype :
-
-Step 10: Add the probe function after the driver's attach function.
-
-Add the following code:
-
-static int {driver_name}_probe(struct i2c_adapter *adap)
-{
-	return i2c_probe(adap, &addr_data, {driver_name}_attach);
-
-}
-
-Step 11: Modify the driver's i2c_driver
-
-Find the i2c_driver , such as
-static struct i2c_driver i2c_driver_saa7110
-It is usually located towards the end of the driver 
-Replace the values from I2C_DRIVERID_{something} to {driver_name}_attach, and 
-add the following
-I2C_DRIVERID_{driver_name} , // verify by looking in include/linux/i2c-id.h 
-I2C_DF_NOTIFY,
-{driver_name}_probe, 
-....
-
-Step 12: Adding the i2c_client 
-
-Add the i2c_client to the driver. Add the following code:
-
-static struct i2c_client client_template = {
-	"{driver_name}_client",
-	-1,
-	0,
-	0,
-	NULL,
-	{i2c_driver reference}
-};
-
-Step 13: Registering and Unregistering
-
-Replace i2c_register_driver with i2c_add_driver
-Replace i2c_unregister_driver with i2c_del_driver
-
--------------------------------------------------------
-
-Example:
-
-The following patch provides the i2c coversion patch for the saa7110 driver
-based on the above guide (for clarity).
-
-
---- drivers/media/video/saa7110.c.old	Fri Jun 28 10:22:52 2002
-+++ drivers/media/video/saa7110.c	Thu Jul  4 16:51:08 2002
-@@ -26,7 +26,7 @@
- #include <asm/io.h>
- #include <asm/uaccess.h>
- 
--#include <linux/i2c-old.h>
-+#include <linux/i2c.h>
- #include <linux/videodev.h>
- #include "linux/video_decoder.h"
- 
-@@ -37,13 +37,31 @@
- 
- #define	I2C_SAA7110		0x9C	/* or 0x9E */
- 
-+#define IF_NAME	"saa7110"
- #define	I2C_DELAY		10	/* 10 us or 100khz */
- 
-+static unsigned short normal_i2c[] = {34>>1, I2C_CLIENT_END };
-+static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
-+static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-+static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-+static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-+static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-+static unsigned short force[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-+
-+static struct i2c_client_address_data addr_data = {
-+	normal_i2c, normal_i2c_range,
-+	probe, probe_range,
-+	ignore, ignore_range,
-+	force
-+};
-+
-+static struct i2c_client client_template;
-+
- struct saa7110 {
--	struct	i2c_bus	*bus;
-+	struct i2c_client *client;
- 	int		addr;
- 	unsigned char	reg[36];
--
-+	struct semaphore lock;
- 	int		norm;
- 	int		input;
- 	int		enable;
-@@ -54,67 +72,10 @@
- };
- 
- /* ----------------------------------------------------------------------- */
--/* I2C support functions						   */
--/* ----------------------------------------------------------------------- */
--static
--int saa7110_write(struct saa7110 *decoder, unsigned char subaddr, unsigned char data)
--{
--	int ack;
--
--	LOCK_I2C_BUS(decoder->bus);
--	i2c_start(decoder->bus);
--	i2c_sendbyte(decoder->bus, decoder->addr, I2C_DELAY);
--	i2c_sendbyte(decoder->bus, subaddr, I2C_DELAY);
--	ack = i2c_sendbyte(decoder->bus, data, I2C_DELAY);
--	i2c_stop(decoder->bus);
--	decoder->reg[subaddr] = data;
--	UNLOCK_I2C_BUS(decoder->bus);
--	return ack;
--}
--
--static
--int saa7110_write_block(struct saa7110* decoder, unsigned const char *data, unsigned int len)
--{
--	unsigned subaddr = *data;
--
--	LOCK_I2C_BUS(decoder->bus);
--        i2c_start(decoder->bus);
--        i2c_sendbyte(decoder->bus,decoder->addr,I2C_DELAY);
--	while (len-- > 0) {
--                if (i2c_sendbyte(decoder->bus,*data,0)) {
--                        i2c_stop(decoder->bus);
--                        UNLOCK_I2C_BUS(decoder->bus);
--                        return -EAGAIN;
--                }
--		decoder->reg[subaddr++] = *data++;
--        }
--	i2c_stop(decoder->bus);
--	UNLOCK_I2C_BUS(decoder->bus);
--
--	return 0;
--}
--
--static
--int saa7110_read(struct saa7110* decoder)
--{
--	int data;
--
--	LOCK_I2C_BUS(decoder->bus);
--	i2c_start(decoder->bus);
--	i2c_sendbyte(decoder->bus, decoder->addr, I2C_DELAY);
--	i2c_start(decoder->bus);
--	i2c_sendbyte(decoder->bus, decoder->addr | 1, I2C_DELAY);
--	data = i2c_readbyte(decoder->bus, 1);
--	i2c_stop(decoder->bus);
--	UNLOCK_I2C_BUS(decoder->bus);
--	return data;
--}
--
--/* ----------------------------------------------------------------------- */
- /* SAA7110 functions							   */
- /* ----------------------------------------------------------------------- */
- static
--int saa7110_selmux(struct i2c_device *device, int chan)
-+int saa7110_selmux(struct i2c_client *client, int chan)
- {
- static	const unsigned char modes[9][8] = {
- /* mode 0 */	{ 0x00, 0xD9, 0x17, 0x40, 0x03, 0x44, 0x75, 0x16 },
-@@ -126,61 +87,59 @@
- /* mode 6 */	{ 0x80, 0x59, 0x17, 0x42, 0xA3, 0x44, 0x75, 0x12 },
- /* mode 7 */	{ 0x80, 0x9A, 0x17, 0xB1, 0x13, 0x60, 0xB5, 0x14 },
- /* mode 8 */	{ 0x80, 0x3C, 0x27, 0xC1, 0x23, 0x44, 0x75, 0x21 } };
--	struct saa7110* decoder = device->data;
- 	const unsigned char* ptr = modes[chan];
- 
--	saa7110_write(decoder,0x06,ptr[0]);	/* Luminance control	*/
--	saa7110_write(decoder,0x20,ptr[1]);	/* Analog Control #1	*/
--	saa7110_write(decoder,0x21,ptr[2]);	/* Analog Control #2	*/
--	saa7110_write(decoder,0x22,ptr[3]);	/* Mixer Control #1	*/
--	saa7110_write(decoder,0x2C,ptr[4]);	/* Mixer Control #2	*/
--	saa7110_write(decoder,0x30,ptr[5]);	/* ADCs gain control	*/
--	saa7110_write(decoder,0x31,ptr[6]);	/* Mixer Control #3	*/
--	saa7110_write(decoder,0x21,ptr[7]);	/* Analog Control #2	*/
-+	i2c_smbus_write_byte_data(client,0x06,ptr[0]);	/* Luminance control	*/
-+	i2c_smbus_write_byte_data(client,0x20,ptr[1]);	/* Analog Control #1	*/
-+	i2c_smbus_write_byte_data(client,0x21,ptr[2]);	/* Analog Control #2	*/
-+	i2c_smbus_write_byte_data(client,0x22,ptr[3]);	/* Mixer Control #1	*/
-+	i2c_smbus_write_byte_data(client,0x2C,ptr[4]);	/* Mixer Control #2	*/
-+	i2c_smbus_write_byte_data(client,0x30,ptr[5]);	/* ADCs gain control	*/
-+	i2c_smbus_write_byte_data(client,0x31,ptr[6]);	/* Mixer Control #3	*/
-+	i2c_smbus_write_byte_data(client,0x21,ptr[7]);	/* Analog Control #2	*/
- 
- 	return 0;
- }
- 
- static
--int determine_norm(struct i2c_device* dev)
-+int determine_norm(struct i2c_client* client)
- {
--	struct	saa7110* decoder = dev->data;
- 	int	status;
- 
- 	/* mode changed, start automatic detection */
--	status = saa7110_read(decoder);
-+	status = i2c_smbus_read_byte(client);
- 	if ((status & 3) == 0) {
--		saa7110_write(decoder,0x06,0x80);
-+		i2c_smbus_write_byte_data(client,0x06,0x80);
- 		if (status & 0x20) {
--			DEBUG(printk(KERN_INFO "%s: norm=bw60\n",dev->name));
--			saa7110_write(decoder,0x2E,0x81);
-+			DEBUG(printk(KERN_INFO "%s: norm=bw60\n",adp->name));
-+			i2c_smbus_write_byte_data(client,0x2E,0x81);
- 			return VIDEO_MODE_NTSC;
- 		}
--		DEBUG(printk(KERN_INFO "%s: norm=bw50\n",dev->name));
--		saa7110_write(decoder,0x2E,0x9A);
-+		DEBUG(printk(KERN_INFO "%s: norm=bw50\n",adp->name));
-+		i2c_smbus_write_byte_data(client,0x2E,0x9A);
- 		return VIDEO_MODE_PAL;
- 	}
- 
--	saa7110_write(decoder,0x06,0x00);
-+	i2c_smbus_write_byte_data(client,0x06,0x00);
- 	if (status & 0x20) {	/* 60Hz */
--		DEBUG(printk(KERN_INFO "%s: norm=ntsc\n",dev->name));
--		saa7110_write(decoder,0x0D,0x06);
--		saa7110_write(decoder,0x11,0x2C);
--		saa7110_write(decoder,0x2E,0x81);
-+		DEBUG(printk(KERN_INFO "%s: norm=ntsc\n",adp->name));
-+		i2c_smbus_write_byte_data(client,0x0D,0x06);
-+		i2c_smbus_write_byte_data(client,0x11,0x2C);
-+		i2c_smbus_write_byte_data(client,0x2E,0x81);
- 		return VIDEO_MODE_NTSC;
- 	}
- 
- 	/* 50Hz -> PAL/SECAM */
--	saa7110_write(decoder,0x0D,0x06);
--	saa7110_write(decoder,0x11,0x59);
--	saa7110_write(decoder,0x2E,0x9A);
-+	i2c_smbus_write_byte_data(client,0x0D,0x06);
-+	i2c_smbus_write_byte_data(client,0x11,0x59);
-+	i2c_smbus_write_byte_data(client,0x2E,0x9A);
- 
- 	mdelay(150);	/* pause 150 ms */
- 
--	status = saa7110_read(decoder);
-+	status = i2c_smbus_read_byte(client);
- 	if ((status & 0x03) == 0x01) {
- 		DEBUG(printk(KERN_INFO "%s: norm=secam\n",dev->name));
--		saa7110_write(decoder,0x0D,0x07);
-+		i2c_smbus_write_byte_data(client,0x0D,0x07);
- 		return VIDEO_MODE_SECAM;
- 	}
- 	DEBUG(printk(KERN_INFO "%s: norm=pal\n",dev->name));
-@@ -188,7 +147,7 @@
- }
- 
- static
--int saa7110_attach(struct i2c_device *device)
-+int saa7110_attach(struct i2c_adapter *adap, int  addr, unsigned short flags, int kind)
- {
- static	const unsigned char initseq[] = {
- 	     0, 0x4C, 0x3C, 0x0D, 0xEF, 0xBD, 0xF0, 0x00, 0x00,
-@@ -198,20 +157,28 @@
- 		0xD9, 0x17, 0x40, 0x41, 0x80, 0x41, 0x80, 0x4F,
- 		0xFE, 0x01, 0xCF, 0x0F, 0x03, 0x01, 0x81, 0x03,
- 		0x40, 0x75, 0x01, 0x8C, 0x03};
--	struct	saa7110*	decoder;
-+	struct	saa7110	*decoder;
-+	struct i2c_client *client;
- 	int			rv;
--
--	device->data = decoder = kmalloc(sizeof(struct saa7110), GFP_KERNEL);
--	if (device->data == 0)
-+	client=kmalloc(sizeof(*client), GFP_KERNEL);
-+	if(client == NULL) 
- 		return -ENOMEM;
--
-+	client_template.adapter = adap;
-+	client_template.addr = addr;
-+	memcpy(client, &client_template, sizeof(*client));
-+
-+	decoder = kmalloc(sizeof(*decoder), GFP_KERNEL);
-+	if (decoder == NULL) {
-+		kfree(client);
-+		return -ENOMEM;
-+		}
- 
- 	/* clear our private data */
--	memset(decoder, 0, sizeof(struct saa7110));
--	strcpy(device->name, "saa7110");
--	decoder->bus = device->bus;
--	decoder->addr = device->addr;
-+	memset(decoder, 0, sizeof(*decoder));
-+	strcpy(client->name, IF_NAME);
-+	decoder->client = client;
-+	client->data = decoder;
-+	decoder->addr = addr;
- 	decoder->norm = VIDEO_MODE_PAL;
- 	decoder->input = 0;
- 	decoder->enable = 1;
-@@ -220,40 +187,52 @@
- 	decoder->hue = 32768;
- 	decoder->sat = 32768;
- 
--	rv = saa7110_write_block(decoder, initseq, sizeof(initseq));
-+	rv = i2c_master_send(client, initseq, sizeof(initseq));
- 	if (rv < 0)
--		printk(KERN_ERR "%s_attach: init status %d\n", device->name, rv);
-+		printk(KERN_ERR "%s_attach: init status %d\n", client->name, rv);
- 	else {
--		saa7110_write(decoder,0x21,0x16);
--		saa7110_write(decoder,0x0D,0x04);
--		DEBUG(printk(KERN_INFO "%s_attach: chip version %x\n", device->name, saa7110_read(decoder)));
--		saa7110_write(decoder,0x0D,0x06);
-+		i2c_smbus_write_byte_data(client,0x21,0x16);
-+		i2c_smbus_write_byte_data(client,0x0D,0x04);
-+		DEBUG(printk(KERN_INFO "%s_attach: chip version %x\n", client->name, i2c_smbus_read_byte(client)));
-+		i2c_smbus_write_byte_data(client,0x0D,0x06);
- 	}
- 
-+	init_MUTEX(&decoder->lock);
-+	i2c_attach_client(client);
- 	/* setup and implicit mode 0 select has been performed */
- 	return 0;
- }
- 
-+static 
-+int saa7110_probe(struct i2c_adapter *adap) 
-+{
-+	return i2c_probe(adap, &addr_data, saa7110_attach);
-+}
-+
- static
--int saa7110_detach(struct i2c_device *device)
-+int saa7110_detach(struct i2c_client *client)
- {
--	struct saa7110* decoder = device->data;
-+	struct saa7110* decoder = client->data;
- 
--	DEBUG(printk(KERN_INFO "%s_detach\n",device->name));
-+	i2c_detach_client(client);
-+
-+	DEBUG(printk(KERN_INFO "%s_detach\n",client->name));
- 
- 	/* stop further output */
--	saa7110_write(decoder,0x0E,0x00);
-+	i2c_smbus_write_byte_data(client,0x0E,0x00);
- 
--	kfree(device->data);
-+	kfree(decoder);
-+	kfree(client);
- 
- 	return 0;
- }
- 
- static
--int saa7110_command(struct i2c_device *device, unsigned int cmd, void *arg)
-+int saa7110_command(struct i2c_client *client, unsigned int cmd, void *arg)
- {
--	struct saa7110* decoder = device->data;
-+	struct saa7110* decoder = client->data;
- 	int	v;
- 
- 	switch (cmd) {
-@@ -272,11 +251,11 @@
- 
- 	 case DECODER_GET_STATUS:
- 		{
--			struct saa7110* decoder = device->data;
-+			struct saa7110* decoder = client->data;
- 			int status;
- 			int res = 0;
- 
--			status = i2c_read(device->bus,device->addr|1);
-+			status = i2c_smbus_read_byte(client);
- 			if (status & 0x40)
- 				res |= DECODER_STATUS_GOOD;
- 			if (status & 0x03)
-@@ -301,26 +280,26 @@
- 		v = *(int*)arg;
- 		if (decoder->norm != v) {
- 			decoder->norm = v;
--			saa7110_write(decoder, 0x06, 0x00);
-+			i2c_smbus_write_byte_data(client, 0x06, 0x00);
- 			switch (v) {
- 			 case VIDEO_MODE_NTSC:
--				saa7110_write(decoder, 0x0D, 0x06);
--				saa7110_write(decoder, 0x11, 0x2C);
--				saa7110_write(decoder, 0x30, 0x81);
--				saa7110_write(decoder, 0x2A, 0xDF);
-+				i2c_smbus_write_byte_data(client, 0x0D, 0x06);
-+				i2c_smbus_write_byte_data(client, 0x11, 0x2C);
-+				i2c_smbus_write_byte_data(client, 0x30, 0x81);
-+				i2c_smbus_write_byte_data(client, 0x2A, 0xDF);
- 				break;
- 			 case VIDEO_MODE_PAL:
--				saa7110_write(decoder, 0x0D, 0x06);
--				saa7110_write(decoder, 0x11, 0x59);
--				saa7110_write(decoder, 0x2E, 0x9A);
-+				i2c_smbus_write_byte_data(client, 0x0D, 0x06);
-+				i2c_smbus_write_byte_data(client, 0x11, 0x59);
-+				i2c_smbus_write_byte_data(client, 0x2E, 0x9A);
- 				break;
- 			 case VIDEO_MODE_SECAM:
--				saa7110_write(decoder, 0x0D, 0x07);
--				saa7110_write(decoder, 0x11, 0x59);
--				saa7110_write(decoder, 0x2E, 0x9A);
-+				i2c_smbus_write_byte_data(client, 0x0D, 0x07);
-+				i2c_smbus_write_byte_data(client, 0x11, 0x59);
-+				i2c_smbus_write_byte_data(client, 0x2E, 0x9A);
- 				break;
- 			 case VIDEO_MODE_AUTO:
--				*(int*)arg = determine_norm(device);
-+				*(int*)arg = determine_norm(client);
- 				break;
- 			 default:
- 				return -EPERM;
-@@ -334,7 +313,7 @@
- 			return -EINVAL;
- 		if (decoder->input != v) {
- 			decoder->input = v;
--			saa7110_selmux(device, v);
-+			saa7110_selmux(client, v);
- 		}
- 		break;
- 
-@@ -349,7 +328,7 @@
- 		v = *(int*)arg;
- 		if (decoder->enable != v) {
- 			decoder->enable = v;
--			saa7110_write(decoder,0x0E, v ? 0x18 : 0x00);
-+			i2c_smbus_write_byte_data(client,0x0E, v ? 0x18 : 0x00);
- 		}
- 		break;
- 
-@@ -360,22 +339,22 @@
- 			if (decoder->bright != pic->brightness) {
- 				/* We want 0 to 255 we get 0-65535 */
- 				decoder->bright = pic->brightness;
--				saa7110_write(decoder, 0x19, decoder->bright >> 8);
-+				i2c_smbus_write_byte_data(client, 0x19, decoder->bright >> 8);
- 			}
- 			if (decoder->contrast != pic->contrast) {
- 				/* We want 0 to 127 we get 0-65535 */
- 				decoder->contrast = pic->contrast;
--				saa7110_write(decoder, 0x13, decoder->contrast >> 9);
-+				i2c_smbus_write_byte_data(client, 0x13, decoder->contrast >> 9);
- 			}
- 			if (decoder->sat != pic->colour) {
- 				/* We want 0 to 127 we get 0-65535 */
- 				decoder->sat = pic->colour;
--				saa7110_write(decoder, 0x12, decoder->sat >> 9);
-+				i2c_smbus_write_byte_data(client, 0x12, decoder->sat >> 9);
- 			}
- 			if (decoder->hue != pic->hue) {
- 				/* We want -128 to 127 we get 0-65535 */
- 				decoder->hue = pic->hue;
--				saa7110_write(decoder, 0x07, (decoder->hue>>8)-128);
-+				i2c_smbus_write_byte_data(client, 0x07, (decoder->hue>>8)-128);
- 			}
- 		}
- 		break;
-@@ -383,7 +362,7 @@
- 	 case DECODER_DUMP:
- 		for (v=0; v<34; v+=16) {
- 			int j;
--			DEBUG(printk(KERN_INFO "%s: %03x\n",device->name,v));
-+			DEBUG(printk(KERN_INFO "%s: %03x\n",client->name,v));
- 			for (j=0; j<16; j++) {
- 				DEBUG(printk(KERN_INFO " %02x",decoder->reg[v+j]));
- 			}
-@@ -402,24 +381,30 @@
- 
- static struct i2c_driver i2c_driver_saa7110 =
- {
--	"saa7110",			/* name */
--
--	I2C_DRIVERID_VIDEODECODER,	/* in i2c.h */
--	I2C_SAA7110, I2C_SAA7110+1,	/* Addr range */
--
--	saa7110_attach,
--	saa7110_detach,
--	saa7110_command
-+	.owner		= THIS_MODULE,
-+	.name		= IF_NAME,
-+	.id		= I2C_DRIVERID_SAA7110,
-+	.flags		= I2C_DF_NOTIFY,
-+	.attach_adapter	= saa7110_probe,
-+	.detach_adapter	= saa7110_detach,
-+	.command	= saa7110_command,
- };
-+static struct i2c_client client_template = {
-+	"saa7110_client",
-+	-1,
-+	0,
-+	0,
-+	NULL,
-+	&i2c_driver_saa7110
-+};
- 
- static int saa7110_init(void)
- {
--	return i2c_register_driver(&i2c_driver_saa7110);
-+	return i2c_add_driver(&i2c_driver_saa7110);
- }
- 
- static void saa7110_exit(void)
- {
--	i2c_unregister_driver(&i2c_driver_saa7110);
-+	i2c_del_driver(&i2c_driver_saa7110);
- }
- 
- 
- 
-
diff -Nru a/Documentation/w1/w1.generic b/Documentation/w1/w1.generic
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/Documentation/w1/w1.generic	2005-01-02 23:10:09 -08:00
@@ -0,0 +1,19 @@
+Any w1 device must be connected to w1 bus master device - for example
+ds9490 usb device or w1-over-GPIO or RS232 converter.
+Driver for w1 bus master must provide several functions(you can find
+them in struct w1_bus_master definition in w1.h) which then will be
+called by w1 core to send various commands over w1 bus(by default it is
+reset and search commands). When some device is found on the bus, w1 core
+checks if driver for it's family is loaded.
+If driver is loaded w1 core creates new w1_slave object and registers it
+in the system(creates some generic sysfs files(struct w1_family_ops in
+w1_family.h), notifies any registered listener and so on...).
+It is device driver's business to provide any communication method
+upstream.
+For example w1_therm driver(ds18?20 thermal sensor family driver)
+provides temperature reading function which is bound to ->rbin() method
+of the above w1_family_ops structure.
+w1_smem - driver for simple 64bit memory cell provides ID reading
+method.
+
+You can call above methods by reading appropriate sysfs files.
diff -Nru a/drivers/i2c/algos/Kconfig b/drivers/i2c/algos/Kconfig
--- a/drivers/i2c/algos/Kconfig	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/algos/Kconfig	2005-01-02 23:10:09 -08:00
@@ -53,5 +53,18 @@
 	tristate "MPC8xx CPM I2C interface"
 	depends on 8xx && I2C
 
+config I2C_ALGO_SIBYTE
+	tristate "SiByte SMBus interface"
+	depends on SIBYTE_SB1xxx_SOC && I2C
+	help
+	  Supports the SiByte SOC on-chip I2C interfaces (2 channels).
+
+config I2C_ALGO_SGI
+	tristate "I2C SGI interfaces"
+	depends on I2C
+	help
+	  Supports the SGI interfaces like the ones found on SGI Indy VINO
+	  or SGI O2 MACE.
+
 endmenu
 
diff -Nru a/drivers/i2c/algos/Makefile b/drivers/i2c/algos/Makefile
--- a/drivers/i2c/algos/Makefile	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/algos/Makefile	2005-01-02 23:10:09 -08:00
@@ -6,6 +6,8 @@
 obj-$(CONFIG_I2C_ALGOPCF)	+= i2c-algo-pcf.o
 obj-$(CONFIG_I2C_ALGOPCA)	+= i2c-algo-pca.o
 obj-$(CONFIG_I2C_ALGOITE)	+= i2c-algo-ite.o
+obj-$(CONFIG_I2C_ALGO_SIBYTE)	+= i2c-algo-sibyte.o
+obj-$(CONFIG_I2C_ALGO_SGI)	+= i2c-algo-sgi.o
 
 ifeq ($(CONFIG_I2C_DEBUG_ALGO),y)
 EXTRA_CFLAGS += -DDEBUG
diff -Nru a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
--- a/drivers/i2c/algos/i2c-algo-bit.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/algos/i2c-algo-bit.c	2005-01-02 23:10:09 -08:00
@@ -511,8 +511,8 @@
 
 static u32 bit_func(struct i2c_adapter *adap)
 {
-	return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_10BIT_ADDR | 
-	       I2C_FUNC_PROTOCOL_MANGLING;
+	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | 
+	       I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING;
 }
 
 
diff -Nru a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
--- a/drivers/i2c/algos/i2c-algo-pca.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/algos/i2c-algo-pca.c	2005-01-02 23:10:09 -08:00
@@ -189,7 +189,7 @@
 
 	state = pca_status(adap);
 	if ( state != 0xF8 ) {
-		printk(KERN_ERR DRIVER ": bus is not idle. status is %#04x\n", state );
+		dev_dbg(&i2c_adap->dev, "bus is not idle. status is %#04x\n", state );
 		/* FIXME: what to do. Force stop ? */
 		return -EREMOTEIO;
 	}
@@ -328,7 +328,7 @@
 
 static u32 pca_func(struct i2c_adapter *adap)
 {
-        return I2C_FUNC_SMBUS_EMUL;
+        return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
 }
 
 static int pca_init(struct i2c_algo_pca_data *adap)
diff -Nru a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c
--- a/drivers/i2c/algos/i2c-algo-pcf.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/algos/i2c-algo-pcf.c	2005-01-02 23:10:09 -08:00
@@ -414,8 +414,8 @@
 
 static u32 pcf_func(struct i2c_adapter *adap)
 {
-	return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_10BIT_ADDR | 
-	       I2C_FUNC_PROTOCOL_MANGLING; 
+	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | 
+	       I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING; 
 }
 
 /* -----exported algorithm data: -------------------------------------	*/
diff -Nru a/drivers/i2c/algos/i2c-algo-sgi.c b/drivers/i2c/algos/i2c-algo-sgi.c
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/drivers/i2c/algos/i2c-algo-sgi.c	2005-01-02 23:10:09 -08:00
@@ -0,0 +1,189 @@
+/*
+ * i2c-algo-sgi.c: i2c driver algorithms for SGI adapters.
+ * 
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+
+#include <linux/i2c.h>
+#include <linux/i2c-algo-sgi.h>
+
+
+#define SGI_I2C_FORCE_IDLE	(0 << 0)
+#define SGI_I2C_NOT_IDLE	(1 << 0)
+#define SGI_I2C_WRITE		(0 << 1)
+#define SGI_I2C_READ		(1 << 1)
+#define SGI_I2C_RELEASE_BUS	(0 << 2)
+#define SGI_I2C_HOLD_BUS	(1 << 2)
+#define SGI_I2C_XFER_DONE	(0 << 4)
+#define SGI_I2C_XFER_BUSY	(1 << 4)
+#define SGI_I2C_ACK		(0 << 5)
+#define SGI_I2C_NACK		(1 << 5)
+#define SGI_I2C_BUS_OK		(0 << 7)
+#define SGI_I2C_BUS_ERR		(1 << 7)
+
+#define get_control()		adap->getctrl(adap->data)
+#define set_control(val)	adap->setctrl(adap->data, val)
+#define read_data()		adap->rdata(adap->data)
+#define write_data(val)		adap->wdata(adap->data, val)
+
+
+static int wait_xfer_done(struct i2c_algo_sgi_data *adap)
+{
+	int i;
+
+	for (i = 0; i < adap->xfer_timeout; i++) {
+		if ((get_control() & SGI_I2C_XFER_BUSY) == 0)
+			return 0;
+		udelay(1);
+	}
+
+	return -ETIMEDOUT;
+}
+
+static int wait_ack(struct i2c_algo_sgi_data *adap)
+{
+	int i;
+
+	if (wait_xfer_done(adap))
+		return -ETIMEDOUT;
+	for (i = 0; i < adap->ack_timeout; i++) {
+		if ((get_control() & SGI_I2C_NACK) == 0)
+			return 0;
+		udelay(1);
+	}
+
+	return -ETIMEDOUT;
+}
+
+static int force_idle(struct i2c_algo_sgi_data *adap)
+{
+	int i;
+
+	set_control(SGI_I2C_FORCE_IDLE);
+	for (i = 0; i < adap->xfer_timeout; i++) {
+		if ((get_control() & SGI_I2C_NOT_IDLE) == 0)
+			goto out;
+		udelay(1);
+	}
+	return -ETIMEDOUT;
+out:
+	if (get_control() & SGI_I2C_BUS_ERR)
+		return -EIO;
+	return 0;
+}
+
+static int do_address(struct i2c_algo_sgi_data *adap, unsigned int addr,
+		      int rd)
+{
+	if (rd)
+		set_control(SGI_I2C_NOT_IDLE);
+	/* Check if bus is idle, eventually force it to do so */
+	if (get_control() & SGI_I2C_NOT_IDLE)
+		if (force_idle(adap))
+	                return -EIO;
+	/* Write out the i2c chip address and specify operation */
+	set_control(SGI_I2C_HOLD_BUS | SGI_I2C_WRITE | SGI_I2C_NOT_IDLE);
+	if (rd)
+		addr |= 1;
+	write_data(addr);
+	if (wait_ack(adap))
+		return -EIO;
+	return 0;
+}
+
+static int i2c_read(struct i2c_algo_sgi_data *adap, unsigned char *buf,
+		    unsigned int len)
+{
+	int i;
+
+	set_control(SGI_I2C_HOLD_BUS | SGI_I2C_READ | SGI_I2C_NOT_IDLE);
+	for (i = 0; i < len; i++) {
+		if (wait_xfer_done(adap))
+			return -EIO;
+		buf[i] = read_data();
+	}
+	set_control(SGI_I2C_RELEASE_BUS | SGI_I2C_FORCE_IDLE);
+
+	return 0;
+
+}
+
+static int i2c_write(struct i2c_algo_sgi_data *adap, unsigned char *buf,
+		     unsigned int len)
+{
+	int i;
+
+	/* We are already in write state */
+	for (i = 0; i < len; i++) {
+		write_data(buf[i]);
+		if (wait_ack(adap))
+			return -EIO;
+	}
+	return 0;
+}
+
+static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[],
+		    int num)
+{
+	struct i2c_algo_sgi_data *adap = i2c_adap->algo_data;
+	struct i2c_msg *p;
+	int i, err = 0;
+
+	for (i = 0; !err && i < num; i++) {
+		p = &msgs[i];
+		err = do_address(adap, p->addr, p->flags & I2C_M_RD);
+		if (err || !p->len)
+			continue;
+		if (p->flags & I2C_M_RD)
+			err = i2c_read(adap, p->buf, p->len);
+		else
+			err = i2c_write(adap, p->buf, p->len);
+	}
+
+	return err;
+}
+
+static u32 sgi_func(struct i2c_adapter *adap)
+{
+	return I2C_FUNC_SMBUS_EMUL;
+}
+
+static struct i2c_algorithm sgi_algo = {
+	.name		= "SGI algorithm",
+	.id		= I2C_ALGO_SGI,
+	.master_xfer	= sgi_xfer,
+	.functionality	= sgi_func,
+};
+
+/* 
+ * registering functions to load algorithms at runtime 
+ */
+int i2c_sgi_add_bus(struct i2c_adapter *adap)
+{
+	adap->id |= sgi_algo.id;
+	adap->algo = &sgi_algo;
+
+	return i2c_add_adapter(adap);
+}
+
+
+int i2c_sgi_del_bus(struct i2c_adapter *adap)
+{
+	return i2c_del_adapter(adap);
+}
+
+EXPORT_SYMBOL(i2c_sgi_add_bus);
+EXPORT_SYMBOL(i2c_sgi_del_bus);
+
+MODULE_AUTHOR("Ladislav Michl <ladis@linux-mips.org>");
+MODULE_DESCRIPTION("I2C-Bus SGI algorithm");
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/i2c/algos/i2c-algo-sibyte.c b/drivers/i2c/algos/i2c-algo-sibyte.c
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/drivers/i2c/algos/i2c-algo-sibyte.c	2005-01-02 23:10:09 -08:00
@@ -0,0 +1,231 @@
+/* ------------------------------------------------------------------------- */
+/* i2c-algo-sibyte.c i2c driver algorithms for bit-shift adapters		     */
+/* ------------------------------------------------------------------------- */
+/*   Copyright (C) 2001,2002,2003 Broadcom Corporation
+     Copyright (C) 1995-2000 Simon G. Vogl
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.		     */
+/* ------------------------------------------------------------------------- */
+
+/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
+   Frodo Looijaard <frodol@dds.nl>.  */
+
+/* Ported for SiByte SOCs by Broadcom Corporation.  */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+
+#include <asm/io.h>
+#include <asm/sibyte/sb1250_regs.h>
+#include <asm/sibyte/sb1250_smbus.h>
+
+#include <linux/i2c.h>
+#include <linux/i2c-algo-sibyte.h>
+
+/* ----- global defines ----------------------------------------------- */
+#define SMB_CSR(a,r) ((long)(a->reg_base + r))
+
+/* ----- global variables ---------------------------------------------	*/
+
+/* module parameters:
+ */
+static int bit_scan=0;	/* have a look at what's hanging 'round		*/
+
+
+static int smbus_xfer(struct i2c_adapter *i2c_adap, u16 addr, 
+                      unsigned short flags, char read_write,
+                      u8 command, int size, union i2c_smbus_data * data)
+{
+	struct i2c_algo_sibyte_data *adap = i2c_adap->algo_data;
+        int data_bytes = 0;
+        int error;
+
+        while (csr_in32(SMB_CSR(adap, R_SMB_STATUS)) & M_SMB_BUSY)
+                ;
+
+        switch (size) {
+        case I2C_SMBUS_QUICK:
+                csr_out32((V_SMB_ADDR(addr) | (read_write == I2C_SMBUS_READ ? M_SMB_QDATA : 0) |
+			   V_SMB_TT_QUICKCMD), SMB_CSR(adap, R_SMB_START));
+                break;
+        case I2C_SMBUS_BYTE:
+                if (read_write == I2C_SMBUS_READ) {
+                        csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_RD1BYTE),
+				  SMB_CSR(adap, R_SMB_START));
+                        data_bytes = 1;
+                } else {
+                        csr_out32(V_SMB_CMD(command), SMB_CSR(adap, R_SMB_CMD));
+                        csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_WR1BYTE),
+				  SMB_CSR(adap, R_SMB_START));
+                }
+                break;
+        case I2C_SMBUS_BYTE_DATA:
+                csr_out32(V_SMB_CMD(command), SMB_CSR(adap, R_SMB_CMD));
+                if (read_write == I2C_SMBUS_READ) {
+                        csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_CMD_RD1BYTE),
+				  SMB_CSR(adap, R_SMB_START));
+                        data_bytes = 1;
+                } else {
+                        csr_out32(V_SMB_LB(data->byte), SMB_CSR(adap, R_SMB_DATA));
+                        csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_WR2BYTE),
+				  SMB_CSR(adap, R_SMB_START));
+                }
+                break;
+        case I2C_SMBUS_WORD_DATA:
+                csr_out32(V_SMB_CMD(command), SMB_CSR(adap, R_SMB_CMD));
+                if (read_write == I2C_SMBUS_READ) {
+                        csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_CMD_RD2BYTE),
+				  SMB_CSR(adap, R_SMB_START));
+                        data_bytes = 2;
+                } else {
+                        csr_out32(V_SMB_LB(data->word & 0xff), SMB_CSR(adap, R_SMB_DATA));
+                        csr_out32(V_SMB_MB(data->word >> 8), SMB_CSR(adap, R_SMB_DATA));
+                        csr_out32((V_SMB_ADDR(addr) | V_SMB_TT_WR2BYTE),
+				  SMB_CSR(adap, R_SMB_START));
+                }
+                break;
+        default:
+                return -1;      /* XXXKW better error code? */
+        }
+
+        while (csr_in32(SMB_CSR(adap, R_SMB_STATUS)) & M_SMB_BUSY)
+                ;
+
+        error = csr_in32(SMB_CSR(adap, R_SMB_STATUS));
+        if (error & M_SMB_ERROR) {
+                /* Clear error bit by writing a 1 */
+                csr_out32(M_SMB_ERROR, SMB_CSR(adap, R_SMB_STATUS));
+                return -1;      /* XXXKW better error code? */
+        }
+
+        if (data_bytes == 1)
+                data->byte = csr_in32(SMB_CSR(adap, R_SMB_DATA)) & 0xff;
+        if (data_bytes == 2)
+                data->word = csr_in32(SMB_CSR(adap, R_SMB_DATA)) & 0xffff;
+
+        return 0;
+}
+
+static int algo_control(struct i2c_adapter *adapter, 
+	unsigned int cmd, unsigned long arg)
+{
+	return 0;
+}
+
+static u32 bit_func(struct i2c_adapter *adap)
+{
+	return (I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
+                I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA);
+}
+
+
+/* -----exported algorithm data: -------------------------------------	*/
+
+static struct i2c_algorithm i2c_sibyte_algo = {
+	"SiByte algorithm",
+	I2C_ALGO_SIBYTE,
+	NULL,                           /* master_xfer          */
+	smbus_xfer,                   	/* smbus_xfer           */
+	NULL,				/* slave_xmit		*/
+	NULL,				/* slave_recv		*/
+	algo_control,			/* ioctl		*/
+	bit_func,			/* functionality	*/
+};
+
+/* 
+ * registering functions to load algorithms at runtime 
+ */
+int i2c_sibyte_add_bus(struct i2c_adapter *i2c_adap, int speed)
+{
+	int i;
+	struct i2c_algo_sibyte_data *adap = i2c_adap->algo_data;
+
+	/* register new adapter to i2c module... */
+
+	i2c_adap->id |= i2c_sibyte_algo.id;
+	i2c_adap->algo = &i2c_sibyte_algo;
+        
+        /* Set the frequency to 100 kHz */
+        csr_out32(speed, SMB_CSR(adap,R_SMB_FREQ));
+        csr_out32(0, SMB_CSR(adap,R_SMB_CONTROL));
+
+	/* scan bus */
+	if (bit_scan) {
+                union i2c_smbus_data data;
+                int rc;
+		printk(KERN_INFO " i2c-algo-sibyte.o: scanning bus %s.\n",
+		       i2c_adap->name);
+		for (i = 0x00; i < 0x7f; i++) {
+                        /* XXXKW is this a realistic probe? */
+                        rc = smbus_xfer(i2c_adap, i, 0, I2C_SMBUS_READ, 0,
+                                        I2C_SMBUS_BYTE_DATA, &data);
+			if (!rc) {
+				printk("(%02x)",i); 
+			} else 
+				printk("."); 
+		}
+		printk("\n");
+	}
+
+#ifdef MODULE
+	MOD_INC_USE_COUNT;
+#endif
+	i2c_add_adapter(i2c_adap);
+
+	return 0;
+}
+
+
+int i2c_sibyte_del_bus(struct i2c_adapter *adap)
+{
+	int res;
+
+	if ((res = i2c_del_adapter(adap)) < 0)
+		return res;
+
+#ifdef MODULE
+	MOD_DEC_USE_COUNT;
+#endif
+	return 0;
+}
+
+int __init i2c_algo_sibyte_init (void)
+{
+	printk("i2c-algo-sibyte.o: i2c SiByte algorithm module\n");
+	return 0;
+}
+
+
+EXPORT_SYMBOL(i2c_sibyte_add_bus);
+EXPORT_SYMBOL(i2c_sibyte_del_bus);
+
+#ifdef MODULE
+MODULE_AUTHOR("Kip Walker, Broadcom Corp.");
+MODULE_DESCRIPTION("SiByte I2C-Bus algorithm");
+MODULE_PARM(bit_scan, "i");
+MODULE_PARM_DESC(bit_scan, "Scan for active chips on the bus");
+MODULE_LICENSE("GPL");
+
+int init_module(void) 
+{
+	return i2c_algo_sibyte_init();
+}
+
+void cleanup_module(void) 
+{
+}
+#endif
diff -Nru a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
--- a/drivers/i2c/busses/Kconfig	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/Kconfig	2005-01-02 23:10:09 -08:00
@@ -323,6 +323,12 @@
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-savage4.
 
+config I2C_SIBYTE
+	tristate "SiByte SMBus interface"
+	depends on SIBYTE_SB1xxx_SOC && I2C
+	help
+	  Supports the SiByte SOC on-chip I2C interfaces (2 channels).
+
 config SCx200_I2C
 	tristate "NatSemi SCx200 I2C using GPIO pins"
 	depends on SCx200_GPIO && I2C
diff -Nru a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
--- a/drivers/i2c/busses/Makefile	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/Makefile	2005-01-02 23:10:09 -08:00
@@ -29,6 +29,7 @@
 obj-$(CONFIG_I2C_RPXLITE)	+= i2c-rpx.o
 obj-$(CONFIG_I2C_S3C2410)	+= i2c-s3c2410.o
 obj-$(CONFIG_I2C_SAVAGE4)	+= i2c-savage4.o
+obj-$(CONFIG_I2C_SIBYTE)	+= i2c-sibyte.o
 obj-$(CONFIG_I2C_SIS5595)	+= i2c-sis5595.o
 obj-$(CONFIG_I2C_SIS630)	+= i2c-sis630.o
 obj-$(CONFIG_I2C_SIS96X)	+= i2c-sis96x.o
diff -Nru a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c
--- a/drivers/i2c/busses/i2c-ali1535.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-ali1535.c	2005-01-02 23:10:09 -08:00
@@ -487,12 +487,7 @@
 };
 
 static struct pci_device_id ali1535_ids[] = {
-	{
-		.vendor =	PCI_VENDOR_ID_AL,
-		.device =	PCI_DEVICE_ID_AL_M7101,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-	},
+	{ PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) },
 	{ },
 };
 
diff -Nru a/drivers/i2c/busses/i2c-ali1563.c b/drivers/i2c/busses/i2c-ali1563.c
--- a/drivers/i2c/busses/i2c-ali1563.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-ali1563.c	2005-01-02 23:10:09 -08:00
@@ -385,12 +385,7 @@
 }
 
 static struct pci_device_id __devinitdata ali1563_id_table[] = {
-	{
-		.vendor		= PCI_VENDOR_ID_AL,
-		.device		= PCI_DEVICE_ID_AL_M1563,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-	},
+	{ PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1563) },
 	{},
 };
 
diff -Nru a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c
--- a/drivers/i2c/busses/i2c-ali15x3.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-ali15x3.c	2005-01-02 23:10:09 -08:00
@@ -477,12 +477,7 @@
 };
 
 static struct pci_device_id ali15x3_ids[] = {
-	{
-	.vendor =	PCI_VENDOR_ID_AL,
-	.device =	PCI_DEVICE_ID_AL_M7101,
-	.subvendor =	PCI_ANY_ID,
-	.subdevice =	PCI_ANY_ID,
-	},
+	{ PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) },
 	{ 0, }
 };
 
diff -Nru a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c
--- a/drivers/i2c/busses/i2c-amd756.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-amd756.c	2005-01-02 23:10:09 -08:00
@@ -316,11 +316,16 @@
 };
 
 static struct pci_device_id amd756_ids[] = {
-	{PCI_VENDOR_ID_AMD, 0x740B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD756 },
-	{PCI_VENDOR_ID_AMD, 0x7413, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD766 },
-	{PCI_VENDOR_ID_AMD, 0x7443, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD768 },
-	{PCI_VENDOR_ID_AMD, 0x746B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD8111 },
-	{PCI_VENDOR_ID_NVIDIA, 0x01B4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, NFORCE },
+	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_740B),
+	  .driver_data = AMD756 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7413),
+	  .driver_data = AMD766 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_OPUS_7443),
+	  .driver_data = AMD768 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS),
+	  .driver_data = AMD8111 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_SMBUS),
+	  .driver_data = NFORCE },
 	{ 0, }
 };
 
diff -Nru a/drivers/i2c/busses/i2c-amd8111.c b/drivers/i2c/busses/i2c-amd8111.c
--- a/drivers/i2c/busses/i2c-amd8111.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-amd8111.c	2005-01-02 23:10:09 -08:00
@@ -332,7 +332,7 @@
 
 
 static struct pci_device_id amd8111_ids[] = {
-	{ 0x1022, 0x746a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS2) },
 	{ 0, }
 };
 
diff -Nru a/drivers/i2c/busses/i2c-hydra.c b/drivers/i2c/busses/i2c-hydra.c
--- a/drivers/i2c/busses/i2c-hydra.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-hydra.c	2005-01-02 23:10:09 -08:00
@@ -111,12 +111,7 @@
 };
 
 static struct pci_device_id hydra_ids[] = {
-	{
-		.vendor		= PCI_VENDOR_ID_APPLE,
-		.device		= PCI_DEVICE_ID_APPLE_HYDRA,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-	},
+	{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_HYDRA) },
 	{ 0, }
 };
 
diff -Nru a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
--- a/drivers/i2c/busses/i2c-i801.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-i801.c	2005-01-02 23:10:09 -08:00
@@ -548,54 +548,14 @@
 };
 
 static struct pci_device_id i801_ids[] = {
-	{
-		.vendor =	PCI_VENDOR_ID_INTEL,
-		.device =	PCI_DEVICE_ID_INTEL_82801AA_3,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_INTEL,
-		.device =	PCI_DEVICE_ID_INTEL_82801AB_3,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_INTEL,
-		.device =	PCI_DEVICE_ID_INTEL_82801BA_2,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_INTEL,
-		.device =	PCI_DEVICE_ID_INTEL_82801CA_3,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_INTEL,
-		.device =	PCI_DEVICE_ID_INTEL_82801DB_3,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_INTEL,
-		.device =	PCI_DEVICE_ID_INTEL_82801EB_3,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_INTEL,
-		.device =	PCI_DEVICE_ID_INTEL_ESB_4,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice = 	PCI_ANY_ID,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_INTEL,
-		.device =	PCI_DEVICE_ID_INTEL_ICH6_16,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-	},
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_3) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_3) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_2) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_3) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_3) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_3) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_4) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_16) },
 	{ 0, }
 };
 
diff -Nru a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
--- a/drivers/i2c/busses/i2c-nforce2.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-nforce2.c	2005-01-02 23:10:09 -08:00
@@ -28,6 +28,7 @@
     nForce2 MCP			0064
     nForce2 Ultra 400 MCP	0084
     nForce3 Pro150 MCP		00D4
+    nForce3 250Gb MCP		00E4
 
     This driver supports the 2 SMBuses that are included in the MCP2 of the
     nForce2 chipset.
@@ -290,12 +291,10 @@
 
 
 static struct pci_device_id nforce2_ids[] = {
-	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS,
-	       	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS,
-	       	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS,
-	       	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SMBUS) },
 	{ 0 }
 };
 
diff -Nru a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
--- a/drivers/i2c/busses/i2c-piix4.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-piix4.c	2005-01-02 23:10:09 -08:00
@@ -414,48 +414,18 @@
 };
 
 static struct pci_device_id piix4_ids[] = {
-	{
-		.vendor =	PCI_VENDOR_ID_INTEL,
-		.device =	PCI_DEVICE_ID_INTEL_82371AB_3,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-		.driver_data =	3
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_SERVERWORKS,
-		.device =	PCI_DEVICE_ID_SERVERWORKS_OSB4,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-		.driver_data =	0,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_SERVERWORKS,
-		.device =	PCI_DEVICE_ID_SERVERWORKS_CSB5,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-		.driver_data =	0,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_SERVERWORKS,
-		.device =	PCI_DEVICE_ID_SERVERWORKS_CSB6,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-		.driver_data =	0,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_INTEL,
-		.device =	PCI_DEVICE_ID_INTEL_82443MX_3,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-		.driver_data =	3,
-	},
-	{
-		.vendor =	PCI_VENDOR_ID_EFAR,
-		.device =	PCI_DEVICE_ID_EFAR_SLC90E66_3,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-		.driver_data =	0,
-	},
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3),
+	  .driver_data = 3 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4),
+	  .driver_data = 0 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5),
+	  .driver_data = 0 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6),
+	  .driver_data = 0 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3),
+	  .driver_data = 3 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_3),
+	  .driver_data = 0 },
 	{ 0, }
 };
 
diff -Nru a/drivers/i2c/busses/i2c-prosavage.c b/drivers/i2c/busses/i2c-prosavage.c
--- a/drivers/i2c/busses/i2c-prosavage.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-prosavage.c	2005-01-02 23:10:09 -08:00
@@ -96,13 +96,6 @@
 /* 
  * S3/VIA 8365/8375 registers
  */
-#ifndef PCI_DEVICE_ID_S3_SAVAGE4
-#define PCI_DEVICE_ID_S3_SAVAGE4	0x8a25
-#endif
-#ifndef PCI_DEVICE_ID_S3_PROSAVAGE8
-#define PCI_DEVICE_ID_S3_PROSAVAGE8	0x8d04
-#endif
-
 #define VGA_CR_IX	0x3d4
 #define VGA_CR_DATA	0x3d5
 
diff -Nru a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/drivers/i2c/busses/i2c-sibyte.c	2005-01-02 23:10:09 -08:00
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2004 Steven J. Hill
+ * Copyright (C) 2001,2002,2003 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/i2c-algo-sibyte.h>
+#include <asm/sibyte/sb1250_regs.h>
+#include <asm/sibyte/sb1250_smbus.h>
+
+static struct i2c_algo_sibyte_data sibyte_board_data[2] = {
+	{ NULL, 0, (void *) (KSEG1+A_SMB_BASE(0)) },
+	{ NULL, 1, (void *) (KSEG1+A_SMB_BASE(1)) }
+};
+
+static struct i2c_adapter sibyte_board_adapter[2] = {
+	{
+		.owner		= THIS_MODULE,
+		.id		= I2C_HW_SIBYTE,
+		.class		= I2C_CLASS_HWMON,
+		.algo		= NULL,
+		.algo_data	= &sibyte_board_data[0],
+		.name		= "SiByte SMBus 0",
+	},
+	{
+		.owner		= THIS_MODULE,
+		.id		= I2C_HW_SIBYTE,
+		.class		= I2C_CLASS_HWMON,
+		.algo		= NULL,
+		.algo_data	= &sibyte_board_data[1],
+		.name		= "SiByte SMBus 1",
+	},
+};
+
+static int __init i2c_sibyte_init(void)
+{
+	printk("i2c-swarm.o: i2c SMBus adapter module for SiByte board\n");
+	if (i2c_sibyte_add_bus(&sibyte_board_adapter[0], K_SMB_FREQ_100KHZ) < 0)
+		return -ENODEV;
+	if (i2c_sibyte_add_bus(&sibyte_board_adapter[1], K_SMB_FREQ_400KHZ) < 0)
+		return -ENODEV;
+	return 0;
+}
+
+static void __exit i2c_sibyte_exit(void)
+{
+	i2c_sibyte_del_bus(&sibyte_board_adapter[0]);
+	i2c_sibyte_del_bus(&sibyte_board_adapter[1]);
+}
+
+module_init(i2c_sibyte_init);
+module_exit(i2c_sibyte_exit);
+
+MODULE_AUTHOR("Kip Walker <kwalker@broadcom.com>, Steven J. Hill <sjhill@realitydiluted.com>");
+MODULE_DESCRIPTION("SMBus adapter routines for SiByte boards");
+MODULE_LICENSE("GPL");
diff -Nru a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c
--- a/drivers/i2c/busses/i2c-sis96x.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-sis96x.c	2005-01-02 23:10:09 -08:00
@@ -51,9 +51,6 @@
 */
 #define SIS96x_VERSION "1.0.0"
 
-/* SiS96x SMBus PCI device ID */
-#define PCI_DEVICE_ID_SI_SMBUS 0x16
-
 /* base address register in PCI config space */
 #define SIS96x_BAR 0x04
 
@@ -267,14 +264,7 @@
 };
 
 static struct pci_device_id sis96x_ids[] = {
-
-	{
-		.vendor	=	PCI_VENDOR_ID_SI,
-		.device =	PCI_DEVICE_ID_SI_SMBUS,
-		.subvendor =	PCI_ANY_ID,
-		.subdevice =	PCI_ANY_ID,
-	},
-
+	{ PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_SMBUS) },
 	{ 0, }
 };
 
diff -Nru a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c
--- a/drivers/i2c/busses/i2c-viapro.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/busses/i2c-viapro.c	2005-01-02 23:10:09 -08:00
@@ -395,62 +395,22 @@
 }
 
 static struct pci_device_id vt596_ids[] = {
-	{
-		.vendor		= PCI_VENDOR_ID_VIA,
-		.device 	= PCI_DEVICE_ID_VIA_82C596_3,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.driver_data	= SMBBA1,
-	},
-	{
-		.vendor		= PCI_VENDOR_ID_VIA,
-		.device		= PCI_DEVICE_ID_VIA_82C596B_3,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.driver_data	= SMBBA1,
-	},
-	{
-		.vendor		= PCI_VENDOR_ID_VIA,
-		.device 	= PCI_DEVICE_ID_VIA_82C686_4,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.driver_data	= SMBBA1,
-	},
-	{
-		.vendor		= PCI_VENDOR_ID_VIA,
-		.device 	= PCI_DEVICE_ID_VIA_8233_0,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.driver_data	= SMBBA3
-	},
-	{
-		.vendor		= PCI_VENDOR_ID_VIA,
-		.device 	= PCI_DEVICE_ID_VIA_8233A,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.driver_data	= SMBBA3,
-	},
-	{
-		.vendor		= PCI_VENDOR_ID_VIA,
-		.device 	= PCI_DEVICE_ID_VIA_8235,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.driver_data	= SMBBA3
-	},
-	{
-		.vendor		= PCI_VENDOR_ID_VIA,
-		.device 	= PCI_DEVICE_ID_VIA_8237,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.driver_data	= SMBBA3
-	},
-	{
-		.vendor		= PCI_VENDOR_ID_VIA,
-		.device 	= PCI_DEVICE_ID_VIA_8231_4,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.driver_data	= SMBBA1,
-	},
+	{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596_3),
+	  .driver_data = SMBBA1 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596B_3),
+	  .driver_data = SMBBA1 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4),
+	  .driver_data = SMBBA1 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233_0),
+	  .driver_data = SMBBA3 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233A),
+	  .driver_data = SMBBA3 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235),
+	  .driver_data = SMBBA3 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237),
+	  .driver_data = SMBBA3 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231_4),
+	  .driver_data = SMBBA1 },
 	{ 0, }
 };
 
diff -Nru a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c
--- a/drivers/i2c/chips/eeprom.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/chips/eeprom.c	2005-01-02 23:10:09 -08:00
@@ -43,13 +43,6 @@
 /* Insmod parameters */
 SENSORS_INSMOD_1(eeprom);
 
-static int checksum = 0;
-module_param(checksum, bool, 0);
-MODULE_PARM_DESC(checksum, "Only accept eeproms whose checksum is correct");
-
-
-/* EEPROM registers */
-#define EEPROM_REG_CHECKSUM	0x3f
 
 /* Size of EEPROM in bytes */
 #define EEPROM_SIZE		256
@@ -168,7 +161,6 @@
 /* This function is called by i2c_detect */
 int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
 {
-	int i, cs;
 	struct i2c_client *new_client;
 	struct eeprom_data *data;
 	int err = 0;
@@ -204,17 +196,6 @@
 
 	/* prevent 24RF08 corruption */
 	i2c_smbus_write_quick(new_client, 0);
-
-	/* Now, we do the remaining detection. It is not there, unless you force
-	   the checksum to work out. */
-	if (checksum) {
-		cs = 0;
-		for (i = 0; i <= 0x3e; i++)
-			cs += i2c_smbus_read_byte_data(new_client, i);
-		cs &= 0xff;
-		if (i2c_smbus_read_byte_data (new_client, EEPROM_REG_CHECKSUM) != cs)
-			goto exit_kfree;
-	}
 
 	data->nature = UNKNOWN;
 	/* Detect the Vaio nature of EEPROMs.
diff -Nru a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c
--- a/drivers/i2c/chips/it87.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/chips/it87.c	2005-01-02 23:10:09 -08:00
@@ -96,9 +96,6 @@
 /* Update battery voltage after every reading if true */
 static int update_vbat;
 
-/* Reset the registers on init if true */
-static int reset;
-
 /* Chip Type */
 
 static u16 chip_type;
@@ -128,6 +125,8 @@
 #define IT87_REG_FAN(nr)       (0x0d + (nr))
 #define IT87_REG_FAN_MIN(nr)   (0x10 + (nr))
 #define IT87_REG_FAN_MAIN_CTRL 0x13
+#define IT87_REG_FAN_CTL       0x14
+#define IT87_REG_PWM(nr)       (0x15 + (nr))
 
 #define IT87_REG_VIN(nr)       (0x20 + (nr))
 #define IT87_REG_TEMP(nr)      (0x29 + (nr))
@@ -164,6 +163,9 @@
 
 #define ALARMS_FROM_REG(val) (val)
 
+#define PWM_TO_REG(val)   ((val) >> 1)
+#define PWM_FROM_REG(val) (((val)&0x7f) << 1)
+
 static int DIV_TO_REG(int val)
 {
 	int answer = 0;
@@ -200,6 +202,8 @@
 	u8 vid;			/* Register encoding, combined */
 	int vrm;
 	u32 alarms;		/* Register encoding, combined */
+	u8 fan_main_ctrl;	/* Register value */
+	u8 manual_pwm_ctl[3];   /* manual PWM value set by user */
 };
 
 
@@ -440,18 +444,28 @@
 {
 	struct it87_data *data = it87_update_device(dev);
 	return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr], 
-				DIV_FROM_REG(data->fan_div[nr])) );
+				DIV_FROM_REG(data->fan_div[nr])));
 }
 static ssize_t show_fan_min(struct device *dev, char *buf, int nr)
 {
 	struct it87_data *data = it87_update_device(dev);
 	return sprintf(buf,"%d\n",
-		FAN_FROM_REG(data->fan_min[nr], DIV_FROM_REG(data->fan_div[nr])) );
+		FAN_FROM_REG(data->fan_min[nr], DIV_FROM_REG(data->fan_div[nr])));
 }
 static ssize_t show_fan_div(struct device *dev, char *buf, int nr)
 {
 	struct it87_data *data = it87_update_device(dev);
-	return sprintf(buf,"%d\n", DIV_FROM_REG(data->fan_div[nr]) );
+	return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr]));
+}
+static ssize_t show_pwm_enable(struct device *dev, char *buf, int nr)
+{
+	struct it87_data *data = it87_update_device(dev);
+	return sprintf(buf,"%d\n", (data->fan_main_ctrl & (1 << nr)) ? 1 : 0);
+}
+static ssize_t show_pwm(struct device *dev, char *buf, int nr)
+{
+	struct it87_data *data = it87_update_device(dev);
+	return sprintf(buf,"%d\n", data->manual_pwm_ctl[nr]);
 }
 static ssize_t set_fan_min(struct device *dev, const char *buf, 
 		size_t count, int nr)
@@ -499,6 +513,44 @@
 	}
 	return count;
 }
+static ssize_t set_pwm_enable(struct device *dev, const char *buf,
+		size_t count, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	int val = simple_strtol(buf, NULL, 10);
+
+	if (val == 0) {
+		/* set on/off mode */
+		data->fan_main_ctrl &= ~(1 << nr);
+		it87_write_value(client, IT87_REG_FAN_MAIN_CTRL, data->fan_main_ctrl);
+	} else if (val == 1) {
+		/* set SmartGuardian mode */
+		data->fan_main_ctrl |= (1 << nr);
+		it87_write_value(client, IT87_REG_FAN_MAIN_CTRL, data->fan_main_ctrl);
+		/* set saved pwm value, clear FAN_CTLX PWM mode bit */
+		it87_write_value(client, IT87_REG_PWM(nr), PWM_TO_REG(data->manual_pwm_ctl[nr]));
+	} else
+		return -EINVAL;
+
+	return count;
+}
+static ssize_t set_pwm(struct device *dev, const char *buf,
+		size_t count, int nr)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct it87_data *data = i2c_get_clientdata(client);
+	int val = simple_strtol(buf, NULL, 10);
+
+	if (val < 0 || val > 255)
+		return -EINVAL;
+
+	data->manual_pwm_ctl[nr] = val;
+	if (data->fan_main_ctrl & (1 << nr))
+		it87_write_value(client, IT87_REG_PWM(nr), PWM_TO_REG(data->manual_pwm_ctl[nr]));
+
+	return count;
+}
 
 #define show_fan_offset(offset)						\
 static ssize_t show_fan_##offset (struct device *dev, char *buf)	\
@@ -533,6 +585,36 @@
 show_fan_offset(2);
 show_fan_offset(3);
 
+#define show_pwm_offset(offset)						\
+static ssize_t show_pwm##offset##_enable (struct device *dev,		\
+	char *buf)							\
+{									\
+	return show_pwm_enable(dev, buf, offset - 1);			\
+}									\
+static ssize_t show_pwm##offset (struct device *dev, char *buf)		\
+{									\
+	return show_pwm(dev, buf, offset - 1);				\
+}									\
+static ssize_t set_pwm##offset##_enable (struct device *dev,		\
+		const char *buf, size_t count)				\
+{									\
+	return set_pwm_enable(dev, buf, count, offset - 1);		\
+}									\
+static ssize_t set_pwm##offset (struct device *dev,			\
+		const char *buf, size_t count)				\
+{									\
+	return set_pwm(dev, buf, count, offset - 1);			\
+}									\
+static DEVICE_ATTR(pwm##offset##_enable, S_IRUGO | S_IWUSR,		\
+		show_pwm##offset##_enable,				\
+		set_pwm##offset##_enable);				\
+static DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR,			\
+		show_pwm##offset , set_pwm##offset );
+
+show_pwm_offset(1);
+show_pwm_offset(2);
+show_pwm_offset(3);
+
 /* Alarms */
 static ssize_t show_alarms(struct device *dev, char *buf)
 {
@@ -624,7 +706,7 @@
 
 	/* Reserve the ISA region */
 	if (is_isa)
-		if (!request_region(address, IT87_EXTENT, name))
+		if (!request_region(address, IT87_EXTENT, it87_driver.name))
 			goto ERROR0;
 
 	/* Probe whether there is anything available on this address. Already
@@ -774,6 +856,12 @@
 	device_create_file(&new_client->dev, &dev_attr_fan2_div);
 	device_create_file(&new_client->dev, &dev_attr_fan3_div);
 	device_create_file(&new_client->dev, &dev_attr_alarms);
+	device_create_file(&new_client->dev, &dev_attr_pwm1_enable);
+	device_create_file(&new_client->dev, &dev_attr_pwm2_enable);
+	device_create_file(&new_client->dev, &dev_attr_pwm3_enable);
+	device_create_file(&new_client->dev, &dev_attr_pwm1);
+	device_create_file(&new_client->dev, &dev_attr_pwm2);
+	device_create_file(&new_client->dev, &dev_attr_pwm3);
 
 	if (data->type == it8712) {
 		device_create_file_vrm(new_client);
@@ -851,12 +939,17 @@
 /* Called when we have found a new IT87. */
 static void it87_init_client(struct i2c_client *client, struct it87_data *data)
 {
-	int tmp;
+	int tmp, i;
 
-	if (reset) {
-		/* Reset all except Watchdog values and last conversion values
-		   This sets fan-divs to 2, among others */
-		it87_write_value(client, IT87_REG_CONFIG, 0x80);
+	/* initialize to sane defaults:
+	 * - if the chip is in manual pwm mode, this will be overwritten with
+	 *   the actual settings on the chip (so in this case, initialization
+	 *   is not needed)
+	 * - if in automatic or on/off mode, we could switch to manual mode,
+	 *   read the registers and set manual_pwm_ctl accordingly, but currently
+	 *   this is not implemented, so we initialize to something sane */
+	for (i = 0; i < 3; i++) {
+		data->manual_pwm_ctl[i] = 0xff;
 	}
 
 	/* Check if temperature channnels are reset manually or by some reason */
@@ -876,13 +969,35 @@
 	}
 
 	/* Check if tachometers are reset manually or by some reason */
-	tmp = it87_read_value(client, IT87_REG_FAN_MAIN_CTRL);
-	if ((tmp & 0x70) == 0) {
+	data->fan_main_ctrl = it87_read_value(client, IT87_REG_FAN_MAIN_CTRL);
+	if ((data->fan_main_ctrl & 0x70) == 0) {
 		/* Enable all fan tachometers */
-		tmp = (tmp & 0x8f) | 0x70;
-		it87_write_value(client, IT87_REG_FAN_MAIN_CTRL, tmp);
+		data->fan_main_ctrl |= 0x70;
+		it87_write_value(client, IT87_REG_FAN_MAIN_CTRL, data->fan_main_ctrl);
 	}
 
+	/* Set current fan mode registers and the default settings for the
+	 * other mode registers */
+	for (i = 0; i < 3; i++) {
+		if (data->fan_main_ctrl & (1 << i)) {
+			/* pwm mode */
+			tmp = it87_read_value(client, IT87_REG_PWM(i));
+			if (tmp & 0x80) {
+				/* automatic pwm - not yet implemented, but
+				 * leave the settings made by the BIOS alone
+				 * until a change is requested via the sysfs
+				 * interface */
+			} else {
+				/* manual pwm */
+				data->manual_pwm_ctl[i] = PWM_FROM_REG(tmp);
+			}
+		}
+ 	}
+
+	/* make sure the fan is on when in on/off mode */
+	tmp = it87_read_value(client, IT87_REG_FAN_CTL);
+	it87_write_value(client, IT87_REG_FAN_CTL, tmp | 0x07);
+
 	/* Start monitoring */
 	it87_write_value(client, IT87_REG_CONFIG,
 			 (it87_read_value(client, IT87_REG_CONFIG) & 0x36)
@@ -984,8 +1099,6 @@
 MODULE_DESCRIPTION("IT8705F, IT8712F, Sis950 driver");
 module_param(update_vbat, bool, 0);
 MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value");
-module_param(reset, bool, 0);
-MODULE_PARM_DESC(reset, "Reset the chip's registers, default no");
 MODULE_LICENSE("GPL");
 
 module_init(sm_it87_init);
diff -Nru a/drivers/i2c/chips/lm78.c b/drivers/i2c/chips/lm78.c
--- a/drivers/i2c/chips/lm78.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/chips/lm78.c	2005-01-02 23:10:09 -08:00
@@ -462,7 +462,7 @@
 
 	/* Reserve the ISA region */
 	if (is_isa)
-		if (!request_region(address, LM78_EXTENT, "lm78")) {
+		if (!request_region(address, LM78_EXTENT, lm78_driver.name)) {
 			err = -EBUSY;
 			goto ERROR0;
 		}
diff -Nru a/drivers/i2c/chips/pc87360.c b/drivers/i2c/chips/pc87360.c
--- a/drivers/i2c/chips/pc87360.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/chips/pc87360.c	2005-01-02 23:10:09 -08:00
@@ -756,7 +756,8 @@
 
 	for (i = 0; i < 3; i++) {
 		if (((data->address[i] = extra_isa[i]))
-		 && !request_region(extra_isa[i], PC87360_EXTENT, "pc87360")) {
+		 && !request_region(extra_isa[i], PC87360_EXTENT,
+		 		    pc87360_driver.name)) {
 			dev_err(&new_client->dev, "Region 0x%x-0x%x already "
 				"in use!\n", extra_isa[i],
 				extra_isa[i]+PC87360_EXTENT-1);
diff -Nru a/drivers/i2c/chips/smsc47m1.c b/drivers/i2c/chips/smsc47m1.c
--- a/drivers/i2c/chips/smsc47m1.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/chips/smsc47m1.c	2005-01-02 23:10:09 -08:00
@@ -400,7 +400,7 @@
 		return 0;
 	}
 
-	if (!request_region(address, SMSC_EXTENT, "smsc47m1")) {
+	if (!request_region(address, SMSC_EXTENT, smsc47m1_driver.name)) {
 		dev_err(&adapter->dev, "Region 0x%x already in use!\n", address);
 		return -EBUSY;
 	}
diff -Nru a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c
--- a/drivers/i2c/chips/via686a.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/chips/via686a.c	2005-01-02 23:10:09 -08:00
@@ -613,7 +613,7 @@
 	}
 
 	/* Reserve the ISA region */
-	if (!request_region(address, VIA686A_EXTENT, "via686a-sensor")) {
+	if (!request_region(address, VIA686A_EXTENT, via686a_driver.name)) {
 		dev_err(&adapter->dev,"region 0x%x already in use!\n",
 		       address);
 		return -ENODEV;
diff -Nru a/drivers/i2c/chips/w83627hf.c b/drivers/i2c/chips/w83627hf.c
--- a/drivers/i2c/chips/w83627hf.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/chips/w83627hf.c	2005-01-02 23:10:09 -08:00
@@ -984,7 +984,7 @@
 	if(force_addr)
 		address = force_addr & ~(WINB_EXTENT - 1);
 
-	if (!request_region(address, WINB_EXTENT, "w83627hf")) {
+	if (!request_region(address, WINB_EXTENT, w83627hf_driver.name)) {
 		err = -EBUSY;
 		goto ERROR0;
 	}
diff -Nru a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c
--- a/drivers/i2c/chips/w83781d.c	2005-01-02 23:10:09 -08:00
+++ b/drivers/i2c/chips/w83781d.c	2005-01-02 23:10:09 -08:00
@@ -1065,7 +1065,8 @@
 	}
 	
 	if (is_isa)
-		if (!request_region(address, W83781D_EXTENT, "w83781d")) {
+		if (!request_region(address, W83781D_EXTENT,
+				    w83781d_driver.name)) {
 			dev_dbg(&adapter->dev, "Request of region "
 				"0x%x-0x%x for w83781d failed\n", address,
 				address + W83781D_EXTENT - 1);
diff -Nru a/include/linux/i2c-algo-sgi.h b/include/linux/i2c-algo-sgi.h
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/include/linux/i2c-algo-sgi.h	2005-01-02 23:10:09 -08:00
@@ -0,0 +1,27 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
+ */
+
+#ifndef I2C_ALGO_SGI_H
+#define I2C_ALGO_SGI_H 1
+
+#include <linux/i2c.h>
+
+struct i2c_algo_sgi_data {
+	void *data;	/* private data for lowlevel routines */
+	unsigned (*getctrl)(void *data);
+	void (*setctrl)(void *data, unsigned val);
+	unsigned (*rdata)(void *data);
+	void (*wdata)(void *data, unsigned val);
+
+	int xfer_timeout;
+	int ack_timeout;
+};
+
+int i2c_sgi_add_bus(struct i2c_adapter *);
+int i2c_sgi_del_bus(struct i2c_adapter *);
+
+#endif /* I2C_ALGO_SGI_H */
diff -Nru a/include/linux/i2c-algo-sibyte.h b/include/linux/i2c-algo-sibyte.h
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/include/linux/i2c-algo-sibyte.h	2005-01-02 23:10:09 -08:00
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2001,2002,2003 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef I2C_ALGO_SIBYTE_H
+#define I2C_ALGO_SIBYTE_H 1
+
+#include <linux/i2c.h>
+
+struct i2c_algo_sibyte_data {
+	void *data;		/* private data */
+        int   bus;		/* which bus */
+        void *reg_base;		/* CSR base */
+};
+
+int i2c_sibyte_add_bus(struct i2c_adapter *, int speed);
+int i2c_sibyte_del_bus(struct i2c_adapter *);
+
+#endif /* I2C_ALGO_SIBYTE_H */
diff -Nru a/include/linux/i2c-id.h b/include/linux/i2c-id.h
--- a/include/linux/i2c-id.h	2005-01-02 23:10:09 -08:00
+++ b/include/linux/i2c-id.h	2005-01-02 23:10:09 -08:00
@@ -109,6 +109,7 @@
 #define I2C_DRIVERID_OVCAMCHIP	61	/* OmniVision CMOS image sens.	*/
 #define I2C_DRIVERID_TDA7313	62	/* TDA7313 audio processor	*/
 #define I2C_DRIVERID_MAX6900	63	/* MAX6900 real-time clock	*/
+#define I2C_DRIVERID_SAA7114H	64	/* video decoder		*/
 
 
 #define I2C_DRIVERID_EXP0	0xF0	/* experimental use id's	*/
@@ -196,6 +197,9 @@
 #define I2C_ALGO_OCP_IOP3XX  0x140000	/* XSCALE IOP3XX On-chip I2C alg */
 #define I2C_ALGO_PCA	0x150000	/* PCA 9564 style adapters	*/
 
+#define I2C_ALGO_SIBYTE 0x150000	/* Broadcom SiByte SOCs		*/
+#define I2C_ALGO_SGI	0x160000        /* SGI algorithm                */
+
 #define I2C_ALGO_EXP	0x800000	/* experimental			*/
 
 #define I2C_ALGO_MASK	0xff0000	/* Mask for algorithms		*/
@@ -257,6 +261,13 @@
 
 /* --- PowerPC on-chip adapters						*/
 #define I2C_HW_OCP 0x00	/* IBM on-chip I2C adapter 	*/
+
+/* --- Broadcom SiByte adapters						*/
+#define I2C_HW_SIBYTE	0x00
+
+/* --- SGI adapters							*/
+#define I2C_HW_SGI_VINO	0x00
+#define I2C_HW_SGI_MACE	0x01
 
 /* --- XSCALE on-chip adapters                          */
 #define I2C_HW_IOP321 0x00
diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h	2005-01-02 23:10:09 -08:00
+++ b/include/linux/pci_ids.h	2005-01-02 23:10:09 -08:00
@@ -506,6 +506,8 @@
 #	define PCI_DEVICE_ID_AMD_VIPER_7449	PCI_DEVICE_ID_AMD_OPUS_7449
 #define PCI_DEVICE_ID_AMD_8111_LAN	0x7462
 #define PCI_DEVICE_ID_AMD_8111_IDE	0x7469
+#define PCI_DEVICE_ID_AMD_8111_SMBUS2	0x746a
+#define PCI_DEVICE_ID_AMD_8111_SMBUS	0x746b
 #define PCI_DEVICE_ID_AMD_8111_AUDIO	0x746d
 #define PCI_DEVICE_ID_AMD_8151_0	0x7454
 #define PCI_DEVICE_ID_AMD_8131_APIC     0x7450
@@ -595,6 +597,7 @@
 #define PCI_DEVICE_ID_SI_6202		0x0002
 #define PCI_DEVICE_ID_SI_503		0x0008
 #define PCI_DEVICE_ID_SI_ACPI		0x0009
+#define PCI_DEVICE_ID_SI_SMBUS		0x0016
 #define PCI_DEVICE_ID_SI_LPC		0x0018
 #define PCI_DEVICE_ID_SI_5597_VGA	0x0200
 #define PCI_DEVICE_ID_SI_6205		0x0205
@@ -1110,7 +1113,6 @@
 #define PCI_DEVICE_ID_NVIDIA_ITNT2		0x00A0
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3		0x00d1
 #define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO		0x00da
-#define PCI_DEVICE_ID_NVIDIA_NFORCE3S  		0x00e1
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS	0x00d4
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE	0x00d5
 #define PCI_DEVICE_ID_NVIDIA_NVENET_3		0x00d6
@@ -1118,6 +1120,7 @@
 #define PCI_DEVICE_ID_NVIDIA_NVENET_7		0x00df
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S		0x00e1
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA	0x00e3
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SMBUS	0x00e4
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE	0x00e5
 #define PCI_DEVICE_ID_NVIDIA_NVENET_6		0x00e6
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2	0x00ee
@@ -1146,6 +1149,7 @@
 #define PCI_DEVICE_ID_NVIDIA_IGEFORCE2		0x01a0
 #define PCI_DEVICE_ID_NVIDIA_NFORCE		0x01a4
 #define PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO		0x01b1
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_SMBUS	0x01b4
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_IDE		0x01bc
 #define PCI_DEVICE_ID_NVIDIA_NVENET_1		0x01c3
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2		0x01e0
@@ -2074,9 +2078,11 @@
 #define PCI_DEVICE_ID_S3_PLATO_PXG	0x8902
 #define PCI_DEVICE_ID_S3_ViRGE_DXGX	0x8a01
 #define PCI_DEVICE_ID_S3_ViRGE_GX2	0x8a10
+#define PCI_DEVICE_ID_S3_SAVAGE4	0x8a25
 #define PCI_DEVICE_ID_S3_ViRGE_MX	0x8c01
 #define PCI_DEVICE_ID_S3_ViRGE_MXP	0x8c02
 #define PCI_DEVICE_ID_S3_ViRGE_MXPMV	0x8c03
+#define PCI_DEVICE_ID_S3_PROSAVAGE8	0x8d04
 #define PCI_DEVICE_ID_S3_SONICVIBES	0xca00
 
 #define PCI_VENDOR_ID_DUNORD		0x5544