projects/linux·commit a5b08073

Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6

a5b08073 · Linus Torvalds <[email protected]> · 2006-09-27 08:09:48 -07:00

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6: (30 commits)
  i2c: Drop unimplemented slave functions
  i2c: Constify i2c_algorithm declarations, part 2
  i2c: Constify i2c_algorithm declarations, part 1
  i2c: Let drivers constify i2c_algorithm data
  i2c-isa: Restore driver owner
  i2c-viapro: Add support for the VT8237A and VT8251
  i2c: Warn on i2c client creation failure
  i2c-core: Drop useless bitmaskings
  i2c-algo-pcf: Discard the mdelay data struct member
  i2c-algo-bit: Cleanups
  i2c-isa: Fail adding driver on attach_adapter error
  i2c: __must_check fixes (chip drivers)
  i2c-dev: attach/detach_adapter cleanups
  i2c-stub: Chip address as a module parameter
  i2c: Plan i2c-isa for removal
  i2c: New bus driver for TI OMAP boards
  i2c-algo-bit: Discard the mdelay data struct member
  i2c-matroxfb: Struct init conversion
  i2c: Fix copy-n-paste in subsystem Kconfig
  i2c-au1550: Add I2C support for Au1200
  ...
Commit
a5b08073a0b512d75fa1a7f82ee850e5c105cce9
Parents
ff0972c2 · 6d3aae9d

Merge commit. Changes below are compared with the first parent: ff0972c2.

Changes

83 files changed · +1219 −482

