Skip to content
Snippets Groups Projects
Commit ddb03448 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

Pull i2c updates from Jean Delvare:
 "The most important changes here are a big cleanup of the i2c-piix4
  driver, cleanups and interrupt support to the i2c-i801 driver, and
  support for the SCCB protocol."

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c-omap: Add support for I2C_M_STOP message flag
  i2c: Fall back to emulated SMBus if the operation isn't supported natively
  i2c: Add SCCB support
  i2c-tiny-usb: Add support for the Robofuzz OSIF USB/I2C converter
  i2c-i801: Enable IRQ for byte_by_byte transactions
  i2c-i801: Enable interrupts on ICH5/7/8/9/10
  i2c-i801: Enable IRQ for SMBus transactions
  i2c-i801: Consolidate polling
  i2c-i801: Drop ENABLE_INT9
  i2c-i801: Rename some SMBHSTCNT bit constants
  i2c-i801: Check and return errors during byte-by-byte transfers
  i2c-i801: Clear only status bits in HST_STS
  i2c-i801: Refactor use of LAST_BYTE in i801_block_transaction_byte_by_byte
  i2c-smbus: Use module_i2c_driver()
  i2c/writing-clients: Mention module_i2c_driver()
  i2c-piix4: Support AMD auxiliary SMBus controller
  i2c-piix4: Separate registration and probing code
  i2c-piix4: Eliminate piix4_smba global variable
  i2c/busses: Use module_pci_driver
  i2c: Update Guenter Roeck's e-mail address
