Re: [GIT PULL for 2.6.36] V4L/DVB fixes

2010-09-27 Thread Mauro Carvalho Chehab
Em 27-09-2010 21:02, Linus Torvalds escreveu:
> On Mon, Sep 27, 2010 at 1:57 PM, Mauro Carvalho Chehab
>  wrote:
>> The following changes since commit 32163f4b2cef28a5aab8b226ffecfc6379a53786:
>>
>>  alpha: fix usp value in multithreaded coredumps (2010-09-25 14:38:13 -0700)
>>
>> are available in the git repository at:
>>  ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 
>> v4l_for_linus
> 
> I get
> 
>   scripts/kconfig/conf --oldconfig arch/x86/Kconfig
>   drivers/media/Kconfig:146: 'endif' in different file than 'if'
>   drivers/media/IR/Kconfig:15: location of the 'if'
>   drivers/Kconfig:114: unexpected 'endmenu' within if block
>   drivers/Kconfig:1: missing end statement for this entry
>   make[1]: *** [oldconfig] Error 1
>   make: *** [oldconfig] Error 2
> 
> with this. And it seems to be due to a totally broken commit at the
> very beginning of the series by a commit called "Kconfig fixes"
> (Hah!), that clearly has not been tested at all.

Argh! something got completely wrong here. Sorry for the mess.
This patch is already upstream (changeset ade321c5b8a0e4).

I had some troubles on my local tree (some objects missed after a gc on
a shared repository). I had to recover my local tree, to avoid loosing 
some patches applied there for linux-next. It seems that I did a bad work 
on recovering them. I always compile everything a few times before sending, 
but this time, I just didn't notice.

> The commit sequence was also done today, apparently immediately before
> sending me the pull request. Which sure as hell explains the "clearly
> not tested at all" situation.
> 
> Don't do this. You are now officially on my shit-list for sending me
> total crap.
> 
> How effing hard can it be to understand: you don't send me stuff that
> hasn't been tested. It needs to be in -next for SEVERAL DAYS, and you
> don't rebase it or take it from some random quilt series just before
> sending it to me.
> 
> That's true _especially_ during the -rc series. But it's damn well
> true at any other time too.
> 
> I'm angry. I expect at least some _minimal_ amount of competence from
> people I pull from. This was not it. Get your ^&#! act together!
> 
>Linus

I'll clean up the mess and prepare a new pull request in the next days.

Sorry,
Mauro.
--
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: [GIT PULL for 2.6.36] V4L/DVB fixes

2010-09-27 Thread Linus Torvalds
On Mon, Sep 27, 2010 at 1:57 PM, Mauro Carvalho Chehab
 wrote:
> The following changes since commit 32163f4b2cef28a5aab8b226ffecfc6379a53786:
>
>  alpha: fix usp value in multithreaded coredumps (2010-09-25 14:38:13 -0700)
>
> are available in the git repository at:
>  ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 
> v4l_for_linus

I get

  scripts/kconfig/conf --oldconfig arch/x86/Kconfig
  drivers/media/Kconfig:146: 'endif' in different file than 'if'
  drivers/media/IR/Kconfig:15: location of the 'if'
  drivers/Kconfig:114: unexpected 'endmenu' within if block
  drivers/Kconfig:1: missing end statement for this entry
  make[1]: *** [oldconfig] Error 1
  make: *** [oldconfig] Error 2

with this. And it seems to be due to a totally broken commit at the
very beginning of the series by a commit called "Kconfig fixes"
(Hah!), that clearly has not been tested at all.

The commit sequence was also done today, apparently immediately before
sending me the pull request. Which sure as hell explains the "clearly
not tested at all" situation.

Don't do this. You are now officially on my shit-list for sending me
total crap.

How effing hard can it be to understand: you don't send me stuff that
hasn't been tested. It needs to be in -next for SEVERAL DAYS, and you
don't rebase it or take it from some random quilt series just before
sending it to me.

That's true _especially_ during the -rc series. But it's damn well
true at any other time too.

I'm angry. I expect at least some _minimal_ amount of competence from
people I pull from. This was not it. Get your ^&#! act together!

   Linus
--
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: updated make_kconfig.pl for Ubuntu

2010-09-27 Thread Mauro Carvalho Chehab
Em 27-09-2010 17:45, Jan Hoogenraad escreveu:
> Mauro:
> 
> On my system, the call to make_kconfig reads:
> ./scripts/make_kconfig.pl /lib/modules/2.6.28-19-generic/build 
> /lib/modules/2.6.28-19-generic/build 1
> 
> Using $kernelsrc yields the following error:
> Global symbol "$kernelsrc" requires explicit package name at 
> ./scripts/make_kconfig.pl line 694.
> 
> Using
> $dmahplace="$kernsrc/include/config/ieee1394/dma.h";
> yields the following INCORRECT expansion:
> /lib/modules/2.6.28-19-generic/build/include/config/ieee1394/dma.h
> this is the place where I am building into, which is different from the place 
> where Ubuntu places the include files from the package
> 
> Thus I built an expression to get:
> /usr/src/linux-headers-2.6.28-19-generic/include/config/ieee1394/dma.h
> as I described in the mail of yesterday.


Huh? Are you sure that Ubuntu doesn't have a symbolic link at 
/lib/modules/2.6.28-19-generic/build pointing
to /usr/src/linux-headers-2.6.28-19-generic/?

If it doesn't have, then all compat checks done by make_config_compat.pl would 
fail.

> Now, I realize that the header files could ALSO be present in the build 
> directory, so there should be a check on that as well, as otherwise the 
> FIREDTV is incorrectly disabled on other distros, or source builds.
> 
> Yes, and I know all of this is ugly 

It is not just ugly. It will break compilation on Ubuntu with:
$ make release DIR=

Cheers,
Mauro
--
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


[GIT PULL for 2.6.36] V4L/DVB fixes

2010-09-27 Thread Mauro Carvalho Chehab
The following changes since commit 32163f4b2cef28a5aab8b226ffecfc6379a53786:

  alpha: fix usp value in multithreaded coredumps (2010-09-25 14:38:13 -0700)

are available in the git repository at:
  ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git 
v4l_for_linus

Andy Walls (1):
  V4L/DVB: cx25840: Fix typo in volume control initialization: 65335 vs. 
65535

Baruch Siach (1):
  V4L/DVB: mx2_camera: fix a race causing NULL dereference

Dan Carpenter (5):
  V4L/DVB: unlock on error path
  V4L/DVB: IR: ir-raw-event: null pointer dereference
  V4L/DVB: opera1: remove unneeded NULL check
  V4L/DVB: pvrusb2: remove unneeded NULL checks
  V4L/DVB: saa7164: move dereference under NULL check

Dan Rosenberg (1):
  V4L/DVB: ivtvfb: prevent reading uninitialized stack memory

Dmitri Belimov (1):
  V4L/DVB: Fix regression for BeholdTV Columbus

Hans Verkuil (2):
  V4L/DVB: ivtv: convert gpio subdev to new control framework
  V4L/DVB: videobuf-dma-sg: set correct size in last sg element

Ionut Gabriel Popescu (1):
  V4L/DVB: mt9v022.c: Fixed compilation warning

Jarod Wilson (1):
  V4L/DVB: mceusb: add two new ASUS device IDs

Jason Wang (1):
  V4L/DVB: gspca - main: Fix a crash of some webcams on ARM arch

Jean-François Moine (1):
  V4L/DVB: gspca - sn9c20x: Bad transfer size of Bayer images

Laurent Pinchart (3):
  V4L/DVB: uvcvideo: Add support for Miricle 307K thermal webcam
  V4L/DVB: uvcvideo: Fix support for Medion Akoya All-in-one PC integrated 
webcam
  V4L/DVB: uvcvideo: Restrict frame rates for Chicony CNF7129 webcam

Mauro Carvalho Chehab (3):
  V4L/DVB: Don't identify PV SBTVD Hybrid as a DibCom device
  V4L/DVB: rc-core: increase repeat time
  V4L/DVB: cx231xx: Avoid an OOPS when card is unknown (card=0)

Maxim Levitsky (4):
  V4L/DVB: IR: Kconfig fixes
  V4L/DVB: IR: fix duty cycle capability
  V4L/DVB: IR: fix keys beeing stuck down forever
  V4L/DVB: IR: extend MCE keymap

Michael Grzeschik (2):
  V4L/DVB: mt9m111: cropcap and s_crop check if type is VIDEO_CAPTURE
  V4L/DVB: mt9m111: added current colorspace at g_fmt

Olivier Grenie (2):
  V4L/DVB: dib7770: enable the current mirror
  V4L/DVB: dib7000p: add disable sample and hold, and diversity delay 
parameter

Pawel Osciak (2):
  V4L/DVB: v4l: mem2mem_testdev: fix errorenous comparison
  V4L/DVB: v4l: mem2mem_testdev: add missing release for video_device

Randy Dunlap (1):
  V4L/DVB: tm6000: depends on IR_CORE

Richard Zidlicky (1):
  V4L/DVB: dvb: fix smscore_getbuffer() logic

Stefan Ringel (1):
  V4L/DVB: tm6000: bugfix data handling

lawrence rust (1):
  V4L/DVB: cx88: Kconfig: Remove EXPERIMENTAL dependency from 
VIDEO_CX88_ALSA

 drivers/media/IR/Kconfig |2 +
 drivers/media/IR/ir-keytable.c   |9 +++-
 drivers/media/IR/ir-lirc-codec.c |2 +-
 drivers/media/IR/ir-raw-event.c  |4 +-
 drivers/media/IR/keymaps/rc-rc6-mce.c|3 +
 drivers/media/IR/mceusb.c|4 ++
 drivers/media/dvb/dvb-usb/dib0700_core.c |3 -
 drivers/media/dvb/dvb-usb/dib0700_devices.c  |   56 +++-
 drivers/media/dvb/dvb-usb/opera1.c   |4 +-
 drivers/media/dvb/frontends/dib7000p.c   |8 +++-
 drivers/media/dvb/frontends/dib7000p.h   |5 ++
 drivers/media/dvb/siano/smscoreapi.c |   31 +
 drivers/media/video/cx231xx/Makefile |1 +
 drivers/media/video/cx231xx/cx231xx-cards.c  |   17 +---
 drivers/media/video/cx25840/cx25840-core.c   |2 +-
 drivers/media/video/cx88/Kconfig |2 +-
 drivers/media/video/gspca/gspca.c|1 +
 drivers/media/video/gspca/sn9c20x.c  |3 +-
 drivers/media/video/ivtv/ivtv-driver.c   |1 +
 drivers/media/video/ivtv/ivtv-driver.h   |1 +
 drivers/media/video/ivtv/ivtvfb.c|2 +
 drivers/media/video/mem2mem_testdev.c|3 +-
 drivers/media/video/mt9m111.c|8 +++-
 drivers/media/video/mt9v022.c|3 -
 drivers/media/video/mx2_camera.c |4 ++
 drivers/media/video/pvrusb2/pvrusb2-ctrl.c   |6 +-
 drivers/media/video/s5p-fimc/fimc-core.c |3 +-
 drivers/media/video/saa7134/saa7134-cards.c  |   10 ++--
 drivers/media/video/saa7164/saa7164-buffer.c |5 +-
 drivers/media/video/uvc/uvc_driver.c |   33 ++
 drivers/media/video/uvc/uvcvideo.h   |1 +
 drivers/media/video/videobuf-dma-sg.c|   11 +++--
 drivers/staging/tm6000/Kconfig   |2 +-
 drivers/staging/tm6000/tm6000-input.c|   61 -
 include/media/videobuf-dma-sg.h  |1 +
 35 files changed, 228 insertions(+), 84 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord..

Re: updated make_kconfig.pl for Ubuntu

2010-09-27 Thread Jan Hoogenraad

Mauro:

On my system, the call to make_kconfig reads:
./scripts/make_kconfig.pl /lib/modules/2.6.28-19-generic/build 
/lib/modules/2.6.28-19-generic/build 1


Using $kernelsrc yields the following error:
Global symbol "$kernelsrc" requires explicit package name at 
./scripts/make_kconfig.pl line 694.


Using
$dmahplace="$kernsrc/include/config/ieee1394/dma.h";
yields the following INCORRECT expansion:
/lib/modules/2.6.28-19-generic/build/include/config/ieee1394/dma.h
this is the place where I am building into, which is different from the 
place where Ubuntu places the include files from the package


Thus I built an expression to get:
/usr/src/linux-headers-2.6.28-19-generic/include/config/ieee1394/dma.h
as I described in the mail of yesterday.

Now, I realize that the header files could ALSO be present in the build 
directory, so there should be a check on that as well, as otherwise the 
FIREDTV is incorrectly disabled on other distros, or source builds.


Yes, and I know all of this is ugly 

Mauro Carvalho Chehab wrote:

Em 27-09-2010 15:41, Jan Hoogenraad escreveu:

I have updated launchpad bug

https://bugs.launchpad.net/ubuntu/+source/linux-kernel-headers/+bug/134222

I also created an updated make_kconfig.pl

http://linuxtv.org/hg/~jhoogenraad/rtl2831-r2/file/cb34ee1c29fc/v4l/scripts/make_kconfig.pl

Unfortunately, I forgot to commit changes to the main archive the first time. I 
do not know how to make a patch file for this one file, without have all other 
changes in the two commits as well.
I cannot find a hg export command to make a patch for this one file between 
versions spanning two commits.


You can just do a diff with upstream. Anyway, I'm enclosing the merged patch.

There's one problem on it:

$dmahplace="/usr/src/linux-headers-$dmahplace/include/config/ieee1394/dma.h";

Don't use absolute names here. -hg build system is smart enough to get the 
directory
where the kernel is installed, depending on what version you're compiling 
against
(you may change it with "make release").

Based on sub kernelcheck(), were we have:
my $fullkernel="$kernsrc/fs/fcntl.c";

I suspect that using:
$dmahplace="$kernelsrc/include/config/ieee1394/dma.h";

should work properly.

---

FYI, this is the diff from the master -hg:

diff -r 1da5fed5c8b2 v4l/scripts/make_kconfig.pl
--- a/v4l/scripts/make_kconfig.pl   Sun Sep 19 02:23:09 2010 -0300
+++ b/v4l/scripts/make_kconfig.pl   Mon Sep 27 16:04:50 2010 -0300
@@ -597,6 +597,9 @@
  disable_config('STAGING_BROKEN');
  $intopt { "DVB_MAX_ADAPTERS" } = 8;

+#check broken Ubuntu headers
+dmahcheck();
+
  # Check dependencies
  my %newconfig = checkdeps();

@@ -681,3 +684,27 @@
  EOF3
sleep 5;
  }
+
+# Check for full kernel sources and print a warning
+sub dmahcheck()
+{
+   my $dmahplace= "".$kernsrc;
+   $dmahplace =~ s-^/lib/modules/--g;
+   $dmahplace =~ s-/.*$--g;
+   
$dmahplace="/usr/src/linux-headers-$dmahplace/include/config/ieee1394/dma.h";
+   if (! -e $dmahplace) {
+   print<<"EOF2";
+
+***WARNING:*** File $dmahplace not present.
+This problem is at least present on Ubuntu systems:
+https://bugs.launchpad.net/ubuntu/+source/linux-kernel-headers/+bug/134222
+
+Therefore disabling FIREDTV driver.
+
+EOF2
+
+   disable_config('DVB_FIREDTV');
+
+   }
+   sleep 5;
+}




--
Jan Hoogenraad
Hoogenraad Interface Services
Postbus 2717
3500 GS Utrecht
--
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: [PATCH v3] OMAP1: Add support for SoC camera interface

2010-09-27 Thread Tony Lindgren
* Janusz Krzysztofik  [100926 17:55]:
> This patch adds a definition of the OMAP1 camera interface platform device, 
> and a function that allows for providing a board specific platform data. 
> The device will be used with the upcoming OMAP1 SoC camera interface driver.
> 
> Created and tested against linux-2.6.36-rc5 on Amstrad Delta.
> 
> Signed-off-by: Janusz Krzysztofik 
> ---
> 
> Tony,
> I hope this now satisfies your requirements.
> 
> I resubmit only this updated patch, not the other two, Amstrad Delta 
> specific, 
> which you have alredy applied. Those are still valid (work for me), only the 
> not yet merged include/media/omap1_camera.h header file is required for 
> successfull compilation of board-ams-delta.c. I hope this is not a problem.

Yes thanks. Queuing these three for the upcoming merge window.

Tony
--
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: updated make_kconfig.pl for Ubuntu

2010-09-27 Thread Mauro Carvalho Chehab
Em 27-09-2010 15:41, Jan Hoogenraad escreveu:
> I have updated launchpad bug
> 
> https://bugs.launchpad.net/ubuntu/+source/linux-kernel-headers/+bug/134222
> 
> I also created an updated make_kconfig.pl
> 
> http://linuxtv.org/hg/~jhoogenraad/rtl2831-r2/file/cb34ee1c29fc/v4l/scripts/make_kconfig.pl
> 
> Unfortunately, I forgot to commit changes to the main archive the first time. 
> I do not know how to make a patch file for this one file, without have all 
> other changes in the two commits as well.
> I cannot find a hg export command to make a patch for this one file between 
> versions spanning two commits.

You can just do a diff with upstream. Anyway, I'm enclosing the merged patch.

There's one problem on it:

$dmahplace="/usr/src/linux-headers-$dmahplace/include/config/ieee1394/dma.h";

Don't use absolute names here. -hg build system is smart enough to get the 
directory
where the kernel is installed, depending on what version you're compiling 
against
(you may change it with "make release").

Based on sub kernelcheck(), were we have:
my $fullkernel="$kernsrc/fs/fcntl.c";

I suspect that using:
$dmahplace="$kernelsrc/include/config/ieee1394/dma.h";

should work properly.

---

FYI, this is the diff from the master -hg:

diff -r 1da5fed5c8b2 v4l/scripts/make_kconfig.pl
--- a/v4l/scripts/make_kconfig.pl   Sun Sep 19 02:23:09 2010 -0300
+++ b/v4l/scripts/make_kconfig.pl   Mon Sep 27 16:04:50 2010 -0300
@@ -597,6 +597,9 @@
 disable_config('STAGING_BROKEN');
 $intopt { "DVB_MAX_ADAPTERS" } = 8;
 
+#check broken Ubuntu headers
+dmahcheck();
+
 # Check dependencies
 my %newconfig = checkdeps();
 
@@ -681,3 +684,27 @@
 EOF3
sleep 5;
 }
+
+# Check for full kernel sources and print a warning
+sub dmahcheck()
+{
+   my $dmahplace= "".$kernsrc;
+   $dmahplace =~ s-^/lib/modules/--g;
+   $dmahplace =~ s-/.*$--g;
+   
$dmahplace="/usr/src/linux-headers-$dmahplace/include/config/ieee1394/dma.h";
+   if (! -e $dmahplace) {
+   print <<"EOF2";
+
+***WARNING:*** File $dmahplace not present.
+This problem is at least present on Ubuntu systems:
+https://bugs.launchpad.net/ubuntu/+source/linux-kernel-headers/+bug/134222
+
+Therefore disabling FIREDTV driver.
+
+EOF2
+
+   disable_config('DVB_FIREDTV');
+
+   }
+   sleep 5;
+}

--
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 2.6.26 and up: ERRORS

2010-09-27 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:Mon Sep 27 19:00:05 CEST 2010
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   15164:1da5fed5c8b2
git master:   3e6dce76d99b328716b43929b9195adfee1de00c
git media-master: dace3857de7a16b83ae7d4e13c94de8e4b267d2a
gcc version:  i686-linux-gcc (GCC) 4.4.3
host hardware:x86_64
host os:  2.6.32.5

linux-2.6.32.6-armv5: WARNINGS
linux-2.6.33-armv5: OK
linux-2.6.34-armv5: WARNINGS
linux-2.6.35.3-armv5: WARNINGS
linux-2.6.36-rc2-armv5: ERRORS
linux-2.6.32.6-armv5-davinci: WARNINGS
linux-2.6.33-armv5-davinci: WARNINGS
linux-2.6.34-armv5-davinci: WARNINGS
linux-2.6.35.3-armv5-davinci: WARNINGS
linux-2.6.36-rc2-armv5-davinci: ERRORS
linux-2.6.32.6-armv5-ixp: WARNINGS
linux-2.6.33-armv5-ixp: WARNINGS
linux-2.6.34-armv5-ixp: WARNINGS
linux-2.6.35.3-armv5-ixp: WARNINGS
linux-2.6.36-rc2-armv5-ixp: ERRORS
linux-2.6.32.6-armv5-omap2: WARNINGS
linux-2.6.33-armv5-omap2: WARNINGS
linux-2.6.34-armv5-omap2: WARNINGS
linux-2.6.35.3-armv5-omap2: WARNINGS
linux-2.6.36-rc2-armv5-omap2: ERRORS
linux-2.6.26.8-i686: WARNINGS
linux-2.6.27.44-i686: WARNINGS
linux-2.6.28.10-i686: WARNINGS
linux-2.6.29.1-i686: WARNINGS
linux-2.6.30.10-i686: 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-rc2-i686: ERRORS
linux-2.6.32.6-m32r: WARNINGS
linux-2.6.33-m32r: OK
linux-2.6.34-m32r: WARNINGS
linux-2.6.35.3-m32r: WARNINGS
linux-2.6.36-rc2-m32r: ERRORS
linux-2.6.32.6-mips: WARNINGS
linux-2.6.33-mips: WARNINGS
linux-2.6.34-mips: WARNINGS
linux-2.6.35.3-mips: WARNINGS
linux-2.6.36-rc2-mips: ERRORS
linux-2.6.32.6-powerpc64: WARNINGS
linux-2.6.33-powerpc64: WARNINGS
linux-2.6.34-powerpc64: WARNINGS
linux-2.6.35.3-powerpc64: WARNINGS
linux-2.6.36-rc2-powerpc64: ERRORS
linux-2.6.26.8-x86_64: WARNINGS
linux-2.6.27.44-x86_64: WARNINGS
linux-2.6.28.10-x86_64: WARNINGS
linux-2.6.29.1-x86_64: WARNINGS
linux-2.6.30.10-x86_64: 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-rc2-x86_64: ERRORS
linux-git-Module.symvers: ERRORS
linux-git-armv5: ERRORS
linux-git-armv5-davinci: ERRORS
linux-git-armv5-ixp: ERRORS
linux-git-armv5-omap2: ERRORS
linux-git-i686: ERRORS
linux-git-m32r: ERRORS
linux-git-mips: ERRORS
linux-git-powerpc64: ERRORS
linux-git-x86_64: ERRORS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Monday.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


Re: cx5000 default auto sleep mode

2010-09-27 Thread Timothy D. Lenz
I am seeing a problem again. driver I'm using is v4l-20100625. Don't 
know if the tuner card is dieing again or what. I had the sleep mode 
turned on and have been using the fusion dual along with a 1800. THe 
1800 shows as the 3rd device. Friday I had recordings setup on 2 
channels at the same time and one started recording the wrong channel 
with a lot of pixiling. When I used femon to try switching through 
tuners one tuner disapeared and then the other tuner switched to the 
channel the other was incorectly trying to record. Ended up restarting 
vdr and the drivers. Today I found that epg data was missing for several 
channels. When I used femon to switch tuners, the second tuner was no 
signal. I have turned the power save back off and restarted. Hopefully 
all 3 tuners will work tonight. This would be the second fusion HDTV7 to 
go bad and it is in a different computer running x63 instead of x32. So 
ether there is a bug in the drivers or theses are really crappy tuners.


On 5/10/2010 6:45 PM, Timothy D. Lenz wrote:



On 4/14/2010 9:39 PM, Devin Heitmueller wrote:

On Wed, Apr 14, 2010 at 11:44 PM, Andy Walls
wrote:

On Wed, 2010-04-14 at 13:40 -0400, Devin Heitmueller wrote:

On Wed, Apr 14, 2010 at 1:29 PM, Timothy D. Lenz
wrote:

Thanks to Andy Walls, found out why I kept loosing 1 tuner on a
FusionHD7
Dual express. Didn't know linux supported an auto sleep mode on the
tuner
chips and that it defaulted to on. Seems like it would be better to
default
to off.


Regarding the general assertion that the power management should be
disabled by default, I disagree. The power savings is considerable,
the time to bring the tuner out of sleep is negligible, and it's
generally good policy.

Andy, do you have any actual details regarding the nature of the
problem?


Not really. DViCo Fusion dual digital tv card. One side of the card
would yield "black video screen" when starting a digital capture
sometime after (?) the VDR ATSC EPG plugin tried to suck off data. I'm
not sure there was a causal relationship.

I hypothesized that one side of the dual-tuner was going stupid or one
of the two channels used in the cx23885 was getting confused. I was
looking at how to narrow the problem down to cx23885 chip or xc5000
tuner, or s5h14xx demod when I noted the power managment module option
for the xc5000. I suggested Tim try it.

It was dumb luck that my guess actually made his symptoms go away.

That's all I know.


We did have a similar issue with the PCTV 800i. Basically, the GPIO
definition was improperly defined for the xc5000 reset callback. As a
result, it was strobing the reset on both the xc5000 *and* the
s5h1411, which would then cause the s5h1411's hardware state to not
match the driver state.

After multiple round trips with the hardware engineer at PCTV, I
finally concluded that there actually wasn't a way to strobe the reset
without screwing up the demodulator, which prompted me to disable the
xc5000 reset callback (see cx88-cards:2944).

My guess is that the reset GPIO definition for that board is wrong (a
problem exposed by this change), or that it's resetting the s5h1411 as
well.

Devin




I replaced the single tuner with the other FusionHD7 Dual Express I had
so there was two of the same cards. Within a few hours Both tuners where
down on the original card and even restarting drivers wouldn't bring it
back. So I moved the new card to it's slot and put the single back in in
case the old card was defective. I removed the no power off switch and
went out for awhile. When I came back vdr had crashed which often
happens when it tried to tune and there is no signal as in when a tuner
goes down. For some reason vdr/xine/xorg/vdpau combo is very unstable
when signal is poor or missing. I wish we could dump xine as it seems to
be the cause. I never had a problem with vdr crashing when it rained
knocking out signal when the nexus card was providing video.
--
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


--
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


updated make_kconfig.pl for Ubuntu

2010-09-27 Thread Jan Hoogenraad

I have updated launchpad bug

https://bugs.launchpad.net/ubuntu/+source/linux-kernel-headers/+bug/134222

I also created an updated make_kconfig.pl

http://linuxtv.org/hg/~jhoogenraad/rtl2831-r2/file/cb34ee1c29fc/v4l/scripts/make_kconfig.pl

Unfortunately, I forgot to commit changes to the main archive the first 
time. I do not know how to make a patch file for this one file, without 
have all other changes in the two commits as well.
I cannot find a hg export command to make a patch for this one file 
between versions spanning two commits.


Douglas: can you help ?

Mauro Carvalho Chehab wrote:

Em 26-09-2010 13:18, Jan Hoogenraad escreveu:

On
Linux 2.6.28-19-generic
the problem is tackled already:
DVB_FIREDTV_IEEE1394: Requires at least kernel 2.6.30

On newer linux versions (I have tried Linux 2.6.32-24-generic) the problem is 
NOT that the modules dma is not present, it is just that the required header 
files are not present in
/usr/include

Another location mighte have been:
ls -l /usr/src/linux-headers-2.6.28-19-generic/include/config/ieee1394


This is the right place is whatever pointed on your kernel source alias, like:

$ ls -la /lib/modules/2.6.35+/source
lrwxrwxrwx. 1 root root 23 Set 26 21:51 /lib/modules/2.6.35+/source ->  
/home/v4l/v4l/patchwork




but that only contains:
-rw-r--r-- 1 root root0 2010-09-16 18:25 dv1394.h
drwxr-xr-x 3 root root 4096 2010-06-15 20:12 eth1394
-rw-r--r-- 1 root root0 2010-09-16 18:25 eth1394.h
-rw-r--r-- 1 root root0 2010-09-16 18:25 ohci1394.h
-rw-r--r-- 1 root root0 2010-09-16 18:25 pcilynx.h
-rw-r--r-- 1 root root0 2010-09-16 18:25 rawio.h
-rw-r--r-- 1 root root0 2010-09-16 18:25 sbp2.h
-rw-r--r-- 1 root root0 2010-09-16 18:25 video1394.h

Can you indicate where following files  should be located ?
dma.h
csr1212.h
highlevel.h


All of them are at the same place:

/lib/modules/2.6.35+/source/drivers/ieee1394/dma.h
/lib/modules/2.6.35+/source/drivers/ieee1394/csr1212.h
/lib/modules/2.6.35+/source/drivers/ieee1394/highlevel.h



In that case checking if the dma.h file is present might be the best way 
forward.

I'll also file an ubuntu bug once I know what is missing where.
I could not find an entry in launchpad on this issue yet.


This is probably the best thing. A check for dma.h may also work. If you want,
do a patch for it and submit to Douglas.

Cheers,
Mauro




--
Jan Hoogenraad
Hoogenraad Interface Services
Postbus 2717
3500 GS Utrecht
--
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: [RFC/PATCH 2/9] v4l: Group media bus pixel codes by types and sort them alphabetically

2010-09-27 Thread Laurent Pinchart
Hi Hans,

On Sunday 26 September 2010 19:57:14 Hans Verkuil wrote:
> On Sunday, September 26, 2010 19:51:22 Laurent Pinchart wrote:
> > On Sunday 26 September 2010 19:44:38 Hans Verkuil wrote:
> > > On Sunday, September 26, 2010 19:34:49 Laurent Pinchart wrote:
> > > > On Sunday 26 September 2010 19:29:53 Hans Verkuil wrote:
> > > > > On Sunday, September 26, 2010 18:13:25 Laurent Pinchart wrote:
> > > > > > Adding new pixel codes at the end of the enumeration will soon
> > > > > > create a mess, so sort the pixel codes by type and then sort
> > > > > > them alphabetically.
> > > > > > 
> > > > > > As the codes are part of the kernel ABI their value can't change
> > > > > > when a new code is inserted in the enumeration, so they are
> > > > > > given an explicit numerical value. When inserting a new pixel
> > > > > > code developers must use and update the V4L2_MBUS_FMT_LAST
> > > > > > value.
> > > > > > 
> > > > > > Signed-off-by: Laurent Pinchart
> > > > > >  ---
> > > > > > 
> > > > > >  include/linux/v4l2-mediabus.h |   54
> > > > > >   1 files changed, 32
> > > > > >  insertions(+), 22 deletions(-)
> > > > > > 
> > > > > > diff --git a/include/linux/v4l2-mediabus.h
> > > > > > b/include/linux/v4l2-mediabus.h index 127512a..bc637a5 100644
> > > > > > --- a/include/linux/v4l2-mediabus.h
> > > > > > +++ b/include/linux/v4l2-mediabus.h
> > > > > > @@ -24,31 +24,41 @@
> > > > > > 
> > > > > >   * transferred first, "BE" means that the most significant bits
> > > > > >   are transferred * first, and "PADHI" and "PADLO" define which
> > > > > >   bits - low or high, in the * incomplete high byte, are filled
> > > > > >   with padding bits.
> > > > > > 
> > > > > > + *
> > > > > > + * The pixel codes are grouped by types and (mostly) sorted
> > > > > > alphabetically. As + * their value can't change when a new pixel
> > > > > > code is inserted in the + * enumeration, they are explicitly
> > > > > > given a numerical value. When inserting a + * new pixel code use
> > > > > > and update the V4L2_MBUS_FMT_LAST value.
> > > > > > 
> > > > > >   */
> > > > > >  
> > > > > >  enum v4l2_mbus_pixelcode {
> > > > > >  
> > > > > > V4L2_MBUS_FMT_FIXED = 1,
> > > > > > 
> > > > > > -   V4L2_MBUS_FMT_YUYV8_2X8,
> > > > > > -   V4L2_MBUS_FMT_YVYU8_2X8,
> > > > > > -   V4L2_MBUS_FMT_UYVY8_2X8,
> > > > > > -   V4L2_MBUS_FMT_VYUY8_2X8,
> > > > > > -   V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
> > > > > > -   V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
> > > > > > -   V4L2_MBUS_FMT_RGB565_2X8_LE,
> > > > > > -   V4L2_MBUS_FMT_RGB565_2X8_BE,
> > > > > > -   V4L2_MBUS_FMT_SBGGR8_1X8,
> > > > > > -   V4L2_MBUS_FMT_SBGGR10_1X10,
> > > > > > -   V4L2_MBUS_FMT_GREY8_1X8,
> > > > > > -   V4L2_MBUS_FMT_Y10_1X10,
> > > > > > -   V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE,
> > > > > > -   V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE,
> > > > > > -   V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE,
> > > > > > -   V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE,
> > > > > > -   V4L2_MBUS_FMT_SGRBG8_1X8,
> > > > > > -   V4L2_MBUS_FMT_SBGGR12_1X12,
> > > > > > -   V4L2_MBUS_FMT_YUYV8_1_5X8,
> > > > > > -   V4L2_MBUS_FMT_YVYU8_1_5X8,
> > > > > > -   V4L2_MBUS_FMT_UYVY8_1_5X8,
> > > > > > -   V4L2_MBUS_FMT_VYUY8_1_5X8,
> > > > > > +   /* RGB */
> > > > > > +   V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 7,
> > > > > > +   V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE = 6,
> > > > > > +   V4L2_MBUS_FMT_RGB565_2X8_BE = 9,
> > > > > > +   V4L2_MBUS_FMT_RGB565_2X8_LE = 8,
> > > > > > +   /* YUV (including grey) */
> > > > > > +   V4L2_MBUS_FMT_GREY8_1X8 = 12,
> > > > > > +   V4L2_MBUS_FMT_Y10_1X10 = 13,
> > > > > > +   V4L2_MBUS_FMT_YUYV8_1_5X8 = 20,
> > > > > > +   V4L2_MBUS_FMT_YVYU8_1_5X8 = 21,
> > > > > > +   V4L2_MBUS_FMT_UYVY8_1_5X8 = 22,
> > > > > > +   V4L2_MBUS_FMT_VYUY8_1_5X8 = 23,
> > > > > > +   V4L2_MBUS_FMT_YUYV8_2X8 = 2,
> > > > > > +   V4L2_MBUS_FMT_UYVY8_2X8 = 4,
> > > > > > +   V4L2_MBUS_FMT_YVYU8_2X8 = 3,
> > > > > > +   V4L2_MBUS_FMT_VYUY8_2X8 = 5,
> > > > > > +   /* Bayer */
> > > > > > +   V4L2_MBUS_FMT_SBGGR8_1X8 = 10,
> > > > > > +   V4L2_MBUS_FMT_SBGGR10_1X10 = 11,
> > > > > > +   V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE = 16,
> > > > > > +   V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE = 14,
> > > > > > +   V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE = 17,
> > > > > > +   V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE = 15,
> > > > > > +   V4L2_MBUS_FMT_SBGGR12_1X12 = 19,
> > > > > > +   V4L2_MBUS_FMT_SGRBG8_1X8 = 18,
> > > > > 
> > > > > Why on earth would you want to keep the original values? It was
> > > > > internal only, so no need to stick to the old values.
> > > > 
> > > > Good point :-)
> > > > 
> > > > > Just let RGB start at 1000, YUV at 2000 and Bayer at 3000 or
> > > > > something like that.
> > > > > 
> > > > > > +   /* Last - Update this when adding a new pixel code */
> > > > > > +   V4L2_MBUS_FMT_LAST = 24,
> > > > > 
> > > > > Why would you need this?
> > > > 
> > > > We've discussed this in the past. Keeping holes won't help, as we
> > > > will have to insert formats in

