public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Walls <awalls@md.metrocast.net>
To: linux-media@vger.kernel.org
Cc: Kenney Phillisjr <kphillisjr@gmail.com>,
	Jarod Wilson <jarod@redhat.com>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Steven Toth <stoth@kernellabs.com>
Subject: [PATCH 11/17] v4l2_subdev: Move interrupt_service_routine ptr to v4l2_subdev_core_ops
Date: Mon, 19 Jul 2010 21:20:49 -0400	[thread overview]
Message-ID: <1279588849.31145.7.camel@localhost> (raw)
In-Reply-To: <cover.1279586511.git.awalls@md.metrocast.net>

The CX2584x and related cores are multifunction subdevices with a number
of internal blocks that act as interrupt sources.  Move the v4L2_subdev
interrupt_service_routine callback from v4l_subdev_ir_ops to
v4l2_subdev_core_ops, as the video and audio blocks of a CX2584x and
related cores can generate interrupts along with the IR block.  This
change also makes sense for other subdev's that generate interrupts and
do not have an IR block.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
---
 drivers/media/video/cx23885/cx23885-core.c |    2 +-
 drivers/media/video/cx23885/cx23888-ir.c   |    3 +--
 include/media/v4l2-subdev.h                |   16 +++++++---------
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c
index 161ae73..ec8baf3 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -1765,7 +1765,7 @@ static irqreturn_t cx23885_irq(int irq, void *dev_id)
 		handled += cx23885_video_irq(dev, vida_status);
 
 	if (pci_status & PCI_MSK_IR) {
-		v4l2_subdev_call(dev->sd_ir, ir, interrupt_service_routine,
+		v4l2_subdev_call(dev->sd_ir, core, interrupt_service_routine,
 				 pci_status, &ir_handled);
 		if (ir_handled)
 			handled++;
diff --git a/drivers/media/video/cx23885/cx23888-ir.c b/drivers/media/video/cx23885/cx23888-ir.c
index 28ca90f..51f2163 100644
--- a/drivers/media/video/cx23885/cx23888-ir.c
+++ b/drivers/media/video/cx23885/cx23888-ir.c
@@ -1126,11 +1126,10 @@ static const struct v4l2_subdev_core_ops cx23888_ir_core_ops = {
 	.g_register = cx23888_ir_g_register,
 	.s_register = cx23888_ir_s_register,
 #endif
+	.interrupt_service_routine = cx23888_ir_irq_handler,
 };
 
 static const struct v4l2_subdev_ir_ops cx23888_ir_ir_ops = {
-	.interrupt_service_routine = cx23888_ir_irq_handler,
-
 	.rx_read = cx23888_ir_rx_read,
 	.rx_g_parameters = cx23888_ir_rx_g_parameters,
 	.rx_s_parameters = cx23888_ir_rx_s_parameters,
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index a780cca..bacd525 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -131,6 +131,11 @@ struct v4l2_subdev_io_pin_config {
 
    s_power: puts subdevice in power saving mode (on == 0) or normal operation
 	mode (on == 1).
+
+   interrupt_service_routine: Called by the bridge chip's interrupt service
+	handler, when an interrupt status has be raised due to this subdev,
+	so that this subdev can handle the details.  It may schedule work to be
+	performed later.  It must not sleep.  *Called from an IRQ context*.
  */
 struct v4l2_subdev_core_ops {
 	int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
@@ -156,6 +161,8 @@ struct v4l2_subdev_core_ops {
 	int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
 #endif
 	int (*s_power)(struct v4l2_subdev *sd, int on);
+	int (*interrupt_service_routine)(struct v4l2_subdev *sd,
+						u32 status, bool *handled);
 };
 
 /* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio.
@@ -330,11 +337,6 @@ struct v4l2_subdev_sensor_ops {
 };
 
 /*
-   interrupt_service_routine: Called by the bridge chip's interrupt service
-	handler, when an IR interrupt status has be raised due to this subdev,
-	so that this subdev can handle the details.  It may schedule work to be
-	performed later.  It must not sleep.  *Called from an IRQ context*.
-
    [rt]x_g_parameters: Get the current operating parameters and state of the
 	the IR receiver or transmitter.
 
@@ -392,10 +394,6 @@ struct v4l2_subdev_ir_parameters {
 };
 
 struct v4l2_subdev_ir_ops {
-	/* Common to receiver and transmitter */
-	int (*interrupt_service_routine)(struct v4l2_subdev *sd,
-						u32 status, bool *handled);
-
 	/* Receiver */
 	int (*rx_read)(struct v4l2_subdev *sd, u8 *buf, size_t count,
 				ssize_t *num);
-- 
1.7.1.1



  parent reply	other threads:[~2010-07-20  1:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1279586511.git.awalls@md.metrocast.net>
2010-07-20  1:08 ` [PATCH 01/17] cx23885: Return -ENXIO on slave nack Andy Walls
2010-07-20  1:09 ` [PATCH 02/17] cx23885: Check for slave nack on all transactions Andy Walls
2010-07-20  1:10 ` [PATCH 03/17] cx23885: i2c_wait_done returns 0 or 1, don't check for < 0 return value Andy Walls
2010-07-20  1:11 ` [PATCH 04/17] cx25840: Make cx25840 i2c register read transactions atomic Andy Walls
2010-07-20  6:42   ` Jean Delvare
2010-07-20 12:35     ` Andy Walls
2010-07-20 12:46       ` Jean Delvare
2010-07-20  1:12 ` [PATCH 05/17] cx23885: Add correct detection of the HVR-1250 model 79501 Andy Walls
2010-07-20  1:12 ` [PATCH 06/17] cx23885: Add a VIDIOC_LOG_STATUS ioctl function for analog video devices Andy Walls
2010-07-20  1:16 ` [PATCH 07/17] v4l2_subdev: Add s_io_pin_config to v4l2_subdev_core_ops Andy Walls
2010-07-20  1:18 ` [PATCH 08/17] cx25840: Add s_io_pin_config core subdev ops for the CX2388[578] Andy Walls
2010-07-20  1:18 ` [PATCH 09/17] v4l2_subdev, cx23885: Differentiate IR carrier sense and I/O pin inversion Andy Walls
2010-07-20  1:19 ` [PATCH 10/17] cx23885: For CX23888 IR, configure the IO pin mux IR pins explcitly Andy Walls
2010-07-20  1:20 ` Andy Walls [this message]
2010-07-20  1:22 ` [PATCH 12/17] cx25840: Add support for CX2388[57] A/V core integrated IR controllers Andy Walls
2010-07-20  1:22 ` [PATCH 13/17] cx23885: Add a v4l2_subdev group id for the CX2388[578] integrated AV core Andy Walls
2010-07-20  1:23 ` [PATCH 14/17] cx23885: Add preliminary IR Rx support for the HVR-1250 and TeVii S470 Andy Walls
2010-07-20  1:25 ` [PATCH 15/17] cx23885: Protect PCI interrupt mask manipulations with a spinlock Andy Walls
2010-07-20  1:25 ` [PATCH 16/17] cx23885: Move AV Core irq handling to a work handler Andy Walls
2010-07-20  1:26 ` [PATCH 17/17] cx23885: Require user to explicitly enable CX2388[57] IR via module param Andy Walls

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1279588849.31145.7.camel@localhost \
    --to=awalls@md.metrocast.net \
    --cc=hverkuil@xs4all.nl \
    --cc=jarod@redhat.com \
    --cc=kphillisjr@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=stoth@kernellabs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox