summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-cards.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@md.metrocast.net>2010-07-19 01:19:43 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-08 23:42:55 -0300
commitdbe83a3b921328e12b2abe894fc692afba293d7f (patch)
treee13443d29b6b929a61584b06dec5f3eff84e2111 /drivers/media/video/cx23885/cx23885-cards.c
parent98d109f90fc02ce8baf1c2471ffcf8d66fb0d8e6 (diff)
downloadblackbird-op-linux-dbe83a3b921328e12b2abe894fc692afba293d7f.tar.gz
blackbird-op-linux-dbe83a3b921328e12b2abe894fc692afba293d7f.zip
V4L/DVB: cx23885: Protect PCI interrupt mask manipulations with a spinlock
This patch encapsulates access to the PCI_INT_MSK register and dev->pci_irqmask variable and protects them with a spinlock. This is needed because both the hard IRQ handler and a workhandler will need to manipulate the mask to disable the AV_CORE interrupt. Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-cards.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-cards.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c
index 294a7530caf7..d72b48ef940e 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -1012,7 +1012,6 @@ int cx23885_ir_init(struct cx23885_dev *dev)
dev->sd_ir = cx23885_find_hw(dev, CX23885_HW_888_IR);
v4l2_subdev_call(dev->sd_cx25840, core, s_io_pin_config,
ir_rxtx_pin_cfg_count, ir_rxtx_pin_cfg);
- dev->pci_irqmask |= PCI_MSK_IR;
/*
* For these boards we need to invert the Tx output via the
* IR controller to have the LED off while idle
@@ -1033,7 +1032,6 @@ int cx23885_ir_init(struct cx23885_dev *dev)
}
v4l2_subdev_call(dev->sd_cx25840, core, s_io_pin_config,
ir_rx_pin_cfg_count, ir_rx_pin_cfg);
- dev->pci_irqmask |= PCI_MSK_AV_CORE;
break;
case CX23885_BOARD_HAUPPAUGE_HVR1250:
dev->sd_ir = cx23885_find_hw(dev, CX23885_HW_AV_CORE);
@@ -1043,7 +1041,6 @@ int cx23885_ir_init(struct cx23885_dev *dev)
}
v4l2_subdev_call(dev->sd_cx25840, core, s_io_pin_config,
ir_rxtx_pin_cfg_count, ir_rxtx_pin_cfg);
- dev->pci_irqmask |= PCI_MSK_AV_CORE;
break;
case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP:
request_module("ir-kbd-i2c");
@@ -1058,15 +1055,13 @@ void cx23885_ir_fini(struct cx23885_dev *dev)
switch (dev->board) {
case CX23885_BOARD_HAUPPAUGE_HVR1850:
case CX23885_BOARD_HAUPPAUGE_HVR1290:
- dev->pci_irqmask &= ~PCI_MSK_IR;
- cx_clear(PCI_INT_MSK, PCI_MSK_IR);
+ cx23885_irq_remove(dev, PCI_MSK_IR);
cx23888_ir_remove(dev);
dev->sd_ir = NULL;
break;
case CX23885_BOARD_TEVII_S470:
case CX23885_BOARD_HAUPPAUGE_HVR1250:
- dev->pci_irqmask &= ~PCI_MSK_AV_CORE;
- cx_clear(PCI_INT_MSK, PCI_MSK_AV_CORE);
+ cx23885_irq_remove(dev, PCI_MSK_AV_CORE);
/* sd_ir is a duplicate pointer to the AV Core, just clear it */
dev->sd_ir = NULL;
break;
@@ -1078,13 +1073,13 @@ void cx23885_ir_pci_int_enable(struct cx23885_dev *dev)
switch (dev->board) {
case CX23885_BOARD_HAUPPAUGE_HVR1850:
case CX23885_BOARD_HAUPPAUGE_HVR1290:
- if (dev->sd_ir && (dev->pci_irqmask & PCI_MSK_IR))
- cx_set(PCI_INT_MSK, PCI_MSK_IR);
+ if (dev->sd_ir)
+ cx23885_irq_add_enable(dev, PCI_MSK_IR);
break;
case CX23885_BOARD_TEVII_S470:
case CX23885_BOARD_HAUPPAUGE_HVR1250:
- if (dev->sd_ir && (dev->pci_irqmask & PCI_MSK_AV_CORE))
- cx_set(PCI_INT_MSK, PCI_MSK_AV_CORE);
+ if (dev->sd_ir)
+ cx23885_irq_add_enable(dev, PCI_MSK_AV_CORE);
break;
}
}
OpenPOWER on IntegriCloud