rpms/kernel/devel linux-2.6-v4l-dvb-fixes.patch, NONE, 1.1 config-generic, 1.248, 1.249 kernel.spec, 1.1353, 1.1354 linux-2.6-v4l-dvb-update.patch, 1.1, 1.2

Mauro Carvalho Chehab mchehab at fedoraproject.org
Sat Feb 28 03:08:59 UTC 2009


Author: mchehab

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3028

Modified Files:
	config-generic kernel.spec linux-2.6-v4l-dvb-update.patch 
Added Files:
	linux-2.6-v4l-dvb-fixes.patch 
Log Message:
Updates V4L/DVB packages to the latest version

This patch updates V4L/DVB to the latest development status, adding some
fixes for 2.6.29 and the improvements for 2.6.30

Since the latest update, there were several improvements. The most important
one is the conversion of Zoran driver to V4L2. Several bug fixes were
solved by the Zoran changes.

Also, cx18 suffered several improvements, with its conversion to the new V4L2
framework.

A series of other miscelaneous improvements were also added.

Signed-off-by: Mauro Carvalho Chehab <mchehab at redhat.com>


linux-2.6-v4l-dvb-fixes.patch:

--- NEW FILE linux-2.6-v4l-dvb-fixes.patch ---
diff -upr drivers/media/dvb/b2c2/flexcop.c /home/v4l/tokernel/wrk/linux-2.6/drivers/media/dvb/b2c2/flexcop.c
--- a/drivers/media/dvb/b2c2/flexcop.c	2009-02-27 22:14:57.000000000 -0300
+++ b/drivers/media/dvb/b2c2/flexcop.c	2009-02-27 00:32:20.000000000 -0300
@@ -212,8 +212,7 @@ void flexcop_reset_block_300(struct flex
 	v210.sw_reset_210.Block_reset_enable = 0xb2;
 
 	fc->write_ibi_reg(fc,sw_reset_210,v210);
-	msleep(1);
-
+	udelay(1000);
 	fc->write_ibi_reg(fc,ctrl_208,v208_save);
 }
 
diff -upr drivers/media/dvb/b2c2/flexcop-hw-filter.c /home/v4l/tokernel/wrk/linux-2.6/drivers/media/dvb/b2c2/flexcop-hw-filter.c
--- a/drivers/media/dvb/b2c2/flexcop-hw-filter.c	2008-12-24 21:26:37.000000000 -0200
+++ b/drivers/media/dvb/b2c2/flexcop-hw-filter.c	2009-02-27 00:32:20.000000000 -0300
@@ -192,6 +192,7 @@ int flexcop_pid_feed_control(struct flex
 
 	return 0;
 }
+EXPORT_SYMBOL(flexcop_pid_feed_control);
 
 void flexcop_hw_filter_init(struct flexcop_device *fc)
 {
diff -upr drivers/media/dvb/b2c2/flexcop-pci.c /home/v4l/tokernel/wrk/linux-2.6/drivers/media/dvb/b2c2/flexcop-pci.c
--- a/drivers/media/dvb/b2c2/flexcop-pci.c	2008-12-24 21:26:37.000000000 -0200
+++ b/drivers/media/dvb/b2c2/flexcop-pci.c	2009-02-27 00:32:20.000000000 -0300
@@ -13,9 +13,9 @@ static int enable_pid_filtering = 1;
 module_param(enable_pid_filtering, int, 0444);
 MODULE_PARM_DESC(enable_pid_filtering, "enable hardware pid filtering: supported values: 0 (fullts), 1");
 
-static int irq_chk_intv;
+static int irq_chk_intv = 100;
 module_param(irq_chk_intv, int, 0644);
-MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ watchdog (currently just debugging).");
+MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ streaming watchdog.");
 
 #ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG
 #define dprintk(level,args...) \
@@ -34,7 +34,9 @@ MODULE_PARM_DESC(irq_chk_intv, "set the 
 
 static int debug;
 module_param(debug, int, 0644);
-MODULE_PARM_DESC(debug, "set debug level (1=info,2=regs,4=TS,8=irqdma (|-able))." DEBSTATUS);
+MODULE_PARM_DESC(debug,
+	"set debug level (1=info,2=regs,4=TS,8=irqdma,16=check (|-able))."
+	 DEBSTATUS);
 
 #define DRIVER_VERSION "0.1"
 #define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver"
@@ -58,6 +60,8 @@ struct flexcop_pci {
 	int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */
 	u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */
 	int count;
+	int count_prev;
+	int stream_problem;
 
 	spinlock_t irq_lock;
 
@@ -103,18 +107,32 @@ static void flexcop_pci_irq_check_work(s
 		container_of(work, struct flexcop_pci, irq_check_work.work);
 	struct flexcop_device *fc = fc_pci->fc_dev;
 
-	flexcop_ibi_value v = fc->read_ibi_reg(fc,sram_dest_reg_714);
+	if (fc->feedcount) {
 
-	flexcop_dump_reg(fc_pci->fc_dev,dma1_000,4);
-
-	if (v.sram_dest_reg_714.net_ovflow_error)
-		deb_chk("sram net_ovflow_error\n");
-	if (v.sram_dest_reg_714.media_ovflow_error)
-		deb_chk("sram media_ovflow_error\n");
-	if (v.sram_dest_reg_714.cai_ovflow_error)
-		deb_chk("sram cai_ovflow_error\n");
-	if (v.sram_dest_reg_714.cai_ovflow_error)
-		deb_chk("sram cai_ovflow_error\n");
+		if (fc_pci->count == fc_pci->count_prev) {
+			deb_chk("no IRQ since the last check\n");
+			if (fc_pci->stream_problem++ == 3) {
+				struct dvb_demux_feed *feed;
+
+				spin_lock_irq(&fc->demux.lock);
+				list_for_each_entry(feed, &fc->demux.feed_list,
+					list_head) {
+					flexcop_pid_feed_control(fc, feed, 0);
+				}
+
+				list_for_each_entry(feed, &fc->demux.feed_list,
+					list_head) {
+					flexcop_pid_feed_control(fc, feed, 1);
+				}
+				spin_unlock_irq(&fc->demux.lock);
+
+				fc_pci->stream_problem = 0;
+			}
+		} else {
+			fc_pci->stream_problem = 0;
+			fc_pci->count_prev = fc_pci->count;
+		}
+	}
 
 	schedule_delayed_work(&fc_pci->irq_check_work,
 			msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv));
@@ -216,16 +234,12 @@ static int flexcop_pci_stream_control(st
 		flexcop_dma_control_timer_irq(fc,FC_DMA_1,1);
 		deb_irq("IRQ enabled\n");
 
+		fc_pci->count_prev = fc_pci->count;
+
 //		fc_pci->active_dma1_addr = 0;
 //		flexcop_dma_control_size_irq(fc,FC_DMA_1,1);
 
-		if (irq_chk_intv > 0)
-			schedule_delayed_work(&fc_pci->irq_check_work,
-					msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv));
 	} else {
-		if (irq_chk_intv > 0)
-			cancel_delayed_work(&fc_pci->irq_check_work);
-
 		flexcop_dma_control_timer_irq(fc,FC_DMA_1,0);
 		deb_irq("IRQ disabled\n");
 
@@ -299,8 +313,6 @@ static int flexcop_pci_init(struct flexc
 					IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0)
 		goto err_pci_iounmap;
 
-
-
 	fc_pci->init_state |= FC_PCI_INIT;
 	return ret;
 
@@ -375,6 +387,10 @@ static int flexcop_pci_probe(struct pci_
 
 	INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work);
 
+		if (irq_chk_intv > 0)
+			schedule_delayed_work(&fc_pci->irq_check_work,
+		msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv));
+
 	return ret;
 
 err_fc_exit:
@@ -393,6 +409,9 @@ static void flexcop_pci_remove(struct pc
 {
 	struct flexcop_pci *fc_pci = pci_get_drvdata(pdev);
 
+	if (irq_chk_intv > 0)
+		cancel_delayed_work(&fc_pci->irq_check_work);
+
 	flexcop_pci_dma_exit(fc_pci);
 	flexcop_device_exit(fc_pci->fc_dev);
 	flexcop_pci_exit(fc_pci);
diff -upr drivers/media/video/em28xx/em28xx-audio.c /home/v4l/tokernel/wrk/linux-2.6/drivers/media/video/em28xx/em28xx-audio.c
--- a/drivers/media/video/em28xx/em28xx-audio.c	2009-02-27 22:44:26.000000000 -0300
+++ b/drivers/media/video/em28xx/em28xx-audio.c	2009-02-27 00:32:20.000000000 -0300
@@ -463,6 +463,8 @@ static int em28xx_audio_init(struct em28
 	pcm->info_flags = 0;
 	pcm->private_data = dev;
 	strcpy(pcm->name, "Empia 28xx Capture");
+
+	snd_card_set_dev(card, &dev->udev->dev);
 	strcpy(card->driver, "Empia Em28xx Audio");
 	strcpy(card->shortname, "Em28xx Audio");
 	strcpy(card->longname, "Empia Em28xx Audio");
diff -upr drivers/media/video/pxa_camera.c /home/v4l/tokernel/wrk/linux-2.6/drivers/media/video/pxa_camera.c
--- a/drivers/media/video/pxa_camera.c	2009-02-27 22:44:50.000000000 -0300
+++ b/drivers/media/video/pxa_camera.c	2009-02-27 00:32:20.000000000 -0300
@@ -1155,23 +1155,23 @@ static int pxa_camera_set_fmt(struct soc
 {
 	struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
 	struct pxa_camera_dev *pcdev = ici->priv;
-	const struct soc_camera_data_format *host_fmt, *cam_fmt = NULL;
-	const struct soc_camera_format_xlate *xlate;
+	const struct soc_camera_data_format *cam_fmt = NULL;
+	const struct soc_camera_format_xlate *xlate = NULL;
 	struct soc_camera_sense sense = {
 		.master_clock = pcdev->mclk,
 		.pixel_clock_max = pcdev->ciclk / 4,
 	};
-	int ret, buswidth;
+	int ret;
 
-	xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
-	if (!xlate) {
-		dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
-		return -EINVAL;
-	}
+	if (pixfmt) {
+		xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
+		if (!xlate) {
+			dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
+			return -EINVAL;
+		}
 
-	buswidth = xlate->buswidth;
-	host_fmt = xlate->host_fmt;
-	cam_fmt = xlate->cam_fmt;
+		cam_fmt = xlate->cam_fmt;
+	}
 
 	/* If PCLK is used to latch data from the sensor, check sense */
 	if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN)
@@ -1201,8 +1201,8 @@ static int pxa_camera_set_fmt(struct soc
 	}
 
 	if (pixfmt && !ret) {
-		icd->buswidth = buswidth;
-		icd->current_fmt = host_fmt;
+		icd->buswidth = xlate->buswidth;
+		icd->current_fmt = xlate->host_fmt;
 	}
 
 	return ret;
diff -upr drivers/media/video/v4l2-common.c /home/v4l/tokernel/wrk/linux-2.6/drivers/media/video/v4l2-common.c
--- a/drivers/media/video/v4l2-common.c	2009-02-27 22:44:26.000000000 -0300
+++ b/drivers/media/video/v4l2-common.c	2009-01-06 22:29:51.000000000 -0200
@@ -547,7 +547,6 @@ int v4l2_ctrl_query_fill(struct v4l2_que
 	case V4L2_CID_CONTRAST:
 	case V4L2_CID_SATURATION:
 	case V4L2_CID_HUE:
-	case V4L2_CID_SHARPNESS:
 		qctrl->flags |= V4L2_CTRL_FLAG_SLIDER;
 		break;
 	}
@@ -586,8 +585,6 @@ int v4l2_ctrl_query_fill_std(struct v4l2
 		return v4l2_ctrl_query_fill(qctrl, 0, 127, 1, 64);
 	case V4L2_CID_HUE:
 		return v4l2_ctrl_query_fill(qctrl, -128, 127, 1, 0);
-	case V4L2_CID_SHARPNESS:
-		return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0);
 
 	/* MPEG controls */
 	case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
diff -upr drivers/media/video/sh_mobile_ceu_camera.c /home/v4l/tokernel/wrk/linux-2.6/drivers/media/video/sh_mobile_ceu_camera.c
--- a/drivers/media/video/sh_mobile_ceu_camera.c	2009-02-27 22:44:50.000000000 -0300
+++ b/drivers/media/video/sh_mobile_ceu_camera.c	2009-02-27 00:32:20.000000000 -0300
@@ -603,21 +603,18 @@ static int sh_mobile_ceu_set_fmt(struct 
 	const struct soc_camera_format_xlate *xlate;
 	int ret;
 
+	if (!pixfmt)
+		return icd->ops->set_fmt(icd, pixfmt, rect);
+
 	xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
 	if (!xlate) {
 		dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
 		return -EINVAL;
 	}
 
-	switch (pixfmt) {
-	case 0:				/* Only geometry change */
-		ret = icd->ops->set_fmt(icd, pixfmt, rect);
-		break;
-	default:
-		ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect);
-	}
+	ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect);
 
-	if (pixfmt && !ret) {
+	if (!ret) {
 		icd->buswidth = xlate->buswidth;
 		icd->current_fmt = xlate->host_fmt;
 		pcdev->camera_fmt = xlate->cam_fmt;


Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-generic,v
retrieving revision 1.248
retrieving revision 1.249
diff -u -r1.248 -r1.249
--- config-generic	27 Feb 2009 07:03:54 -0000	1.248
+++ config-generic	28 Feb 2009 03:08:27 -0000	1.249
@@ -2809,6 +2809,7 @@
 CONFIG_USB_GSPCA_TV8532=m
 CONFIG_USB_GSPCA_VC032X=m
 CONFIG_USB_GSPCA_ZC3XX=m
+CONFIG_USB_GSPCA_SQ905=m
 CONFIG_USB_IBMCAM=m
 CONFIG_USB_KONICAWC=m
 CONFIG_USB_OV511=m


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1353
retrieving revision 1.1354
diff -u -r1.1353 -r1.1354
--- kernel.spec	27 Feb 2009 17:03:34 -0000	1.1353
+++ kernel.spec	28 Feb 2009 03:08:27 -0000	1.1354
@@ -671,7 +671,8 @@
 # silence the ACPI blacklist code
 Patch2802: linux-2.6-silence-acpi-blacklist.patch
 
-# Updates V4L/DVB to the latest development tree
+# Updates/Fixes on V4L/DVB to the latest development tree
+Patch 2899: linux-2.6-v4l-dvb-fixes.patch
 Patch 2900: linux-2.6-v4l-dvb-update.patch
 
 Patch9001: revert-fix-modules_install-via-nfs.patch
@@ -1199,7 +1200,8 @@
 # silence the ACPI blacklist code
 ApplyPatch linux-2.6-silence-acpi-blacklist.patch
 
-# V4L/DVB updates
+# V4L/DVB updates/fixes
+ApplyPatch linux-2.6-v4l-dvb-fixes.patch
 ApplyPatch linux-2.6-v4l-dvb-update.patch
 
 # revert 8b249b6856f16f09b0e5b79ce5f4d435e439b9d6
@@ -1790,6 +1792,9 @@
 # and build.
 
 %changelog
+* Wed Feb 27 2009 Mauro Carvalho Chehab <mchehab at redhat.com>
+- Update V4L/DVB to the latest development tree (fixes and updates for linux-next)
+
 * Fri Feb 27 2009 Jarod Wilson <jarod at redhat.com>
 - minor lirc and hdpvr patch updates from respective upstreams
 
@@ -1844,6 +1849,7 @@
 * Wed Feb 25 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29-0.158.rc6.git2
 - re-add modules.modesetting list.
 
+>>>>>>> 1.1353
 * Wed Feb 25 2009 Jeremy Katz <katzj at redhat.com> 2.6.29-0.157.rc6.git2
 - add dcbw's patch to fix wireless problems on the OLPC (from cjb, should
    be upstream "soon" but is currently blocking OLPC testing)

linux-2.6-v4l-dvb-update.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.1 -r 1.2 linux-2.6-v4l-dvb-update.patch
Index: linux-2.6-v4l-dvb-update.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-v4l-dvb-update.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-v4l-dvb-update.patch	25 Feb 2009 03:08:37 -0000	1.1
+++ linux-2.6-v4l-dvb-update.patch	28 Feb 2009 03:08:27 -0000	1.2
@@ -1,3 +1,15 @@
+diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
+index f1d6399..3a311fe 100644
+--- a/Documentation/ioctl/ioctl-number.txt
++++ b/Documentation/ioctl/ioctl-number.txt
+@@ -125,7 +125,6 @@ Code	Seq#	Include File		Comments
+ 'd'	00-DF	linux/video_decoder.h	conflict!
+ 'd'	F0-FF	linux/digi1.h
+ 'e'	all	linux/digi1.h		conflict!
+-'e'	00-1F	linux/video_encoder.h	conflict!
+ 'e'	00-1F	net/irda/irtty.h	conflict!
+ 'f'	00-1F	linux/ext2_fs.h
+ 'h'	00-7F				Charon filesystem
 diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv
 index 0d93fa1..4dfe626 100644
 --- a/Documentation/video4linux/CARDLIST.bttv
@@ -19,19 +31,33 @@
 + 15 -> TeVii S470                                          [d470:9022]
 + 16 -> DVBWorld DVB-S2 2005                                [0001:2005]
 diff --git a/Documentation/video4linux/CARDLIST.em28xx b/Documentation/video4linux/CARDLIST.em28xx
-index 75bded8..77874bd 100644
+index 75bded8..78d0a6e 100644
 --- a/Documentation/video4linux/CARDLIST.em28xx
 +++ b/Documentation/video4linux/CARDLIST.em28xx
-@@ -7,7 +7,7 @@
+@@ -7,12 +7,12 @@
    6 -> Terratec Cinergy 200 USB                 (em2800)
    7 -> Leadtek Winfast USB II                   (em2800)        [0413:6023]
    8 -> Kworld USB2800                           (em2800)
 -  9 -> Pinnacle Dazzle DVC 90/DVC 100           (em2820/em2840) [2304:0207,2304:021a]
-+  9 -> Pinnacle Dazzle DVC 90/DVC 100/DVC 101/DVC 107 (em2820/em2840) [2304:0207,2304:021a]
++  9 -> Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker (em2820/em2840) [1b80:e302,2304:0207,2304:021a]
   10 -> Hauppauge WinTV HVR 900                  (em2880)        [2040:6500]
   11 -> Terratec Hybrid XS                       (em2880)        [0ccd:0042]
   12 -> Kworld PVR TV 2800 RF                    (em2820/em2840)
-@@ -58,3 +58,7 @@
+  13 -> Terratec Prodigy XS                      (em2880)        [0ccd:0047]
+- 14 -> Pixelview Prolink PlayTV USB 2.0         (em2820/em2840)
++ 14 -> SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0 (em2820/em2840)
+  15 -> V-Gear PocketTV                          (em2800)
+  16 -> Hauppauge WinTV HVR 950                  (em2883)        [2040:6513,2040:6517,2040:651b]
+  17 -> Pinnacle PCTV HD Pro Stick               (em2880)        [2304:0227]
+@@ -30,7 +30,6 @@
+  30 -> Videology 20K14XUSB USB2.0               (em2820/em2840)
+  31 -> Usbgear VD204v9                          (em2821)
+  32 -> Supercomp USB 2.0 TV                     (em2821)
+- 33 -> SIIG AVTuner-PVR/Prolink PlayTV USB 2.0  (em2821)
+  34 -> Terratec Cinergy A Hybrid XS             (em2860)        [0ccd:004f]
+  35 -> Typhoon DVD Maker                        (em2860)
+  36 -> NetGMBH Cam                              (em2860)
+@@ -58,3 +57,7 @@
   58 -> Compro VideoMate ForYou/Stereo           (em2820/em2840) [185b:2041]
   60 -> Hauppauge WinTV HVR 850                  (em2883)        [2040:651f]
   61 -> Pixelview PlayTV Box 4 USB 2.0           (em2820/em2840)
@@ -132,7 +158,7 @@
  Module Parameters
  =================
 diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
-index ff12437..48cdf86 100644
+index ff12437..accc376 100644
 --- a/Documentation/video4linux/v4l2-framework.txt
 +++ b/Documentation/video4linux/v4l2-framework.txt
 @@ -47,7 +47,9 @@ All drivers have the following structure:
@@ -146,7 +172,26 @@
  
  This is a rough schematic of how it all relates:
  
-@@ -134,7 +136,7 @@ The recommended approach is as follows:
+@@ -82,12 +84,14 @@ You must register the device instance:
+ 	v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev);
+ 
+ Registration will initialize the v4l2_device struct and link dev->driver_data
+-to v4l2_dev. Registration will also set v4l2_dev->name to a value derived from
+-dev (driver name followed by the bus_id, to be precise). You may change the
+-name after registration if you want.
++to v4l2_dev. If v4l2_dev->name is empty then it will be set to a value derived
++from dev (driver name followed by the bus_id, to be precise). If you set it
++up before calling v4l2_device_register then it will be untouched. If dev is
++NULL, then you *must* setup v4l2_dev->name before calling v4l2_device_register.
+ 
+ The first 'dev' argument is normally the struct device pointer of a pci_dev,
+-usb_device or platform_device.
++usb_device or platform_device. It is rare for dev to be NULL, but it happens
++with ISA devices, for example.
+ 
+ You unregister with:
+ 
+@@ -134,7 +138,7 @@ The recommended approach is as follows:
  
  static atomic_t drv_instance = ATOMIC_INIT(0);
  
@@ -155,7 +200,7 @@
  				const struct pci_device_id *pci_id)
  {
  	...
-@@ -218,7 +220,7 @@ to add new ops and categories.
+@@ -218,7 +222,7 @@ to add new ops and categories.
  
  A sub-device driver initializes the v4l2_subdev struct using:
  
@@ -164,7 +209,7 @@
  
  Afterwards you need to initialize subdev->name with a unique name and set the
  module owner. This is done for you if you use the i2c helper functions.
-@@ -226,7 +228,7 @@ module owner. This is done for you if you use the i2c helper functions.
+@@ -226,7 +230,7 @@ module owner. This is done for you if you use the i2c helper functions.
  A device (bridge) driver needs to register the v4l2_subdev with the
  v4l2_device:
  
@@ -173,7 +218,7 @@
  
  This can fail if the subdev module disappeared before it could be registered.
  After this function was called successfully the subdev->dev field points to
-@@ -234,17 +236,17 @@ the v4l2_device.
+@@ -234,17 +238,17 @@ the v4l2_device.
  
  You can unregister a sub-device using:
  
@@ -195,7 +240,7 @@
  
  The macro will to the right NULL pointer checks and returns -ENODEV if subdev
  is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is
-@@ -252,12 +254,12 @@ NULL, or the actual result of the subdev->ops->core->g_chip_ident ops.
+@@ -252,19 +256,19 @@ NULL, or the actual result of the subdev->ops->core->g_chip_ident ops.
  
  It is also possible to call all or a subset of the sub-devices:
  
@@ -210,7 +255,15 @@
  
  Any error except -ENOIOCTLCMD will exit the loop with that error. If no
  errors (except -ENOIOCTLCMD) occured, then 0 is returned.
-@@ -340,6 +342,12 @@ Make sure to call v4l2_device_unregister_subdev(sd) when the remove() callback
+ 
+ The second argument to both calls is a group ID. If 0, then all subdevs are
+ called. If non-zero, then only those whose group ID match that value will
+-be called. Before a bridge driver registers a subdev it can set subdev->grp_id
++be called. Before a bridge driver registers a subdev it can set sd->grp_id
+ to whatever value it wants (it's 0 by default). This value is owned by the
+ bridge driver and the sub-device driver will never modify or use it.
+ 
+@@ -340,6 +344,12 @@ Make sure to call v4l2_device_unregister_subdev(sd) when the remove() callback
  is called. This will unregister the sub-device from the bridge driver. It is
  safe to call this even if the sub-device was never registered.
  
@@ -223,7 +276,7 @@
  
  The bridge driver also has some helper functions it can use:
  
-@@ -499,8 +507,8 @@ There are a few useful helper functions:
+@@ -499,8 +509,8 @@ There are a few useful helper functions:
  
  You can set/get driver private data in the video_device struct using:
  
@@ -234,7 +287,7 @@
  
  Note that you can safely call video_set_drvdata() before calling
  video_register_device().
-@@ -519,3 +527,103 @@ void *video_drvdata(struct file *file);
+@@ -519,3 +529,103 @@ void *video_drvdata(struct file *file);
  You can go from a video_device struct to the v4l2_device struct using:
  
  struct v4l2_device *v4l2_dev = vdev->v4l2_dev;
@@ -347,6 +400,94 @@
  0x0a17  0x004e   Pentax          Optio 50
  0x041e  0x405d   Creative        DiVi CAM 516
 +0x08ca  0x2102   Aiptek          DV T300
+diff --git a/arch/arm/plat-mxc/include/mach/mx3_camera.h b/arch/arm/plat-mxc/include/mach/mx3_camera.h
+new file mode 100644
+index 0000000..36d7ff2
+--- /dev/null
++++ b/arch/arm/plat-mxc/include/mach/mx3_camera.h
+@@ -0,0 +1,52 @@
++/*
++ * mx3_camera.h - i.MX3x camera driver header file
++ *
++ * Copyright (C) 2008, Guennadi Liakhovetski, DENX Software Engineering, <lg at denx.de>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++
[...70905 lines suppressed...]
+-			return 0;
+-		case VIDIOCSFREQ:
+-			if(copy_from_user(&tea->freq, arg, sizeof(tea->freq)))
+-				return -EFAULT;
+-			snd_tea575x_set_freq(tea);
+-			return 0;
+-		case VIDIOCGAUDIO:
+-		{
+-			struct video_audio v;
+-			memset(&v, 0, sizeof(v));
+-			strcpy(v.name, "Radio");
+-			if(copy_to_user(arg,&v, sizeof(v)))
+-				return -EFAULT;
++	}
++	return -EINVAL;
++}
++
++static int vidioc_g_ctrl(struct file *file, void *priv,
++					struct v4l2_control *ctrl)
++{
++	struct snd_tea575x *tea = video_drvdata(file);
++
++	switch (ctrl->id) {
++	case V4L2_CID_AUDIO_MUTE:
++		if (tea->ops->mute) {
++			ctrl->value = tea->mute;
+ 			return 0;
+ 		}
+-		case VIDIOCSAUDIO:
+-		{
+-			struct video_audio v;
+-			if(copy_from_user(&v, arg, sizeof(v)))
+-				return -EFAULT;
+-			if (tea->ops->mute)
+-				tea->ops->mute(tea,
+-					       (v.flags &
+-						VIDEO_AUDIO_MUTE) ? 1 : 0);
+-			if(v.audio)
+-				return -EINVAL;
++	}
++	return -EINVAL;
++}
++
++static int vidioc_s_ctrl(struct file *file, void *priv,
++					struct v4l2_control *ctrl)
++{
++	struct snd_tea575x *tea = video_drvdata(file);
++
++	switch (ctrl->id) {
++	case V4L2_CID_AUDIO_MUTE:
++		if (tea->ops->mute) {
++			tea->ops->mute(tea, ctrl->value);
++			tea->mute = 1;
+ 			return 0;
+ 		}
+-		default:
+-			return -ENOIOCTLCMD;
+ 	}
++	return -EINVAL;
++}
++
++static int vidioc_g_input(struct file *filp, void *priv, unsigned int *i)
++{
++	*i = 0;
++	return 0;
+ }
+ 
+-static void snd_tea575x_release(struct video_device *vfd)
++static int vidioc_s_input(struct file *filp, void *priv, unsigned int i)
+ {
++	if (i != 0)
++		return -EINVAL;
++	return 0;
+ }
+ 
+ static int snd_tea575x_exclusive_open(struct file *file)
+@@ -189,50 +260,91 @@ static int snd_tea575x_exclusive_release(struct file *file)
+ 	return 0;
+ }
+ 
++static const struct v4l2_file_operations tea575x_fops = {
++	.owner		= THIS_MODULE,
++	.open           = snd_tea575x_exclusive_open,
++	.release        = snd_tea575x_exclusive_release,
++	.ioctl		= video_ioctl2,
++};
++
++static const struct v4l2_ioctl_ops tea575x_ioctl_ops = {
++	.vidioc_querycap    = vidioc_querycap,
++	.vidioc_g_tuner     = vidioc_g_tuner,
++	.vidioc_s_tuner     = vidioc_s_tuner,
++	.vidioc_g_audio     = vidioc_g_audio,
++	.vidioc_s_audio     = vidioc_s_audio,
++	.vidioc_g_input     = vidioc_g_input,
++	.vidioc_s_input     = vidioc_s_input,
++	.vidioc_g_frequency = vidioc_g_frequency,
++	.vidioc_s_frequency = vidioc_s_frequency,
++	.vidioc_queryctrl   = vidioc_queryctrl,
++	.vidioc_g_ctrl      = vidioc_g_ctrl,
++	.vidioc_s_ctrl      = vidioc_s_ctrl,
++};
++
++static struct video_device tea575x_radio = {
++	.name           = "tea575x-tuner",
++	.fops           = &tea575x_fops,
++	.ioctl_ops 	= &tea575x_ioctl_ops,
++	.release	= video_device_release,
++};
++
+ /*
+  * initialize all the tea575x chips
+  */
+ void snd_tea575x_init(struct snd_tea575x *tea)
+ {
++	int retval;
+ 	unsigned int val;
++	struct video_device *tea575x_radio_inst;
+ 
+ 	val = tea->ops->read(tea);
+ 	if (val == 0x1ffffff || val == 0) {
+-		snd_printk(KERN_ERR "Cannot find TEA575x chip\n");
++		snd_printk(KERN_ERR
++			   "tea575x-tuner: Cannot find TEA575x chip\n");
+ 		return;
+ 	}
+ 
+-	memset(&tea->vd, 0, sizeof(tea->vd));
+-	strcpy(tea->vd.name, tea->tea5759 ? "TEA5759 radio" : "TEA5757 radio");
+-	tea->vd.release = snd_tea575x_release;
+-	video_set_drvdata(&tea->vd, tea);
+-	tea->vd.fops = &tea->fops;
+ 	tea->in_use = 0;
+-	tea->fops.owner = tea->card->module;
+-	tea->fops.open = snd_tea575x_exclusive_open;
+-	tea->fops.release = snd_tea575x_exclusive_release;
+-	tea->fops.ioctl = snd_tea575x_ioctl;
+-	if (video_register_device(&tea->vd, VFL_TYPE_RADIO, tea->dev_nr - 1) < 0) {
+-		snd_printk(KERN_ERR "unable to register tea575x tuner\n");
++	tea->val = TEA575X_BIT_BAND_FM | TEA575X_BIT_SEARCH_10_40;
++	tea->freq = 90500 * 16;		/* 90.5Mhz default */
++
++	tea575x_radio_inst = video_device_alloc();
++	if (tea575x_radio_inst == NULL) {
++		printk(KERN_ERR "tea575x-tuner: not enough memory\n");
+ 		return;
+ 	}
+-	tea->vd_registered = 1;
+ 
+-	tea->val = TEA575X_BIT_BAND_FM | TEA575X_BIT_SEARCH_10_40;
+-	tea->freq = 90500 * 16;		/* 90.5Mhz default */
++	memcpy(tea575x_radio_inst, &tea575x_radio, sizeof(tea575x_radio));
++
++	strcpy(tea575x_radio.name, tea->tea5759 ?
++				   "TEA5759 radio" : "TEA5757 radio");
++
++	video_set_drvdata(tea575x_radio_inst, tea);
++
++	retval = video_register_device(tea575x_radio_inst,
++				       VFL_TYPE_RADIO, radio_nr);
++	if (retval) {
++		printk(KERN_ERR "tea575x-tuner: can't register video device!\n");
++		kfree(tea575x_radio_inst);
++		return;
++	}
+ 
+ 	snd_tea575x_set_freq(tea);
+ 
+ 	/* mute on init */
+-	if (tea->ops->mute)
++	if (tea->ops->mute) {
+ 		tea->ops->mute(tea, 1);
++		tea->mute = 1;
++	}
++	tea->vd = tea575x_radio_inst;
+ }
+ 
+ void snd_tea575x_exit(struct snd_tea575x *tea)
+ {
+-	if (tea->vd_registered) {
+-		video_unregister_device(&tea->vd);
+-		tea->vd_registered = 0;
++	if (tea->vd) {
++		video_unregister_device(tea->vd);
++		tea->vd = NULL;
+ 	}
+ }
+ 
+diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
+index 82b9bdd..6cc18bf 100644
+--- a/sound/pci/Kconfig
++++ b/sound/pci/Kconfig
+@@ -487,7 +487,7 @@ config SND_FM801
+ config SND_FM801_TEA575X_BOOL
+ 	bool "ForteMedia FM801 + TEA5757 tuner"
+ 	depends on SND_FM801
+-	depends on VIDEO_V4L1=y || VIDEO_V4L1=SND_FM801
++	depends on VIDEO_V4L2=y || VIDEO_V4L2=SND_FM801
+ 	help
+ 	  Say Y here to include support for soundcards based on the ForteMedia
+ 	  FM801 chip with a TEA5757 tuner connected to GPIO1-3 pins (Media




More information about the fedora-extras-commits mailing list