Re: [RFC/PATCH 2/9] v4l: Group media bus pixel codes by types and sort them alphabetically

2010-09-27 Thread Laurent Pinchart
Hi Guennadi,

On Monday 27 September 2010 10:31:02 Guennadi Liakhovetski wrote:
> On Sun, 26 Sep 2010, Laurent Pinchart wrote:
> > Adding new pixel codes at the end of the enumeration will soon create a
> > mess, so sort the pixel codes by type and then sort them alphabetically.
> > 
> > As the codes are part of the kernel ABI their value can't change when a
> > new code is inserted in the enumeration, so they are given an explicit
> > numerical value. When inserting a new pixel code developers must use and
> > update the V4L2_MBUS_FMT_LAST value.
> > 
> > Signed-off-by: Laurent Pinchart 
> > ---
> > 
> >  include/linux/v4l2-mediabus.h |   54
> >   1 files changed, 32
> >  insertions(+), 22 deletions(-)
> > 
> > diff --git a/include/linux/v4l2-mediabus.h
> > b/include/linux/v4l2-mediabus.h index 127512a..bc637a5 100644
> > --- a/include/linux/v4l2-mediabus.h
> > +++ b/include/linux/v4l2-mediabus.h
> > @@ -24,31 +24,41 @@
> > 
> >   * transferred first, "BE" means that the most significant bits are
> >   transferred * first, and "PADHI" and "PADLO" define which bits - low
> >   or high, in the * incomplete high byte, are filled with padding bits.
> > 
> > + *
> > + * The pixel codes are grouped by types and (mostly) sorted
> > alphabetically. As
> 
> Why mostly? Wouldn't it make it easier for future additions if we sorted
> them strictly from the beginning?

I knew someone would raise that issue :-)

A pure alphebetical order would be a bit confusing. YUYV10 would come before 
YUYV8 for instance, while it should come after. We can say the list needs to 
be sorted according to general numerical value to solve this.

Another problem is the presence of optional specifiers. The following formats

V4L2_MBUS_FMT_SBGGR10_1X8
V4L2_MBUS_FMT_SBGGR10_1X10
V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE
V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE
V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE
V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE
V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8

should instead be sorted this way

V4L2_MBUS_FMT_SBGGR10_1X8
V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8
V4L2_MBUS_FMT_SBGGR10_1X10
V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE
V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE
V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE
V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE

Omitted optional components should come first in the sort order. If we 
consider that SBGGR10_DPCM8 is a format on its own instead of a format and a 
specifier, an alphabetical sort order will work. There could be other optional 
specifiers though.

What's your opinion ?

-- 
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: [RFC/PATCH 1/9] v4l: Move the media/v4l2-mediabus.h header to include/linux

2010-09-27 Thread Laurent Pinchart
Hi Guennadi,

Thanks for the review.

On Monday 27 September 2010 10:20:57 Guennadi Liakhovetski wrote:
> On Sun, 26 Sep 2010, Laurent Pinchart wrote:
> > The header defines the v4l2_mbus_framefmt structure which will be used
> > by the V4L2 subdevs userspace API.
> > 
> > Change the type of the v4l2_mbus_framefmt::code field to __u32, as enum
> > sizes can differ between different ABIs on the same architectures.
> > 
> > Signed-off-by: Laurent Pinchart 
> > ---
> > 
> >  include/linux/Kbuild  |1 +
> >  include/linux/v4l2-mediabus.h |   70
> >  + include/media/soc_mediabus.h 
> >  |3 +-
> >  include/media/v4l2-mediabus.h |   53 +--
> 
> Hm, yeah... I guess, you have to move them to make available to the
> user-space...

Yes, that's why.

> >  4 files changed, 73 insertions(+), 54 deletions(-)
> >  create mode 100644 include/linux/v4l2-mediabus.h
> > 
> > diff --git a/include/linux/Kbuild b/include/linux/Kbuild
> > index f836ee4..38127c2 100644
> > --- a/include/linux/Kbuild
> > +++ b/include/linux/Kbuild
> > @@ -369,6 +369,7 @@ header-y += unistd.h
> > 
> >  header-y += usbdevice_fs.h
> >  header-y += utime.h
> >  header-y += utsname.h
> > 
> > +header-y += v4l2-mediabus.h
> > 
> >  header-y += veth.h
> >  header-y += vhost.h
> >  header-y += videodev.h
> > 
> > diff --git a/include/linux/v4l2-mediabus.h
> > b/include/linux/v4l2-mediabus.h new file mode 100644
> > index 000..127512a
> > --- /dev/null
> > +++ b/include/linux/v4l2-mediabus.h
> > @@ -0,0 +1,70 @@
> > +/*
> > + * Media Bus API header
> > + *
> > + * Copyright (C) 2009, Guennadi Liakhovetski 
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +
> > +#ifndef __LINUX_V4L2_MEDIABUS_H
> > +#define __LINUX_V4L2_MEDIABUS_H
> > +
> > +#include 
> > +#include 
> > +
> > +/*
> > + * These pixel codes uniquely identify data formats on the media bus.
> > Mostly + * they correspond to similarly named V4L2_PIX_FMT_* formats,
> > format 0 is + * reserved, V4L2_MBUS_FMT_FIXED shall be used by
> > host-client pairs, where the + * data format is fixed. Additionally,
> > "2X8" means that one pixel is transferred + * in two 8-bit samples, "BE"
> > or "LE" specify in which order those samples are + * transferred over
> > the bus: "LE" means that the least significant bits are + * transferred
> > first, "BE" means that the most significant bits are transferred + *
> > first, and "PADHI" and "PADLO" define which bits - low or high, in the +
> > * incomplete high byte, are filled with padding bits.
> > + */
> > +enum v4l2_mbus_pixelcode {
> 
> If you now do not want to use this enum in the API, maybe better make it
> unnamed and switch all users to __u32 for consistency? I'm not sure this
> would be an advantage, just something to maybe think about...

I think it makes sense to keep the enumeration type for type checking reasons 
(both in kernel space and user space). Unfortunately it can't be used in the 
kernel <-> user API because of ABI incompatibilities.

-- 
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


[PATCH 13/13] Staging: cx25821: fix tabs and space coding style issue in cx25821.h

2010-09-27 Thread Ruslan Pisarev
This is a patch to the cx25821.h file that fixed
up a tabs and space error and warnings found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev 
---
 drivers/staging/cx25821/cx25821.h |   51 ++---
 1 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821.h 
b/drivers/staging/cx25821/cx25821.h
index 1b628f6..c940001 100644
--- a/drivers/staging/cx25821/cx25821.h
+++ b/drivers/staging/cx25821/cx25821.h
@@ -91,10 +91,10 @@
 
 /* Currently supported by the driver */
 #define CX25821_NORMS (\
-V4L2_STD_NTSC_M |  V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_M_KR | \
-V4L2_STD_PAL_BG |  V4L2_STD_PAL_DK|  V4L2_STD_PAL_I| \
-V4L2_STD_PAL_M  |  V4L2_STD_PAL_N |  V4L2_STD_PAL_H| \
-V4L2_STD_PAL_Nc )
+   V4L2_STD_NTSC_M |  V4L2_STD_NTSC_M_JP | V4L2_STD_NTSC_M_KR | \
+   V4L2_STD_PAL_BG |  V4L2_STD_PAL_DK|  V4L2_STD_PAL_I| \
+   V4L2_STD_PAL_M  |  V4L2_STD_PAL_N |  V4L2_STD_PAL_H| \
+   V4L2_STD_PAL_Nc)
 
 #define CX25821_BOARD_CONEXANT_ATHENA10 1
 #define MAX_VID_CHANNEL_NUM 12
@@ -139,7 +139,7 @@ struct cx25821_fh {
/* video capture */
struct cx25821_fmt *fmt;
unsigned int width, height;
-int channel_id;
+   int channel_id;
 
/* vbi capture */
struct videobuf_queue vidq;
@@ -238,26 +238,25 @@ struct cx25821_data {
 };
 
 struct cx25821_channel {
-   struct v4l2_prio_state prio;
+   struct v4l2_prio_state prio;
 
-   int ctl_bright;
-   int ctl_contrast;
-   int ctl_hue;
-   int ctl_saturation;
+   int ctl_bright;
+   int ctl_contrast;
+   int ctl_hue;
+   int ctl_saturation;
+   struct cx25821_data timeout_data;
 
-   struct cx25821_data timeout_data;
+   struct video_device *video_dev;
+   struct cx25821_dmaqueue vidq;
 
-   struct video_device *video_dev;
-   struct cx25821_dmaqueue vidq;
+   struct sram_channel *sram_channels;
 
-   struct sram_channel *sram_channels;
-
-   struct mutex lock;
-   int resources;
+   struct mutex lock;
+   int resources;
 
-   int pixel_formats;
-   int use_cif_resolution;
-   int cif_width;
+   int pixel_formats;
+   int use_cif_resolution;
+   int cif_width;
 };
 
 struct cx25821_dev {
@@ -283,7 +282,7 @@ struct cx25821_dev {
int nr;
struct mutex lock;
 
-struct cx25821_channel channels[MAX_VID_CHANNEL_NUM];
+   struct cx25821_channel channels[MAX_VID_CHANNEL_NUM];
 
/* board details */
unsigned int board;
@@ -311,7 +310,7 @@ struct cx25821_dev {
int _audio_lines_count;
int _audioframe_count;
int _audio_upstream_channel_select;
-   int _last_index_irq;/* The last interrupt index processed. */
+   int _last_index_irq;/* The last interrupt index processed. */
 
__le32 *_risc_audio_jmp_addr;
__le32 *_risc_virt_start_addr;
@@ -443,7 +442,7 @@ static inline struct cx25821_dev *get_cx25821(struct 
v4l2_device *v4l2_dev)
 }
 
 #define cx25821_call_all(dev, o, f, args...) \
-v4l2_device_call_all(&dev->v4l2_dev, 0, o, f, ##args)
+   v4l2_device_call_all(&dev->v4l2_dev, 0, o, f, ##args)
 
 extern struct list_head cx25821_devlist;
 extern struct cx25821_board cx25821_boards[];
@@ -491,7 +490,7 @@ struct sram_channel {
u32 fld_aud_fifo_en;
u32 fld_aud_risc_en;
 
-   /* For Upstream Video */
+   /* For Upstream Video */
u32 vid_fmt_ctl;
u32 vid_active_ctl1;
u32 vid_active_ctl2;
@@ -511,8 +510,8 @@ extern struct sram_channel cx25821_sram_channels[];
 #define cx_write(reg, value) writel((value), dev->lmmio + ((reg)>>2))
 
 #define cx_andor(reg, mask, value) \
-  writel((readl(dev->lmmio+((reg)>>2)) & ~(mask)) |\
-  ((value) & (mask)), dev->lmmio+((reg)>>2))
+   writel((readl(dev->lmmio+((reg)>>2)) & ~(mask)) |\
+   ((value) & (mask)), dev->lmmio+((reg)>>2))
 
 #define cx_set(reg, bit)  cx_andor((reg), (bit), (bit))
 #define cx_clear(reg, bit)cx_andor((reg), (bit), 0)
-- 
1.7.0.4

--
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 12/13] Staging: cx25821: fix tabs and space coding style issue in cx25821-video-upstream.c

2010-09-27 Thread Ruslan Pisarev
This is a patch to the cx25821-video-upstream.c file that fixed
up a tabs and space warnings found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev 
---
 drivers/staging/cx25821/cx25821-video-upstream.c |   28 +++---
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-video-upstream.c 
b/drivers/staging/cx25821/cx25821-video-upstream.c
index 756a820..16bf74d 100644
--- a/drivers/staging/cx25821/cx25821-video-upstream.c
+++ b/drivers/staging/cx25821/cx25821-video-upstream.c
@@ -39,7 +39,7 @@ MODULE_AUTHOR("Hiep Huynh ");
 MODULE_LICENSE("GPL");
 
 static int _intr_msk =
-FLD_VID_SRC_RISC1 | FLD_VID_SRC_UF | FLD_VID_SRC_SYNC | 
FLD_VID_SRC_OPC_ERR;
+   FLD_VID_SRC_RISC1 | FLD_VID_SRC_UF | FLD_VID_SRC_SYNC | 
FLD_VID_SRC_OPC_ERR;
 
 int cx25821_sram_channel_setup_upstream(struct cx25821_dev *dev,
struct sram_channel *ch,
@@ -346,13 +346,13 @@ int cx25821_get_frame(struct cx25821_dev *dev, struct 
sram_channel *sram_ch)
 
if (IS_ERR(myfile)) {
const int open_errno = -PTR_ERR(myfile);
-  printk(KERN_ERR
+   printk(KERN_ERR
   "%s(): ERROR opening file(%s) with errno = %d!\n",
   __func__, dev->_filename, open_errno);
return PTR_ERR(myfile);
} else {
if (!(myfile->f_op)) {
-  printk(KERN_ERR
+   printk(KERN_ERR
   "%s: File has no file operations registered!",
   __func__);
filp_close(myfile, NULL);
@@ -360,7 +360,7 @@ int cx25821_get_frame(struct cx25821_dev *dev, struct 
sram_channel *sram_ch)
}
 
if (!myfile->f_op->read) {
-  printk(KERN_ERR
+   printk(KERN_ERR
   "%s: File has no READ operations registered!",
   __func__);
filp_close(myfile, NULL);
@@ -415,7 +415,7 @@ static void cx25821_vidups_handler(struct work_struct *work)
container_of(work, struct cx25821_dev, _irq_work_entry);
 
if (!dev) {
-  printk(KERN_ERR
+   printk(KERN_ERR
   "ERROR %s(): since container_of(work_struct) FAILED!\n",
   __func__);
return;
@@ -448,7 +448,7 @@ int cx25821_openfile(struct cx25821_dev *dev, struct 
sram_channel *sram_ch)
return PTR_ERR(myfile);
} else {
if (!(myfile->f_op)) {
-  printk(KERN_ERR
+   printk(KERN_ERR
   "%s: File has no file operations registered!",
   __func__);
filp_close(myfile, NULL);
@@ -456,7 +456,7 @@ int cx25821_openfile(struct cx25821_dev *dev, struct 
sram_channel *sram_ch)
}
 
if (!myfile->f_op->read) {
-  printk(KERN_ERR
+   printk(KERN_ERR
   "%s: File has no READ operations registered!  \
   Returning.",
 __func__);
@@ -589,7 +589,7 @@ int cx25821_video_upstream_irq(struct cx25821_dev *dev, int 
chan_num,
   u32 status)
 {
u32 int_msk_tmp;
-   struct sram_channel *channel = dev->channels[chan_num].sram_channels;
+   struct sram_channel *channel = dev->channels[chan_num].sram_channels;
int singlefield_lines = NTSC_FIELD_HEIGHT;
int line_size_in_bytes = Y422_LINE_SZ;
int odd_risc_prog_size = 0;
@@ -657,12 +657,12 @@ int cx25821_video_upstream_irq(struct cx25821_dev *dev, 
int chan_num,
   Interrupt!\n", __func__);
 
if (status & FLD_VID_SRC_SYNC)
-  printk(KERN_ERR "%s: Video Received Sync Error \
-  Interrupt!\n", __func__);
+   printk(KERN_ERR "%s: Video Received Sync Error \
+   Interrupt!\n", __func__);
 
if (status & FLD_VID_SRC_OPC_ERR)
-  printk(KERN_ERR "%s: Video Received OpCode Error \
-  Interrupt!\n", __func__);
+   printk(KERN_ERR "%s: Video Received OpCode Error \
+   Interrupt!\n", __func__);
}
 
if (dev->_file_status == END_OF_FILE) {
@@ -690,7 +690,7 @@ static irqreturn_t cx25821_upstream_irq(int irq, void 
*dev_id)
 
channel_num = VID_UPSTREAM_SRAM_CHANNEL_I;
 
-   sram_ch = dev->channels[channel_num].sram_channels;
+   sram_ch = dev->channels[channel_num].sram_channels;
 
msk_stat = cx_read(sram_ch->int_mstat);
vid_status = cx_read(sram_ch->int_stat);
@@ -811,7 +811,7 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, 
int channel_select,
}
 
 

[PATCH 11/13] Staging: cx25821: fix tabs and space coding style issue in cx25821-video-upstream.h

2010-09-27 Thread Ruslan Pisarev
This is a patch to the cx25821-video-upstream.h file that fixed up
a space errors found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev 
---
 drivers/staging/cx25821/cx25821-video-upstream.h |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-video-upstream.h 
b/drivers/staging/cx25821/cx25821-video-upstream.h
index 10dee5c..f0b3ac0 100644
--- a/drivers/staging/cx25821/cx25821-video-upstream.h
+++ b/drivers/staging/cx25821/cx25821-video-upstream.h
@@ -97,13 +97,13 @@
 #define PAL_RISC_BUF_SIZE   (2 * PAL_US_VID_PROG_SIZE)
 
 #define PAL_VID_PROG_SIZE   ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + 
2*RISC_SYNC_INSTRUCTION_SIZE + \
- RISC_WRITECR_INSTRUCTION_SIZE + 
JUMP_INSTRUCTION_SIZE )
+ RISC_WRITECR_INSTRUCTION_SIZE + 
JUMP_INSTRUCTION_SIZE)
 
-#define ODD_FLD_PAL_PROG_SIZE   ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + 
RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE )
-#define ODD_FLD_NTSC_PROG_SIZE  ((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + 
RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE )
+#define ODD_FLD_PAL_PROG_SIZE   ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + 
RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE)
+#define ODD_FLD_NTSC_PROG_SIZE  ((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + 
RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE)
 
 #define NTSC_US_VID_PROG_SIZE   ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE 
+ RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE)
-#define NTSC_RISC_BUF_SIZE  ( 2 * (RISC_SYNC_INSTRUCTION_SIZE + 
NTSC_US_VID_PROG_SIZE) )
+#define NTSC_RISC_BUF_SIZE  (2 * (RISC_SYNC_INSTRUCTION_SIZE + 
NTSC_US_VID_PROG_SIZE))
 #define FRAME1_VID_PROG_SIZE((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) 
* 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \
- RISC_WRITECR_INSTRUCTION_SIZE + 
JUMP_INSTRUCTION_SIZE )
+ RISC_WRITECR_INSTRUCTION_SIZE + 
JUMP_INSTRUCTION_SIZE)
 #endif
-- 
1.7.0.4

--
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/13] Staging: cx25821: fix tabs and space coding style issue in cx25821-video-upstream-ch2.h

2010-09-27 Thread Ruslan Pisarev
This is a patch to the cx25821-video-upstream-ch2.h file that fixed up
a space errors found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev 
---
 .../staging/cx25821/cx25821-video-upstream-ch2.h   |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-video-upstream-ch2.h 
b/drivers/staging/cx25821/cx25821-video-upstream-ch2.h
index 6234063..029e830 100644
--- a/drivers/staging/cx25821/cx25821-video-upstream-ch2.h
+++ b/drivers/staging/cx25821/cx25821-video-upstream-ch2.h
@@ -88,14 +88,14 @@
 #endif
 
 #ifndef USE_RISC_NOOP_VIDEO
-#define PAL_US_VID_PROG_SIZE  ((PAL_FIELD_HEIGHT + 1) * 3 * DWORD_SIZE + 
RISC_WRITECR_INSTRUCTION_SIZE )
-#define PAL_RISC_BUF_SIZE ( 2 * (RISC_SYNC_INSTRUCTION_SIZE + 
PAL_US_VID_PROG_SIZE) )
+#define PAL_US_VID_PROG_SIZE  ((PAL_FIELD_HEIGHT + 1) * 3 * DWORD_SIZE + 
RISC_WRITECR_INSTRUCTION_SIZE)
+#define PAL_RISC_BUF_SIZE (2 * (RISC_SYNC_INSTRUCTION_SIZE + 
PAL_US_VID_PROG_SIZE))
 #define PAL_VID_PROG_SIZE ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + 
2*RISC_SYNC_INSTRUCTION_SIZE + \
-   RISC_WRITECR_INSTRUCTION_SIZE + 
JUMP_INSTRUCTION_SIZE )
-#define ODD_FLD_PAL_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + 
RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE )
-#define ODD_FLD_NTSC_PROG_SIZE((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + 
RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE )
+   RISC_WRITECR_INSTRUCTION_SIZE + 
JUMP_INSTRUCTION_SIZE)
+#define ODD_FLD_PAL_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + 
RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE)
+#define ODD_FLD_NTSC_PROG_SIZE((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + 
RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE)
 #define NTSC_US_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + 
RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE)
-#define NTSC_RISC_BUF_SIZE(2 * (RISC_SYNC_INSTRUCTION_SIZE + 
NTSC_US_VID_PROG_SIZE) )
+#define NTSC_RISC_BUF_SIZE(2 * (RISC_SYNC_INSTRUCTION_SIZE + 
NTSC_US_VID_PROG_SIZE))
 #define FRAME1_VID_PROG_SIZE  ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * 
3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \
-   RISC_WRITECR_INSTRUCTION_SIZE + 
JUMP_INSTRUCTION_SIZE )
+   RISC_WRITECR_INSTRUCTION_SIZE + 
JUMP_INSTRUCTION_SIZE)
 #endif
-- 
1.7.0.4

--
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/13] Staging: cx25821: fix braces, tabs and space coding style issue in cx25821-video-upstream-ch2.c

2010-09-27 Thread ruslanpisarev
From: Ruslan Pisarev 

This is a patch to the cx25821-video-upstream-ch2.c file that fixed
up a braces, tabs and space warnings found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev 
---
 .../staging/cx25821/cx25821-video-upstream-ch2.c   |  135 +---
 1 files changed, 63 insertions(+), 72 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-video-upstream-ch2.c 
b/drivers/staging/cx25821/cx25821-video-upstream-ch2.c
index d12dbb5..405e2db 100644
--- a/drivers/staging/cx25821/cx25821-video-upstream-ch2.c
+++ b/drivers/staging/cx25821/cx25821-video-upstream-ch2.c
@@ -32,17 +32,17 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 MODULE_DESCRIPTION("v4l2 driver module for cx25821 based TV cards");
 MODULE_AUTHOR("Hiep Huynh ");
 MODULE_LICENSE("GPL");
 
 static int _intr_msk =
-FLD_VID_SRC_RISC1 | FLD_VID_SRC_UF | FLD_VID_SRC_SYNC | 
FLD_VID_SRC_OPC_ERR;
+   FLD_VID_SRC_RISC1 | FLD_VID_SRC_UF | FLD_VID_SRC_SYNC | 
FLD_VID_SRC_OPC_ERR;
 
 static __le32 *cx25821_update_riscprogram_ch2(struct cx25821_dev *dev,
- __le32 * rp, unsigned int offset,
+ __le32 *rp, unsigned int offset,
  unsigned int bpl, u32 sync_line,
  unsigned int lines,
  int fifo_enable, int field_type)
@@ -53,9 +53,8 @@ static __le32 *cx25821_update_riscprogram_ch2(struct 
cx25821_dev *dev,
*(rp++) = cpu_to_le32(RISC_RESYNC | sync_line);
 
if (USE_RISC_NOOP_VIDEO) {
-   for (i = 0; i < NUM_NO_OPS; i++) {
+   for (i = 0; i < NUM_NO_OPS; i++)
*(rp++) = cpu_to_le32(RISC_NOOP);
-   }
}
 
/* scan lines */
@@ -75,7 +74,7 @@ static __le32 *cx25821_update_riscprogram_ch2(struct 
cx25821_dev *dev,
 }
 
 static __le32 *cx25821_risc_field_upstream_ch2(struct cx25821_dev *dev,
-  __le32 * rp,
+  __le32 *rp,
   dma_addr_t databuf_phys_addr,
   unsigned int offset,
   u32 sync_line, unsigned int bpl,
@@ -88,14 +87,12 @@ static __le32 *cx25821_risc_field_upstream_ch2(struct 
cx25821_dev *dev,
int dist_betwn_starts = bpl * 2;
 
/* sync instruction */
-   if (sync_line != NO_SYNC_LINE) {
+   if (sync_line != NO_SYNC_LINE)
*(rp++) = cpu_to_le32(RISC_RESYNC | sync_line);
-   }
 
if (USE_RISC_NOOP_VIDEO) {
-   for (i = 0; i < NUM_NO_OPS; i++) {
+   for (i = 0; i < NUM_NO_OPS; i++)
*(rp++) = cpu_to_le32(RISC_NOOP);
-   }
}
 
/* scan lines */
@@ -133,7 +130,7 @@ int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev 
*dev,
 {
__le32 *rp;
int fifo_enable = 0;
-   int singlefield_lines = lines >> 1; /*get line count for single field */
+   int singlefield_lines = lines >> 1; /*get line count for single field */
int odd_num_lines = singlefield_lines;
int frame = 0;
int frame_size = 0;
@@ -218,15 +215,15 @@ void cx25821_stop_upstream_video_ch2(struct cx25821_dev 
*dev)
("cx25821: No video file is currently running so 
return!\n");
return;
}
-   /* Disable RISC interrupts */
+   /* Disable RISC interrupts */
tmp = cx_read(sram_ch->int_msk);
cx_write(sram_ch->int_msk, tmp & ~_intr_msk);
 
-   /* Turn OFF risc and fifo */
+   /* Turn OFF risc and fifo */
tmp = cx_read(sram_ch->dma_ctl);
cx_write(sram_ch->dma_ctl, tmp & ~(FLD_VID_FIFO_EN | FLD_VID_RISC_EN));
 
-   /* Clear data buffer memory */
+   /* Clear data buffer memory */
if (dev->_data_buf_virt_addr_ch2)
memset(dev->_data_buf_virt_addr_ch2, 0,
   dev->_data_buf_size_ch2);
@@ -250,9 +247,8 @@ void cx25821_stop_upstream_video_ch2(struct cx25821_dev 
*dev)
 
 void cx25821_free_mem_upstream_ch2(struct cx25821_dev *dev)
 {
-   if (dev->_is_running_ch2) {
+   if (dev->_is_running_ch2)
cx25821_stop_upstream_video_ch2(dev);
-   }
 
if (dev->_dma_virt_addr_ch2) {
pci_free_consistent(dev->pci, dev->_risc_size_ch2,
@@ -303,11 +299,10 @@ int cx25821_get_frame_ch2(struct cx25821_dev *dev, struct 
sram_channel *sram_ch)
file_offset = dev->_frame_count_ch2 * frame_size;
 
myfile = filp_open(dev->_filename_ch2, O_RDONLY | O_LARGEFILE, 0);
-
if (IS_ERR(myfile)) {
const int open_errno = -PTR_ERR(myfile);
-   printk("%s(): ERROR opening file(%s) with errno = %d! \n",
-  __func__, dev->_filename_ch2, open_errno);
+

[PATCH 08/13] Staging: cx25821: fix tabs and space coding style issue in cx25821-reg.h

2010-09-27 Thread Ruslan Pisarev
This is a patch to the cx25821-reg.h file that fixed up a macros errors found 
by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev 
---
 drivers/staging/cx25821/cx25821-reg.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-reg.h 
b/drivers/staging/cx25821/cx25821-reg.h
index cfe0f32..a3fc25a 100644
--- a/drivers/staging/cx25821/cx25821-reg.h
+++ b/drivers/staging/cx25821/cx25821-reg.h
@@ -163,8 +163,8 @@
 #define  FLD_VID_DST_RISC2 0x0010
 #define  FLD_VID_SRC_RISC1 0x0002
 #define  FLD_VID_DST_RISC1 0x0001
-#define  FLD_VID_SRC_ERRORSFLD_VID_SRC_OPC_ERR | FLD_VID_SRC_SYNC 
| FLD_VID_SRC_UF
-#define  FLD_VID_DST_ERRORSFLD_VID_DST_OPC_ERR | FLD_VID_DST_SYNC 
| FLD_VID_DST_OF
+#define  FLD_VID_SRC_ERRORS(FLD_VID_SRC_OPC_ERR | FLD_VID_SRC_SYNC 
| FLD_VID_SRC_UF)
+#define  FLD_VID_DST_ERRORS(FLD_VID_DST_OPC_ERR | FLD_VID_DST_SYNC 
| FLD_VID_DST_OF)
 
 /* 
* */
 #define  AUD_A_INT_MSK 0x0400C0/* Audio Int interrupt mask */
-- 
1.7.0.4

--
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/13] Staging: cx25821: fix tabs and space coding style issue in cx25821-medusa-reg.h

2010-09-27 Thread Ruslan Pisarev
 This is a patch to the cx25821-medusa-reg.h file that fixed up a tabs
 and space warnings found by the checkpatch.pl tools.

 Signed-off-by: Ruslan Pisarev 
---
 drivers/staging/cx25821/cx25821-medusa-reg.h |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-medusa-reg.h 
b/drivers/staging/cx25821/cx25821-medusa-reg.h
index f7f33b3..1c1c228 100644
--- a/drivers/staging/cx25821/cx25821-medusa-reg.h
+++ b/drivers/staging/cx25821/cx25821-medusa-reg.h
@@ -443,13 +443,13 @@
 /*/
 /* LUMA_CTRL register fields */
 #define VDEC_A_BRITE_CTRL  0x1014
-#define VDEC_A_CNTRST_CTRL 0x1015
-#define VDEC_A_PEAK_SEL0x1016
+#define VDEC_A_CNTRST_CTRL 0x1015
+#define VDEC_A_PEAK_SEL0x1016
 
 /*/
 /* CHROMA_CTRL register fields */
-#define VDEC_A_USAT_CTRL   0x1018
-#define VDEC_A_VSAT_CTRL   0x1019
-#define VDEC_A_HUE_CTRL0x101A
+#define VDEC_A_USAT_CTRL   0x1018
+#define VDEC_A_VSAT_CTRL   0x1019
+#define VDEC_A_HUE_CTRL0x101A
 
 #endif
-- 
1.7.0.4

--
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 07/13] Staging: cx25821: fix tabs and space coding style issue in cx25821-medusa-video.c

2010-09-27 Thread Ruslan Pisarev
This is a patch to the cx25821-medusa-video.c file that fixed up a tabs
and space warnings found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev 
---
 drivers/staging/cx25821/cx25821-medusa-video.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-medusa-video.c 
b/drivers/staging/cx25821/cx25821-medusa-video.c
index ef9f2b8..1e11e0c 100644
--- a/drivers/staging/cx25821/cx25821-medusa-video.c
+++ b/drivers/staging/cx25821/cx25821-medusa-video.c
@@ -778,9 +778,9 @@ int medusa_set_saturation(struct cx25821_dev *dev, int 
saturation, int decoder)
 
 int medusa_video_init(struct cx25821_dev *dev)
 {
-   u32 value = 0, tmp = 0;
-   int ret_val = 0;
-   int i = 0;
+   u32 value = 0, tmp = 0;
+   int ret_val = 0;
+   int i = 0;
 
mutex_lock(&dev->lock);
 
@@ -829,7 +829,7 @@ int medusa_video_init(struct cx25821_dev *dev)
/* select AFE clock to output mode */
value = cx25821_i2c_read(&dev->i2c_bus[0], AFE_AB_DIAG_CTRL, &tmp);
value &= 0x83FF;
-   ret_val =
+   ret_val =
   cx25821_i2c_write(&dev->i2c_bus[0], AFE_AB_DIAG_CTRL,
 value | 0x1000);
 
-- 
1.7.0.4

--
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 04/13] Staging: cx25821: fix tabs and space coding style issue in cx25821-core.c

2010-09-27 Thread Ruslan Pisarev
This is a patch to the cx25821-core.c file that fixed up a tabs
and space Errors and warnings found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev 
---
 drivers/staging/cx25821/cx25821-core.c |   62 
 1 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-core.c 
b/drivers/staging/cx25821/cx25821-core.c
index c487c19..e793b21 100644
--- a/drivers/staging/cx25821/cx25821-core.c
+++ b/drivers/staging/cx25821/cx25821-core.c
@@ -42,7 +42,7 @@ static unsigned int card[] = {[0 ... (CX25821_MAXBOARDS - 1)] 
= UNSET };
 module_param_array(card, int, NULL, 0444);
 MODULE_PARM_DESC(card, "card type");
 
-static unsigned int cx25821_devcount = 0;
+static unsigned int cx25821_devcount;
 
 static DEFINE_MUTEX(devlist);
 LIST_HEAD(cx25821_devlist);
@@ -781,14 +781,14 @@ static void cx25821_shutdown(struct cx25821_dev *dev)
 
/* Disable Video A/B activity */
for (i = 0; i < VID_CHANNEL_NUM; i++) {
-  cx_write(dev->channels[i].sram_channels->dma_ctl, 0);
-  cx_write(dev->channels[i].sram_channels->int_msk, 0);
+   cx_write(dev->channels[i].sram_channels->dma_ctl, 0);
+   cx_write(dev->channels[i].sram_channels->int_msk, 0);
}
 
-   for (i = VID_UPSTREAM_SRAM_CHANNEL_I; i <= VID_UPSTREAM_SRAM_CHANNEL_J;
-i++) {
-  cx_write(dev->channels[i].sram_channels->dma_ctl, 0);
-  cx_write(dev->channels[i].sram_channels->int_msk, 0);
+   for (i = VID_UPSTREAM_SRAM_CHANNEL_I;
+   i <= VID_UPSTREAM_SRAM_CHANNEL_J; i++) {
+   cx_write(dev->channels[i].sram_channels->dma_ctl, 0);
+   cx_write(dev->channels[i].sram_channels->int_msk, 0);
}
 
/* Disable Audio activity */
@@ -806,9 +806,9 @@ void cx25821_set_pixel_format(struct cx25821_dev *dev, int 
channel_select,
  u32 format)
 {
if (channel_select <= 7 && channel_select >= 0) {
-  cx_write(dev->channels[channel_select].
-  sram_channels->pix_frmt, format);
-  dev->channels[channel_select].pixel_formats = format;
+   cx_write(dev->channels[channel_select].
+   sram_channels->pix_frmt, format);
+   dev->channels[channel_select].pixel_formats = format;
}
 }
 
@@ -829,7 +829,7 @@ static void cx25821_initialize(struct cx25821_dev *dev)
cx_write(PCI_INT_STAT, 0x);
 
for (i = 0; i < VID_CHANNEL_NUM; i++)
-  cx_write(dev->channels[i].sram_channels->int_stat, 0x);
+   cx_write(dev->channels[i].sram_channels->int_stat, 0x);
 
cx_write(AUD_A_INT_STAT, 0x);
cx_write(AUD_B_INT_STAT, 0x);
@@ -843,22 +843,22 @@ static void cx25821_initialize(struct cx25821_dev *dev)
mdelay(100);
 
for (i = 0; i < VID_CHANNEL_NUM; i++) {
-  cx25821_set_vip_mode(dev, dev->channels[i].sram_channels);
-  cx25821_sram_channel_setup(dev, dev->channels[i].sram_channels,
-  1440, 0);
-  dev->channels[i].pixel_formats = PIXEL_FRMT_422;
-  dev->channels[i].use_cif_resolution = FALSE;
+   cx25821_set_vip_mode(dev, dev->channels[i].sram_channels);
+   cx25821_sram_channel_setup(dev, dev->channels[i].sram_channels,
+   1440, 0);
+   dev->channels[i].pixel_formats = PIXEL_FRMT_422;
+   dev->channels[i].use_cif_resolution = FALSE;
}
 
/* Probably only affect Downstream */
-   for (i = VID_UPSTREAM_SRAM_CHANNEL_I; i <= VID_UPSTREAM_SRAM_CHANNEL_J;
-i++) {
-  cx25821_set_vip_mode(dev, dev->channels[i].sram_channels);
+   for (i = VID_UPSTREAM_SRAM_CHANNEL_I;
+   i <= VID_UPSTREAM_SRAM_CHANNEL_J; i++) {
+   cx25821_set_vip_mode(dev, dev->channels[i].sram_channels);
}
 
-   cx25821_sram_channel_setup_audio(dev,
-  dev->channels[SRAM_CH08].sram_channels,
-  128, 0);
+   cx25821_sram_channel_setup_audio(dev,
+   dev->channels[SRAM_CH08].sram_channels,
+   128, 0);
 
cx25821_gpio_init(dev);
 }
@@ -931,8 +931,8 @@ static int cx25821_dev_setup(struct cx25821_dev *dev)
 
/* Apply a sensible clock frequency for the PCIe bridge */
dev->clk_freq = 2800;
-   for (i = 0; i < MAX_VID_CHANNEL_NUM; i++)
-  dev->channels[i].sram_channels = &cx25821_sram_channels[i];
+   for (i = 0; i < MAX_VID_CHANNEL_NUM; i++)
+   dev->channels[i].sram_channels = &cx25821_sram_channels[i];
 
if (dev->nr > 1)
CX25821_INFO("dev->nr > 1!");
@@ -1003,11 +1003,11 @@ static int cx25821_dev_setup(struct cx25821_dev *de

[PATCH 05/13] Staging: cx25821: fix space coding style issue in cx25821-i2c.c

2010-09-27 Thread Ruslan Pisarev
This is a patch to the cx25821-i2c.c file that fixed up a space warning found 
by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev 
---
 drivers/staging/cx25821/cx25821-i2c.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-i2c.c 
b/drivers/staging/cx25821/cx25821-i2c.c
index e43572e..2b14bcc 100644
--- a/drivers/staging/cx25821/cx25821-i2c.c
+++ b/drivers/staging/cx25821/cx25821-i2c.c
@@ -283,7 +283,7 @@ static struct i2c_algorithm cx25821_i2c_algo_template = {
.master_xfer = i2c_xfer,
.functionality = cx25821_functionality,
 #ifdef NEED_ALGO_CONTROL
-   .algo_control = dummy_algo_control,
+   .algo_control = dummy_algo_control,
 #endif
 };
 
-- 
1.7.0.4

--
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 03/13] Staging: cx25821: fix comments and space coding style issue in cx25821-audio.h

2010-09-27 Thread Ruslan Pisarev
This is a patch to the cx25821-audio.h file that fixed up a comments
and space Errors found by the checkpatch.pl tools.

Signed-off-by: Ruslan Pisarev 
---
 drivers/staging/cx25821/cx25821-audio.h |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-audio.h 
b/drivers/staging/cx25821/cx25821-audio.h
index 434b2a3..a702a0d 100644
--- a/drivers/staging/cx25821/cx25821-audio.h
+++ b/drivers/staging/cx25821/cx25821-audio.h
@@ -31,18 +31,18 @@
 #define NUMBER_OF_PROGRAMS  8
 
 /*
-  Max size of the RISC program for a buffer. - worst case is 2 writes per line
-  Space is also added for the 4 no-op instructions added on the end.
-*/
+ * Max size of the RISC program for a buffer. - worst case is 2 writes per line
+ * Space is also added for the 4 no-op instructions added on the end.
+ */
 #ifndef USE_RISC_NOOP
 #define MAX_BUFFER_PROGRAM_SIZE \
-(2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + 
RISC_WRITECR_INSTRUCTION_SIZE*4)
+   (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + 
RISC_WRITECR_INSTRUCTION_SIZE*4)
 #endif
 
 /* MAE 12 July 2005 Try to use NOOP RISC instruction instead */
 #ifdef USE_RISC_NOOP
 #define MAX_BUFFER_PROGRAM_SIZE \
-(2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + 
RISC_NOOP_INSTRUCTION_SIZE*4)
+   (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + 
RISC_NOOP_INSTRUCTION_SIZE*4)
 #endif
 
 /* Sizes of various instructions in bytes.  Used when adding instructions. */
-- 
1.7.0.4

--
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/13] Staging: cx25821: fix braces and space coding style issue in cx25821-audio-upstream.c This is a patch to the cx25821-audio-upstream.c file that fixed up a brace and space Errors found by

2010-09-27 Thread Ruslan Pisarev
Signed-off-by: Ruslan Pisarev 
---
 drivers/staging/cx25821/cx25821-audio-upstream.c |   13 ++---
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-audio-upstream.c 
b/drivers/staging/cx25821/cx25821-audio-upstream.c
index cdff49f..6f32006 100644
--- a/drivers/staging/cx25821/cx25821-audio-upstream.c
+++ b/drivers/staging/cx25821/cx25821-audio-upstream.c
@@ -40,8 +40,8 @@ MODULE_AUTHOR("Hiep Huynh ");
 MODULE_LICENSE("GPL");
 
 static int _intr_msk =
-FLD_AUD_SRC_RISCI1 | FLD_AUD_SRC_OF | FLD_AUD_SRC_SYNC |
-FLD_AUD_SRC_OPC_ERR;
+   FLD_AUD_SRC_RISCI1 | FLD_AUD_SRC_OF | FLD_AUD_SRC_SYNC |
+   FLD_AUD_SRC_OPC_ERR;
 
 int cx25821_sram_channel_setup_upstream_audio(struct cx25821_dev *dev,
  struct sram_channel *ch,
@@ -506,7 +506,7 @@ int cx25821_audio_upstream_irq(struct cx25821_dev *dev, int 
chan_num,
 {
int i = 0;
u32 int_msk_tmp;
-   struct sram_channel *channel = dev->channels[chan_num].sram_channels;
+   struct sram_channel *channel = dev->channels[chan_num].sram_channels;
dma_addr_t risc_phys_jump_addr;
__le32 *rp;
 
@@ -608,7 +608,7 @@ static irqreturn_t cx25821_upstream_irq_audio(int irq, void 
*dev_id)
if (!dev)
return -1;
 
-   sram_ch = dev->channels[dev->_audio_upstream_channel_select].
+   sram_ch = dev->channels[dev->_audio_upstream_channel_select].
   sram_channels;
 
msk_stat = cx_read(sram_ch->int_mstat);
@@ -733,7 +733,7 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, 
int channel_select)
}
 
dev->_audio_upstream_channel_select = channel_select;
-   sram_ch = dev->channels[channel_select].sram_channels;
+   sram_ch = dev->channels[channel_select].sram_channels;
 
/* Work queue */
INIT_WORK(&dev->_audio_work_entry, cx25821_audioups_handler);
@@ -764,9 +764,8 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, 
int channel_select)
   str_length + 1);
 
/* Default if filename is empty string */
-   if (strcmp(dev->input_audiofilename, "") == 0) {
+   if (strcmp(dev->input_audiofilename, "") == 0)
dev->_audiofilename = "/root/audioGOOD.wav";
-   }
} else {
str_length = strlen(_defaultAudioName);
dev->_audiofilename = kmalloc(str_length + 1, GFP_KERNEL);
-- 
1.7.0.4

--
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 01/13] Staging: cx25821: fox "ERROR: space prohibited after that open parenthesis '('" This is a patch to the cx25821-audio-upstream.h file that fixed up a space Errors found by the checkpatch.

2010-09-27 Thread ruslanpisarev
From: Ruslan Pisarev 

---
 drivers/staging/cx25821/cx25821-audio-upstream.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/cx25821/cx25821-audio-upstream.h 
b/drivers/staging/cx25821/cx25821-audio-upstream.h
index ca987ad..668a4f1 100644
--- a/drivers/staging/cx25821/cx25821-audio-upstream.h
+++ b/drivers/staging/cx25821/cx25821-audio-upstream.h
@@ -46,11 +46,11 @@
 #define USE_RISC_NOOP_AUDIO   1
 
 #ifdef USE_RISC_NOOP_AUDIO
-#define AUDIO_RISC_DMA_BUF_SIZE( 
LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + 
RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE + 
RISC_JUMP_INSTRUCTION_SIZE)
+#define AUDIO_RISC_DMA_BUF_SIZE
(LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + 
RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE + 
RISC_JUMP_INSTRUCTION_SIZE)
 #endif
 
 #ifndef USE_RISC_NOOP_AUDIO
-#define AUDIO_RISC_DMA_BUF_SIZE( 
LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + 
RISC_WRITECR_INSTRUCTION_SIZE + RISC_JUMP_INSTRUCTION_SIZE)
+#define AUDIO_RISC_DMA_BUF_SIZE
(LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + 
RISC_WRITECR_INSTRUCTION_SIZE + RISC_JUMP_INSTRUCTION_SIZE)
 #endif
 
 static int _line_size;
-- 
1.7.0.4

--
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: [PATCH v2] tm6000+audio

2010-09-27 Thread Mauro Carvalho Chehab
Em 27-09-2010 14:49, Dmitri Belimov escreveu:
> Hi
> 
>> Em 23-09-2010 13:45, Dmitri Belimov escreveu:
>>> Hi
>>>
 Em 20-09-2010 17:07, Dmitri Belimov escreveu:
> Hi 
>
> I rework my last patch for audio and now audio works well. This
> patch can be submited to GIT tree Quality of audio now is good for
> SECAM-DK. For other standard I set some value from datasheet need
> some tests.
>
> 1. Fix pcm buffer overflow
> 2. Rework pcm buffer fill method
> 3. Swap bytes in audio stream
> 4. Change some registers value for TM6010
> 5. Change pcm buffer size
> --- a/drivers/staging/tm6000/tm6000-stds.c
> +++ b/drivers/staging/tm6000/tm6000-stds.c
> @@ -96,6 +96,7 @@ static struct tm6000_std_tv_settings tv_stds[]
> = { 
>   {TM6010_REQ07_R04_LUMA_HAGC_CONTROL,
> 0xdc}, {TM6010_REQ07_R0D_CHROMA_KILL_LEVEL, 0x07},
> + {TM6010_REQ08_R05_A_STANDARD_MOD,
> 0x21}, /* FIXME */

 This didn't seem to work for PAL-M. Probably, the right value for
 it is 0x22, to follow NTSC/M, since both uses the same audio
 standard.

 On some tests, I was able to receive some audio there, at the
 proper rate, with a tm6010-based device. It died when I tried to
 change the channel, so I didn't rear yet the real audio, but I
 suspect it will work on my next tests.

 Yet, is being hard to test, as the driver has a some spinlock logic
 broken. I'm enclosing the logs.
>>>
>>> Yes. I have some as crash from mplayer and arecord.
>>>
 I was able to test only when using a monitor on the same machine.
 All trials of using vnc and X11 export ended by not receiving any
 audio and hanging the machine.

 I suspect that we need to fix the spinlock issue, in order to
 better test it.
>>>
>>> Who can fix it?
>>
>> Well, any of us ;)
>>
>> I did a BKL lock fix series of patches, and hverkuil is improving
>> them. They'll make easier to avoid problems inside tm6000. We just
>> need to make sure that we'll hold/release the proper locks at
>> tm6000-alsa, after applying it at the mainstream.
> 
> I found that mplayer crashed when call usb_control_msg and kfree functions.

Yeah, you can't call usb_control_msg at trigger callback. Some of those 
callbacks
seem to happen at IRQ time. With respect to kfree, that's weird.

The same troubles with alsa is also happening, at some extent, with em28xx and 
cx231xx.

I did a patch yesterday for cx231xx-audio to avoid using usb_control_msg (see 
enclosed).
This seems to solve part of the bugs, but I still got an OOPS when s_frequency 
call
happens while alsa is starting. So, I suspect that this patch, plus the ioctl 
locking
at the video part may solve the issue, but more tests are required.

Cheers,
Mauro.

commit 6ddc490d1b8ff01ddc1db8fc0a440d534fa13176
Author: Mauro Carvalho Chehab 
Date:   Mon Sep 27 03:07:22 2010 -0300

V4L/DVB: cx231xx-audio: fix some locking issues

Signed-off-by: Mauro Carvalho Chehab 

diff --git a/drivers/media/video/cx231xx/cx231xx-audio.c 
b/drivers/media/video/cx231xx/cx231xx-audio.c
index 6ac418c..30d13c1 100644
--- a/drivers/media/video/cx231xx/cx231xx-audio.c
+++ b/drivers/media/video/cx231xx/cx231xx-audio.c
@@ -124,6 +124,9 @@ static void cx231xx_audio_isocirq(struct urb *urb)
break;
}
 
+   if (atomic_read(&dev->stream_started) == 0)
+   return;
+
if (dev->adev.capture_pcm_substream) {
substream = dev->adev.capture_pcm_substream;
runtime = substream->runtime;
@@ -206,6 +209,9 @@ static void cx231xx_audio_bulkirq(struct urb *urb)
break;
}
 
+   if (atomic_read(&dev->stream_started) == 0)
+   return;
+
if (dev->adev.capture_pcm_substream) {
substream = dev->adev.capture_pcm_substream;
runtime = substream->runtime;
@@ -370,35 +376,6 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev)
return errCode;
 }
 
-
-static int cx231xx_cmd(struct cx231xx *dev, int cmd, int arg)
-{
-   dprintk("%s transfer\n", (dev->adev.capture_stream == STREAM_ON) ?
-   "stop" : "start");
-
-   switch (cmd) {
-   case CX231XX_CAPTURE_STREAM_EN:
-   if (dev->adev.capture_stream == STREAM_OFF && arg == 1) {
-   dev->adev.capture_stream = STREAM_ON;
-   if (is_fw_load(dev) == 0)
-   cx25840_call(dev, core, load_fw);
-   if (dev->USE_ISO)
-   cx231xx_init_audio_isoc(dev);
-   else
-   cx231xx_init_audio_bulk(dev);
-   } else if (dev->adev.capture_stream == STREAM_ON && arg == 0) {
-   dev->adev.capture_stream = STREAM_OFF;
-   cx231xx_isoc_audio_deinit(dev);
-   } else {
-  

[RFC/PATCH 6/6] OMAP3 ISP driver

2010-09-27 Thread Laurent Pinchart
Patch 6/6 seems to be too big for vger, even in compressed form. You can find 
it at 
http://git.linuxtv.org/pinchartl/media.git?a=shortlog;h=refs/heads/media-0004-
omap3isp

Sorry for the inconvenience.

-- 
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


[RFC/PATCH 2/6] V4L/DVB: v4l: Use v4l2_get_subdevdata instead of accessing v4l2_subdev::priv

2010-09-27 Thread Laurent Pinchart
Replace direct access to the v4l2_subdev priv field with the inline
v4l2_get_subdevdata method.

Signed-off-by: Laurent Pinchart 
Acked-by: Hans Verkuil 
Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/video/mt9m001.c|   26 +-
 drivers/media/video/mt9m111.c|   20 ++--
 drivers/media/video/mt9t031.c|   24 
 drivers/media/video/mt9t112.c|   14 +++---
 drivers/media/video/mt9v022.c|   26 +-
 drivers/media/video/ov772x.c |   18 +-
 drivers/media/video/ov9640.c |   12 ++--
 drivers/media/video/rj54n1cb0c.c |   26 +-
 drivers/media/video/soc_camera.c |2 +-
 drivers/media/video/tw9910.c |   20 ++--
 10 files changed, 94 insertions(+), 94 deletions(-)

diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c
index 79f096d..fcb4cd9 100644
--- a/drivers/media/video/mt9m001.c
+++ b/drivers/media/video/mt9m001.c
@@ -157,7 +157,7 @@ static int mt9m001_init(struct i2c_client *client)
 
 static int mt9m001_s_stream(struct v4l2_subdev *sd, int enable)
 {
-   struct i2c_client *client = sd->priv;
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
 
/* Switch to master "normal" mode or stop sensor readout */
if (reg_write(client, MT9M001_OUTPUT_CONTROL, enable ? 2 : 0) < 0)
@@ -206,7 +206,7 @@ static unsigned long mt9m001_query_bus_param(struct 
soc_camera_device *icd)
 
 static int mt9m001_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
 {
-   struct i2c_client *client = sd->priv;
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
struct mt9m001 *mt9m001 = to_mt9m001(client);
struct v4l2_rect rect = a->c;
struct soc_camera_device *icd = client->dev.platform_data;
@@ -271,7 +271,7 @@ static int mt9m001_s_crop(struct v4l2_subdev *sd, struct 
v4l2_crop *a)
 
 static int mt9m001_g_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
 {
-   struct i2c_client *client = sd->priv;
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
struct mt9m001 *mt9m001 = to_mt9m001(client);
 
a->c= mt9m001->rect;
@@ -297,7 +297,7 @@ static int mt9m001_cropcap(struct v4l2_subdev *sd, struct 
v4l2_cropcap *a)
 static int mt9m001_g_fmt(struct v4l2_subdev *sd,
 struct v4l2_mbus_framefmt *mf)
 {
-   struct i2c_client *client = sd->priv;
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
struct mt9m001 *mt9m001 = to_mt9m001(client);
 
mf->width   = mt9m001->rect.width;
@@ -312,7 +312,7 @@ static int mt9m001_g_fmt(struct v4l2_subdev *sd,
 static int mt9m001_s_fmt(struct v4l2_subdev *sd,
 struct v4l2_mbus_framefmt *mf)
 {
-   struct i2c_client *client = sd->priv;
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
struct mt9m001 *mt9m001 = to_mt9m001(client);
struct v4l2_crop a = {
.c = {
@@ -340,7 +340,7 @@ static int mt9m001_s_fmt(struct v4l2_subdev *sd,
 static int mt9m001_try_fmt(struct v4l2_subdev *sd,
   struct v4l2_mbus_framefmt *mf)
 {
-   struct i2c_client *client = sd->priv;
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
struct mt9m001 *mt9m001 = to_mt9m001(client);
const struct mt9m001_datafmt *fmt;
 
@@ -367,7 +367,7 @@ static int mt9m001_try_fmt(struct v4l2_subdev *sd,
 static int mt9m001_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *id)
 {
-   struct i2c_client *client = sd->priv;
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
struct mt9m001 *mt9m001 = to_mt9m001(client);
 
if (id->match.type != V4L2_CHIP_MATCH_I2C_ADDR)
@@ -386,7 +386,7 @@ static int mt9m001_g_chip_ident(struct v4l2_subdev *sd,
 static int mt9m001_g_register(struct v4l2_subdev *sd,
  struct v4l2_dbg_register *reg)
 {
-   struct i2c_client *client = sd->priv;
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
 
if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
return -EINVAL;
@@ -406,7 +406,7 @@ static int mt9m001_g_register(struct v4l2_subdev *sd,
 static int mt9m001_s_register(struct v4l2_subdev *sd,
  struct v4l2_dbg_register *reg)
 {
-   struct i2c_client *client = sd->priv;
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
 
if (reg->match.type != V4L2_CHIP_MATCH_I2C_ADDR || reg->reg > 0xff)
return -EINVAL;
@@ -468,7 +468,7 @@ static struct soc_camera_ops mt9m001_ops = {
 
 static int mt9m001_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
 {
-   struct i2c_client *client = sd->priv;
+   struct i2c_client *client = v4l2_get_subdevdata(sd);
struct mt9m001 *mt9m001 = to_mt9m001(client);
int data;
 
@@ -4

[RFC/PATCH 4/6] ARM: OMAP3: Update Camera ISP definitions for OMAP3630

2010-09-27 Thread Laurent Pinchart
From: Tuukka Toivonen 

Add new/changed base address definitions and resources for
OMAP3630 ISP.

The OMAP3430 CSI2PHY block is same as the OMAP3630 CSIPHY2
block. But the later name is chosen as it gives more symmetry
to the names.

Signed-off-by: Tuukka Toivonen 
Signed-off-by: Vimarsh Zutshi 
---
 arch/arm/mach-omap2/devices.c  |   28 
 arch/arm/plat-omap/include/plat/omap34xx.h |   16 
 2 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 2dbb265..ade8db0 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -106,13 +106,33 @@ static struct resource omap3isp_resources[] = {
.flags  = IORESOURCE_MEM,
},
{
-   .start  = OMAP3430_ISP_CSI2A_BASE,
-   .end= OMAP3430_ISP_CSI2A_END,
+   .start  = OMAP3430_ISP_CSI2A_REGS1_BASE,
+   .end= OMAP3430_ISP_CSI2A_REGS1_END,
.flags  = IORESOURCE_MEM,
},
{
-   .start  = OMAP3430_ISP_CSI2PHY_BASE,
-   .end= OMAP3430_ISP_CSI2PHY_END,
+   .start  = OMAP3430_ISP_CSIPHY2_BASE,
+   .end= OMAP3430_ISP_CSIPHY2_END,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = OMAP3630_ISP_CSI2A_REGS2_BASE,
+   .end= OMAP3630_ISP_CSI2A_REGS2_END,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = OMAP3630_ISP_CSI2C_REGS1_BASE,
+   .end= OMAP3630_ISP_CSI2C_REGS1_END,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = OMAP3630_ISP_CSIPHY1_BASE,
+   .end= OMAP3630_ISP_CSIPHY1_END,
+   .flags  = IORESOURCE_MEM,
+   },
+   {
+   .start  = OMAP3630_ISP_CSI2C_REGS2_BASE,
+   .end= OMAP3630_ISP_CSI2C_REGS2_END,
.flags  = IORESOURCE_MEM,
},
{
diff --git a/arch/arm/plat-omap/include/plat/omap34xx.h 
b/arch/arm/plat-omap/include/plat/omap34xx.h
index 98fc8b4..b9e8588 100644
--- a/arch/arm/plat-omap/include/plat/omap34xx.h
+++ b/arch/arm/plat-omap/include/plat/omap34xx.h
@@ -56,8 +56,12 @@
 #define OMAP3430_ISP_RESZ_BASE (OMAP3430_ISP_BASE + 0x1000)
 #define OMAP3430_ISP_SBL_BASE  (OMAP3430_ISP_BASE + 0x1200)
 #define OMAP3430_ISP_MMU_BASE  (OMAP3430_ISP_BASE + 0x1400)
-#define OMAP3430_ISP_CSI2A_BASE(OMAP3430_ISP_BASE + 0x1800)
-#define OMAP3430_ISP_CSI2PHY_BASE  (OMAP3430_ISP_BASE + 0x1970)
+#define OMAP3430_ISP_CSI2A_REGS1_BASE  (OMAP3430_ISP_BASE + 0x1800)
+#define OMAP3430_ISP_CSIPHY2_BASE  (OMAP3430_ISP_BASE + 0x1970)
+#define OMAP3630_ISP_CSI2A_REGS2_BASE  (OMAP3430_ISP_BASE + 0x19C0)
+#define OMAP3630_ISP_CSI2C_REGS1_BASE  (OMAP3430_ISP_BASE + 0x1C00)
+#define OMAP3630_ISP_CSIPHY1_BASE  (OMAP3430_ISP_BASE + 0x1D70)
+#define OMAP3630_ISP_CSI2C_REGS2_BASE  (OMAP3430_ISP_BASE + 0x1DC0)
 
 #define OMAP3430_ISP_END   (OMAP3430_ISP_BASE + 0x06F)
 #define OMAP3430_ISP_CBUFF_END (OMAP3430_ISP_CBUFF_BASE   + 0x077)
@@ -69,8 +73,12 @@
 #define OMAP3430_ISP_RESZ_END  (OMAP3430_ISP_RESZ_BASE+ 0x0AB)
 #define OMAP3430_ISP_SBL_END   (OMAP3430_ISP_SBL_BASE + 0x0FB)
 #define OMAP3430_ISP_MMU_END   (OMAP3430_ISP_MMU_BASE + 0x06F)
-#define OMAP3430_ISP_CSI2A_END (OMAP3430_ISP_CSI2A_BASE   + 0x16F)
-#define OMAP3430_ISP_CSI2PHY_END   (OMAP3430_ISP_CSI2PHY_BASE + 0x007)
+#define OMAP3430_ISP_CSI2A_REGS1_END   (OMAP3430_ISP_CSI2A_REGS1_BASE + 0x16F)
+#define OMAP3430_ISP_CSIPHY2_END   (OMAP3430_ISP_CSIPHY2_BASE + 0x00B)
+#define OMAP3630_ISP_CSI2A_REGS2_END   (OMAP3630_ISP_CSI2A_REGS2_BASE + 0x3F)
+#define OMAP3630_ISP_CSI2C_REGS1_END   (OMAP3630_ISP_CSI2C_REGS1_BASE + 0x16F)
+#define OMAP3630_ISP_CSIPHY1_END   (OMAP3630_ISP_CSIPHY1_BASE + 0x00B)
+#define OMAP3630_ISP_CSI2C_REGS2_END   (OMAP3630_ISP_CSI2C_REGS2_BASE + 0x3F)
 
 #define OMAP34XX_HSUSB_OTG_BASE(L4_34XX_BASE + 0xAB000)
 #define OMAP34XX_USBTLL_BASE   (L4_34XX_BASE + 0x62000)
-- 
1.7.2.2

--
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


[RFC/PATCH 5/6] omap3: Export omap3isp platform device structure

2010-09-27 Thread Laurent Pinchart
From: Stanimir Varbanov 

The omap3isp platform device requires platform data. As the data can be
provided by a kernel module, the device can't be registered during arch
initialization.

Remove the omap3isp platform device registration from
omap_init_camera(), and export the platform device structure to let
board code register/unregister it.

Signed-off-by: Stanimir Varbanov 
Signed-off-by: Laurent Pinchart 
---
 arch/arm/mach-omap2/devices.c |   18 --
 arch/arm/mach-omap2/devices.h |   17 +
 2 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/devices.h

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index ade8db0..f9bc507 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -31,6 +31,8 @@
 
 #include "mux.h"
 
+#include "devices.h"
+
 #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
 
 static struct resource cam_resources[] = {
@@ -141,16 +143,28 @@ static struct resource omap3isp_resources[] = {
}
 };
 
-static struct platform_device omap3isp_device = {
+static void omap3isp_release(struct device *dev)
+{
+   /* Zero the device structure to avoid re-initialization complaints from
+* kobject when the device will be re-registered.
+*/
+   memset(dev, 0, sizeof(*dev));
+   dev->release = omap3isp_release;
+}
+
+struct platform_device omap3isp_device = {
.name   = "omap3isp",
.id = -1,
.num_resources  = ARRAY_SIZE(omap3isp_resources),
.resource   = omap3isp_resources,
+   .dev = {
+   .release= omap3isp_release,
+   },
 };
+EXPORT_SYMBOL_GPL(omap3isp_device);
 
 static inline void omap_init_camera(void)
 {
-   platform_device_register(&omap3isp_device);
 }
 #else
 static inline void omap_init_camera(void)
diff --git a/arch/arm/mach-omap2/devices.h b/arch/arm/mach-omap2/devices.h
new file mode 100644
index 000..f312d49
--- /dev/null
+++ b/arch/arm/mach-omap2/devices.h
@@ -0,0 +1,17 @@
+/*
+ * arch/arm/mach-omap2/devices.h
+ *
+ * OMAP2 platform device setup/initialization
+ *
+ * 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.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP_DEVICES_H
+#define __ARCH_ARM_MACH_OMAP_DEVICES_H
+
+extern struct platform_device omap3isp_device;
+
+#endif
-- 
1.7.2.2

--
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


[RFC/PATCH 0/6] OMAP3 ISP driver

2010-09-27 Thread Laurent Pinchart
Hi everybody,

Here's the OMAP3 ISP driver, updated to 2.6.36-rc5 and the latest changes in
the media controller and sub-device APIs.

The V4L/DVB patches come from the upstream staging/v2.6.37 branch and won't be
needed anymore when the driver will be rebased on top of 2.6.36.

No more needs to be said. The driver is obviously not perfect, but I believe
it's in a pretty good shape, good enough to submit it for its first public
review. If nothing else these patches will at least serve as sample code for
the media controller and the subdev pad-level operations APIs.

Laurent Pinchart (4):
  v4l: subdev: Generic ioctl support
  V4L/DVB: v4l: Use v4l2_get_subdevdata instead of accessing
v4l2_subdev::priv
  V4L/DVB: v4l: Add a v4l2_subdev host private data field
  OMAP3 ISP driver

Stanimir Varbanov (1):
  omap3: Export omap3isp platform device structure

Tuukka Toivonen (1):
  ARM: OMAP3: Update Camera ISP definitions for OMAP3630

 Documentation/video4linux/v4l2-framework.txt |   10 +
 arch/arm/mach-omap2/devices.c|   46 +-
 arch/arm/mach-omap2/devices.h|   17 +
 arch/arm/plat-omap/include/mach/isp_user.h   |  644 
 arch/arm/plat-omap/include/plat/omap34xx.h   |   16 +-
 drivers/media/video/Kconfig  |   15 +
 drivers/media/video/Makefile |2 +
 drivers/media/video/isp/Makefile |   13 +
 drivers/media/video/isp/bluegamma_table.h| 1050 
 drivers/media/video/isp/cfa_coef_table.h |  601 +++
 drivers/media/video/isp/greengamma_table.h   | 1050 
 drivers/media/video/isp/isp.c| 1867 +
 drivers/media/video/isp/isp.h|  399 +
 drivers/media/video/isp/ispccdc.c| 2295 +
 drivers/media/video/isp/ispccdc.h|  194 +++
 drivers/media/video/isp/ispccp2.c| 1122 +
 drivers/media/video/isp/ispccp2.h|   97 ++
 drivers/media/video/isp/ispcsi2.c| 1220 ++
 drivers/media/video/isp/ispcsi2.h|  162 ++
 drivers/media/video/isp/ispcsiphy.c  |  246 +++
 drivers/media/video/isp/ispcsiphy.h  |   77 +
 drivers/media/video/isp/isph3a.h |  116 ++
 drivers/media/video/isp/isph3a_aewb.c|  354 
 drivers/media/video/isp/isph3a_af.c  |  401 +
 drivers/media/video/isp/isphist.c|  509 ++
 drivers/media/video/isp/isphist.h|   39 +
 drivers/media/video/isp/isppreview.c | 2297 ++
 drivers/media/video/isp/isppreview.h |  262 +++
 drivers/media/video/isp/ispqueue.c   | 1103 
 drivers/media/video/isp/ispqueue.h   |  183 ++
 drivers/media/video/isp/ispreg.h | 1652 ++
 drivers/media/video/isp/ispresizer.c | 1734 +++
 drivers/media/video/isp/ispresizer.h |  142 ++
 drivers/media/video/isp/ispstat.c| 1039 
 drivers/media/video/isp/ispstat.h|  165 ++
 drivers/media/video/isp/ispvideo.c   | 1158 +
 drivers/media/video/isp/ispvideo.h   |  168 ++
 drivers/media/video/isp/luma_enhance_table.h |  154 ++
 drivers/media/video/isp/noise_filter_table.h |   90 +
 drivers/media/video/isp/redgamma_table.h | 1050 
 drivers/media/video/mt9m001.c|   26 +-
 drivers/media/video/mt9m111.c|   20 +-
 drivers/media/video/mt9t031.c|   24 +-
 drivers/media/video/mt9t112.c|   14 +-
 drivers/media/video/mt9v022.c|   26 +-
 drivers/media/video/ov772x.c |   18 +-
 drivers/media/video/ov9640.c |   12 +-
 drivers/media/video/rj54n1cb0c.c |   26 +-
 drivers/media/video/soc_camera.c |2 +-
 drivers/media/video/tw9910.c |   20 +-
 drivers/media/video/v4l2-subdev.c|5 +-
 include/media/v4l2-subdev.h  |   17 +-
 52 files changed, 23860 insertions(+), 109 deletions(-)
 create mode 100644 arch/arm/mach-omap2/devices.h
 create mode 100644 arch/arm/plat-omap/include/mach/isp_user.h
 create mode 100644 drivers/media/video/isp/Makefile
 create mode 100644 drivers/media/video/isp/bluegamma_table.h
 create mode 100644 drivers/media/video/isp/cfa_coef_table.h
 create mode 100644 drivers/media/video/isp/greengamma_table.h
 create mode 100644 drivers/media/video/isp/isp.c
 create mode 100644 drivers/media/video/isp/isp.h
 create mode 100644 drivers/media/video/isp/ispccdc.c
 create mode 100644 drivers/media/video/isp/ispccdc.h
 create mode 100644 drivers/media/video/isp/ispccp2.c
 create mode 100644 drivers/media/video/isp/ispccp2.h
 create mode 100644 drivers/media/video/isp/ispcsi2.c
 create mode 100644 drivers/media/video/isp/ispcsi2.h
 create mode 100644 drivers/media/video/isp/ispcsiphy.c
 create mode 100644 drivers/media/video/isp/ispcsi

[RFC/PATCH 3/6] V4L/DVB: v4l: Add a v4l2_subdev host private data field

2010-09-27 Thread Laurent Pinchart
The existing priv field stores subdev private data owned by the subdev
driver. Host (bridge) drivers might need to store per-subdev
host-specific data, such as a pointer to platform data.

Add a v4l2_subdev host_priv field to store host-specific data, and
rename the existing priv field to dev_priv.

Signed-off-by: Laurent Pinchart 
Acked-by: Hans Verkuil 
Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/video4linux/v4l2-framework.txt |5 +
 drivers/media/video/v4l2-subdev.c|3 ++-
 include/media/v4l2-subdev.h  |   17 ++---
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/Documentation/video4linux/v4l2-framework.txt 
b/Documentation/video4linux/v4l2-framework.txt
index 21bb837..9127a28 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -206,6 +206,11 @@ You also need a way to go from the low-level struct to 
v4l2_subdev. For the
 common i2c_client struct the i2c_set_clientdata() call is used to store a
 v4l2_subdev pointer, for other busses you may have to use other methods.
 
+Bridges might also need to store per-subdev private data, such as a pointer to
+bridge-specific per-subdev private data. The v4l2_subdev structure provides
+host private data for that purpose that can be accessed with
+v4l2_get_subdev_hostdata() and v4l2_set_subdev_hostdata().
+
 From the bridge driver perspective you load the sub-device module and somehow
 obtain the v4l2_subdev pointer. For i2c devices this is easy: you call
 i2c_get_clientdata(). For other busses something similar needs to be done.
diff --git a/drivers/media/video/v4l2-subdev.c 
b/drivers/media/video/v4l2-subdev.c
index ecbdaca..497eea4 100644
--- a/drivers/media/video/v4l2-subdev.c
+++ b/drivers/media/video/v4l2-subdev.c
@@ -308,7 +308,8 @@ void v4l2_subdev_init(struct v4l2_subdev *sd, const struct 
v4l2_subdev_ops *ops)
sd->flags = 0;
sd->name[0] = '\0';
sd->grp_id = 0;
-   sd->priv = NULL;
+   sd->dev_priv = NULL;
+   sd->host_priv = NULL;
sd->initialized = 1;
sd->entity.name = sd->name;
sd->entity.type = MEDIA_ENTITY_TYPE_SUBDEV;
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 3b947ed..8c25f10 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -485,7 +485,8 @@ struct v4l2_subdev {
/* can be used to group similar subdevs, value is driver-specific */
u32 grp_id;
/* pointer to private data */
-   void *priv;
+   void *dev_priv;
+   void *host_priv;
/* subdev device node */
struct video_device devnode;
unsigned int initialized;
@@ -526,12 +527,22 @@ extern const struct v4l2_file_operations v4l2_subdev_fops;
 
 static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p)
 {
-   sd->priv = p;
+   sd->dev_priv = p;
 }
 
 static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd)
 {
-   return sd->priv;
+   return sd->dev_priv;
+}
+
+static inline void v4l2_set_subdev_hostdata(struct v4l2_subdev *sd, void *p)
+{
+   sd->host_priv = p;
+}
+
+static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd)
+{
+   return sd->host_priv;
 }
 
 void v4l2_subdev_init(struct v4l2_subdev *sd,
-- 
1.7.2.2

--
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


[RFC/PATCH 1/6] v4l: subdev: Generic ioctl support

2010-09-27 Thread Laurent Pinchart
Instead of returning an error when receiving an ioctl call with an
unsupported command, forward the call to the subdev core::ioctl handler.

Signed-off-by: Laurent Pinchart 
---
 Documentation/video4linux/v4l2-framework.txt |5 +
 drivers/media/video/v4l2-subdev.c|2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/Documentation/video4linux/v4l2-framework.txt 
b/Documentation/video4linux/v4l2-framework.txt
index 3416d93..21bb837 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -402,6 +402,11 @@ VIDIOC_UNSUBSCRIBE_EVENT
To properly support events, the poll() file operation is also
implemented.
 
+Private ioctls
+
+   All ioctls not in the above list are passed directly to the sub-device
+   driver through the core::ioctl operation.
+
 
 I2C sub-device drivers
 --
diff --git a/drivers/media/video/v4l2-subdev.c 
b/drivers/media/video/v4l2-subdev.c
index 8e146ce..ecbdaca 100644
--- a/drivers/media/video/v4l2-subdev.c
+++ b/drivers/media/video/v4l2-subdev.c
@@ -262,7 +262,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int 
cmd, void *arg)
}
 
default:
-   return -ENOIOCTLCMD;
+   return v4l2_subdev_call(sd, core, ioctl, cmd, arg);
}
 
return 0;
-- 
1.7.2.2

--
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: [RFC/PATCH 2/9] v4l: Group media bus pixel codes by types and sort them alphabetically

2010-09-27 Thread Guennadi Liakhovetski
On Sun, 26 Sep 2010, Laurent Pinchart wrote:

> Adding new pixel codes at the end of the enumeration will soon create a
> mess, so sort the pixel codes by type and then sort them alphabetically.
> 
> As the codes are part of the kernel ABI their value can't change when a
> new code is inserted in the enumeration, so they are given an explicit
> numerical value. When inserting a new pixel code developers must use and
> update the V4L2_MBUS_FMT_LAST value.
> 
> Signed-off-by: Laurent Pinchart 
> ---
>  include/linux/v4l2-mediabus.h |   54 
>  1 files changed, 32 insertions(+), 22 deletions(-)
> 
> diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h
> index 127512a..bc637a5 100644
> --- a/include/linux/v4l2-mediabus.h
> +++ b/include/linux/v4l2-mediabus.h
> @@ -24,31 +24,41 @@
>   * transferred first, "BE" means that the most significant bits are 
> transferred
>   * first, and "PADHI" and "PADLO" define which bits - low or high, in the
>   * incomplete high byte, are filled with padding bits.
> + *
> + * The pixel codes are grouped by types and (mostly) sorted alphabetically. 
> As

Why mostly? Wouldn't it make it easier for future additions if we sorted 
them strictly from the beginning?

> + * their value can't change when a new pixel code is inserted in the
> + * enumeration, they are explicitly given a numerical value. When inserting a
> + * new pixel code use and update the V4L2_MBUS_FMT_LAST value.
>   */
>  enum v4l2_mbus_pixelcode {
>   V4L2_MBUS_FMT_FIXED = 1,
> - V4L2_MBUS_FMT_YUYV8_2X8,
> - V4L2_MBUS_FMT_YVYU8_2X8,
> - V4L2_MBUS_FMT_UYVY8_2X8,
> - V4L2_MBUS_FMT_VYUY8_2X8,
> - V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
> - V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
> - V4L2_MBUS_FMT_RGB565_2X8_LE,
> - V4L2_MBUS_FMT_RGB565_2X8_BE,
> - V4L2_MBUS_FMT_SBGGR8_1X8,
> - V4L2_MBUS_FMT_SBGGR10_1X10,
> - V4L2_MBUS_FMT_GREY8_1X8,
> - V4L2_MBUS_FMT_Y10_1X10,
> - V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE,
> - V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE,
> - V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE,
> - V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE,
> - V4L2_MBUS_FMT_SGRBG8_1X8,
> - V4L2_MBUS_FMT_SBGGR12_1X12,
> - V4L2_MBUS_FMT_YUYV8_1_5X8,
> - V4L2_MBUS_FMT_YVYU8_1_5X8,
> - V4L2_MBUS_FMT_UYVY8_1_5X8,
> - V4L2_MBUS_FMT_VYUY8_1_5X8,
> + /* RGB */
> + V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 7,
> + V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE = 6,
> + V4L2_MBUS_FMT_RGB565_2X8_BE = 9,
> + V4L2_MBUS_FMT_RGB565_2X8_LE = 8,
> + /* YUV (including grey) */
> + V4L2_MBUS_FMT_GREY8_1X8 = 12,
> + V4L2_MBUS_FMT_Y10_1X10 = 13,
> + V4L2_MBUS_FMT_YUYV8_1_5X8 = 20,
> + V4L2_MBUS_FMT_YVYU8_1_5X8 = 21,
> + V4L2_MBUS_FMT_UYVY8_1_5X8 = 22,
> + V4L2_MBUS_FMT_VYUY8_1_5X8 = 23,
> + V4L2_MBUS_FMT_YUYV8_2X8 = 2,
> + V4L2_MBUS_FMT_UYVY8_2X8 = 4,
> + V4L2_MBUS_FMT_YVYU8_2X8 = 3,
> + V4L2_MBUS_FMT_VYUY8_2X8 = 5,
> + /* Bayer */
> + V4L2_MBUS_FMT_SBGGR8_1X8 = 10,
> + V4L2_MBUS_FMT_SBGGR10_1X10 = 11,
> + V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE = 16,
> + V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE = 14,
> + V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE = 17,
> + V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE = 15,
> + V4L2_MBUS_FMT_SBGGR12_1X12 = 19,
> + V4L2_MBUS_FMT_SGRBG8_1X8 = 18,
> + /* Last - Update this when adding a new pixel code */
> + V4L2_MBUS_FMT_LAST = 24,
>  };
>  
>  /**
> -- 
> 1.7.2.2

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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: [RFC/PATCH 1/9] v4l: Move the media/v4l2-mediabus.h header to include/linux

2010-09-27 Thread Guennadi Liakhovetski
On Sun, 26 Sep 2010, Laurent Pinchart wrote:

> The header defines the v4l2_mbus_framefmt structure which will be used
> by the V4L2 subdevs userspace API.
> 
> Change the type of the v4l2_mbus_framefmt::code field to __u32, as enum
> sizes can differ between different ABIs on the same architectures.
> 
> Signed-off-by: Laurent Pinchart 
> ---
>  include/linux/Kbuild  |1 +
>  include/linux/v4l2-mediabus.h |   70 
> +
>  include/media/soc_mediabus.h  |3 +-
>  include/media/v4l2-mediabus.h |   53 +--

Hm, yeah... I guess, you have to move them to make available to the 
user-space...

>  4 files changed, 73 insertions(+), 54 deletions(-)
>  create mode 100644 include/linux/v4l2-mediabus.h
> 
> diff --git a/include/linux/Kbuild b/include/linux/Kbuild
> index f836ee4..38127c2 100644
> --- a/include/linux/Kbuild
> +++ b/include/linux/Kbuild
> @@ -369,6 +369,7 @@ header-y += unistd.h
>  header-y += usbdevice_fs.h
>  header-y += utime.h
>  header-y += utsname.h
> +header-y += v4l2-mediabus.h
>  header-y += veth.h
>  header-y += vhost.h
>  header-y += videodev.h
> diff --git a/include/linux/v4l2-mediabus.h b/include/linux/v4l2-mediabus.h
> new file mode 100644
> index 000..127512a
> --- /dev/null
> +++ b/include/linux/v4l2-mediabus.h
> @@ -0,0 +1,70 @@
> +/*
> + * Media Bus API header
> + *
> + * Copyright (C) 2009, Guennadi Liakhovetski 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#ifndef __LINUX_V4L2_MEDIABUS_H
> +#define __LINUX_V4L2_MEDIABUS_H
> +
> +#include 
> +#include 
> +
> +/*
> + * These pixel codes uniquely identify data formats on the media bus. Mostly
> + * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is
> + * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where 
> the
> + * data format is fixed. Additionally, "2X8" means that one pixel is 
> transferred
> + * in two 8-bit samples, "BE" or "LE" specify in which order those samples 
> are
> + * transferred over the bus: "LE" means that the least significant bits are
> + * transferred first, "BE" means that the most significant bits are 
> transferred
> + * first, and "PADHI" and "PADLO" define which bits - low or high, in the
> + * incomplete high byte, are filled with padding bits.
> + */
> +enum v4l2_mbus_pixelcode {

If you now do not want to use this enum in the API, maybe better make it 
unnamed and switch all users to __u32 for consistency? I'm not sure this 
would be an advantage, just something to maybe think about...

> + V4L2_MBUS_FMT_FIXED = 1,
> + V4L2_MBUS_FMT_YUYV8_2X8,
> + V4L2_MBUS_FMT_YVYU8_2X8,
> + V4L2_MBUS_FMT_UYVY8_2X8,
> + V4L2_MBUS_FMT_VYUY8_2X8,
> + V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
> + V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
> + V4L2_MBUS_FMT_RGB565_2X8_LE,
> + V4L2_MBUS_FMT_RGB565_2X8_BE,
> + V4L2_MBUS_FMT_SBGGR8_1X8,
> + V4L2_MBUS_FMT_SBGGR10_1X10,
> + V4L2_MBUS_FMT_GREY8_1X8,
> + V4L2_MBUS_FMT_Y10_1X10,
> + V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE,
> + V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE,
> + V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE,
> + V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE,
> + V4L2_MBUS_FMT_SGRBG8_1X8,
> + V4L2_MBUS_FMT_SBGGR12_1X12,
> + V4L2_MBUS_FMT_YUYV8_1_5X8,
> + V4L2_MBUS_FMT_YVYU8_1_5X8,
> + V4L2_MBUS_FMT_UYVY8_1_5X8,
> + V4L2_MBUS_FMT_VYUY8_1_5X8,
> +};
> +
> +/**
> + * struct v4l2_mbus_framefmt - frame format on the media bus
> + * @width:   frame width
> + * @height:  frame height
> + * @code:data format code
> + * @field:   used interlacing type
> + * @colorspace:  colorspace of the data
> + */
> +struct v4l2_mbus_framefmt {
> + __u32   width;
> + __u32   height;
> + __u32   code;
> + enum v4l2_field field;
> + enum v4l2_colorspacecolorspace;
> +};
> +
> +#endif
> diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h
> index 037cd7b..6243147 100644
> --- a/include/media/soc_mediabus.h
> +++ b/include/media/soc_mediabus.h
> @@ -12,8 +12,7 @@
>  #define SOC_MEDIABUS_H
>  
>  #include 
> -
> -#include 
> +#include 
>  
>  /**
>   * enum soc_mbus_packing - data packing types on the media-bus
> diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
> index f0cf2e7..971c7fa 100644
> --- a/include/media/v4l2-mediabus.h
> +++ b/include/media/v4l2-mediabus.h
> @@ -11,58 +11,7 @@
>  #ifndef V4L2_MEDIABUS_H
>  #define V4L2_MEDIABUS_H
>  
> -/*
> - * These pixel codes uniquely identify data formats on the media bus. Mostly
> - * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is
> - * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where 
> the
> - * data

Re: [RFC/PATCH v1 0/9] Sub-device pad-level operations

2010-09-27 Thread Guennadi Liakhovetski
On Sun, 26 Sep 2010, Laurent Pinchart wrote:

> Hi everybody,
> 
> Here's the first version of the sub-device pad-level operations patches (this
> is actually not strictly true, as other versions have been posted before as
> sample code, but this one is the first version officially sent for public
> review).
> 
> Anyway, try to enjoy the documentation (I've spent quite a lot of time on it,
> and it's not the most enjoyable part of kernel development, so be nice :-)).
> Guennadi, don't forget that you owe me a drink for documenting your media bus
> format codes :-)

Any time, Laurent, any time;)

Guennadi

> 
> If you're careful enough during the review (I shouldn't have said that, it
> could have been a test) you will notice that the cropping behaviour on subdev
> output pads isn't defined. This one requires some brainstorming, which by
> definition I can't do alone. Comments are, as usual, more than welcome.
> 
> The patches apply on top of the "RFC/PATCH v3 V4L2 subdev userspace API" and
> "RFC/PATCH v5 Media controller (core and V4L2)" patch series. They are 
> available
> from the http://git.linuxtv.org/pinchartl/media.git git tree (media-000*
> branches).
> 
> Antti Koskipaa (1):
>   v4l: v4l2_subdev userspace crop API
> 
> Laurent Pinchart (7):
>   v4l: Move the media/v4l2-mediabus.h header to include/linux
>   v4l: Group media bus pixel codes by types and sort them
> alphabetically
>   v4l: Add 8-bit YUYV on 16-bit bus and SGRBG10 media bus pixel codes
>   v4l: Add remaining RAW10 patterns w DPCM pixel code variants
>   v4l: v4l2_subdev pad-level operations
>   v4l: v4l2_subdev userspace format API
>   v4l: v4l2_subdev userspace frame interval API
> 
> Stanimir Varbanov (1):
>   v4l: Create v4l2 subdev file handle structure
> 
>  Documentation/DocBook/Makefile |5 +-
>  Documentation/DocBook/media-entities.tmpl  |   26 +
>  Documentation/DocBook/v4l/bayer.pdf|  Bin 0 -> 12116 bytes
>  Documentation/DocBook/v4l/bayer.png|  Bin 0 -> 9725 bytes
>  Documentation/DocBook/v4l/dev-subdev.xml   |  300 +
>  Documentation/DocBook/v4l/pipeline.png |  Bin 0 -> 12130 bytes
>  Documentation/DocBook/v4l/subdev-formats.xml   | 1282 
> 
>  Documentation/DocBook/v4l/v4l2.xml |7 +
>  Documentation/DocBook/v4l/vidioc-streamon.xml  |9 +
>  .../v4l/vidioc-subdev-enum-frame-interval.xml  |  147 +++
>  .../DocBook/v4l/vidioc-subdev-enum-frame-size.xml  |  148 +++
>  .../DocBook/v4l/vidioc-subdev-enum-mbus-code.xml   |  113 ++
>  Documentation/DocBook/v4l/vidioc-subdev-g-crop.xml |  143 +++
>  Documentation/DocBook/v4l/vidioc-subdev-g-fmt.xml  |  168 +++
>  .../DocBook/v4l/vidioc-subdev-g-frame-interval.xml |  135 ++
>  drivers/media/video/v4l2-subdev.c  |  175 +++-
>  include/linux/Kbuild   |2 +
>  include/linux/v4l2-mediabus.h  |   91 ++
>  include/linux/v4l2-subdev.h|  141 +++
>  include/media/soc_mediabus.h   |3 +-
>  include/media/v4l2-mediabus.h  |   53 +-
>  include/media/v4l2-subdev.h|   53 +
>  22 files changed, 2919 insertions(+), 82 deletions(-)
>  create mode 100644 Documentation/DocBook/v4l/bayer.pdf
>  create mode 100644 Documentation/DocBook/v4l/bayer.png
>  create mode 100644 Documentation/DocBook/v4l/dev-subdev.xml
>  create mode 100644 Documentation/DocBook/v4l/pipeline.png
>  create mode 100644 Documentation/DocBook/v4l/subdev-formats.xml
>  create mode 100644 
> Documentation/DocBook/v4l/vidioc-subdev-enum-frame-interval.xml
>  create mode 100644 
> Documentation/DocBook/v4l/vidioc-subdev-enum-frame-size.xml
>  create mode 100644 Documentation/DocBook/v4l/vidioc-subdev-enum-mbus-code.xml
>  create mode 100644 Documentation/DocBook/v4l/vidioc-subdev-g-crop.xml
>  create mode 100644 Documentation/DocBook/v4l/vidioc-subdev-g-fmt.xml
>  create mode 100644 
> Documentation/DocBook/v4l/vidioc-subdev-g-frame-interval.xml
>  create mode 100644 include/linux/v4l2-mediabus.h
>  create mode 100644 include/linux/v4l2-subdev.h
> 
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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


wnv_cs.c: i2c question

2010-09-27 Thread Dominik Brodowski
Hey,

as I recently obtained such a PCMCIA card, I try to revive the wnv_cs driver
for Winnov Videum Traveler video cards. First (non-working, but compiling
and able to access the EEPROM and to detect the decoder) results may be
found at

http://git.kernel.org/?p=linux/kernel/git/brodo/pcmcia-2.6.git;a=shortlog;h=refs/heads/wnv

Now, I got a bit stuck at the i2c level -- do the following access functions
look familiar to one of the i2c experts? If so, which algo driver is to be
used? Is this an i2c_smbus_, or some very custom interface not worth
converting to use the i2c subsystem? Many thanks!

Best,
Dominik

PS: The i2c addresses used in this driver are > 0x7f (e.g. 0xa0, 0x8e, 0x48,
0x4a, 0x34, 0xa8, 0x68)


/*
 *2
 *  I   C   B U S   I N T E R F A C E
 *
 */

static __u16
in_ctl(struct videum_device *dev)
{   return wavi_readreg(dev, WAVI_CTL);
}
static void
out_ctl(struct videum_device *dev)
{   wavi_writereg(dev, WAVI_CTL, dev->ctl);
}
static void
i2c_delay(void)
{   udelay(2);
}
static void
i2c_clock(struct videum_device *dev, int c)
{   int t = 1000;
if (c) dev->ctl |= WAVI_I2CBIT; else dev->ctl &= ~WAVI_I2CBIT;
out_ctl(dev);
if (!c) while (--t && (in_ctl(dev) & WAVI_I2CBIT));
}
static void
i2c_data(struct videum_device *dev, int d)
{   if (d) dev->ctl |= WAVI_IMDBIT; else dev->ctl &= ~WAVI_IMDBIT;
out_ctl(dev);
}
/* BUG: I2C bit read routines, polarity */

static void
i2c_start(struct videum_device *dev)
{   dev->ctl &= ~(WAVI_I2CBIT | WAVI_IMDBIT);
out_ctl(dev);   i2c_delay();
i2c_data(dev, 1);   i2c_delay();
i2c_clock(dev, 0);  i2c_delay();
}

static int
i2c_get_ack(struct videum_device *dev)
{
i2c_clock(dev, 1);  i2c_delay();
i2c_data(dev, 0);   i2c_delay();
i2c_clock(dev, 0);  i2c_delay();
i2c_delay();
return in_ctl(dev) & WAVI_IMDBIT;
}

static void
i2c_send_ack(struct videum_device *dev)
{
i2c_clock(dev, 1);  i2c_delay();
i2c_data(dev, 1);   i2c_delay();
i2c_clock(dev, 0);  i2c_delay();
}

static void
i2c_send_nak(struct videum_device *dev)
{
i2c_clock(dev, 1);  i2c_delay();
i2c_data(dev, 0);   i2c_delay();
i2c_clock(dev, 0);  i2c_delay();
}

static void
i2c_end(struct videum_device *dev)
{
i2c_clock(dev, 1);  i2c_delay();
i2c_data(dev, 1);   i2c_delay();
i2c_clock(dev, 0);  i2c_delay();
i2c_data(dev, 0);   i2c_delay();
}

static void
i2c_vpxrestart(struct videum_device *dev)
{
i2c_clock(dev, 1);  i2c_delay();
i2c_data(dev, 0);   i2c_delay();
i2c_clock(dev, 0);  i2c_delay();
}

static void
i2c_out8(struct videum_device *dev,
 intndata)
{
int i;

ndata = ~ndata;
for (i = 0; i < 8; ++i)
{
i2c_clock(dev, 1);  i2c_delay();
i2c_data(dev, ndata & 128); i2c_delay();
i2c_clock(dev, 0);  i2c_delay();
ndata <<= 1;
}
}

static int
i2c_in8(struct videum_device *dev)
{
int i;
int ndata = ~0;

dev->ctl &= ~WAVI_IMDBIT;// Don't write to h/w now
for (i = 0; i < 8; ++i)
{
i2c_clock(dev, 1);  i2c_delay();
i2c_clock(dev, 0);  i2c_delay();
ndata = (in_ctl(dev) & 1) | (ndata << 1);
}
return ~ndata;
}

static void
i2c_get_ready(struct videum_device *dev)
{/* Prepare I2C bus for operation   */
dev->ctl = in_ctl(dev); /* initialize the CTL register shadow */
i2c_end(dev);   /* idle the I2C bus */
}

static int
i2c_error(struct videum_device *dev)
{
i2c_end(dev);
return -1;
}

// Returns -1 on error.
static int i2c_read_reg_byte(struct videum_device *dev, int addr, int reg)
{   int ndata;

i2c_start(dev);
i2c_out8(dev, addr);
if (!i2c_get_ack(dev))
return i2c_error(dev);/* no ACK from device */
i2c_out8(dev, reg);
i2c_get_ack(dev); /* assume it succeeds if the first one succeeded */
if (addr == 0x86 || addr == 0x8E)/* ITT VPX is a little different  */
i2c_vpxrestart(dev);
else
i2c_end(dev);
i2c_start(dev);
i2c_out8(dev, addr | 1);
if (!i2c_get_ack(dev))
return i2c_error(dev);
ndata = i2c_in8(dev);
if (addr == 0x86 || addr == 0x8E)/* ITT VPX is a little different  */
i2c_send_nak(dev);
i2c_end(dev);
return ndata;
}

static int /* -1 on error */
i2c_write_reg_byte(struct videum_device *dev, 
   int addr, int reg, int ndata)
{
i2c_start(dev);
i2c_out8(dev, addr);
if (!i2c_get_ack(dev))
return i2c_error(dev);/* no ACK from device */

[PATCH v2 1/2] V4L/DVB: OMAP_VOUT: Create a seperate vrfb functions library

2010-09-27 Thread Archit Taneja
Create omap_vout_vrfb.c and omap_vout_vrfb.h, these contain functions which
omap_vout will call if the rotation type is set to VRFB rotation. It is
essentialy the code in omap_vout which is used for vrfb specific tasks.

Apart from this, some functions and preprocessor defines needed by the new
vrfb function's have been moved around.

Signed-off-by: Archit Taneja 
---
 drivers/media/video/omap/omap_vout.c  |   32 +--
 drivers/media/video/omap/omap_vout_vrfb.c |  417 +
 drivers/media/video/omap/omap_vout_vrfb.h |   40 +++
 drivers/media/video/omap/omap_voutdef.h   |   25 ++
 4 files changed, 490 insertions(+), 24 deletions(-)
 create mode 100644 drivers/media/video/omap/omap_vout_vrfb.c
 create mode 100644 drivers/media/video/omap/omap_vout_vrfb.h

diff --git a/drivers/media/video/omap/omap_vout.c 
b/drivers/media/video/omap/omap_vout.c
index 4ed51b1..46bc642
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -56,7 +56,6 @@ MODULE_AUTHOR("Texas Instruments");
 MODULE_DESCRIPTION("OMAP Video for Linux Video out driver");
 MODULE_LICENSE("GPL");
 
-
 /* Driver Configuration macros */
 #define VOUT_NAME  "omap_vout"
 
@@ -65,28 +64,13 @@ enum omap_vout_channels {
OMAP_VIDEO2,
 };
 
-enum dma_channel_state {
-   DMA_CHAN_NOT_ALLOTED,
-   DMA_CHAN_ALLOTED,
-};
-
 #define QQVGA_WIDTH160
 #define QQVGA_HEIGHT   120
 
-/* Max Resolution supported by the driver */
-#define VID_MAX_WIDTH  1280/* Largest width */
-#define VID_MAX_HEIGHT 720 /* Largest height */
-
 /* Mimimum requirement is 2x2 for DSS */
 #define VID_MIN_WIDTH  2
 #define VID_MIN_HEIGHT 2
 
-/* 2048 x 2048 is max res supported by OMAP display controller */
-#define MAX_PIXELS_PER_LINE 2048
-
-#define VRFB_TX_TIMEOUT 1000
-#define VRFB_NUM_BUFS  4
-
 /* Max buffer size tobe allocated during init */
 #define OMAP_VOUT_MAX_BUF_SIZE (VID_MAX_WIDTH*VID_MAX_HEIGHT*4)
 
@@ -96,8 +80,8 @@ static u32 video1_numbuffers = 3;
 static u32 video2_numbuffers = 3;
 static u32 video1_bufsize = OMAP_VOUT_MAX_BUF_SIZE;
 static u32 video2_bufsize = OMAP_VOUT_MAX_BUF_SIZE;
-static u32 vid1_static_vrfb_alloc;
-static u32 vid2_static_vrfb_alloc;
+u32 vid1_static_vrfb_alloc;
+u32 vid2_static_vrfb_alloc;
 static int debug;
 
 /* Module parameters */
@@ -174,7 +158,7 @@ const static struct v4l2_fmtdesc omap_formats[] = {
 /*
  * Allocate buffers
  */
-static unsigned long omap_vout_alloc_buffer(u32 buf_size, u32 *phys_addr)
+unsigned long omap_vout_alloc_buffer(u32 buf_size, u32 *phys_addr)
 {
u32 order, size;
unsigned long virt_addr, addr;
@@ -198,7 +182,7 @@ static unsigned long omap_vout_alloc_buffer(u32 buf_size, 
u32 *phys_addr)
 /*
  * Free buffers
  */
-static void omap_vout_free_buffer(unsigned long virtaddr, u32 buf_size)
+void omap_vout_free_buffer(unsigned long virtaddr, u32 buf_size)
 {
u32 order, size;
unsigned long addr = virtaddr;
@@ -371,7 +355,7 @@ static void omap_vout_release_vrfb(struct omap_vout_device 
*vout)
 /*
  * Return true if rotation is 90 or 270
  */
-static inline int rotate_90_or_270(const struct omap_vout_device *vout)
+int rotate_90_or_270(const struct omap_vout_device *vout)
 {
return (vout->rotation == dss_rotation_90_degree ||
vout->rotation == dss_rotation_270_degree);
@@ -380,7 +364,7 @@ static inline int rotate_90_or_270(const struct 
omap_vout_device *vout)
 /*
  * Return true if rotation is enabled
  */
-static inline int rotation_enabled(const struct omap_vout_device *vout)
+int rotation_enabled(const struct omap_vout_device *vout)
 {
return vout->rotation || vout->mirror;
 }
@@ -388,7 +372,7 @@ static inline int rotation_enabled(const struct 
omap_vout_device *vout)
 /*
  * Reverse the rotation degree if mirroring is enabled
  */
-static inline int calc_rotation(const struct omap_vout_device *vout)
+int calc_rotation(const struct omap_vout_device *vout)
 {
if (!vout->mirror)
return vout->rotation;
@@ -408,7 +392,7 @@ static inline int calc_rotation(const struct 
omap_vout_device *vout)
 /*
  * Free the V4L2 buffers
  */
-static void omap_vout_free_buffers(struct omap_vout_device *vout)
+void omap_vout_free_buffers(struct omap_vout_device *vout)
 {
int i, numbuffers;
 
diff --git a/drivers/media/video/omap/omap_vout_vrfb.c 
b/drivers/media/video/omap/omap_vout_vrfb.c
new file mode 100644
index 000..1e6d8a7
--- /dev/null
+++ b/drivers/media/video/omap/omap_vout_vrfb.c
@@ -0,0 +1,417 @@
+/*
+ * omap_vout_vrfb.c
+ *
+ * Copyright (C) 2010 Texas Instruments.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#includ

[PATCH v2 2/2] V4L/DVB: OMAP_VOUT: Use rotation_type to choose between vrfb and sdram buffers

2010-09-27 Thread Archit Taneja
Add "rotation_type" member to omapvideo_info, this is initialized based on
the value "def_vrfb" bootarg parameter, vrfb rotation is chosen by default.
The rotation_type var is now used to choose between vrfb and non-vrfb calls.

vrfb specific code in omap_vout has been removed and is present in 
omap_vout_vrfb.c

Signed-off-by: Archit Taneja 
---
 drivers/media/video/omap/Kconfig|1 -
 drivers/media/video/omap/Makefile   |1 +
 drivers/media/video/omap/omap_vout.c|  448 ++-
 drivers/media/video/omap/omap_voutdef.h |1 +
 4 files changed, 81 insertions(+), 370 deletions(-)

diff --git a/drivers/media/video/omap/Kconfig b/drivers/media/video/omap/Kconfig
index e63233f..d554bfd
--- a/drivers/media/video/omap/Kconfig
+++ b/drivers/media/video/omap/Kconfig
@@ -5,7 +5,6 @@ config VIDEO_OMAP2_VOUT
select VIDEOBUF_DMA_CONTIG
select OMAP2_DSS
select OMAP2_VRAM
-   select OMAP2_VRFB
default n
---help---
  V4L2 Display driver support for OMAP2/3 based boards.
diff --git a/drivers/media/video/omap/Makefile 
b/drivers/media/video/omap/Makefile
index b287880..bc47569
--- a/drivers/media/video/omap/Makefile
+++ b/drivers/media/video/omap/Makefile
@@ -5,3 +5,4 @@
 # OMAP2/3 Display driver
 omap-vout-y := omap_vout.o omap_voutlib.o
 obj-$(CONFIG_VIDEO_OMAP2_VOUT) += omap-vout.o
+obj-$(CONFIG_OMAP2_VRFB) += omap_vout_vrfb.o
diff --git a/drivers/media/video/omap/omap_vout.c 
b/drivers/media/video/omap/omap_vout.c
index 46bc642..4d61ee0
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -51,6 +51,7 @@
 
 #include "omap_voutlib.h"
 #include "omap_voutdef.h"
+#include "omap_vout_vrfb.h"
 
 MODULE_AUTHOR("Texas Instruments");
 MODULE_DESCRIPTION("OMAP Video for Linux Video out driver");
@@ -82,6 +83,7 @@ static u32 video1_bufsize = OMAP_VOUT_MAX_BUF_SIZE;
 static u32 video2_bufsize = OMAP_VOUT_MAX_BUF_SIZE;
 u32 vid1_static_vrfb_alloc;
 u32 vid2_static_vrfb_alloc;
+static int def_vrfb = 1;
 static int debug;
 
 /* Module parameters */
@@ -109,6 +111,10 @@ module_param(vid2_static_vrfb_alloc, bool, S_IRUGO);
 MODULE_PARM_DESC(vid2_static_vrfb_alloc,
"Static allocation of the VRFB buffer for video2 device");
 
+module_param(def_vrfb, bool, S_IRUGO);
+MODULE_PARM_DESC(def_vrfb,
+   "decide if vrfb is used for rotation");
+
 module_param(debug, bool, S_IRUGO);
 MODULE_PARM_DESC(debug, "Debug level (0-1)");
 
@@ -199,41 +205,6 @@ void omap_vout_free_buffer(unsigned long virtaddr, u32 
buf_size)
 }
 
 /*
- * Function for allocating video buffers
- */
-static int omap_vout_allocate_vrfb_buffers(struct omap_vout_device *vout,
-   unsigned int *count, int startindex)
-{
-   int i, j;
-
-   for (i = 0; i < *count; i++) {
-   if (!vout->smsshado_virt_addr[i]) {
-   vout->smsshado_virt_addr[i] =
-   omap_vout_alloc_buffer(vout->smsshado_size,
-   &vout->smsshado_phy_addr[i]);
-   }
-   if (!vout->smsshado_virt_addr[i] && startindex != -1) {
-   if (V4L2_MEMORY_MMAP == vout->memory && i >= startindex)
-   break;
-   }
-   if (!vout->smsshado_virt_addr[i]) {
-   for (j = 0; j < i; j++) {
-   omap_vout_free_buffer(
-   vout->smsshado_virt_addr[j],
-   vout->smsshado_size);
-   vout->smsshado_virt_addr[j] = 0;
-   vout->smsshado_phy_addr[j] = 0;
-   }
-   *count = 0;
-   return -ENOMEM;
-   }
-   memset((void *) vout->smsshado_virt_addr[i], 0,
-   vout->smsshado_size);
-   }
-   return 0;
-}
-
-/*
  * Try format
  */
 static int omap_vout_try_format(struct v4l2_pix_format *pix)
@@ -326,33 +297,6 @@ static u32 omap_vout_uservirt_to_phys(u32 virtp)
 }
 
 /*
- * Wakes up the application once the DMA transfer to VRFB space is completed.
- */
-static void omap_vout_vrfb_dma_tx_callback(int lch, u16 ch_status, void *data)
-{
-   struct vid_vrfb_dma *t = (struct vid_vrfb_dma *) data;
-
-   t->tx_status = 1;
-   wake_up_interruptible(&t->wait);
-}
-
-/*
- * Release the VRFB context once the module exits
- */
-static void omap_vout_release_vrfb(struct omap_vout_device *vout)
-{
-   int i;
-
-   for (i = 0; i < VRFB_NUM_BUFS; i++)
-   omap_vrfb_release_ctx(&vout->vrfb_context[i]);
-
-   if (vout->vrfb_dma_tx.req_status == DMA_CHAN_ALLOTED) {
-   vout->vrfb_dma_tx.req_status = DMA_CHAN_NOT_ALLOTED;
-   omap_free_dma(vout->vrfb_dma_tx.dma_ch);
-   }
-}
-
-/*
  * Return true if rotation is 90 or 270
  */
 int rot

[PATCH v2 0/2] V4L/DVB: OMAP_VOUT: Allow omap_vout to build without VRFB

2010-09-27 Thread Archit Taneja
This lets omap_vout driver build and run without VRFB. It works along the
lines of the following patch series:

OMAP: DSS2: OMAPFB: Allow FB_OMAP2 to build without VRFB
https://patchwork.kernel.org/patch/105371/

Since VRFB is tightly coupled with the omap_vout driver, a handful of vrfb
specific functions have been defined and placed in omap_vout_vrfb.c

A variable rotation_type is introduced in omapvideo_info like the way in
omapfb_info, this allows to call vrfb specific functions only if the rotation
type is vrfb. When the rotation_type is set to SDMA, the S_CTRL ioctl prevents
the user setting a non zero rotation value.

Archit Taneja (2):
  V4L/DVB: OMAP_VOUT: Create a seperate vrfb functions library
  V4L/DVB: OMAP_VOUT: Use rotation_type to choose between vrfb and
sdram buffers

 drivers/media/video/omap/Kconfig  |1 -
 drivers/media/video/omap/Makefile |1 +
 drivers/media/video/omap/omap_vout.c  |  480 ++---
 drivers/media/video/omap/omap_vout_vrfb.c |  417 +
 drivers/media/video/omap/omap_vout_vrfb.h |   40 +++
 drivers/media/video/omap/omap_voutdef.h   |   26 ++
 6 files changed, 571 insertions(+), 394 deletions(-)
 create mode 100644 drivers/media/video/omap/omap_vout_vrfb.c
 create mode 100644 drivers/media/video/omap/omap_vout_vrfb.h
--
Version 2:
 - Don't try to enable SDRAM rotation , return an error if non zero rotation
   is attempted when rotation_type is set to SDMA rotation.
Version 1:
   http://www.mail-archive.com/linux-media@vger.kernel.org/msg21937.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