parents dbf7b591 fb604a3d
No related branches found
No related tags found
No related merge requests found
...@@ -513,21 +513,8 @@ static struct pci_driver sis630_driver = { ...@@ -513,21 +513,8 @@ static struct pci_driver sis630_driver = {
.remove = __devexit_p(sis630_remove), .remove = __devexit_p(sis630_remove),
}; };
static int __init i2c_sis630_init(void) module_pci_driver(sis630_driver);
{
return pci_register_driver(&sis630_driver);
}
static void __exit i2c_sis630_exit(void)
{
pci_unregister_driver(&sis630_driver);
}
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Alexander Malysh <amalysh@web.de>"); MODULE_AUTHOR("Alexander Malysh <amalysh@web.de>");
MODULE_DESCRIPTION("SIS630 SMBus driver"); MODULE_DESCRIPTION("SIS630 SMBus driver");
module_init(i2c_sis630_init);
module_exit(i2c_sis630_exit);
...@@ -324,21 +324,8 @@ static struct pci_driver sis96x_driver = { ...@@ -324,21 +324,8 @@ static struct pci_driver sis96x_driver = {
.remove = __devexit_p(sis96x_remove), .remove = __devexit_p(sis96x_remove),
}; };
static int __init i2c_sis96x_init(void) module_pci_driver(sis96x_driver);
{
return pci_register_driver(&sis96x_driver);
}
static void __exit i2c_sis96x_exit(void)
{
pci_unregister_driver(&sis96x_driver);
}
MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>"); MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>");
MODULE_DESCRIPTION("SiS96x SMBus driver"); MODULE_DESCRIPTION("SiS96x SMBus driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* Register initialization functions using helper macros */
module_init(i2c_sis96x_init);
module_exit(i2c_sis96x_exit);
...@@ -143,6 +143,7 @@ static const struct i2c_algorithm usb_algorithm = { ...@@ -143,6 +143,7 @@ static const struct i2c_algorithm usb_algorithm = {
static const struct usb_device_id i2c_tiny_usb_table[] = { static const struct usb_device_id i2c_tiny_usb_table[] = {
{ USB_DEVICE(0x0403, 0xc631) }, /* FTDI */ { USB_DEVICE(0x0403, 0xc631) }, /* FTDI */
{ USB_DEVICE(0x1c40, 0x0534) }, /* EZPrototypes */ { USB_DEVICE(0x1c40, 0x0534) }, /* EZPrototypes */
{ USB_DEVICE(0x1964, 0x0001) }, /* Robofuzz OSIF */
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
......
...@@ -161,20 +161,8 @@ static struct pci_driver vt586b_driver = { ...@@ -161,20 +161,8 @@ static struct pci_driver vt586b_driver = {
.remove = __devexit_p(vt586b_remove), .remove = __devexit_p(vt586b_remove),
}; };
static int __init i2c_vt586b_init(void) module_pci_driver(vt586b_driver);
{
return pci_register_driver(&vt586b_driver);
}
static void __exit i2c_vt586b_exit(void)
{
pci_unregister_driver(&vt586b_driver);
}
MODULE_AUTHOR("Kyösti Mälkki <kmalkki@cc.hut.fi>"); MODULE_AUTHOR("Kyösti Mälkki <kmalkki@cc.hut.fi>");
MODULE_DESCRIPTION("i2c for Via vt82c586b southbridge"); MODULE_DESCRIPTION("i2c for Via vt82c586b southbridge");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(i2c_vt586b_init);
module_exit(i2c_vt586b_exit);
...@@ -2122,7 +2122,7 @@ s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, unsigned short flags, ...@@ -2122,7 +2122,7 @@ s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, unsigned short flags,
int try; int try;
s32 res; s32 res;
flags &= I2C_M_TEN | I2C_CLIENT_PEC; flags &= I2C_M_TEN | I2C_CLIENT_PEC | I2C_CLIENT_SCCB;
if (adapter->algo->smbus_xfer) { if (adapter->algo->smbus_xfer) {
i2c_lock_adapter(adapter); i2c_lock_adapter(adapter);
...@@ -2140,11 +2140,17 @@ s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, unsigned short flags, ...@@ -2140,11 +2140,17 @@ s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, unsigned short flags,
break; break;
} }
i2c_unlock_adapter(adapter); i2c_unlock_adapter(adapter);
} else
res = i2c_smbus_xfer_emulated(adapter, addr, flags, read_write,
command, protocol, data);
return res; if (res != -EOPNOTSUPP || !adapter->algo->master_xfer)
return res;
/*
* Fall back to i2c_smbus_xfer_emulated if the adapter doesn't
* implement native support for the SMBus operation.
*/
}
return i2c_smbus_xfer_emulated(adapter, addr, flags, read_write,
command, protocol, data);
} }
EXPORT_SYMBOL(i2c_smbus_xfer); EXPORT_SYMBOL(i2c_smbus_xfer);
......
...@@ -245,18 +245,7 @@ int i2c_handle_smbus_alert(struct i2c_client *ara) ...@@ -245,18 +245,7 @@ int i2c_handle_smbus_alert(struct i2c_client *ara)
} }
EXPORT_SYMBOL_GPL(i2c_handle_smbus_alert); EXPORT_SYMBOL_GPL(i2c_handle_smbus_alert);
static int __init i2c_smbus_init(void) module_i2c_driver(smbalert_driver);
{
return i2c_add_driver(&smbalert_driver);
}
static void __exit i2c_smbus_exit(void)
{
i2c_del_driver(&smbalert_driver);
}
module_init(i2c_smbus_init);
module_exit(i2c_smbus_exit);
MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>"); MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>");
MODULE_DESCRIPTION("SMBus protocol extensions support"); MODULE_DESCRIPTION("SMBus protocol extensions support");
......
...@@ -396,6 +396,6 @@ static struct i2c_driver pca9541_driver = { ...@@ -396,6 +396,6 @@ static struct i2c_driver pca9541_driver = {
module_i2c_driver(pca9541_driver); module_i2c_driver(pca9541_driver);
MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
MODULE_DESCRIPTION("PCA9541 I2C master selector driver"); MODULE_DESCRIPTION("PCA9541 I2C master selector driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
...@@ -25,11 +25,6 @@ ...@@ -25,11 +25,6 @@
#define I2C_DRIVERID_WIS_TW2804 0xf0f6 #define I2C_DRIVERID_WIS_TW2804 0xf0f6
#define I2C_DRIVERID_S2250 0xf0f7 #define I2C_DRIVERID_S2250 0xf0f7
/* Flag to indicate that the client needs to be accessed with SCCB semantics */
/* We re-use the I2C_M_TEN value so the flag passes through the masks in the
* core I2C code. Major kludge, but the I2C layer ain't exactly flexible. */
#define I2C_CLIENT_SCCB 0x10
/* Definitions for new video decoder commands */ /* Definitions for new video decoder commands */
struct video_decoder_resolution { struct video_decoder_resolution {
......
...@@ -425,6 +425,8 @@ void i2c_unlock_adapter(struct i2c_adapter *); ...@@ -425,6 +425,8 @@ void i2c_unlock_adapter(struct i2c_adapter *);
#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
/* Must equal I2C_M_TEN below */ /* Must equal I2C_M_TEN below */
#define I2C_CLIENT_WAKE 0x80 /* for board_info; true iff can wake */ #define I2C_CLIENT_WAKE 0x80 /* for board_info; true iff can wake */
#define I2C_CLIENT_SCCB 0x9000 /* Use Omnivision SCCB protocol */
/* Must match I2C_M_STOP|IGNORE_NAK */
/* i2c adapter classes (bitmask) */ /* i2c adapter classes (bitmask) */
#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */
...@@ -541,6 +543,7 @@ struct i2c_msg { ...@@ -541,6 +543,7 @@ struct i2c_msg {
__u16 flags; __u16 flags;
#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */ #define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
#define I2C_M_RD 0x0001 /* read data, from slave to master */ #define I2C_M_RD 0x0001 /* read data, from slave to master */
#define I2C_M_STOP 0x8000 /* if I2C_FUNC_PROTOCOL_MANGLING */
#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_NOSTART */ #define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_NOSTART */
#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */ #define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */ #define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment