Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6
Browse files Browse the repository at this point in the history
* 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
  ...
  • Loading branch information
Linus Torvalds committed Sep 27, 2006
2 parents ff0972c + 6d3aae9 commit a5b0807
Show file tree
Hide file tree
Showing 83 changed files with 1,219 additions and 482 deletions.
9 changes: 9 additions & 0 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,12 @@ Why: The stacking of class devices makes these values misleading and
Who: Kay Sievers <kay.sievers@suse.de>

---------------------------

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 <khali@linux-fr.org>

---------------------------
7 changes: 6 additions & 1 deletion Documentation/i2c/busses/i2c-viapro
Original file line number Diff line number Diff line change
Expand Up @@ -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 <kmalkki@cc.hut.fi>,
Mark D. Studebaker <mdsxyz123@yahoo.com>,
Expand Down Expand Up @@ -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.
Expand Down
15 changes: 13 additions & 2 deletions Documentation/i2c/i2c-stub
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.

1 change: 0 additions & 1 deletion drivers/acorn/char/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ static struct i2c_algo_bit_data ioc_data = {
.getsda = ioc_getsda,
.getscl = ioc_getscl,
.udelay = 80,
.mdelay = 80,
.timeout = 100
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/i2c_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/it87.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/lm78.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/pc87360.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/sis5595.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/smsc47b397.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/smsc47m1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/via686a.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/vt8231.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/w83627ehf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/w83627hf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/w83781d.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Character device configuration
# I2C subsystem configuration
#

menu "I2C support"
Expand Down
6 changes: 0 additions & 6 deletions drivers/i2c/algos/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion drivers/i2c/algos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
23 changes: 9 additions & 14 deletions drivers/i2c/algos/i2c-algo-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ) {
Expand All @@ -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;
}
Expand All @@ -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);
Expand Down Expand Up @@ -306,7 +305,7 @@ static int test_bus(struct i2c_algo_bit_data *adap, char* name) {
* 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;
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/algos/i2c-algo-pca.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/algos/i2c-algo-pcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/algos/i2c-algo-sgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
Loading

0 comments on commit a5b0807

Please sign in to comment.