V4L/DVB (10827): Add support for GeoVision GV-800(S)

I have a GeoVision GV-800(S) card, it has 4 CONEXANT BT878A chips.
It has 16 video inputs and 4 audio inputs, and it is almost identical
to the GV-800, as seen on http://bttv-gallery.de .
The only difference appears to be the analog mux, it has a CD22M3494
in place of the MT8816AP. The card has a blue PCB, as seen in this
picture: http://www.gsbr.com.br/imagem/kits/GeoVision%20GV%20800.jpg .

This card wasn't originally supported, and it was detected as
UNKNOWN/GENERIC. The video inputs weren't working, so I tried
"forcing" a few cards like the GeoVision GV-600, but there was still
no video. So I made a patch to support this card, based on the Kodicom
4400r.

The GV-800(S) is identified as follows:

...
02:00.0 Multimedia video controller: Brooktree Corporation Bt878 Video
Capture (rev 11)
02:00.1 Multimedia controller: Brooktree Corporation Bt878 Audio
Capture (rev 11)
02:04.0 Multimedia video controller: Brooktree Corporation Bt878 Video
Capture (rev 11)
02:04.1 Multimedia controller: Brooktree Corporation Bt878 Audio
Capture (rev 11)
02:08.0 Multimedia video controller: Brooktree Corporation Bt878 Video
Capture (rev 11)
02:08.1 Multimedia controller: Brooktree Corporation Bt878 Audio
Capture (rev 11)
02:0c.0 Multimedia video controller: Brooktree Corporation Bt878 Video
Capture (rev 11)
02:0c.1 Multimedia controller: Brooktree Corporation Bt878 Audio
Capture (rev 11)

...
02:00.0 0400: 109e:036e (rev 11)
       Subsystem: 800a:763d
       Flags: bus master, medium devsel, latency 32, IRQ 10
       Memory at cdfff000 (32-bit, prefetchable) [size=4K]
       Capabilities: [44] Vital Product Data <?>
       Capabilities: [4c] Power Management version 2
       Kernel modules: bttv

02:00.1 0480: 109e:0878 (rev 11)
       Subsystem: 800a:763d
       Flags: bus master, medium devsel, latency 32, IRQ 10
       Memory at cdffe000 (32-bit, prefetchable) [size=4K]
       Capabilities: [44] Vital Product Data <?>
       Capabilities: [4c] Power Management version 2

02:04.0 0400: 109e:036e (rev 11)
       Subsystem: 800b:763d
       Flags: bus master, medium devsel, latency 32, IRQ 10
       Memory at cdffd000 (32-bit, prefetchable) [size=4K]
       Capabilities: [44] Vital Product Data <?>
       Capabilities: [4c] Power Management version 2
       Kernel modules: bttv

02:04.1 0480: 109e:0878 (rev 11)
       Subsystem: 800b:763d
       Flags: bus master, medium devsel, latency 32, IRQ 10
       Memory at cdffc000 (32-bit, prefetchable) [size=4K]
       Capabilities: [44] Vital Product Data <?>
       Capabilities: [4c] Power Management version 2

02:08.0 0400: 109e:036e (rev 11)
       Subsystem: 800c:763d
       Flags: bus master, medium devsel, latency 32, IRQ 10
       Memory at cdffb000 (32-bit, prefetchable) [size=4K]
       Capabilities: [44] Vital Product Data <?>
       Capabilities: [4c] Power Management version 2
       Kernel modules: bttv

02:08.1 0480: 109e:0878 (rev 11)
       Subsystem: 800c:763d
       Flags: bus master, medium devsel, latency 32, IRQ 10
       Memory at cdffa000 (32-bit, prefetchable) [size=4K]
       Capabilities: [44] Vital Product Data <?>
       Capabilities: [4c] Power Management version 2

02:0c.0 0400: 109e:036e (rev 11)
       Subsystem: 800d:763d
       Flags: bus master, medium devsel, latency 32, IRQ 10
       Memory at cdff9000 (32-bit, prefetchable) [size=4K]
       Capabilities: [44] Vital Product Data <?>
       Capabilities: [4c] Power Management version 2
       Kernel modules: bttv

02:0c.1 0480: 109e:0878 (rev 11)
       Subsystem: 800d:763d
       Flags: bus master, medium devsel, latency 32, IRQ 10
       Memory at cdff8000 (32-bit, prefetchable) [size=4K]
       Capabilities: [44] Vital Product Data <?>
       Capabilities: [4c] Power Management version 2

As you can see, the GV-800(S) card is almost identical to the GV-800
on bttv-gallery, so this patch might also work for that card. If not,
only a few changes should be required on the gv800s_write() function.

After this patch, the video inputs work correctly on linux 2.6.24 and
2.6.27 using the software 'motion'. The input order may seem a little
odd, but it's the order the original software/driver uses, and I decided
to keep that order to get the most out of the card.

I tried to get the audio working with the snd-bt87x module, but I only
get noise from every audio input, even after selecting a different mux
with alsamixer. Also, after trying to play sound from those sources, I
randomly get a RISC error about an invalid RISC opcode, and then that
output stops working. I also can't change the sampling rate when
recording. Any pointers to adding audio support are welcome.

Signed-off-by: Bruno Christo <bchristo@inf.ufsm.br>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/video/bt8xx/bttv.h b/drivers/media/video/bt8xx/bttv.h
index ead6e74..737a464 100644
--- a/drivers/media/video/bt8xx/bttv.h
+++ b/drivers/media/video/bt8xx/bttv.h
@@ -181,6 +181,8 @@
 #define BTTV_BOARD_VD012_X1		   0x9a
 #define BTTV_BOARD_VD012_X2		   0x9b
 #define BTTV_BOARD_IVCE8784		   0x9c
+#define BTTV_BOARD_GEOVISION_GV800S	   0x9d
+#define BTTV_BOARD_GEOVISION_GV800S_SL	   0x9e
 
 
 /* more card-specific defines */