From 2e3e13f8e9d9b2111404cdccaa4e1b988b70acce Mon Sep 17 00:00:00 2001 From: "Mark M. Hoffman" Date: Sun, 6 Nov 2005 23:04:51 +0100 Subject: [PATCH] i2c: i2c-i801 explicitly enables/disables PEC This patch tweaks i2c-i801.c so that the driver always sets the SMBAUXCTL register (which enables/disables PEC) explicitly before each transaction. Signed-off-by: Mark M. Hoffman Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-i801.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'drivers/i2c/busses') diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index ac3eafa8aac..1c752ddc10e 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -468,8 +468,7 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr, return -1; } - if (hwpec) - outb_p(1, SMBAUXCTL); /* enable hardware PEC */ + outb_p(hwpec, SMBAUXCTL); /* enable/disable hardware PEC */ if(block) ret = i801_block_transaction(data, read_write, size, hwpec); @@ -478,9 +477,6 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr, ret = i801_transaction(); } - if (hwpec) - outb_p(0, SMBAUXCTL); /* disable hardware PEC */ - if(block) return ret; if(ret) -- cgit v1.2.3 From 1d26f455eb0db0bf4d4b7177547f4310b645a32a Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Sat, 26 Nov 2005 20:18:43 +0100 Subject: [PATCH] i2c: Add support for Barco LPT->DVI to i2c-parport The following patch adds support for the Barco LPT->DVI I2C adapter to the i2c-parport driver. Signed-off-by: Peter Korsgaard Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-parport.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'drivers/i2c/busses') diff --git a/drivers/i2c/busses/i2c-parport.h b/drivers/i2c/busses/i2c-parport.h index f63a5377928..d702e5e0388 100644 --- a/drivers/i2c/busses/i2c-parport.h +++ b/drivers/i2c/busses/i2c-parport.h @@ -80,6 +80,14 @@ static struct adapter_parm adapter_parm[] = { .setscl = { 0x01, DATA, 1 }, .getsda = { 0x10, STAT, 1 }, }, + /* type 6: Barco LPT->DVI (K5800236) adapter */ + { + .setsda = { 0x02, DATA, 1 }, + .setscl = { 0x01, DATA, 1 }, + .getsda = { 0x20, STAT, 0 }, + .getscl = { 0x40, STAT, 0 }, + .init = { 0xfc, DATA, 0 }, + }, }; static int type; @@ -91,4 +99,6 @@ MODULE_PARM_DESC(type, " 2 = Velleman K8000 adapter\n" " 3 = ELV adapter\n" " 4 = ADM1032 evaluation board\n" - " 5 = ADM1025, ADM1030 and ADM1031 evaluation boards\n"); + " 5 = ADM1025, ADM1030 and ADM1031 evaluation boards\n" + " 6 = Barco LPT->DVI (K5800236) adapter\n" +); -- cgit v1.2.3 From 35d8b2e6b8e86b0d5126f36613b5202d4eb978b6 Mon Sep 17 00:00:00 2001 From: Laurent Riffard Date: Sat, 26 Nov 2005 20:34:05 +0100 Subject: [PATCH] i2c: Drop i2c_driver.{owner,name}, 1 of 11 We should use the i2c_driver.driver's .name and .owner fields instead of the i2c_driver's ones. This patch updates the core of the i2c drivers: it removes .name and .owner fields from the struct i2c_device and modify various functions to use struct device fields instead. Signed-off-by: Laurent Riffard Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-isa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/i2c/busses') diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c index 03672c9ca40..9f93fb85d06 100644 --- a/drivers/i2c/busses/i2c-isa.c +++ b/drivers/i2c/busses/i2c-isa.c @@ -92,8 +92,6 @@ int i2c_isa_add_driver(struct i2c_driver *driver) int res; /* Add the driver to the list of i2c drivers in the driver core */ - driver->driver.name = driver->name; - driver->driver.owner = driver->owner; driver->driver.bus = &i2c_bus_type; driver->driver.probe = i2c_isa_device_probe; driver->driver.remove = i2c_isa_device_remove; @@ -124,7 +122,7 @@ int i2c_isa_del_driver(struct i2c_driver *driver) if ((res = driver->detach_client(client))) { dev_err(&isa_adapter.dev, "Failed, driver " "%s not unregistered!\n", - driver->name); + driver->driver.name); return res; } } -- cgit v1.2.3 From e1c489b0e4fbb1687f8227fe78b4769c123768c1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 30 Nov 2005 16:35:09 -0800 Subject: [PATCH] I2C: Fix up debug build error for previous i2c structure changes Signed-off-by: Greg Kroah-Hartman Signed-off-by: Jean Delvare --- drivers/i2c/busses/i2c-isa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/i2c/busses') diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c index 9f93fb85d06..9f2ffef4d81 100644 --- a/drivers/i2c/busses/i2c-isa.c +++ b/drivers/i2c/busses/i2c-isa.c @@ -98,7 +98,7 @@ int i2c_isa_add_driver(struct i2c_driver *driver) res = driver_register(&driver->driver); if (res) return res; - dev_dbg(&isa_adapter.dev, "Driver %s registered\n", driver->name); + dev_dbg(&isa_adapter.dev, "Driver %s registered\n", driver->driver.name); /* Now look for clients */ driver->attach_adapter(&isa_adapter); @@ -129,7 +129,7 @@ int i2c_isa_del_driver(struct i2c_driver *driver) /* Get the driver off the core list */ driver_unregister(&driver->driver); - dev_dbg(&isa_adapter.dev, "Driver %s unregistered\n", driver->name); + dev_dbg(&isa_adapter.dev, "Driver %s unregistered\n", driver->driver.name); return 0; } @@ -174,7 +174,7 @@ static void __exit i2c_isa_exit(void) list_for_each_safe(item, _n, &isa_adapter.clients) { client = list_entry(item, struct i2c_client, list); dev_err(&isa_adapter.dev, "Driver %s still has an active " - "ISA client at 0x%x\n", client->driver->name, + "ISA client at 0x%x\n", client->driver->driver.name, client->addr); } if (client != NULL) -- cgit v1.2.3 From a4787c0d232e16e727b37205dc647337b8974f35 Mon Sep 17 00:00:00 2001 From: Martin Hicks Date: Sun, 18 Dec 2005 17:18:01 +0100 Subject: [PATCH] i2c: i2c-ibm_iic add I2C_CLASS_HWMON Add the ibm_iic driver to the HWMON class so it will scan the bus for connected hardware monitor sensors. Signed-off-by: Martin Hicks Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-ibm_iic.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/i2c/busses') diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c index 1a587253d71..87fae937e66 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c @@ -725,6 +725,7 @@ static int __devinit iic_probe(struct ocp_device *ocp){ strcpy(adap->name, "IBM IIC"); i2c_set_adapdata(adap, dev); adap->id = I2C_HW_OCP; + adap->class = I2C_CLASS_HWMON; adap->algo = &iic_algo; adap->client_register = NULL; adap->client_unregister = NULL; -- cgit v1.2.3 From 7c72ccf09b6debe55b8e049377ad3183ed4f4cb3 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 18 Dec 2005 17:25:18 +0100 Subject: [PATCH] i2c: i2c-nforce2 add nforce4 MCP-04 device ID One more supported PCI ID for the i2c-nforce2 driver. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-nforce2.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/i2c/busses') diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index 4d18e6e5f15..2d80eb26f68 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c @@ -30,6 +30,7 @@ nForce3 Pro150 MCP 00D4 nForce3 250Gb MCP 00E4 nForce4 MCP 0052 + nForce4 MCP-04 0034 This driver supports the 2 SMBuses that are included in the MCP of the nForce2/3/4 chipsets. @@ -257,6 +258,7 @@ static struct pci_device_id nforce2_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE4_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SMBUS) }, { 0 } }; -- cgit v1.2.3 From e91c021c487110386a07facd0396e6c3b7cf9c1f Mon Sep 17 00:00:00 2001 From: "Mark A. Greer" Date: Sun, 18 Dec 2005 17:22:01 +0100 Subject: [PATCH] i2c: i2c-mv64xxx fix transaction abortion When the i2c-mv64xxx i2c driver is signalled to abort a transaction, it aborts it immediately by issuing a stop condition on the bus. This violates the i2c protocol and can cause what appears to be an i2c bus hang. This patch delays issuing the stop condition until the i2c device can reasonably expect a stop condition. Also includes a minor fixup. Signed-off-by: Mark A. Greer Signed-off-by: Jean Delvare --- drivers/i2c/busses/i2c-mv64xxx.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'drivers/i2c/busses') diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index 81031eb5105..22781d84f79 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c @@ -1,6 +1,4 @@ /* - * drivers/i2c/busses/i2c-mv64xxx.c - * * Driver for the i2c controller on the Marvell line of host bridges for MIPS * and PPC (e.g, gt642[46]0, mv643[46]0, mv644[46]0). * @@ -65,7 +63,6 @@ enum { MV64XXX_I2C_STATE_WAITING_FOR_ADDR_2_ACK, MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK, MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA, - MV64XXX_I2C_STATE_ABORTING, }; /* Driver actions */ @@ -85,6 +82,7 @@ struct mv64xxx_i2c_data { int irq; u32 state; u32 action; + u32 aborting; u32 cntl_bits; void __iomem *reg_base; u32 reg_base_p; @@ -122,12 +120,6 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status) return; } - if (drv_data->state == MV64XXX_I2C_STATE_ABORTING) { - drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP; - drv_data->state = MV64XXX_I2C_STATE_IDLE; - return; - } - /* The status from the ctlr [mostly] tells us what to do next */ switch (status) { /* Start condition interrupt */ @@ -148,14 +140,16 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status) /* FALLTHRU */ case MV64XXX_I2C_STATUS_MAST_WR_ADDR_2_ACK: /* 0xd0 */ case MV64XXX_I2C_STATUS_MAST_WR_ACK: /* 0x28 */ - if (drv_data->bytes_left > 0) { + if ((drv_data->bytes_left == 0) + || (drv_data->aborting + && (drv_data->byte_posn != 0))) { + drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP; + drv_data->state = MV64XXX_I2C_STATE_IDLE; + } else { drv_data->action = MV64XXX_I2C_ACTION_SEND_DATA; drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK; drv_data->bytes_left--; - } else { - drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP; - drv_data->state = MV64XXX_I2C_STATE_IDLE; } break; @@ -184,7 +178,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status) } drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA; - if (drv_data->bytes_left == 1) + if ((drv_data->bytes_left == 1) || drv_data->aborting) drv_data->cntl_bits &= ~MV64XXX_I2C_REG_CONTROL_ACK; break; @@ -320,6 +314,7 @@ mv64xxx_i2c_prepare_for_io(struct mv64xxx_i2c_data *drv_data, drv_data->msg = msg; drv_data->byte_posn = 0; drv_data->bytes_left = msg->len; + drv_data->aborting = 0; drv_data->rc = 0; drv_data->cntl_bits = MV64XXX_I2C_REG_CONTROL_ACK | MV64XXX_I2C_REG_CONTROL_INTEN | MV64XXX_I2C_REG_CONTROL_TWSIEN; @@ -359,17 +354,19 @@ mv64xxx_i2c_wait_for_completion(struct mv64xxx_i2c_data *drv_data) } if (abort && drv_data->block) { - drv_data->state = MV64XXX_I2C_STATE_ABORTING; + drv_data->aborting = 1; spin_unlock_irqrestore(&drv_data->lock, flags); time_left = wait_event_timeout(drv_data->waitq, !drv_data->block, msecs_to_jiffies(drv_data->adapter.timeout)); - if (time_left <= 0) { + if ((time_left <= 0) && drv_data->block) { drv_data->state = MV64XXX_I2C_STATE_IDLE; dev_err(&drv_data->adapter.dev, - "mv64xxx: I2C bus locked\n"); + "mv64xxx: I2C bus locked, block: %d, " + "time_left: %d\n", drv_data->block, + (int)time_left); } } else spin_unlock_irqrestore(&drv_data->lock, flags); @@ -510,7 +507,7 @@ mv64xxx_i2c_probe(struct platform_device *pd) goto exit_kfree; } - strncpy(drv_data->adapter.name, MV64XXX_I2C_CTLR_NAME " adapter", + strlcpy(drv_data->adapter.name, MV64XXX_I2C_CTLR_NAME " adapter", I2C_NAME_SIZE); init_waitqueue_head(&drv_data->waitq); -- cgit v1.2.3