FileStatusAddDelContent
Documentation/feature-removal-schedule.txtmodified+9−0View file
Documentation/i2c/busses/i2c-viapromodified+6−1View file
Documentation/i2c/i2c-stubmodified+13−2View file
drivers/acorn/char/i2c.cmodified+0−1View file
drivers/acpi/i2c_ec.cmodified+1−1View file
drivers/hwmon/it87.cmodified+1−0View file
drivers/hwmon/lm78.cmodified+1−0View file
drivers/hwmon/pc87360.cmodified+1−0View file
drivers/hwmon/sis5595.cmodified+1−0View file
drivers/hwmon/smsc47b397.cmodified+1−0View file
drivers/hwmon/smsc47m1.cmodified+1−0View file
drivers/hwmon/via686a.cmodified+1−0View file
drivers/hwmon/vt8231.cmodified+1−0View file
drivers/hwmon/w83627ehf.cmodified+1−0View file
drivers/hwmon/w83627hf.cmodified+1−0View file
drivers/hwmon/w83781d.cmodified+1−0View file
drivers/i2c/Kconfigmodified+1−1View file
drivers/i2c/algos/Kconfigmodified+0−6View file
drivers/i2c/algos/Makefilemodified+0−1View file
drivers/i2c/algos/i2c-algo-bit.cmodified+9−14View file
drivers/i2c/algos/i2c-algo-pca.cmodified+1−1View file
drivers/i2c/algos/i2c-algo-pcf.cmodified+1−1View file
drivers/i2c/algos/i2c-algo-sgi.cmodified+1−1View file
drivers/i2c/algos/i2c-algo-sibyte.cdeleted+0−215View before deletion
drivers/i2c/busses/Kconfigmodified+22−12View file
drivers/i2c/busses/Makefilemodified+1−0View file
drivers/i2c/busses/i2c-ali1535.cmodified+1−1View file
drivers/i2c/busses/i2c-ali1563.cmodified+1−1View file
drivers/i2c/busses/i2c-ali15x3.cmodified+1−1View file
drivers/i2c/busses/i2c-amd756.cmodified+1−1View file
drivers/i2c/busses/i2c-amd8111.cmodified+1−1View file
drivers/i2c/busses/i2c-au1550.cmodified+13−8View file
drivers/i2c/busses/i2c-elektor.cmodified+0−1View file
drivers/i2c/busses/i2c-hydra.cmodified+0−1View file
drivers/i2c/busses/i2c-i801.cmodified+1−1View file
drivers/i2c/busses/i2c-i810.cmodified+0−2View file
drivers/i2c/busses/i2c-ibm_iic.cmodified+1−1View file
drivers/i2c/busses/i2c-iop3xx.cmodified+1−1View file
drivers/i2c/busses/i2c-isa.cmodified+35−7View file
drivers/i2c/busses/i2c-ixp2000.cmodified+0−1View file
drivers/i2c/busses/i2c-ixp4xx.cmodified+0−1View file
drivers/i2c/busses/i2c-mpc.cmodified+1−1View file
drivers/i2c/busses/i2c-mv64xxx.cmodified+1−1View file
drivers/i2c/busses/i2c-nforce2.cmodified+1−1View file
drivers/i2c/busses/i2c-ocores.cmodified+1−1View file
drivers/i2c/busses/i2c-omap.cadded+676−0View file
drivers/i2c/busses/i2c-parport-light.cmodified+0−1View file
drivers/i2c/busses/i2c-parport.cmodified+0−1View file
drivers/i2c/busses/i2c-piix4.cmodified+1−1View file
drivers/i2c/busses/i2c-powermac.cmodified+1−1View file
drivers/i2c/busses/i2c-prosavage.cmodified+0−1View file
drivers/i2c/busses/i2c-pxa.cmodified+1−1View file
drivers/i2c/busses/i2c-s3c2410.cmodified+1−1View file
drivers/i2c/busses/i2c-savage4.cmodified+0−1View file
drivers/i2c/busses/i2c-sibyte.cmodified+156−4View file
drivers/i2c/busses/i2c-sis5595.cmodified+1−1View file
drivers/i2c/busses/i2c-sis630.cmodified+1−1View file
drivers/i2c/busses/i2c-sis96x.cmodified+1−1View file
drivers/i2c/busses/i2c-stub.cmodified+19−2View file
drivers/i2c/busses/i2c-via.cmodified+0−1View file
drivers/i2c/busses/i2c-viapro.cmodified+9−1View file
drivers/i2c/busses/i2c-voodoo3.cmodified+0−2View file
drivers/i2c/busses/scx200_acb.cmodified+1−1View file
drivers/i2c/busses/scx200_i2c.cmodified+6−6View file
drivers/i2c/chips/eeprom.cmodified+7−1View file
drivers/i2c/chips/max6875.cmodified+19−6View file
drivers/i2c/chips/pca9539.cmodified+9−2View file
drivers/i2c/chips/pcf8574.cmodified+17−5View file
drivers/i2c/chips/pcf8591.cmodified+45−13View file
drivers/i2c/i2c-core.cmodified+55−17View file
drivers/i2c/i2c-dev.cmodified+50−59View file
drivers/ieee1394/pcilynx.cmodified+0−1View file
drivers/media/video/bt8xx/bttv-i2c.cmodified+0−1View file
drivers/media/video/cx88/cx88-i2c.cmodified+0−1View file
drivers/media/video/cx88/cx88-vp3054-i2c.cmodified+0−1View file
drivers/media/video/zoran_card.cmodified+0−1View file
drivers/video/i810/i810-i2c.cmodified+0−1View file
drivers/video/matrox/i2c-matroxfb.cmodified+6−6View file
drivers/video/savage/savagefb-i2c.cmodified+0−1View file
include/linux/i2c-algo-bit.hmodified+0−1View file
include/linux/i2c-algo-pcf.hmodified+0−1View file
include/linux/i2c-algo-sibyte.hdeleted+0−33View before deletion
include/linux/i2c.hmodified+1−13View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/feature-removal-schedule.txt

View file
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index bf56b20..93b10bd 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -313,3 +313,12 @@ Why: The stacking of class devices makes these values misleading and
Who: Kay Sievers <[email protected]>
---------------------------
+
+What: i2c-isa
+When: December 2006
+Why: i2c-isa is a non-sense and doesn't fit in the device driver
+ model. Drivers relying on it are better implemented as platform
+ drivers.
+Who: Jean Delvare <[email protected]>
+
+---------------------------

Documentation/i2c/busses/i2c-viapro

