aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/pcilynx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/pcilynx.c')
-rw-r--r--drivers/ieee1394/pcilynx.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c
index d1a5bcdb5e0..8af01ab30cc 100644
--- a/drivers/ieee1394/pcilynx.c
+++ b/drivers/ieee1394/pcilynx.c
@@ -121,16 +121,6 @@ static int bit_getsda(void *data)
121 return reg_read((struct ti_lynx *) data, SERIAL_EEPROM_CONTROL) & 0x00000010; 121 return reg_read((struct ti_lynx *) data, SERIAL_EEPROM_CONTROL) & 0x00000010;
122} 122}
123 123
124static int bit_reg(struct i2c_client *client)
125{
126 return 0;
127}
128
129static int bit_unreg(struct i2c_client *client)
130{
131 return 0;
132}
133
134static struct i2c_algo_bit_data bit_data = { 124static struct i2c_algo_bit_data bit_data = {
135 .setsda = bit_setsda, 125 .setsda = bit_setsda,
136 .setscl = bit_setscl, 126 .setscl = bit_setscl,
@@ -140,14 +130,6 @@ static struct i2c_algo_bit_data bit_data = {
140 .timeout = 100, 130 .timeout = 100,
141}; 131};
142 132
143static struct i2c_adapter bit_ops = {
144 .id = 0xAA, //FIXME: probably we should get an id in i2c-id.h
145 .client_register = bit_reg,
146 .client_unregister = bit_unreg,
147 .name = "PCILynx I2C",
148};
149
150
151 133
152/* 134/*
153 * PCL handling functions. 135 * PCL handling functions.
@@ -765,7 +747,6 @@ static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg)
765 } else { 747 } else {
766 struct ti_pcl pcl; 748 struct ti_pcl pcl;
767 u32 ack; 749 u32 ack;
768 struct hpsb_packet *packet;
769 750
770 PRINT(KERN_INFO, lynx->id, "cancelling async packet, that was already in PCL"); 751 PRINT(KERN_INFO, lynx->id, "cancelling async packet, that was already in PCL");
771 752
@@ -1436,9 +1417,11 @@ static int __devinit add_card(struct pci_dev *dev,
1436 struct i2c_algo_bit_data i2c_adapter_data; 1417 struct i2c_algo_bit_data i2c_adapter_data;
1437 1418
1438 error = -ENOMEM; 1419 error = -ENOMEM;
1439 i2c_ad = kmemdup(&bit_ops, sizeof(*i2c_ad), GFP_KERNEL); 1420 i2c_ad = kzalloc(sizeof(*i2c_ad), GFP_KERNEL);
1440 if (!i2c_ad) FAIL("failed to allocate I2C adapter memory"); 1421 if (!i2c_ad) FAIL("failed to allocate I2C adapter memory");
1441 1422
1423 i2c_ad->id = I2C_HW_B_PCILYNX;
1424 strlcpy(i2c_ad->name, "PCILynx I2C", sizeof(i2c_ad->name));
1442 i2c_adapter_data = bit_data; 1425 i2c_adapter_data = bit_data;
1443 i2c_ad->algo_data = &i2c_adapter_data; 1426 i2c_ad->algo_data = &i2c_adapter_data;
1444 i2c_adapter_data.data = lynx; 1427 i2c_adapter_data.data = lynx;
@@ -1465,13 +1448,11 @@ static int __devinit add_card(struct pci_dev *dev,
1465 { 0x50, I2C_M_RD, 20, (unsigned char*) lynx->bus_info_block } 1448 { 0x50, I2C_M_RD, 20, (unsigned char*) lynx->bus_info_block }
1466 }; 1449 };
1467 1450
1468 /* we use i2c_transfer, because i2c_smbus_read_block_data does not work properly and we 1451 /* we use i2c_transfer because we have no i2c_client
1469 do it more efficiently in one transaction rather then using several reads */ 1452 at hand */
1470 if (i2c_transfer(i2c_ad, msg, 2) < 0) { 1453 if (i2c_transfer(i2c_ad, msg, 2) < 0) {
1471 PRINT(KERN_ERR, lynx->id, "unable to read bus info block from i2c"); 1454 PRINT(KERN_ERR, lynx->id, "unable to read bus info block from i2c");
1472 } else { 1455 } else {
1473 int i;
1474
1475 PRINT(KERN_INFO, lynx->id, "got bus info block from serial eeprom"); 1456 PRINT(KERN_INFO, lynx->id, "got bus info block from serial eeprom");
1476 /* FIXME: probably we shoud rewrite the max_rec, max_ROM(1394a), 1457 /* FIXME: probably we shoud rewrite the max_rec, max_ROM(1394a),
1477 * generation(1394a) and link_spd(1394a) field and recalculate 1458 * generation(1394a) and link_spd(1394a) field and recalculate