git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[pandora-kernel.git]
/
drivers
/
ieee1394
/
pcilynx.c
diff --git
a/drivers/ieee1394/pcilynx.c
b/drivers/ieee1394/pcilynx.c
index
0742bef
..
7aee1ac
100644
(file)
--- a/
drivers/ieee1394/pcilynx.c
+++ b/
drivers/ieee1394/pcilynx.c
@@
-121,16
+121,6
@@
static int bit_getsda(void *data)
return reg_read((struct ti_lynx *) data, SERIAL_EEPROM_CONTROL) & 0x00000010;
}
return reg_read((struct ti_lynx *) data, SERIAL_EEPROM_CONTROL) & 0x00000010;
}
-static int bit_reg(struct i2c_client *client)
-{
- return 0;
-}
-
-static int bit_unreg(struct i2c_client *client)
-{
- return 0;
-}
-
static struct i2c_algo_bit_data bit_data = {
.setsda = bit_setsda,
.setscl = bit_setscl,
static struct i2c_algo_bit_data bit_data = {
.setsda = bit_setsda,
.setscl = bit_setscl,
@@
-140,14
+130,6
@@
static struct i2c_algo_bit_data bit_data = {
.timeout = 100,
};
.timeout = 100,
};
-static struct i2c_adapter bit_ops = {
- .id = 0xAA, //FIXME: probably we should get an id in i2c-id.h
- .client_register = bit_reg,
- .client_unregister = bit_unreg,
- .name = "PCILynx I2C",
-};
-
-
/*
* PCL handling functions.
/*
* PCL handling functions.
@@
-244,7
+226,7
@@
static int get_phy_reg(struct ti_lynx *lynx, int addr)
if (addr > 15) {
PRINT(KERN_ERR, lynx->id,
"%s: PHY register address %d out of range",
if (addr > 15) {
PRINT(KERN_ERR, lynx->id,
"%s: PHY register address %d out of range",
- __
FUNCTION
__, addr);
+ __
func
__, addr);
return -1;
}
return -1;
}
@@
-256,7
+238,7
@@
static int get_phy_reg(struct ti_lynx *lynx, int addr)
if (i > 10000) {
PRINT(KERN_ERR, lynx->id, "%s: runaway loop, aborting",
if (i > 10000) {
PRINT(KERN_ERR, lynx->id, "%s: runaway loop, aborting",
- __
FUNCTION
__);
+ __
func
__);
retval = -1;
break;
}
retval = -1;
break;
}
@@
-279,13
+261,13
@@
static int set_phy_reg(struct ti_lynx *lynx, int addr, int val)
if (addr > 15) {
PRINT(KERN_ERR, lynx->id,
if (addr > 15) {
PRINT(KERN_ERR, lynx->id,
-
"%s: PHY register address %d out of range", __FUNCTION
__, addr);
+
"%s: PHY register address %d out of range", __func
__, addr);
return -1;
}
if (val > 0xff) {
PRINT(KERN_ERR, lynx->id,
return -1;
}
if (val > 0xff) {
PRINT(KERN_ERR, lynx->id,
-
"%s: PHY register value %d out of range", __FUNCTION
__, val);
+
"%s: PHY register value %d out of range", __func
__, val);
return -1;
}
return -1;
}
@@
-305,7
+287,7
@@
static int sel_phy_reg_page(struct ti_lynx *lynx, int page)
if (page > 7) {
PRINT(KERN_ERR, lynx->id,
if (page > 7) {
PRINT(KERN_ERR, lynx->id,
-
"%s: PHY page %d out of range", __FUNCTION
__, page);
+
"%s: PHY page %d out of range", __func
__, page);
return -1;
}
return -1;
}
@@
-327,7
+309,7
@@
static int sel_phy_reg_port(struct ti_lynx *lynx, int port)
if (port > 15) {
PRINT(KERN_ERR, lynx->id,
if (port > 15) {
PRINT(KERN_ERR, lynx->id,
-
"%s: PHY port %d out of range", __FUNCTION
__, port);
+
"%s: PHY port %d out of range", __func
__, port);
return -1;
}
return -1;
}
@@
-477,7
+459,11
@@
static void send_next(struct ti_lynx *lynx, int what)
struct lynx_send_data *d;
struct hpsb_packet *packet;
struct lynx_send_data *d;
struct hpsb_packet *packet;
+#if 0 /* has been removed from ieee1394 core */
d = (what == hpsb_iso ? &lynx->iso_send : &lynx->async);
d = (what == hpsb_iso ? &lynx->iso_send : &lynx->async);
+#else
+ d = &lynx->async;
+#endif
if (!list_empty(&d->pcl_queue)) {
PRINT(KERN_ERR, lynx->id, "trying to queue a new packet in nonempty fifo");
BUG();
if (!list_empty(&d->pcl_queue)) {
PRINT(KERN_ERR, lynx->id, "trying to queue a new packet in nonempty fifo");
BUG();
@@
-511,9
+497,11
@@
static void send_next(struct ti_lynx *lynx, int what)
case hpsb_async:
pcl.buffer[0].control |= PCL_CMD_XMT;
break;
case hpsb_async:
pcl.buffer[0].control |= PCL_CMD_XMT;
break;
+#if 0 /* has been removed from ieee1394 core */
case hpsb_iso:
pcl.buffer[0].control |= PCL_CMD_XMT | PCL_ISOMODE;
break;
case hpsb_iso:
pcl.buffer[0].control |= PCL_CMD_XMT | PCL_ISOMODE;
break;
+#endif
case hpsb_raw:
pcl.buffer[0].control |= PCL_CMD_UNFXMT;
break;
case hpsb_raw:
pcl.buffer[0].control |= PCL_CMD_UNFXMT;
break;
@@
-542,9
+530,11
@@
static int lynx_transmit(struct hpsb_host *host, struct hpsb_packet *packet)
case hpsb_raw:
d = &lynx->async;
break;
case hpsb_raw:
d = &lynx->async;
break;
+#if 0 /* has been removed from ieee1394 core */
case hpsb_iso:
d = &lynx->iso_send;
break;
case hpsb_iso:
d = &lynx->iso_send;
break;
+#endif
default:
PRINT(KERN_ERR, lynx->id, "invalid packet type %d",
packet->type);
default:
PRINT(KERN_ERR, lynx->id, "invalid packet type %d",
packet->type);
@@
-748,8
+738,7
@@
static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg)
spin_lock_irqsave(&lynx->async.queue_lock, flags);
reg_write(lynx, DMA_CHAN_CTRL(CHANNEL_ASYNC_SEND), 0);
spin_lock_irqsave(&lynx->async.queue_lock, flags);
reg_write(lynx, DMA_CHAN_CTRL(CHANNEL_ASYNC_SEND), 0);
- list_splice(&lynx->async.queue, &packet_list);
- INIT_LIST_HEAD(&lynx->async.queue);
+ list_splice_init(&lynx->async.queue, &packet_list);
if (list_empty(&lynx->async.pcl_queue)) {
spin_unlock_irqrestore(&lynx->async.queue_lock, flags);
if (list_empty(&lynx->async.pcl_queue)) {
spin_unlock_irqrestore(&lynx->async.queue_lock, flags);
@@
-757,7
+746,6
@@
static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg)
} else {
struct ti_pcl pcl;
u32 ack;
} else {
struct ti_pcl pcl;
u32 ack;
- struct hpsb_packet *packet;
PRINT(KERN_INFO, lynx->id, "cancelling async packet, that was already in PCL");
PRINT(KERN_INFO, lynx->id, "cancelling async packet, that was already in PCL");
@@
-797,7
+785,7
@@
static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg)
}
break;
}
break;
-
+#if 0 /* has been removed from ieee1394 core */
case ISO_LISTEN_CHANNEL:
spin_lock_irqsave(&lynx->iso_rcv.lock, flags);
case ISO_LISTEN_CHANNEL:
spin_lock_irqsave(&lynx->iso_rcv.lock, flags);
@@
-819,7
+807,7
@@
static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg)
spin_unlock_irqrestore(&lynx->iso_rcv.lock, flags);
break;
spin_unlock_irqrestore(&lynx->iso_rcv.lock, flags);
break;
-
+#endif
default:
PRINT(KERN_ERR, lynx->id, "unknown devctl command %d", cmd);
retval = -1;
default:
PRINT(KERN_ERR, lynx->id, "unknown devctl command %d", cmd);
retval = -1;
@@
-1009,11
+997,11
@@
static irqreturn_t lynx_irq_handler(int irq, void *dev_id)
pci_unmap_single(lynx->dev, lynx->iso_send.data_dma,
packet->data_size, PCI_DMA_TODEVICE);
}
pci_unmap_single(lynx->dev, lynx->iso_send.data_dma,
packet->data_size, PCI_DMA_TODEVICE);
}
-
+#if 0 /* has been removed from ieee1394 core */
if (!list_empty(&lynx->iso_send.queue)) {
send_next(lynx, hpsb_iso);
}
if (!list_empty(&lynx->iso_send.queue)) {
send_next(lynx, hpsb_iso);
}
-
+#endif
spin_unlock(&lynx->iso_send.queue_lock);
if (pcl.pcl_status & DMA_CHAN_STAT_PKTCMPL) {
spin_unlock(&lynx->iso_send.queue_lock);
if (pcl.pcl_status & DMA_CHAN_STAT_PKTCMPL) {
@@
-1428,9
+1416,11
@@
static int __devinit add_card(struct pci_dev *dev,
struct i2c_algo_bit_data i2c_adapter_data;
error = -ENOMEM;
struct i2c_algo_bit_data i2c_adapter_data;
error = -ENOMEM;
- i2c_ad = k
memdup(&bit_ops,
sizeof(*i2c_ad), GFP_KERNEL);
+ i2c_ad = k
zalloc(
sizeof(*i2c_ad), GFP_KERNEL);
if (!i2c_ad) FAIL("failed to allocate I2C adapter memory");
if (!i2c_ad) FAIL("failed to allocate I2C adapter memory");
+ i2c_ad->id = I2C_HW_B_PCILYNX;
+ strlcpy(i2c_ad->name, "PCILynx I2C", sizeof(i2c_ad->name));
i2c_adapter_data = bit_data;
i2c_ad->algo_data = &i2c_adapter_data;
i2c_adapter_data.data = lynx;
i2c_adapter_data = bit_data;
i2c_ad->algo_data = &i2c_adapter_data;
i2c_adapter_data.data = lynx;
@@
-1457,13
+1447,11
@@
static int __devinit add_card(struct pci_dev *dev,
{ 0x50, I2C_M_RD, 20, (unsigned char*) lynx->bus_info_block }
};
{ 0x50, I2C_M_RD, 20, (unsigned char*) lynx->bus_info_block }
};
- /* we use i2c_transfer, because i2c_smbus_read_block_data does not work properly and we
-
do it more efficiently in one transaction rather then using several reads
*/
+ /* we use i2c_transfer because we have no i2c_client
+
at hand
*/
if (i2c_transfer(i2c_ad, msg, 2) < 0) {
PRINT(KERN_ERR, lynx->id, "unable to read bus info block from i2c");
} else {
if (i2c_transfer(i2c_ad, msg, 2) < 0) {
PRINT(KERN_ERR, lynx->id, "unable to read bus info block from i2c");
} else {
- int i;
-
PRINT(KERN_INFO, lynx->id, "got bus info block from serial eeprom");
/* FIXME: probably we shoud rewrite the max_rec, max_ROM(1394a),
* generation(1394a) and link_spd(1394a) field and recalculate
PRINT(KERN_INFO, lynx->id, "got bus info block from serial eeprom");
/* FIXME: probably we shoud rewrite the max_rec, max_ROM(1394a),
* generation(1394a) and link_spd(1394a) field and recalculate