aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-core.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-09-26 22:17:30 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:16 -0500
commit29f8a0a50ac32ac4bc1937dcfdf8de6c406a5f10 (patch)
tree8a7406ebbb15dd7743543901eaeafc00708d31c5 /drivers/media/video/cx23885/cx23885-core.c
parent74618244003a5a9e11240af8c5795ae747d9a2e0 (diff)
V4L/DVB (13086): cx23885: Add skeleton v4l2_subdev for the CX23888 integrated IR controller
This change adds a skeletal implementation of a v4l2_subdevice to provide encapsulation and abstraction of the CX23888's integrated consumer infrared controller. This change also instantiates the cx23888_ir subdev for the HVR-1850 which has IR hardware physically wired up to a CX23888. The cx23888_ir subdev code is being written with long-term objectives to: 1. port it to the cx25840 module for the CX2584x, CX2583x, CX23885, & CX231xx IR controllers 2. possibly port it to the cx18 module for the CX23418 IR controller 3. have the IR subdevice accessed abstractly in the cx23885 module, so the driver can ignore the difference between the CX23885 and CX23888. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-core.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-core.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c
index c31284ba19dd..73be16b0d2a0 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -32,6 +32,7 @@
32 32
33#include "cx23885.h" 33#include "cx23885.h"
34#include "cimax2.h" 34#include "cimax2.h"
35#include "cx23888-ir.h"
35 36
36MODULE_DESCRIPTION("Driver for cx23885 based TV cards"); 37MODULE_DESCRIPTION("Driver for cx23885 based TV cards");
37MODULE_AUTHOR("Steven Toth <stoth@linuxtv.org>"); 38MODULE_AUTHOR("Steven Toth <stoth@linuxtv.org>");
@@ -753,6 +754,23 @@ static void cx23885_dev_checkrevision(struct cx23885_dev *dev)
753 __func__, dev->hwrevision); 754 __func__, dev->hwrevision);
754} 755}
755 756
757/* Find the first v4l2_subdev member of the group id in hw */
758struct v4l2_subdev *cx23885_find_hw(struct cx23885_dev *dev, u32 hw)
759{
760 struct v4l2_subdev *result = NULL;
761 struct v4l2_subdev *sd;
762
763 spin_lock(&dev->v4l2_dev.lock);
764 v4l2_device_for_each_subdev(sd, &dev->v4l2_dev) {
765 if (sd->grp_id == hw) {
766 result = sd;
767 break;
768 }
769 }
770 spin_unlock(&dev->v4l2_dev.lock);
771 return result;
772}
773
756static int cx23885_dev_setup(struct cx23885_dev *dev) 774static int cx23885_dev_setup(struct cx23885_dev *dev)
757{ 775{
758 int i; 776 int i;
@@ -1914,6 +1932,8 @@ static void __devexit cx23885_finidev(struct pci_dev *pci_dev)
1914 1932
1915 cx23885_shutdown(dev); 1933 cx23885_shutdown(dev);
1916 1934
1935 cx23888_ir_remove(dev);
1936
1917 pci_disable_device(pci_dev); 1937 pci_disable_device(pci_dev);
1918 1938
1919 /* unregister stuff */ 1939 /* unregister stuff */