Patch for Lorex QLR0440 (BTTV)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm new to this list so please be kind if I do something improper.

I have a patch that adds support for the Lorex QLR0440 CCTV card. It is 4 channel multiplex input to a single BT878. It doesn't have an EEPROM so it can't be automatically identified. The change was that the card has an external video mux that is controlled by GPIO[16:17].

Below is the "hg diff". I have tested it on my system and it works for me.

Can someone please let me know if I changed the code appropriately and if I created the patch correctly so that it can be submitted?

Thanks,
Mino
--------

diff -r dba0b6fae413 linux/Documentation/video4linux/CARDLIST.bttv
--- a/linux/Documentation/video4linux/CARDLIST.bttv Thu Apr 09 08:21:42 2009 -0300 +++ b/linux/Documentation/video4linux/CARDLIST.bttv Sat Apr 11 18:24:08 2009 -0700
@@ -158,3 +158,4 @@
 157 -> Geovision GV-800(S) (master)                        [800a:763d]
158 -> Geovision GV-800(S) (slave) [800b: 763d,800c:763d,800d:763d] 159 -> ProVideo PV183 [1830 : 1540,1831 :1540,1832:1540,1833:1540,1834:1540,1835:1540,1836:1540,1837:1540]
+160 -> Lorex QLR0440
diff -r dba0b6fae413 linux/drivers/media/video/bt8xx/bttv-cards.c
--- a/linux/drivers/media/video/bt8xx/bttv-cards.c Thu Apr 09 08:21:42 2009 -0300 +++ b/linux/drivers/media/video/bt8xx/bttv-cards.c Sat Apr 11 18:24:08 2009 -0700
@@ -79,6 +79,9 @@
 static void gv800s_muxsel(struct bttv *btv, unsigned int input);
 static void gv800s_init(struct bttv *btv);

+static void qlr0440_muxsel(struct bttv *btv, unsigned int input);
+static void qlr0440_init(struct bttv *btv);
+
 static int terratec_active_radio_upgrade(struct bttv *btv);
 static int tea5757_read(struct bttv *btv);
 static int tea5757_write(struct bttv *btv, int value);
@@ -2940,6 +2943,18 @@
 		.tuner_type     = TUNER_ABSENT,
 		.tuner_addr	= ADDR_UNSET,
 	},
+	[BTTV_BOARD_LOREX_QLR0440] = {
+		.name           = "Lorex QLR0440",
+		.video_inputs   = 4,
+		/* .audio_inputs= 0, */
+		.svhs           = NO_SVHS,
+		.muxsel         = MUXSEL(2, 2, 2, 2),
+		.muxsel_hook    = qlr0440_muxsel,
+		.needs_tvaudio  = 0,
+		.pll            = PLL_28,
+		.tuner_type     = TUNER_ABSENT,
+		.tuner_addr	= ADDR_UNSET,
+	},
 };

 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
@@ -3471,6 +3486,8 @@
 	case BTTV_BOARD_GEOVISION_GV800S:
 		gv800s_init(btv);
 		break;
+	case BTTV_BOARD_LOREX_QLR0440:
+		qlr0440_init(btv);
 	}

 	/* pll configuration */
@@ -4913,6 +4930,20 @@
 	master[btv->c.nr+3] = btv;
 }

+static void qlr0440_muxsel(struct bttv *btv, unsigned int input)
+{
+	/* video mux */
+	gpio_bits(0x030000, input << 16);
+}
+
+static void qlr0440_init(struct bttv *btv)
+{
+	/* enable gpio bits, mask obtained via btSpy */
+	gpio_inout(0xffffff, 0x030000);
+	gpio_write(0x000000);
+}
+
+
/* ----------------------------------------------------------------------- */ /* motherboard chipset specific stuff */

diff -r dba0b6fae413 linux/drivers/media/video/bt8xx/bttv.h
--- a/linux/drivers/media/video/bt8xx/bttv.h Thu Apr 09 08:21:42 2009 -0300 +++ b/linux/drivers/media/video/bt8xx/bttv.h Sat Apr 11 18:24:08 2009 -0700
@@ -186,7 +186,7 @@
 #define BTTV_BOARD_GEOVISION_GV800S	   0x9d
 #define BTTV_BOARD_GEOVISION_GV800S_SL	   0x9e
 #define BTTV_BOARD_PV183                   0x9f
-
+#define BTTV_BOARD_LOREX_QLR0440           0xa0

 /* more card-specific defines */
 #define PT2254_L_CHANNEL 0x10

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

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux