Re: [PATCH 1/1] EM28xx - fix deadlock when unplugging and replugging a DVB adapter

2011-08-21 Thread Chris Rankin
It occurred to me this morning that since we're no longer supposed to be holding 
the device lock when taking the device list lock, then the 
em28xx_usb_disconnect() function needs changing too.


Signed-off-by: Chris Rankin ranki...@yahoo.com

--- linux-3.0/drivers/media/video/em28xx/em28xx-cards.c.orig	2011-08-19 00:45:48.0 +0100
+++ linux-3.0/drivers/media/video/em28xx/em28xx-cards.c	2011-08-21 13:16:43.0 +0100
@@ -2929,7 +2929,9 @@
 		goto fail_reg_analog_devices;
 	}
 
+	mutex_unlock(dev-lock);
 	em28xx_init_extension(dev);
+	mutex_lock(dev-lock);
 
 	/* Save some power by putting tuner to sleep */
 	v4l2_device_call_all(dev-v4l2_dev, 0, core, s_power, 0);
@@ -3191,10 +3193,10 @@
 		em28xx_release_resources(dev);
 	}
 
-	em28xx_close_extension(dev);
-
 	mutex_unlock(dev-lock);
 
+	em28xx_close_extension(dev);
+
 	if (!dev-users) {
 		kfree(dev-alt_max_pkt_size);
 		kfree(dev);


Re: Afatech AF9013

2011-08-21 Thread Josu Lazkano
Hello again, thanks Jason for your reply. It is interesting to ear
that is not just my problem.

I add the dual device on a laptop with same kernel 2.6.32.

It works well, both tuners working great with no pixeled images.

Two weeks ago, I must change my HTPC power supply, a 300W PFC. I had
some problems when connecting a 2,5 USB drive (it use to shutdown). On
the local shop they test it and there are more than 5V on the USB, so
they change it.

How can I test the USB? Is there any USB debug tool?

I don't know how to continue with this, thanks for all your help, best regards.

2011/8/21 Jason Hecker jwhec...@gmail.com:
 I have a problem that may be related to the issues on this thread and
 it's driving me nuts.

 I have two dual tuner Afatech based cards, they are both Leadtek
 2000DS cards, one made by Leadtek and the other branded as KWorld but
 they are otherwise identical in spite of different VID:PID.

 On each card tuner A is an AF9015 and tuner B is an AF9013.  The
 KWorld card worked just fine for about 18 months in Mythbuntu 10.04
 with the rebuilt and patched modules as described in the Wiki entry on
 the 2000DS.  A few weeks ago tuner A started giving errors making the
 viewing unwatchable so figuring the card had died I bought the
 Leadtek.  To my surprise it gave the same problem as the KWorld when
 using tuner A.  It seems Tuner A is OK until Tuner B is used and then
 Tuner A gets a lot of errors.  Tuner B never has errors.  I did try
 using the latest media_build from V4L but that didn't help.

 So, I installed Mythbuntu 11.04 and with both cards I
 still get the same problem.  Watching live TV with MythTV or with
 mplayer on tuner A gives errors and tuner B is always flawless even
 with media_build updates.

 I honestly can't recall if when the failure first occurred if I had
 done a routine kernel update at that time - though it would have just
 been the usual 2.6.32 update that is in line with 10.04 maintenance.

 I have tried everything imaginable to nail down the problem but can't
 seem to fix it.  Even options dvb-usb force_pid_filter_usage=1 seems
 to improve the problem somewhat but the errors are still there.  I
 have tried every firmware from 4.65 to 5.10, adjusting the PCI latency
 from 32 to 96, fed each card directly from the antenna (taking the
 splitter out of the loop), one card fitted, both cards fitted, kernel
 and system upgrades (Mythbuntu 10.04 to 11.04), mplayer vs MythTV but
 the results are always the same.  Tuner B is perfect, tuner A
 corrupts when Tuner B is used.  There are no errors or warnings in
 syslog or dmesg to
 suggest anything has failed.

 I'd appreciate any suggestions at this point as I am pretty unhappy
 with the situation considering it *used* to work.
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html




-- 
Josu Lazkano
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: USB mini-summit report

2011-08-21 Thread Greg KH
On Fri, Aug 19, 2011 at 02:37:25PM -0700, Sarah Sharp wrote:
 The USB mini-summit was a success!  Thank you to all the people who attended. 
  I
 think we had some productive discussions that could have taken weeks on the
 mailing list.
 
 Please reply to this email if you have your own notes, or if your memory of 
 the
 mini-summit differs from mine. :)

Cc:s dropped so that the lists can pick this up.

Thanks Sarah for organizing this and running it.  It went really well
and I hope everyone else enjoyed it as much as I did.

I'll leave the rest below for the lists to see it.

greg k-h

 Key decisions:
 =
 
 Theodore Kilgore agreed to move the userspace still camera drivers into the
 kernel in order to make the hand-off between still cam and webcam mode more
 user-friendly.  The proposal was to have the V4L2 still cam interface attached
 to a separate file so that userspace could just use the standard READ 
 syscalls,
 rather than adding new ioctls to /dev/videoN.
 
 The issue with TV tuners having resources that need to be shared across
 separate drivers didn't really get resolved, but Mauro Carvalho Chehab is 
 going
 to look into using the devres subsystem to share resources.
 
 Hans Geode gave a demo of his USB redirection code that's being used in qemu 
 0.15, and
 we discussed how to integrate his project with the USB over IP kernel driver
 that Matt Mooney has been working on.  Matt and Hans agreed that the USB over 
 IP
 protocol was fairly inefficient, and that Matt would re-work the kernel driver
 to use Han's protocol instead.  That way, people could use the VHCI driver to
 talk to qemu devices on other computers.
 
 The discussion with the virtualization folks mostly centered around pain 
 points
 in usbfs: the arbitrary 16KB URB buffer size limit, lack of a zero-copy
 interface, and a request for bulk streams support for USB 3.0 devices.  Hans'
 USB redirect code also seemed to have fairly poor performance and high CPU 
 load
 in comparison to a non-virtualized transfer, which indicates there are issues 
 in
 either qemu, libusb, usbfs, or Hans' USB redirect code.
 
 
 Notes:
 =
 
 Dual mode cameras
 -
 
 Theodore confirmed there is always a direct mapping between one webcam driver
 and one still cam driver for each webcam chipset.  All the still cam drivers 
 are
 maybe 5,000 lines of code, so they shouldn't be too difficult to move into the
 kernel.
 
 Only one camera actually deletes photos when the video starts streaming.  (It
 was unclear whether it was only one camera version, or all the cameras for a
 particular camera chipset.  Theodore, can you comment?)
 
 The issue with gphoto not re-attaching the kernel driver was mostly caused by
 the fact that it was using libusb0.1, which doesn't have the re-attach
 functionality.  gphoto now directly uses the usbfs ioctl to reattach the 
 kernel
 driver when the still cam media is unmounted.
 
 The suggestion was made that if the camera was busy, either in still cam mode,
 or in webcam mode and the opposite mode was requested, that we should log a
 message to the kernel log along with returning -EBUSY.  The still cam driver
 should only send a busy error when the mount is actually active -- when a 
 photo
 is being fetched or being deleted.  A warning message about the one camera 
 that
 deletes photos when video streaming is enabled should be printed so users 
 could
 be aware of it.
 
 At first, the proposal was to attach the new still cam ioctls to /dev/videoN.
 Mauro suggested that we actually create a new file (with the same permissions 
 as
 /dev/videoN).  This followed the UNIX philosophy of separating out different
 functionality into separate programs/files, and allows userspace to use READ
 syscalls directly.
 
 Debate followed.  The files transferred off of the still cam drivers weren't
 very big, since most devices only have 16MB of RAM, so just passing data in
 ioctls could be acceptable.  Mauro suggested it would be better to have a
 separate file so userspace can just read from it with mmap.  Mauro still wants
 to use v4l class and core, just have a separate file, like they do with dual
 input/outputs.  Hans agreed a separate file seems more elegant.
 
 Discussion of the decoding code for V4L2 followed, but I will admit it was
 mostly over my head.  Perhaps Hans and Theodore can provide a summary?  I 
 think
 people said V4L2 uses bilinear interpolation, which causes zippered bands at
 the edges of objects.  Gphoto uses the accure interpolation, which is 
 better,
 but still leaves bluish bands on the edges.  Theordore is exploring AHD
 demosaicing, which eliminates the bands.
 
 
 TV tuners
 -
 
 Many TV tuners have both an analog and a digital tuner, and many of them also
 include sound interfaces, 3G modems, or mass storage devices.  Mauro said one
 device had mass storage, 3G, and a TV tuner, and the user would have to
 disconnect the mass storage device and connect through the 3G 

Re: Afatech AF9013

2011-08-21 Thread Malcolm Priestley
On Sun, 2011-08-21 at 11:51 +1000, Jason Hecker wrote:

 I have tried everything imaginable to nail down the problem but can't
 seem to fix it.  Even options dvb-usb force_pid_filter_usage=1 seems
 to improve the problem somewhat but the errors are still there.  I
 have tried every firmware from 4.65 to 5.10, adjusting the PCI latency
 from 32 to 96, fed each card directly from the antenna (taking the
 splitter out of the loop), one card fitted, both cards fitted, kernel
 and system upgrades (Mythbuntu 10.04 to 11.04), mplayer vs MythTV but
 the results are always the same.  Tuner B is perfect, tuner A
 corrupts when Tuner B is used.  There are no errors or warnings in
 syslog or dmesg to
 suggest anything has failed.
I think there is a BUG, where on some systems, the frontends become
swapped between kernels 2.6.35 and 2.6.38 on dual tuners.

I haven't fully investigated the cause, but I think it's to do with
applying a later build of dvb-usb to an earlier kernel.

So, Tuner B on 2.6.38(11.04) is the old Tuner A.

Regards

Malcolm

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[cron job] v4l-dvb daily build: WARNINGS

2011-08-21 Thread Hans Verkuil
This message is generated daily by a cron job that builds v4l-dvb for
the kernels and architectures in the list below.

Results of the daily build of v4l-dvb:

date:Sun Aug 21 19:00:37 CEST 2011
git hash:9bed77ee2fb46b74782d0d9d14b92e9d07f3df6e
gcc version:  i686-linux-gcc (GCC) 4.6.1
host hardware:x86_64
host os:  2.6.32.5

linux-git-armv5: WARNINGS
linux-git-armv5-davinci: WARNINGS
linux-git-armv5-ixp: WARNINGS
linux-git-armv5-omap2: WARNINGS
linux-git-i686: WARNINGS
linux-git-m32r: OK
linux-git-mips: WARNINGS
linux-git-powerpc64: WARNINGS
linux-git-x86_64: WARNINGS
linux-2.6.31.12-i686: WARNINGS
linux-2.6.32.6-i686: WARNINGS
linux-2.6.33-i686: WARNINGS
linux-2.6.34-i686: WARNINGS
linux-2.6.35.3-i686: WARNINGS
linux-2.6.36-i686: WARNINGS
linux-2.6.37-i686: WARNINGS
linux-2.6.38.2-i686: WARNINGS
linux-2.6.39.1-i686: WARNINGS
linux-3.0-i686: WARNINGS
linux-3.1-rc1-i686: WARNINGS
linux-2.6.31.12-x86_64: WARNINGS
linux-2.6.32.6-x86_64: WARNINGS
linux-2.6.33-x86_64: WARNINGS
linux-2.6.34-x86_64: WARNINGS
linux-2.6.35.3-x86_64: WARNINGS
linux-2.6.36-x86_64: WARNINGS
linux-2.6.37-x86_64: WARNINGS
linux-2.6.38.2-x86_64: WARNINGS
linux-2.6.39.1-x86_64: WARNINGS
linux-3.0-x86_64: WARNINGS
linux-3.1-rc1-x86_64: WARNINGS
spec-git: WARNINGS
sparse: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.tar.bz2

The V4L-DVB specification from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/14] [media] Logging cleanups

2011-08-21 Thread Joe Perches
First block of logging message cleanups for drivers/media.

Joe Perches (14):
  [media] saa7146: Use current logging styles
  [media] rc-core.h: Surround macro with do {} while (0)
  [media] ene_ir: Use current logging styles
  [media] winbond-cir: Use current logging styles
  [media] bt8xx: Use current logging styles
  [media] cx18: Use current logging styles
  [media] et61x251: Use current logging styles
  [media] gl860: Use current logging styles
  [media] m5602: Use current logging styles
  [media] finepix: Use current logging styles
  [media] pac207: Use current logging styles
  [media] sn9c20x: Use current logging styles
  [media] t613: Use current logging styles
  [media] gspca: Use current logging styles

 drivers/media/common/saa7146_core.c|   74 +++---
 drivers/media/common/saa7146_fops.c|  118 +
 drivers/media/common/saa7146_hlp.c |   14 +-
 drivers/media/common/saa7146_i2c.c |   60 ++--
 drivers/media/common/saa7146_vbi.c |   48 ++--
 drivers/media/common/saa7146_video.c   |  171 ++--
 drivers/media/dvb/ttpci/av7110_v4l.c   |   32 ++-
 drivers/media/dvb/ttpci/budget-av.c|   42 ++--
 drivers/media/rc/ene_ir.c  |   73 +++---
 drivers/media/rc/ene_ir.h  |   19 +-
 drivers/media/rc/winbond-cir.c |6 +-
 drivers/media/video/bt8xx/bttv-cards.c |  242 -
 drivers/media/video/bt8xx/bttv-driver.c|  294 ++--
 drivers/media/video/bt8xx/bttv-gpio.c  |4 +-
 drivers/media/video/bt8xx/bttv-i2c.c   |   56 ++--
 drivers/media/video/bt8xx/bttv-input.c |   37 ++--
 drivers/media/video/bt8xx/bttv-risc.c  |   25 +-
 drivers/media/video/bt8xx/bttv-vbi.c   |9 +-
 drivers/media/video/bt8xx/bttvp.h  |   18 +-
 drivers/media/video/cx18/cx18-alsa-main.c  |   26 +-
 drivers/media/video/cx18/cx18-alsa-mixer.c |2 +
 drivers/media/video/cx18/cx18-alsa-pcm.c   |   12 +-
 drivers/media/video/cx18/cx18-alsa.h   |   32 +-
 drivers/media/video/cx18/cx18-audio.c  |2 +
 drivers/media/video/cx18/cx18-av-audio.c   |2 +
 drivers/media/video/cx18/cx18-av-core.c|2 +
 drivers/media/video/cx18/cx18-av-firmware.c|2 +
 drivers/media/video/cx18/cx18-av-vbi.c |1 +
 drivers/media/video/cx18/cx18-controls.c   |3 +
 drivers/media/video/cx18/cx18-driver.c |   35 ++--
 drivers/media/video/cx18/cx18-driver.h |  177 +++-
 drivers/media/video/cx18/cx18-dvb.c|2 +
 drivers/media/video/cx18/cx18-fileops.c|9 +-
 drivers/media/video/cx18/cx18-firmware.c   |4 +-
 drivers/media/video/cx18/cx18-gpio.c   |2 +
 drivers/media/video/cx18/cx18-i2c.c|2 +
 drivers/media/video/cx18/cx18-io.c |2 +
 drivers/media/video/cx18/cx18-ioctl.c  |4 +-
 drivers/media/video/cx18/cx18-irq.c|2 +
 drivers/media/video/cx18/cx18-mailbox.c|2 +
 drivers/media/video/cx18/cx18-queue.c  |2 +
 drivers/media/video/cx18/cx18-scb.c|2 +
 drivers/media/video/cx18/cx18-streams.c|2 +
 drivers/media/video/cx18/cx18-vbi.c|2 +
 drivers/media/video/cx18/cx18-video.c  |2 +
 drivers/media/video/et61x251/et61x251.h|   66 +++--
 drivers/media/video/et61x251/et61x251_core.c   |2 +
 drivers/media/video/et61x251/et61x251_tas5130d1b.c |2 +
 drivers/media/video/gspca/benq.c   |   18 +-
 drivers/media/video/gspca/conex.c  |6 +-
 drivers/media/video/gspca/cpia1.c  |7 +-
 drivers/media/video/gspca/etoms.c  |6 +-
 drivers/media/video/gspca/finepix.c|8 +-
 drivers/media/video/gspca/gl860/gl860.c|8 +-
 drivers/media/video/gspca/gspca.c  |   46 ++--
 drivers/media/video/gspca/gspca.h  |   22 +-
 drivers/media/video/gspca/jeilinj.c|   10 +-
 drivers/media/video/gspca/kinect.c |   36 ++-
 drivers/media/video/gspca/konica.c |   16 +-
 drivers/media/video/gspca/m5602/m5602_core.c   |9 +-
 drivers/media/video/gspca/m5602/m5602_mt9m111.c|   28 +-
 drivers/media/video/gspca/m5602/m5602_ov7660.c |   21 +-
 drivers/media/video/gspca/m5602/m5602_ov9650.c |   19 +-
 drivers/media/video/gspca/m5602/m5602_po1030.c |   21 +-
 drivers/media/video/gspca/m5602/m5602_s5k4aa.c |   35 ++-
 drivers/media/video/gspca/m5602/m5602_s5k83a.c |   30 ++-
 drivers/media/video/gspca/mars.c   |6 +-
 drivers/media/video/gspca/mr97310a.c   

[PATCH 04/14] [media] winbond-cir: Use current logging styles

2011-08-21 Thread Joe Perches
Add pr_fmt, convert printks to pr_level.

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/media/rc/winbond-cir.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index bec8abc..13f54b5 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -41,6 +41,8 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include linux/module.h
 #include linux/pnp.h
 #include linux/interrupt.h
@@ -1155,12 +1157,12 @@ wbcir_init(void)
case IR_PROTOCOL_RC6:
break;
default:
-   printk(KERN_ERR DRVNAME : Invalid power-on protocol\n);
+   pr_err(Invalid power-on protocol\n);
}
 
ret = pnp_register_driver(wbcir_driver);
if (ret)
-   printk(KERN_ERR DRVNAME : Unable to register driver\n);
+   pr_err(Unable to register driver\n);
 
return ret;
 }
-- 
1.7.6.405.gc1be0

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATH v2] cxd2820r: fix possible out-of-array lookup

2011-08-21 Thread Antti Palosaari
Mauro, don't apply that patch since it is now obsolete after another
patch [1] from Steve Kerrison.

[1] https://patchwork.kernel.org/patch/1048832/

regards
Antti

On 07/29/2011 03:54 PM, Antti Palosaari wrote:
 On 07/29/2011 09:57 AM, HoP wrote:
 When I2C_WRITE is used the msg[] array contains one element only.
 Don't access msg[1] in that case. Also moved rest of msg2[1]
 setting to be used only if needed.

 Signed-off-by: Honza Petrous jpetr...@smartimp.cz
 Acked-by: Antti Palosaari cr...@iki.fi
 

 ---

 diff -r ae517614bf00 drivers/media/dvb/frontends/cxd2820r_core.c
 --- a/drivers/media/dvb/frontends/cxd2820r_core.cThu Jul 28 15:44:49 
 2011 +0200
 +++ b/drivers/media/dvb/frontends/cxd2820r_core.cThu Jul 28 16:20:17 
 2011 +0200
 @@ -747,12 +747,7 @@ static int cxd2820r_tuner_i2c_xfer(struc
  .flags = 0,
  .len = sizeof(obuf),
  .buf = obuf,
 -}, {
 -.addr = priv-cfg.i2c_address,
 -.flags = I2C_M_RD,
 -.len = msg[1].len,
 -.buf = msg[1].buf,
 -}
 +},
  };

  obuf[0] = 0x09;
 @@ -760,6 +755,11 @@ static int cxd2820r_tuner_i2c_xfer(struc
  if (num == 2) { /* I2C read */
  obuf[1] = (msg[0].addr  1) | I2C_M_RD; /* I2C RD flag */
  msg2[0].len = sizeof(obuf) - 1; /* maybe HW bug ? */
 +
 +msg2[1].addr = priv-cfg.i2c_address,
 +msg2[1].flags = I2C_M_RD,
 +msg2[1].len = msg[1].len,
 +msg2[1].buf = msg[1].buf,
  }
  memcpy(obuf[2], msg[0].buf, msg[0].len);
 
 


-- 
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/14] [media] m5602: Use current logging styles

2011-08-21 Thread Joe Perches
Add pr_fmt and convert usb style logging macro uses to pr_level.
Coalesce format strings.

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/media/video/gspca/m5602/m5602_core.c|9 +++--
 drivers/media/video/gspca/m5602/m5602_mt9m111.c |   28 ++
 drivers/media/video/gspca/m5602/m5602_ov7660.c  |   21 +++--
 drivers/media/video/gspca/m5602/m5602_ov9650.c  |   19 ++--
 drivers/media/video/gspca/m5602/m5602_po1030.c  |   21 +++--
 drivers/media/video/gspca/m5602/m5602_s5k4aa.c  |   35 +--
 drivers/media/video/gspca/m5602/m5602_s5k83a.c  |   30 +++
 7 files changed, 89 insertions(+), 74 deletions(-)

diff --git a/drivers/media/video/gspca/m5602/m5602_core.c 
b/drivers/media/video/gspca/m5602/m5602_core.c
index a7722b1..67533e5 100644
--- a/drivers/media/video/gspca/m5602/m5602_core.c
+++ b/drivers/media/video/gspca/m5602/m5602_core.c
@@ -16,6 +16,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include m5602_ov9650.h
 #include m5602_ov7660.h
 #include m5602_mt9m111.h
@@ -192,10 +194,9 @@ static void m5602_dump_bridge(struct sd *sd)
for (i = 0; i  0x80; i++) {
unsigned char val = 0;
m5602_read_bridge(sd, i, val);
-   info(ALi m5602 address 0x%x contains 0x%x, i, val);
+   pr_info(ALi m5602 address 0x%x contains 0x%x\n, i, val);
}
-   info(Warning: The ALi m5602 webcam probably won't work 
-   until it's power cycled);
+   pr_info(Warning: The ALi m5602 webcam probably won't work until it's 
power cycled\n);
 }
 
 static int m5602_probe_sensor(struct sd *sd)
@@ -231,7 +232,7 @@ static int m5602_probe_sensor(struct sd *sd)
return 0;
 
/* More sensor probe function goes here */
-   info(Failed to find a sensor);
+   pr_info(Failed to find a sensor\n);
sd-sensor = NULL;
return -ENODEV;
 }
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.c 
b/drivers/media/video/gspca/m5602/m5602_mt9m111.c
index 0d605a5..6268aa2 100644
--- a/drivers/media/video/gspca/m5602/m5602_mt9m111.c
+++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.c
@@ -16,6 +16,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include m5602_mt9m111.h
 
 static int mt9m111_set_vflip(struct gspca_dev *gspca_dev, __s32 val);
@@ -163,7 +165,7 @@ int mt9m111_probe(struct sd *sd)
 
if (force_sensor) {
if (force_sensor == MT9M111_SENSOR) {
-   info(Forcing a %s sensor, mt9m111.name);
+   pr_info(Forcing a %s sensor\n, mt9m111.name);
goto sensor_found;
}
/* If we want to force another sensor, don't try to probe this
@@ -191,7 +193,7 @@ int mt9m111_probe(struct sd *sd)
return -ENODEV;
 
if ((data[0] == 0x14)  (data[1] == 0x3a)) {
-   info(Detected a mt9m111 sensor);
+   pr_info(Detected a mt9m111 sensor\n);
goto sensor_found;
}
 
@@ -612,34 +614,34 @@ static void mt9m111_dump_registers(struct sd *sd)
 {
u8 address, value[2] = {0x00, 0x00};
 
-   info(Dumping the mt9m111 register state);
+   pr_info(Dumping the mt9m111 register state\n);
 
-   info(Dumping the mt9m111 sensor core registers);
+   pr_info(Dumping the mt9m111 sensor core registers\n);
value[1] = MT9M111_SENSOR_CORE;
m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2);
for (address = 0; address  0xff; address++) {
m5602_read_sensor(sd, address, value, 2);
-   info(register 0x%x contains 0x%x%x,
-address, value[0], value[1]);
+   pr_info(register 0x%x contains 0x%x%x\n,
+   address, value[0], value[1]);
}
 
-   info(Dumping the mt9m111 color pipeline registers);
+   pr_info(Dumping the mt9m111 color pipeline registers\n);
value[1] = MT9M111_COLORPIPE;
m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2);
for (address = 0; address  0xff; address++) {
m5602_read_sensor(sd, address, value, 2);
-   info(register 0x%x contains 0x%x%x,
-address, value[0], value[1]);
+   pr_info(register 0x%x contains 0x%x%x\n,
+   address, value[0], value[1]);
}
 
-   info(Dumping the mt9m111 camera control registers);
+   pr_info(Dumping the mt9m111 camera control registers\n);
value[1] = MT9M111_CAMERA_CONTROL;
m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2);
for (address = 0; address  0xff; address++) {
m5602_read_sensor(sd, address, value, 2);
-   info(register 0x%x contains 0x%x%x,
-address, value[0], value[1]);
+   pr_info(register 0x%x contains 0x%x%x\n,
+   address, value[0], value[1]);
}
 
-   

[PATCH 12/14] [media] sn9c20x: Use current logging styles

2011-08-21 Thread Joe Perches
Add pr_fmt.
Convert usb style logging macros to pr_level.

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/media/video/gspca/sn9c20x.c |   74 ++-
 1 files changed, 38 insertions(+), 36 deletions(-)

diff --git a/drivers/media/video/gspca/sn9c20x.c 
b/drivers/media/video/gspca/sn9c20x.c
index c431900..9b3a052 100644
--- a/drivers/media/video/gspca/sn9c20x.c
+++ b/drivers/media/video/gspca/sn9c20x.c
@@ -18,6 +18,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include linux/input.h
 
 #include gspca.h
@@ -1123,7 +1125,7 @@ static int reg_r(struct gspca_dev *gspca_dev, u16 reg, 
u16 length)
length,
500);
if (unlikely(result  0 || result != length)) {
-   err(Read register failed 0x%02X, reg);
+   pr_err(Read register failed 0x%02X\n, reg);
return -EIO;
}
return 0;
@@ -1144,7 +1146,7 @@ static int reg_w(struct gspca_dev *gspca_dev, u16 reg,
length,
500);
if (unlikely(result  0 || result != length)) {
-   err(Write register failed index 0x%02X, reg);
+   pr_err(Write register failed index 0x%02X\n, reg);
return -EIO;
}
return 0;
@@ -1275,14 +1277,14 @@ static int ov9650_init_sensor(struct gspca_dev 
*gspca_dev)
return -EINVAL;
 
if (id != 0x7fa2) {
-   err(sensor id for ov9650 doesn't match (0x%04x), id);
+   pr_err(sensor id for ov9650 doesn't match (0x%04x)\n, id);
return -ENODEV;
}
 
for (i = 0; i  ARRAY_SIZE(ov9650_init); i++) {
if (i2c_w1(gspca_dev, ov9650_init[i].reg,
ov9650_init[i].val)  0) {
-   err(OV9650 sensor initialization failed);
+   pr_err(OV9650 sensor initialization failed\n);
return -ENODEV;
}
}
@@ -1299,7 +1301,7 @@ static int ov9655_init_sensor(struct gspca_dev *gspca_dev)
for (i = 0; i  ARRAY_SIZE(ov9655_init); i++) {
if (i2c_w1(gspca_dev, ov9655_init[i].reg,
ov9655_init[i].val)  0) {
-   err(OV9655 sensor initialization failed);
+   pr_err(OV9655 sensor initialization failed\n);
return -ENODEV;
}
}
@@ -1318,7 +1320,7 @@ static int soi968_init_sensor(struct gspca_dev *gspca_dev)
for (i = 0; i  ARRAY_SIZE(soi968_init); i++) {
if (i2c_w1(gspca_dev, soi968_init[i].reg,
soi968_init[i].val)  0) {
-   err(SOI968 sensor initialization failed);
+   pr_err(SOI968 sensor initialization failed\n);
return -ENODEV;
}
}
@@ -1338,7 +1340,7 @@ static int ov7660_init_sensor(struct gspca_dev *gspca_dev)
for (i = 0; i  ARRAY_SIZE(ov7660_init); i++) {
if (i2c_w1(gspca_dev, ov7660_init[i].reg,
ov7660_init[i].val)  0) {
-   err(OV7660 sensor initialization failed);
+   pr_err(OV7660 sensor initialization failed\n);
return -ENODEV;
}
}
@@ -1355,7 +1357,7 @@ static int ov7670_init_sensor(struct gspca_dev *gspca_dev)
for (i = 0; i  ARRAY_SIZE(ov7670_init); i++) {
if (i2c_w1(gspca_dev, ov7670_init[i].reg,
ov7670_init[i].val)  0) {
-   err(OV7670 sensor initialization failed);
+   pr_err(OV7670 sensor initialization failed\n);
return -ENODEV;
}
}
@@ -1379,14 +1381,14 @@ static int mt9v_init_sensor(struct gspca_dev *gspca_dev)
for (i = 0; i  ARRAY_SIZE(mt9v011_init); i++) {
if (i2c_w2(gspca_dev, mt9v011_init[i].reg,
mt9v011_init[i].val)  0) {
-   err(MT9V011 sensor initialization failed);
+   pr_err(MT9V011 sensor initialization 
failed\n);
return -ENODEV;
}
}
sd-hstart = 2;
sd-vstart = 2;
sd-sensor = SENSOR_MT9V011;
-   info(MT9V011 sensor detected);
+   pr_info(MT9V011 sensor detected\n);
return 0;
}
 
@@ -1397,7 +1399,7 @@ static int mt9v_init_sensor(struct gspca_dev *gspca_dev)
for (i = 0; i  ARRAY_SIZE(mt9v111_init); i++) {
if (i2c_w2(gspca_dev, mt9v111_init[i].reg,
mt9v111_init[i].val)  0) {
- 

[PATCH 13/14] [media] t613: Use current logging styles

2011-08-21 Thread Joe Perches
Add pr_fmt.
Convert usb style logging macros to pr_level.

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/media/video/gspca/t613.c |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c
index d1d733b..90f0877 100644
--- a/drivers/media/video/gspca/t613.c
+++ b/drivers/media/video/gspca/t613.c
@@ -26,6 +26,8 @@
  * Costantino Leandro
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #define MODULE_NAME t613
 
 #include linux/slab.h
@@ -572,7 +574,7 @@ static void reg_w_buf(struct gspca_dev *gspca_dev,
 
tmpbuf = kmemdup(buffer, len, GFP_KERNEL);
if (!tmpbuf) {
-   err(Out of memory);
+   pr_err(Out of memory\n);
return;
}
usb_control_msg(gspca_dev-dev,
@@ -598,7 +600,7 @@ static void reg_w_ixbuf(struct gspca_dev *gspca_dev,
} else {
p = tmpbuf = kmalloc(len * 2, GFP_KERNEL);
if (!tmpbuf) {
-   err(Out of memory);
+   pr_err(Out of memory\n);
return;
}
}
@@ -652,7 +654,7 @@ static void om6802_sensor_init(struct gspca_dev *gspca_dev)
}
byte = reg_r(gspca_dev, 0x0063);
if (byte != 0x17) {
-   err(Bad sensor reset %02x, byte);
+   pr_err(Bad sensor reset %02x\n, byte);
/* continue? */
}
 
@@ -890,7 +892,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
sd-sensor = SENSOR_OM6802;
break;
default:
-   err(unknown sensor %04x, sensor_id);
+   pr_err(unknown sensor %04x\n, sensor_id);
return -EINVAL;
}
 
@@ -905,7 +907,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
break;  /* OK */
}
if (i  0) {
-   err(Bad sensor reset %02x, test_byte);
+   pr_err(Bad sensor reset %02x\n, test_byte);
return -EIO;
}
reg_w_buf(gspca_dev, n2, sizeof n2);
-- 
1.7.6.405.gc1be0

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/14] [media] pac207: Use current logging styles

2011-08-21 Thread Joe Perches
Add pr_fmt.
Convert usb style logging macros to pr_level.
Coalesce formats.

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/media/video/gspca/pac207.c |   14 --
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/media/video/gspca/pac207.c 
b/drivers/media/video/gspca/pac207.c
index 81739a2..1600df1 100644
--- a/drivers/media/video/gspca/pac207.c
+++ b/drivers/media/video/gspca/pac207.c
@@ -23,6 +23,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #define MODULE_NAME pac207
 
 #include linux/input.h
@@ -178,8 +180,8 @@ static int pac207_write_regs(struct gspca_dev *gspca_dev, 
u16 index,
0x00, index,
gspca_dev-usb_buf, length, PAC207_CTRL_TIMEOUT);
if (err  0)
-   err(Failed to write registers to index 0x%04X, error %d),
-   index, err);
+   pr_err(Failed to write registers to index 0x%04X, error %d\n,
+  index, err);
 
return err;
 }
@@ -194,8 +196,8 @@ static int pac207_write_reg(struct gspca_dev *gspca_dev, 
u16 index, u16 value)
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
value, index, NULL, 0, PAC207_CTRL_TIMEOUT);
if (err)
-   err(Failed to write a register (index 0x%04X,
-value 0x%02X, error %d), index, value, err);
+   pr_err(Failed to write a register (index 0x%04X, value 0x%02X, 
error %d)\n,
+  index, value, err);
 
return err;
 }
@@ -210,8 +212,8 @@ static int pac207_read_reg(struct gspca_dev *gspca_dev, u16 
index)
0x00, index,
gspca_dev-usb_buf, 1, PAC207_CTRL_TIMEOUT);
if (res  0) {
-   err(Failed to read a register (index 0x%04X, error %d),
-   index, res);
+   pr_err(Failed to read a register (index 0x%04X, error %d)\n,
+  index, res);
return res;
}
 
-- 
1.7.6.405.gc1be0

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/14] [media] finepix: Use current logging styles

2011-08-21 Thread Joe Perches
Add pr_fmt.
Convert usb style logging macros to pr_level.

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/media/video/gspca/finepix.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/gspca/finepix.c 
b/drivers/media/video/gspca/finepix.c
index 987b4b6..ea48200 100644
--- a/drivers/media/video/gspca/finepix.c
+++ b/drivers/media/video/gspca/finepix.c
@@ -18,6 +18,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #define MODULE_NAME finepix
 
 #include gspca.h
@@ -182,7 +184,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
/* Init the device */
ret = command(gspca_dev, 0);
if (ret  0) {
-   err(init failed %d, ret);
+   pr_err(init failed %d\n, ret);
return ret;
}
 
@@ -194,14 +196,14 @@ static int sd_start(struct gspca_dev *gspca_dev)
FPIX_MAX_TRANSFER, len,
FPIX_TIMEOUT);
if (ret  0) {
-   err(usb_bulk_msg failed %d, ret);
+   pr_err(usb_bulk_msg failed %d\n, ret);
return ret;
}
 
/* Request a frame, but don't read it */
ret = command(gspca_dev, 1);
if (ret  0) {
-   err(frame request failed %d, ret);
+   pr_err(frame request failed %d\n, ret);
return ret;
}
 
-- 
1.7.6.405.gc1be0

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/14] [media] rc-core.h: Surround macro with do {} while (0)

2011-08-21 Thread Joe Perches
Macros coded with if statements should be do { if... } while (0)
so the macros can be used in other if tests.

Use ##__VA_ARGS__ for variadic macro as well.

Signed-off-by: Joe Perches j...@perches.com
---
 include/media/rc-core.h |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index b1f19b7..b0c494a 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -23,8 +23,11 @@
 #include media/rc-map.h
 
 extern int rc_core_debug;
-#define IR_dprintk(level, fmt, arg...) if (rc_core_debug = level) \
-   printk(KERN_DEBUG %s:  fmt , __func__, ## arg)
+#define IR_dprintk(level, fmt, ...)\
+do {   \
+   if (rc_core_debug = level) \
+   pr_debug(%s:  fmt, __func__, ##__VA_ARGS__);  \
+} while (0)
 
 enum rc_driver_type {
RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */
-- 
1.7.6.405.gc1be0

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/14] [media] cx18: Use current logging styles

2011-08-21 Thread Joe Perches
Add pr_fmt.
Convert printks to pr_level.
Convert printks without KERN_level to appropriate pr_level.
Removed embedded prefixes when pr_fmt was added.
Use ##__VA_ARGS__ for variadic macros.
Coalesce format strings.

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/media/video/cx18/cx18-alsa-main.c   |   26 ++--
 drivers/media/video/cx18/cx18-alsa-mixer.c  |2 +
 drivers/media/video/cx18/cx18-alsa-pcm.c|   12 +-
 drivers/media/video/cx18/cx18-alsa.h|   32 +++---
 drivers/media/video/cx18/cx18-audio.c   |2 +
 drivers/media/video/cx18/cx18-av-audio.c|2 +
 drivers/media/video/cx18/cx18-av-core.c |2 +
 drivers/media/video/cx18/cx18-av-firmware.c |2 +
 drivers/media/video/cx18/cx18-av-vbi.c  |1 +
 drivers/media/video/cx18/cx18-controls.c|3 +
 drivers/media/video/cx18/cx18-driver.c  |   35 +++---
 drivers/media/video/cx18/cx18-driver.h  |  177 +++
 drivers/media/video/cx18/cx18-dvb.c |2 +
 drivers/media/video/cx18/cx18-fileops.c |9 +-
 drivers/media/video/cx18/cx18-firmware.c|4 +-
 drivers/media/video/cx18/cx18-gpio.c|2 +
 drivers/media/video/cx18/cx18-i2c.c |2 +
 drivers/media/video/cx18/cx18-io.c  |2 +
 drivers/media/video/cx18/cx18-ioctl.c   |4 +-
 drivers/media/video/cx18/cx18-irq.c |2 +
 drivers/media/video/cx18/cx18-mailbox.c |2 +
 drivers/media/video/cx18/cx18-queue.c   |2 +
 drivers/media/video/cx18/cx18-scb.c |2 +
 drivers/media/video/cx18/cx18-streams.c |2 +
 drivers/media/video/cx18/cx18-vbi.c |2 +
 drivers/media/video/cx18/cx18-video.c   |2 +
 26 files changed, 201 insertions(+), 134 deletions(-)

diff --git a/drivers/media/video/cx18/cx18-alsa-main.c 
b/drivers/media/video/cx18/cx18-alsa-main.c
index a1e6c2a..99d1b01 100644
--- a/drivers/media/video/cx18/cx18-alsa-main.c
+++ b/drivers/media/video/cx18/cx18-alsa-main.c
@@ -22,6 +22,8 @@
  *  02111-1307  USA
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include linux/init.h
 #include linux/slab.h
 #include linux/module.h
@@ -42,11 +44,11 @@
 
 int cx18_alsa_debug;
 
-#define CX18_DEBUG_ALSA_INFO(fmt, arg...) \
-   do { \
-   if (cx18_alsa_debug  2) \
-   printk(KERN_INFO %s:  fmt, cx18-alsa, ## arg); \
-   } while (0);
+#define CX18_DEBUG_ALSA_INFO(fmt, ...)   \
+do { \
+   if (cx18_alsa_debug  2)  \
+   pr_info(fmt, ##__VA_ARGS__);  \
+} while (0)
 
 module_param_named(debug, cx18_alsa_debug, int, 0644);
 MODULE_PARM_DESC(debug,
@@ -203,14 +205,13 @@ int cx18_alsa_load(struct cx18 *cx)
struct cx18_stream *s;
 
if (v4l2_dev == NULL) {
-   printk(KERN_ERR cx18-alsa: %s: struct v4l2_device * is NULL\n,
-  __func__);
+   pr_err(%s: struct v4l2_device * is NULL\n, __func__);
return 0;
}
 
cx = to_cx18(v4l2_dev);
if (cx == NULL) {
-   printk(KERN_ERR cx18-alsa cx is NULL\n);
+   pr_err(cx is NULL\n);
return 0;
}
 
@@ -239,7 +240,7 @@ int cx18_alsa_load(struct cx18 *cx)
 
 static int __init cx18_alsa_init(void)
 {
-   printk(KERN_INFO cx18-alsa: module loading...\n);
+   pr_info(module loading...\n);
cx18_ext_init = cx18_alsa_load;
return 0;
 }
@@ -260,8 +261,7 @@ static int __exit cx18_alsa_exit_callback(struct device 
*dev, void *data)
struct snd_cx18_card *cxsc;
 
if (v4l2_dev == NULL) {
-   printk(KERN_ERR cx18-alsa: %s: struct v4l2_device * is NULL\n,
-  __func__);
+   pr_err(%s: struct v4l2_device * is NULL\n, __func__);
return 0;
}
 
@@ -281,14 +281,14 @@ static void __exit cx18_alsa_exit(void)
struct device_driver *drv;
int ret;
 
-   printk(KERN_INFO cx18-alsa: module unloading...\n);
+   pr_info(module unloading...\n);
 
drv = driver_find(cx18, pci_bus_type);
ret = driver_for_each_device(drv, NULL, NULL, cx18_alsa_exit_callback);
put_driver(drv);
 
cx18_ext_init = NULL;
-   printk(KERN_INFO cx18-alsa: module unload complete\n);
+   pr_info(module unload complete\n);
 }
 
 module_init(cx18_alsa_init);
diff --git a/drivers/media/video/cx18/cx18-alsa-mixer.c 
b/drivers/media/video/cx18/cx18-alsa-mixer.c
index 341bddc..551bd1a 100644
--- a/drivers/media/video/cx18/cx18-alsa-mixer.c
+++ b/drivers/media/video/cx18/cx18-alsa-mixer.c
@@ -20,6 +20,8 @@
  *  02111-1307  USA
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include linux/init.h
 #include linux/kernel.h
 #include linux/device.h
diff --git a/drivers/media/video/cx18/cx18-alsa-pcm.c 
b/drivers/media/video/cx18/cx18-alsa-pcm.c
index 

[PATCH 03/14] [media] ene_ir: Use current logging styles

2011-08-21 Thread Joe Perches
Add pr_fmt.
Convert ene_warn and ene_notice to pr_level.
Use pr_debug in __dbg macro and a little neatening.

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/media/rc/ene_ir.c |   73 +++--
 drivers/media/rc/ene_ir.h |   19 +++
 2 files changed, 42 insertions(+), 50 deletions(-)

diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
index 2b9c2569..cf10ecf 100644
--- a/drivers/media/rc/ene_ir.c
+++ b/drivers/media/rc/ene_ir.c
@@ -30,6 +30,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include linux/kernel.h
 #include linux/module.h
 #include linux/pnp.h
@@ -118,31 +120,31 @@ static int ene_hw_detect(struct ene_device *dev)
dev-pll_freq == ENE_DEFAULT_PLL_FREQ ? 2 : 4;
 
if (hw_revision == 0xFF) {
-   ene_warn(device seems to be disabled);
-   ene_warn(send a mail to lirc-l...@lists.sourceforge.net);
-   ene_warn(please attach output of acpidump and dmidecode);
+   pr_warn(device seems to be disabled\n);
+   pr_warn(send a mail to lirc-l...@lists.sourceforge.net\n);
+   pr_warn(please attach output of acpidump and dmidecode\n);
return -ENODEV;
}
 
-   ene_notice(chip is 0x%02x%02x - kbver = 0x%02x, rev = 0x%02x,
-   chip_major, chip_minor, old_ver, hw_revision);
+   pr_notice(chip is 0x%02x%02x - kbver = 0x%02x, rev = 0x%02x\n,
+ chip_major, chip_minor, old_ver, hw_revision);
 
-   ene_notice(PLL freq = %d, dev-pll_freq);
+   pr_notice(PLL freq = %d\n, dev-pll_freq);
 
if (chip_major == 0x33) {
-   ene_warn(chips 0x33xx aren't supported);
+   pr_warn(chips 0x33xx aren't supported\n);
return -ENODEV;
}
 
if (chip_major == 0x39  chip_minor == 0x26  hw_revision == 0xC0) {
dev-hw_revision = ENE_HW_C;
-   ene_notice(KB3926C detected);
+   pr_notice(KB3926C detected\n);
} else if (old_ver == 0x24  hw_revision == 0xC0) {
dev-hw_revision = ENE_HW_B;
-   ene_notice(KB3926B detected);
+   pr_notice(KB3926B detected\n);
} else {
dev-hw_revision = ENE_HW_D;
-   ene_notice(KB3926D or higher detected);
+   pr_notice(KB3926D or higher detected\n);
}
 
/* detect features hardware supports */
@@ -152,7 +154,7 @@ static int ene_hw_detect(struct ene_device *dev)
fw_reg1 = ene_read_reg(dev, ENE_FW1);
fw_reg2 = ene_read_reg(dev, ENE_FW2);
 
-   ene_notice(Firmware regs: %02x %02x, fw_reg1, fw_reg2);
+   pr_notice(Firmware regs: %02x %02x\n, fw_reg1, fw_reg2);
 
dev-hw_use_gpio_0a = !!(fw_reg2  ENE_FW2_GP0A);
dev-hw_learning_and_tx_capable = !!(fw_reg2  ENE_FW2_LEARNING);
@@ -161,30 +163,29 @@ static int ene_hw_detect(struct ene_device *dev)
if (dev-hw_learning_and_tx_capable)
dev-hw_fan_input = !!(fw_reg2  ENE_FW2_FAN_INPUT);
 
-   ene_notice(Hardware features:);
+   pr_notice(Hardware features:\n);
 
if (dev-hw_learning_and_tx_capable) {
-   ene_notice(* Supports transmitting  learning mode);
-   ene_notice(   This feature is rare and therefore,);
-   ene_notice(   you are welcome to test it,);
-   ene_notice(   and/or contact the author via:);
-   ene_notice(   lirc-l...@lists.sourceforge.net);
-   ene_notice(   or maximlevit...@gmail.com);
+   pr_notice(* Supports transmitting  learning mode\n);
+   pr_notice(   This feature is rare and therefore,\n);
+   pr_notice(   you are welcome to test it,\n);
+   pr_notice(   and/or contact the author via:\n);
+   pr_notice(   lirc-l...@lists.sourceforge.net\n);
+   pr_notice(   or maximlevit...@gmail.com\n);
 
-   ene_notice(* Uses GPIO %s for IR raw input,
-   dev-hw_use_gpio_0a ? 40 : 0A);
+   pr_notice(* Uses GPIO %s for IR raw input\n,
+ dev-hw_use_gpio_0a ? 40 : 0A);
 
if (dev-hw_fan_input)
-   ene_notice(* Uses unused fan feedback input as source
-of demodulated IR data);
+   pr_notice(* Uses unused fan feedback input as source 
of demodulated IR data\n);
}
 
if (!dev-hw_fan_input)
-   ene_notice(* Uses GPIO %s for IR demodulated input,
-   dev-hw_use_gpio_0a ? 0A : 40);
+   pr_notice(* Uses GPIO %s for IR demodulated input\n,
+ dev-hw_use_gpio_0a ? 0A : 40);
 
if (dev-hw_extra_buffer)
-   ene_notice(* Uses new style input buffer);
+   pr_notice(* Uses new style input buffer\n);
return 0;
 }
 
@@ -215,13 

Re: [PATCH] v4l: Add V4L2_PIX_FMT_NV24 and V4L2_PIX_FMT_NV42 formats

2011-08-21 Thread Laurent Pinchart
Hi Sakari,

On Saturday 20 August 2011 07:26:17 Sakari Ailus wrote:
 Hi Laurent,
 
 Thanks for the patch.

And thanks for the comments.

 On Fri, Aug 19, 2011 at 08:14:20AM +0200, Laurent Pinchart wrote:
  NV24 and NV42 are planar YCbCr 4:4:4 and YCrCb 4:4:4 formats with a
  luma plane followed by an interleaved chroma plane.
  
  Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
  ---
  
   Documentation/DocBook/media/v4l/pixfmt-nv24.xml |  128
   +++ Documentation/DocBook/media/v4l/pixfmt.xml 
   |1 +
   include/linux/videodev2.h   |2 +
   3 files changed, 131 insertions(+), 0 deletions(-)
   create mode 100644 Documentation/DocBook/media/v4l/pixfmt-nv24.xml
  
  This format will be used by an fbdev driver. I'm already posting the
  patch for for review and will send a pull request later.
  
  diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv24.xml
  b/Documentation/DocBook/media/v4l/pixfmt-nv24.xml new file mode 100644
  index 000..e77301d
  --- /dev/null
  +++ b/Documentation/DocBook/media/v4l/pixfmt-nv24.xml
  @@ -0,0 +1,128 @@
  +refentry
  +  refmeta
  +   refentrytitleV4L2_PIX_FMT_NV24 ('NV24'), V4L2_PIX_FMT_NV42
  ('NV42')/refentrytitle +  manvol;
  +  /refmeta
  +  refnamediv
  +   refname
  id=V4L2-PIX-FMT-NV24constantV4L2_PIX_FMT_NV24/constant/refname
  +   refname
  id=V4L2-PIX-FMT-NV42constantV4L2_PIX_FMT_NV42/constant/refname
  +   refpurposeFormats with full horizontal and vertical
  +chroma resolutions, also known as YUV 4:4:4. One luminance and one
  +chrominance plane with alternating chroma samples as opposed to
  +constantV4L2_PIX_FMT_YVU420/constant/refpurpose
  +  /refnamediv
  +  refsect1
  +   titleDescription/title
  +
  +   paraThese are two-plane versions of the YUV 4:4:4 format.
  +The three components are separated into two sub-images or planes. The
  +Y plane is first. The Y plane has one byte per pixel. For
 
 Are all 8 bits being used per sample, or is there padding?

All 8 bits are used, as in all YUV planar formats. Do you think that's worth 
mentioning ?

  +constantV4L2_PIX_FMT_NV24/constant, a combined CbCr plane
  +immediately follows the Y plane in memory.  The CbCr plane is the same
  +width and height, in pixels, as the Y plane (and of the image).
  +Each line contains one CbCr pair per pixel.
 
 How may bits / bytes per Cb / Cr sample? Perhaps you could mention this
 once somewhere if all have the same.

All YUV planar formats use 8 bits for each Cb and Cr samples. I will clarify 
this.

  +constantV4L2_PIX_FMT_NV42/constant is the same except the Cb and
  +Cr bytes are swapped, the CrCb plane starts with a Cr byte./para
  +   paraIf the Y plane has pad bytes after each row, then the
  +CbCr plane has twice as many pad bytes after its rows./para
 
 [clip]
 
 Cheers,

-- 
Regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Afatech AF9013

2011-08-21 Thread Jason Hecker
I just tried LiveCDs of Mythbuntu 10.04 and 10.10 but had limited luck
with the former and some joy with the latter.  Unfortunately the
default framebuffer slowed things down.  Anyway in LiveCD 10.10 I used
mplayer to set up and view Tuner A and Tuner B and Tuner A only showed
some slight errors when Tuner B was being set up.  After that for some
strange reason attempt at retuning with mplayer failed utterly so I
suspect there is some problems with the older versions of mplayer.

These cards have blue LEDs for each tuner and light up when in use.  I
did notice in my testing that the LED on tuner A would flicker off
briefly (and presumably issue the errors) when Tuner B was being set
up.  I am wondering if there is a general setup problem or even a I2S
timing problem.  Could someone contact me off list about sending me
the data sheets for the AF901x chips?
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html