diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-09-30 23:55:03 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-30 23:55:03 -0400 |
commit | e993835441734c184d70d3716eed78a08eeb71c2 (patch) | |
tree | 583aa17813cdae1c4640e353f8c6df3f197e7548 /drivers/i2c | |
parent | 360f654e7cda850034f3f6252a7a7cff3fa77356 (diff) | |
parent | 1bdfd554be94def718323659173517c5d4a69d25 (diff) |
Merge branch 'master' into upstream
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/Kconfig | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-iop3xx.c | 16 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sibyte.c | 4 | ||||
-rw-r--r-- | drivers/i2c/i2c-core.c | 25 |
4 files changed, 25 insertions, 22 deletions
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 9e56c3989d6..0d9667921f6 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -196,7 +196,7 @@ config I2C_IBM_IIC config I2C_IOP3XX tristate "Intel IOP3xx and IXP4xx on-chip I2C interface" - depends on (ARCH_IOP3XX || ARCH_IXP4XX) && I2C + depends on (ARCH_IOP32X || ARCH_IOP33X || ARCH_IXP4XX) && I2C help Say Y here if you want to use the IIC bus controller on the Intel IOP3xx I/O Processors or IXP4xx Network Processors. diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index 8e413150af3..4436c89be58 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c @@ -82,14 +82,16 @@ iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap) /* * Every time unit enable is asserted, GPOD needs to be cleared - * on IOP321 to avoid data corruption on the bus. + * on IOP3XX to avoid data corruption on the bus. */ -#ifdef CONFIG_ARCH_IOP321 -#define IOP321_GPOD_I2C0 0x00c0 /* clear these bits to enable ch0 */ -#define IOP321_GPOD_I2C1 0x0030 /* clear these bits to enable ch1 */ - - *IOP321_GPOD &= (iop3xx_adap->id == 0) ? ~IOP321_GPOD_I2C0 : - ~IOP321_GPOD_I2C1; +#ifdef CONFIG_PLAT_IOP + if (iop3xx_adap->id == 0) { + gpio_line_set(IOP3XX_GPIO_LINE(7), GPIO_LOW); + gpio_line_set(IOP3XX_GPIO_LINE(6), GPIO_LOW); + } else { + gpio_line_set(IOP3XX_GPIO_LINE(5), GPIO_LOW); + gpio_line_set(IOP3XX_GPIO_LINE(4), GPIO_LOW); + } #endif /* NB SR bits not same position as CR IE bits :-( */ iop3xx_adap->SR_enabled = diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c index 8f2b1f0deb8..0ca599d3b40 100644 --- a/drivers/i2c/busses/i2c-sibyte.c +++ b/drivers/i2c/busses/i2c-sibyte.c @@ -210,8 +210,8 @@ static int __init i2c_sibyte_init(void) static void __exit i2c_sibyte_exit(void) { - i2c_del_bus(&sibyte_board_adapter[0]); - i2c_del_bus(&sibyte_board_adapter[1]); + i2c_del_adapter(&sibyte_board_adapter[0]); + i2c_del_adapter(&sibyte_board_adapter[1]); } module_init(i2c_sibyte_init); diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 01233f0f777..7ca81f42d14 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -420,14 +420,6 @@ int i2c_attach_client(struct i2c_client *client) } list_add_tail(&client->list,&adapter->clients); - if (adapter->client_register) { - if (adapter->client_register(client)) { - dev_dbg(&adapter->dev, "client_register " - "failed for client [%s] at 0x%02x\n", - client->name, client->addr); - } - } - client->usage_count = 0; client->dev.parent = &client->adapter->dev; @@ -445,10 +437,17 @@ int i2c_attach_client(struct i2c_client *client) res = device_create_file(&client->dev, &dev_attr_client_name); if (res) goto out_unregister; - -out_unlock: mutex_unlock(&adapter->clist_lock); - return res; + + if (adapter->client_register) { + if (adapter->client_register(client)) { + dev_dbg(&adapter->dev, "client_register " + "failed for client [%s] at 0x%02x\n", + client->name, client->addr); + } + } + + return 0; out_unregister: init_completion(&client->released); /* Needed? */ @@ -458,7 +457,9 @@ out_list: list_del(&client->list); dev_err(&adapter->dev, "Failed to attach i2c client %s at 0x%02x " "(%d)\n", client->name, client->addr, res); - goto out_unlock; +out_unlock: + mutex_unlock(&adapter->clist_lock); + return res; } |