Commit ea991147 authored by Jens Taprogge's avatar Jens Taprogge Committed by Greg Kroah-Hartman

Staging: ipack: move the responsibility to clear interrupts to the IPack devices.

Now the IPack device acknowledges its own IRQ.
Signed-off-by: default avatarJens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: default avatarSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e4af9497
...@@ -126,10 +126,6 @@ static irqreturn_t tpci200_slot_irq(struct slot_irq *slot_irq) ...@@ -126,10 +126,6 @@ static irqreturn_t tpci200_slot_irq(struct slot_irq *slot_irq)
return -ENODEV; return -ENODEV;
ret = slot_irq->handler(slot_irq->arg); ret = slot_irq->handler(slot_irq->arg);
/* Clear the IPack device interrupt */
readw(slot_irq->holder->io_space.address + 0xC0);
readw(slot_irq->holder->io_space.address + 0xC2);
return ret; return ret;
} }
......
...@@ -252,6 +252,10 @@ static irqreturn_t ipoctal_irq_handler(void *arg) ...@@ -252,6 +252,10 @@ static irqreturn_t ipoctal_irq_handler(void *arg)
for (i = 0; i < NR_CHANNELS; i++) for (i = 0; i < NR_CHANNELS; i++)
ipoctal_irq_channel(&ipoctal->channel[i]); ipoctal_irq_channel(&ipoctal->channel[i]);
/* Clear the IPack device interrupt */
readw(ipoctal->dev->int_space.address + ACK_INT_REQ0);
readw(ipoctal->dev->int_space.address + ACK_INT_REQ1);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -264,7 +268,6 @@ static int ipoctal_check_model(struct ipack_device *dev, unsigned char *id) ...@@ -264,7 +268,6 @@ static int ipoctal_check_model(struct ipack_device *dev, unsigned char *id)
manufacturerID = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MANUFACTURER_ID); manufacturerID = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MANUFACTURER_ID);
if (manufacturerID != IPACK1_VENDOR_ID_SBS) if (manufacturerID != IPACK1_VENDOR_ID_SBS)
return -ENODEV; return -ENODEV;
board_id = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MODEL); board_id = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MODEL);
switch (board_id) { switch (board_id) {
case IPACK1_DEVICE_ID_SBS_OCTAL_232: case IPACK1_DEVICE_ID_SBS_OCTAL_232:
...@@ -322,13 +325,22 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, ...@@ -322,13 +325,22 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
goto out_unregister_id_space; goto out_unregister_id_space;
} }
res = ipoctal->dev->bus->ops->map_space(ipoctal->dev, 0,
IPACK_INT_SPACE);
if (res) {
dev_err(&ipoctal->dev->dev,
"Unable to map slot [%d:%d] INT space!\n",
bus_nr, slot);
goto out_unregister_io_space;
}
res = ipoctal->dev->bus->ops->map_space(ipoctal->dev, res = ipoctal->dev->bus->ops->map_space(ipoctal->dev,
0x8000, IPACK_MEM_SPACE); 0x8000, IPACK_MEM_SPACE);
if (res) { if (res) {
dev_err(&ipoctal->dev->dev, dev_err(&ipoctal->dev->dev,
"Unable to map slot [%d:%d] MEM space!\n", "Unable to map slot [%d:%d] MEM space!\n",
bus_nr, slot); bus_nr, slot);
goto out_unregister_io_space; goto out_unregister_int_space;
} }
/* Save the virtual address to access the registers easily */ /* Save the virtual address to access the registers easily */
...@@ -450,6 +462,8 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, ...@@ -450,6 +462,8 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
out_unregister_slot_unmap: out_unregister_slot_unmap:
ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_ID_SPACE); ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_ID_SPACE);
out_unregister_int_space:
ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_INT_SPACE);
out_unregister_io_space: out_unregister_io_space:
ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_IO_SPACE); ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_IO_SPACE);
out_unregister_id_space: out_unregister_id_space:
...@@ -735,6 +749,7 @@ static void __ipoctal_remove(struct ipoctal *ipoctal) ...@@ -735,6 +749,7 @@ static void __ipoctal_remove(struct ipoctal *ipoctal)
tty_unregister_driver(ipoctal->tty_drv); tty_unregister_driver(ipoctal->tty_drv);
put_tty_driver(ipoctal->tty_drv); put_tty_driver(ipoctal->tty_drv);
ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_MEM_SPACE); ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_MEM_SPACE);
ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_INT_SPACE);
ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_IO_SPACE); ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_IO_SPACE);
ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_ID_SPACE); ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_ID_SPACE);
kfree(ipoctal); kfree(ipoctal);
......
...@@ -221,4 +221,7 @@ union scc2698_block { ...@@ -221,4 +221,7 @@ union scc2698_block {
#define ISR_DELTA_BREAK_B (0x1 << 6) #define ISR_DELTA_BREAK_B (0x1 << 6)
#define ISR_INPUT_PORT_CHANGE (0x1 << 7) #define ISR_INPUT_PORT_CHANGE (0x1 << 7)
#define ACK_INT_REQ0 0
#define ACK_INT_REQ1 2
#endif /* SCC2698_H_ */ #endif /* SCC2698_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment