From 6c805d2ce9d910ea915d7dbe4aed0a91f138be07 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 13 Aug 2006 23:45:52 +0200 Subject: i2c: Plan i2c-isa for removal i2c: Plan i2c-isa for removal i2c-isa doesn't make much sense in the device driver model. Drivers relying on it are better implemented as platform drivers. We must wait for recent versions of libsensors (2.10.0 or later) to be widely deployed beforehand, though. This move should also make it easier to convert i2c-core to the device driver model. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- Documentation/feature-removal-schedule.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Documentation') diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 611acc32fdf5..afe3d0197aca 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -321,3 +321,12 @@ Why: The stacking of class devices makes these values misleading and Who: Kay Sievers --------------------------- + +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 + +--------------------------- -- cgit v1.2.3 From 7a8d29cec7a53cf1a29dc5055aa9d1fa0f95830f Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 13 Aug 2006 23:46:44 +0200 Subject: i2c-stub: Chip address as a module parameter i2c-stub: Chip address as a module parameter Add a mandatory chip_addr parameter to i2c-stub. This parameter defines to which chip address the driver will respond, instead of reponding to all addresses as before. The idea is to prevent the users from loading i2c-stub at random and being then confused by the results of sensors-detect or other user-space tools. Signed-off-by: Jean Delvare Signed-off-by: Mark M. Hoffman Signed-off-by: Greg Kroah-Hartman --- Documentation/i2c/i2c-stub | 15 +++++++++++++-- drivers/i2c/busses/i2c-stub.c | 19 ++++++++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) (limited to 'Documentation') diff --git a/Documentation/i2c/i2c-stub b/Documentation/i2c/i2c-stub index d6dcb138abf5..9cc081e69764 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. diff --git a/drivers/i2c/busses/i2c-stub.c b/drivers/i2c/busses/i2c-stub.c index 73f481e93a36..8cf374ddd989 100644 --- a/drivers/i2c/busses/i2c-stub.c +++ b/drivers/i2c/busses/i2c-stub.c @@ -27,6 +27,10 @@ #include #include +static unsigned short chip_addr; +module_param(chip_addr, ushort, S_IRUGO); +MODULE_PARM_DESC(chip_addr, "Chip address (between 0x03 and 0x77)\n"); + static u8 stub_pointer; static u8 stub_bytes[256]; static u16 stub_words[256]; @@ -37,6 +41,9 @@ static s32 stub_xfer(struct i2c_adapter * adap, u16 addr, unsigned short flags, { s32 ret; + if (addr != chip_addr) + return -ENODEV; + switch (size) { case I2C_SMBUS_QUICK: @@ -122,7 +129,17 @@ static struct i2c_adapter stub_adapter = { static int __init i2c_stub_init(void) { - printk(KERN_INFO "i2c-stub loaded\n"); + if (!chip_addr) { + printk(KERN_ERR "i2c-stub: Please specify a chip address\n"); + return -ENODEV; + } + if (chip_addr < 0x03 || chip_addr > 0x77) { + printk(KERN_ERR "i2c-stub: Invalid chip address 0x%02x\n", + chip_addr); + return -EINVAL; + } + + printk(KERN_INFO "i2c-stub: Virtual chip at 0x%02x\n", chip_addr); return i2c_add_adapter(&stub_adapter); } -- cgit v1.2.3 From c243353a90fae3a9a85d2bd79b1df06bb21c568a Mon Sep 17 00:00:00 2001 From: Rudolf Marek Date: Sun, 3 Sep 2006 22:35:21 +0200 Subject: i2c-viapro: Add support for the VT8237A and VT8251 i2c-viapro: Add support for the VT8237A and VT8251 Documentation update included. Compile tested. Signed-off-by: Rudolf Marek Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- Documentation/i2c/busses/i2c-viapro | 7 ++++++- drivers/i2c/busses/Kconfig | 18 +++++++++--------- drivers/i2c/busses/i2c-viapro.c | 8 ++++++++ 3 files changed, 23 insertions(+), 10 deletions(-) (limited to 'Documentation') diff --git a/Documentation/i2c/busses/i2c-viapro b/Documentation/i2c/busses/i2c-viapro index 16775663b9f5..25680346e0ac 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 , Mark D. Studebaker , @@ -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. diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 1df3bd97cb15..9e56c3989d68 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -492,19 +492,19 @@ config I2C_VIA will be called i2c-via. config I2C_VIAPRO - tristate "VIA 82C596/82C686/823x" + tristate "VIA 82C596/82C686/82xx" depends on I2C && PCI help If you say yes to this option, support will be included for the VIA - 82C596/82C686/823x I2C interfaces. Specifically, the following + 82C596/82C686/82xx I2C interfaces. Specifically, the following chipsets are supported: - 82C596A/B - 82C686A/B - 8231 - 8233 - 8233A - 8235 - 8237 + VT82C596A/B + VT82C686A/B + VT8231 + VT8233/A + VT8235 + VT8237R/A + VT8251 This driver can also be built as a module. If so, the module will be called i2c-viapro. diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c index 47e52bf2c5ec..1ccc0fbc5947 100644 --- a/drivers/i2c/busses/i2c-viapro.c +++ b/drivers/i2c/busses/i2c-viapro.c @@ -34,6 +34,8 @@ VT8233A 0x3147 yes? VT8235 0x3177 yes VT8237R 0x3227 yes + VT8237A 0x3337 yes + VT8251 0x3287 yes Note: we assume there can only be one device, with one SMBus interface. */ @@ -381,7 +383,9 @@ found: dev_dbg(&pdev->dev, "VT596_smba = 0x%X\n", vt596_smba); switch (pdev->device) { + case PCI_DEVICE_ID_VIA_8251: case PCI_DEVICE_ID_VIA_8237: + case PCI_DEVICE_ID_VIA_8237A: case PCI_DEVICE_ID_VIA_8235: case PCI_DEVICE_ID_VIA_8233A: case PCI_DEVICE_ID_VIA_8233_0: @@ -432,8 +436,12 @@ static struct pci_device_id vt596_ids[] = { .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_8237A), + .driver_data = SMBBA3 }, { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231_4), .driver_data = SMBBA1 }, + { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8251), + .driver_data = SMBBA3 }, { 0, } }; -- cgit v1.2.3