View file
diff --git a/Documentation/i2c/busses/i2c-viapro b/Documentation/i2c/busses/i2c-viapro
index 1677566..2568034 100644
--- a/Documentation/i2c/busses/i2c-viapro
+++ b/Documentation/i2c/busses/i2c-viapro
@@ -7,9 +7,12 @@ Supported adapters:
* VIA Technologies, Inc. VT82C686A/B
Datasheet: Sometimes available at the VIA website
- * VIA Technologies, Inc. VT8231, VT8233, VT8233A, VT8235, VT8237R
+ * VIA Technologies, Inc. VT8231, VT8233, VT8233A
Datasheet: available on request from VIA
+ * VIA Technologies, Inc. VT8235, VT8237R, VT8237A, VT8251
+ Datasheet: available on request and under NDA from VIA
+
Authors:
Ky�sti M�lkki <[email protected]>,
Mark D. Studebaker <[email protected]>,
@@ -39,6 +42,8 @@ Your lspci -n listing must show one of these :
device 1106:8235 (VT8231 function 4)
device 1106:3177 (VT8235)
device 1106:3227 (VT8237R)
+ device 1106:3337 (VT8237A)
+ device 1106:3287 (VT8251)
If none of these show up, you should look in the BIOS for settings like
enable ACPI / SMBus or even USB.

Documentation/i2c/i2c-stub

View file
diff --git a/Documentation/i2c/i2c-stub b/Documentation/i2c/i2c-stub
index d6dcb13..9cc081e 100644
--- a/Documentation/i2c/i2c-stub
+++ b/Documentation/i2c/i2c-stub
@@ -6,9 +6,12 @@ This module is a very simple fake I2C/SMBus driver. It implements four
types of SMBus commands: write quick, (r/w) byte, (r/w) byte data, and
(r/w) word data.
+You need to provide a chip address as a module parameter when loading
+this driver, which will then only react to SMBus commands to this address.
+
No hardware is needed nor associated with this module. It will accept write
-quick commands to all addresses; it will respond to the other commands (also
-to all addresses) by reading from or writing to an array in memory. It will
+quick commands to one address; it will respond to the other commands (also
+to one address) by reading from or writing to an array in memory. It will
also spam the kernel logs for every command it handles.
A pointer register with auto-increment is implemented for all byte
@@ -21,6 +24,11 @@ The typical use-case is like this:
3. load the target sensors chip driver module
4. observe its behavior in the kernel log
+PARAMETERS:
+
+int chip_addr:
+ The SMBus address to emulate a chip at.
+
CAVEATS:
There are independent arrays for byte/data and word/data commands. Depending
@@ -33,6 +41,9 @@ If the hardware for your driver has banked registers (e.g. Winbond sensors
chips) this module will not work well - although it could be extended to
support that pretty easily.
+Only one chip address is supported - although this module could be
+extended to support more.
+
If you spam it hard enough, printk can be lossy. This module really wants
something like relayfs.

drivers/acorn/char/i2c.c

View file
diff --git a/drivers/acorn/char/i2c.c b/drivers/acorn/char/i2c.c
index c26c08b..bdb9c8b 100644
--- a/drivers/acorn/char/i2c.c
+++ b/drivers/acorn/char/i2c.c
@@ -308,7 +308,6 @@ static struct i2c_algo_bit_data ioc_data = {
.getsda = ioc_getsda,
.getscl = ioc_getscl,
.udelay = 80,
- .mdelay = 80,
.timeout = 100
};

drivers/acpi/i2c_ec.c

View file
diff --git a/drivers/acpi/i2c_ec.c b/drivers/acpi/i2c_ec.c
index 6809c28..6342e61 100644
--- a/drivers/acpi/i2c_ec.c
+++ b/drivers/acpi/i2c_ec.c
@@ -293,7 +293,7 @@ static u32 acpi_ec_smb_func(struct i2c_adapter *adapter)
I2C_FUNC_SMBUS_I2C_BLOCK | I2C_FUNC_SMBUS_HWPEC_CALC);
}
-static struct i2c_algorithm acpi_ec_smbus_algorithm = {
+static const struct i2c_algorithm acpi_ec_smbus_algorithm = {
.smbus_xfer = acpi_ec_smb_access,
.functionality = acpi_ec_smb_func,
};

drivers/hwmon/it87.c

View file
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 06df92b..b0ee574 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -243,6 +243,7 @@ static struct i2c_driver it87_driver = {
static struct i2c_driver it87_isa_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "it87-isa",
},
.attach_adapter = it87_isa_attach_adapter,

drivers/hwmon/lm78.c

View file
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
index a6ce7ab..fa1715b 100644
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -175,6 +175,7 @@ static struct i2c_driver lm78_driver = {
static struct i2c_driver lm78_isa_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "lm78-isa",
},
.attach_adapter = lm78_isa_attach_adapter,

drivers/hwmon/pc87360.c

View file
diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
index ae05e48..236f9f2 100644
--- a/drivers/hwmon/pc87360.c
+++ b/drivers/hwmon/pc87360.c
@@ -238,6 +238,7 @@ static struct pc87360_data *pc87360_update_device(struct device *dev);
static struct i2c_driver pc87360_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "pc87360",
},
.attach_adapter = pc87360_detect,

drivers/hwmon/sis5595.c

View file
diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c
index 063f71c..3783af4 100644
--- a/drivers/hwmon/sis5595.c
+++ b/drivers/hwmon/sis5595.c
@@ -200,6 +200,7 @@ static void sis5595_init_client(struct i2c_client *client);
static struct i2c_driver sis5595_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "sis5595",
},
.attach_adapter = sis5595_detect,

drivers/hwmon/smsc47b397.c

View file
diff --git a/drivers/hwmon/smsc47b397.c b/drivers/hwmon/smsc47b397.c
index b608618..a858693 100644
--- a/drivers/hwmon/smsc47b397.c
+++ b/drivers/hwmon/smsc47b397.c
@@ -228,6 +228,7 @@ static int smsc47b397_detect(struct i2c_adapter *adapter);
static struct i2c_driver smsc47b397_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "smsc47b397",
},
.attach_adapter = smsc47b397_detect,

drivers/hwmon/smsc47m1.c

View file
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c
index 825e8f7..6c81b84 100644
--- a/drivers/hwmon/smsc47m1.c
+++ b/drivers/hwmon/smsc47m1.c
@@ -128,6 +128,7 @@ static struct smsc47m1_data *smsc47m1_update_device(struct device *dev,
static struct i2c_driver smsc47m1_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "smsc47m1",
},
.attach_adapter = smsc47m1_detect,

drivers/hwmon/via686a.c

View file
diff --git a/drivers/hwmon/via686a.c b/drivers/hwmon/via686a.c
index 166298f..95ae056 100644
--- a/drivers/hwmon/via686a.c
+++ b/drivers/hwmon/via686a.c
@@ -574,6 +574,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
smbus_driver and isa_driver, and clients could be of either kind */
static struct i2c_driver via686a_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "via686a",
},
.attach_adapter = via686a_detect,

drivers/hwmon/vt8231.c

View file
diff --git a/drivers/hwmon/vt8231.c b/drivers/hwmon/vt8231.c
index 686f3de..236ccf0 100644
--- a/drivers/hwmon/vt8231.c
+++ b/drivers/hwmon/vt8231.c
@@ -587,6 +587,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
static struct i2c_driver vt8231_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "vt8231",
},
.attach_adapter = vt8231_detect,

drivers/hwmon/w83627ehf.c

View file
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index 40301bc..b21d6b9 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -903,6 +903,7 @@ static int w83627ehf_detach_client(struct i2c_client *client)
static struct i2c_driver w83627ehf_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "w83627ehf",
},
.attach_adapter = w83627ehf_detect,

drivers/hwmon/w83627hf.c

View file
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
index 79368d5..3029502 100644
--- a/drivers/hwmon/w83627hf.c
+++ b/drivers/hwmon/w83627hf.c
@@ -339,6 +339,7 @@ static void w83627hf_init_client(struct i2c_client *client);
static struct i2c_driver w83627hf_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "w83627hf",
},
.attach_adapter = w83627hf_detect,

drivers/hwmon/w83781d.c

View file
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index 7be469e..95221b1 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -288,6 +288,7 @@ static struct i2c_driver w83781d_driver = {
static struct i2c_driver w83781d_isa_driver = {
.driver = {
+ .owner = THIS_MODULE,
.name = "w83781d-isa",
},
.attach_adapter = w83781d_isa_attach_adapter,

drivers/i2c/Kconfig

View file
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index 24383af..11935f6 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -1,5 +1,5 @@
#
-# Character device configuration
+# I2C subsystem configuration
#
menu "I2C support"

drivers/i2c/algos/Kconfig

View file
diff --git a/drivers/i2c/algos/Kconfig b/drivers/i2c/algos/Kconfig
index 3040801..c034820 100644
--- a/drivers/i2c/algos/Kconfig
+++ b/drivers/i2c/algos/Kconfig
@@ -53,12 +53,6 @@ config I2C_ALGO8XX
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 && (SGI_IP22 || SGI_IP32 || X86_VISWS)

drivers/i2c/algos/Makefile

View file
diff --git a/drivers/i2c/algos/Makefile b/drivers/i2c/algos/Makefile
index 867fe1f..208be04 100644
--- a/drivers/i2c/algos/Makefile
+++ b/drivers/i2c/algos/Makefile
@@ -6,7 +6,6 @@ obj-$(CONFIG_I2C_ALGOBIT) += i2c-algo-bit.o
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)

drivers/i2c/algos/i2c-algo-bit.c

View file
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index ab230c0..21c36bf 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -76,17 +76,15 @@ static inline void scllo(struct i2c_algo_bit_data *adap)
* Raise scl line, and do checking for delays. This is necessary for slower
* devices.
*/
-static inline int sclhi(struct i2c_algo_bit_data *adap)
+static int sclhi(struct i2c_algo_bit_data *adap)
{
unsigned long start;
setscl(adap,1);
/* Not all adapters have scl sense line... */
- if (adap->getscl == NULL ) {
- udelay(adap->udelay);
- return 0;
- }
+ if (!adap->getscl)
+ goto done;
start=jiffies;
while (! getscl(adap) ) {
@@ -101,6 +99,8 @@ static inline int sclhi(struct i2c_algo_bit_data *adap)
cond_resched();
}
DEBSTAT(printk(KERN_DEBUG "needed %ld jiffies\n", jiffies-start));
+
+done:
udelay(adap->udelay);
return 0;
}
@@ -121,7 +121,6 @@ static void i2c_repstart(struct i2c_algo_bit_data *adap)
DEBPROTO(printk(" Sr "));
setsda(adap,1);
sclhi(adap);
- udelay(adap->udelay);
sdalo(adap);
scllo(adap);
@@ -306,7 +305,7 @@ bailout:
* 0 chip did not answer
* -x transmission error
*/
-static inline int try_address(struct i2c_adapter *i2c_adap,
+static int try_address(struct i2c_adapter *i2c_adap,
unsigned char addr, int retries)
{
struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
@@ -354,15 +353,11 @@ static int sendbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
return (retval<0)? retval : -EFAULT;
/* got a better one ?? */
}
-#if 0
- /* from asm/delay.h */
- __delay(adap->mdelay * (loops_per_sec / 1000) );
-#endif
}
return wrcount;
}
-static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
+static int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
{
int inval;
int rdcount=0; /* counts bytes read */
@@ -412,7 +407,7 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
* -x an error occurred (like: -EREMOTEIO if the device did not answer, or
* -ETIMEDOUT, for example if the lines are stuck...)
*/
-static inline int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
+static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
{
unsigned short flags = msg->flags;
unsigned short nak_ok = msg->flags & I2C_M_IGNORE_NAK;
@@ -517,7 +512,7 @@ static u32 bit_func(struct i2c_adapter *adap)
/* -----exported algorithm data: ------------------------------------- */
-static struct i2c_algorithm i2c_bit_algo = {
+static const struct i2c_algorithm i2c_bit_algo = {
.master_xfer = bit_xfer,
.functionality = bit_func,
};

drivers/i2c/algos/i2c-algo-pca.c

View file
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
index b88a6fc..9081c9f 100644
--- a/drivers/i2c/algos/i2c-algo-pca.c
+++ b/drivers/i2c/algos/i2c-algo-pca.c
@@ -355,7 +355,7 @@ static int pca_init(struct i2c_algo_pca_data *adap)
return 0;
}
-static struct i2c_algorithm pca_algo = {
+static const struct i2c_algorithm pca_algo = {
.master_xfer = pca_xfer,
.functionality = pca_func,
};

drivers/i2c/algos/i2c-algo-pcf.c

View file
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c
index 5b24930..3b20033 100644
--- a/drivers/i2c/algos/i2c-algo-pcf.c
+++ b/drivers/i2c/algos/i2c-algo-pcf.c
@@ -458,7 +458,7 @@ static u32 pcf_func(struct i2c_adapter *adap)
/* -----exported algorithm data: ------------------------------------- */
-static struct i2c_algorithm pcf_algo = {
+static const struct i2c_algorithm pcf_algo = {
.master_xfer = pcf_xfer,
.functionality = pcf_func,
};

drivers/i2c/algos/i2c-algo-sgi.c

View file
diff --git a/drivers/i2c/algos/i2c-algo-sgi.c b/drivers/i2c/algos/i2c-algo-sgi.c
index 932c4fa..490d999 100644
--- a/drivers/i2c/algos/i2c-algo-sgi.c
+++ b/drivers/i2c/algos/i2c-algo-sgi.c
@@ -157,7 +157,7 @@ static u32 sgi_func(struct i2c_adapter *adap)
return I2C_FUNC_SMBUS_EMUL;
}
-static struct i2c_algorithm sgi_algo = {
+static const struct i2c_algorithm sgi_algo = {
.master_xfer = sgi_xfer,
.functionality = sgi_func,
};

drivers/i2c/algos/i2c-algo-sibyte.c

View before deletion
diff --git a/drivers/i2c/algos/i2c-algo-sibyte.c b/drivers/i2c/algos/i2c-algo-sibyte.c
deleted file mode 100644
index 32d41c6..0000000
--- a/drivers/i2c/algos/i2c-algo-sibyte.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/* ------------------------------------------------------------------------- */
-/* 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 <[email protected]> and even
- Frodo Looijaard <[email protected]>. */
-
-/* Ported for SiByte SOCs by Broadcom Corporation. */
-
-#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; /* 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 = {
- .smbus_xfer = smbus_xfer,
- .algo_control = algo_control, /* ioctl */
- .functionality = bit_func,
-};
-
-/*
- * 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->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");
- }
-
- return i2c_add_adapter(i2c_adap);
-}
-
-
-int i2c_sibyte_del_bus(struct i2c_adapter *adap)
-{
- int res;
-
- if ((res = i2c_del_adapter(adap)) < 0)
- return res;
-
- return 0;

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ali1535.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ali1563.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ali15x3.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-amd756.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-amd8111.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-au1550.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-elektor.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-hydra.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-i801.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-i810.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ibm_iic.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-iop3xx.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-isa.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ixp2000.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ixp4xx.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-mpc.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-mv64xxx.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-nforce2.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ocores.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-omap.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-parport-light.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-parport.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-piix4.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-powermac.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-prosavage.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-pxa.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-s3c2410.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-savage4.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-sibyte.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-sis5595.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-sis630.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-sis96x.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-stub.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-via.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-viapro.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-voodoo3.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/scx200_acb.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/scx200_i2c.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/eeprom.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/max6875.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/pca9539.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/pcf8574.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/pcf8591.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/i2c-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/i2c-dev.c

View file

This diff is incomplete. Download the complete patch.

drivers/ieee1394/pcilynx.c

View file

This diff is incomplete. Download the complete patch.

drivers/media/video/bt8xx/bttv-i2c.c

View file

This diff is incomplete. Download the complete patch.

drivers/media/video/cx88/cx88-i2c.c

View file

This diff is incomplete. Download the complete patch.

drivers/media/video/cx88/cx88-vp3054-i2c.c

View file

This diff is incomplete. Download the complete patch.

drivers/media/video/zoran_card.c

View file

This diff is incomplete. Download the complete patch.

drivers/video/i810/i810-i2c.c

View file

This diff is incomplete. Download the complete patch.

drivers/video/matrox/i2c-matroxfb.c

View file

This diff is incomplete. Download the complete patch.

drivers/video/savage/savagefb-i2c.c

View file

This diff is incomplete. Download the complete patch.

include/linux/i2c-algo-bit.h

View file

This diff is incomplete. Download the complete patch.

include/linux/i2c-algo-pcf.h

View file

This diff is incomplete. Download the complete patch.

include/linux/i2c-algo-sibyte.h

View before deletion

This diff is incomplete. Download the complete patch.

include/linux/i2c.h

View file

This diff is incomplete. Download the complete patch.