From sime@logos.hr  Tue Nov  9 14:46:13 2004
Return-Path: <sime@logos.hr>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D636B16A4CF
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  9 Nov 2004 14:46:13 +0000 (GMT)
Received: from mail.logos.hr (gates.logos.hr [213.149.47.2])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1B99E43D1F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  9 Nov 2004 14:46:09 +0000 (GMT)
	(envelope-from sime@logos.hr)
Received: from localhost (localhost.logos.hr [127.0.0.1])
	by mail.logos.hr (Postfix) with ESMTP id 06E6326D055
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  9 Nov 2004 15:46:06 +0100 (CET)
Received: from mail.logos.hr ([127.0.0.1])
 by localhost (mail.logos.hr [127.0.0.1]) (amavisd-new, port 10024) with LMTP
 id 11131-02 for <FreeBSD-gnats-submit@freebsd.org>;
 Tue,  9 Nov 2004 15:46:04 +0100 (CET)
Received: by mail.logos.hr (Postfix, from userid 34062)
	id 00F5E26D045; Tue,  9 Nov 2004 15:46:03 +0100 (CET)
Message-Id: <20041109144603.00F5E26D045@mail.logos.hr>
Date: Tue,  9 Nov 2004 15:46:03 +0100 (CET)
From: Simun Mikecin <sime@logos.hr>
Reply-To: Simun Mikecin <sime@logos.hr>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Update port: multimedia/pvr250 Support Microtune 4049FM5
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         73717
>Category:       ports
>Synopsis:       Update port: multimedia/pvr250 Support Microtune 4049FM5
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    edwin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 09 14:50:23 GMT 2004
>Closed-Date:    Mon May 02 00:28:30 GMT 2005
>Last-Modified:  Mon May 02 00:28:30 GMT 2005
>Originator:     Simun Mikecin
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD data.home.hr 5.3-STABLE FreeBSD 5.3-STABLE #0: Mon Nov 8 19:22:32 CET 2004 root@data.home.hr:/usr/obj/usr/src/sys/DATA i386


	
>Description:
	
        - Added support for Microtune 4049 FM5 tuner. This tuner supports
        both PAL and SECAM video standards. Users have to select their video
        standard using 'make config' to properly initialize this tuner. I
        tried it only on European PAL B/G/H.

        - Added patches to be able to compile on 5.3-STABLE

        - Added a 'make config' option for 12MBit/s encoding
        
>How-To-Repeat:
	
>Fix:

	

--- pvr250.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	pvr250
#	pvr250/files
#	pvr250/files/patch-modules::cxm::cxm::Makefile
#	pvr250/files/patch-modules::cxm::cxm_iic::Makefile
#	pvr250/files/patch-cxm_i2c.c
#	pvr250/files/patch-cxm.h
#	pvr250/files/patch-cxm_eeprom.c
#	pvr250/files/patch-setchannel.c
#	pvr250/files/patch-cxm.c
#	pvr250/files/patch-setsize.c
#	pvr250/files/patch-cxm_tuner.c
#	pvr250/files/patch-cxm.4
#	pvr250/files/patch-cxm_extract_fw.c
#	pvr250/Makefile
#	pvr250/distinfo
#	pvr250/pkg-descr
#	pvr250/pkg-message
#	pvr250/pkg-plist
#
echo c - pvr250
mkdir -p pvr250 > /dev/null 2>&1
echo c - pvr250/files
mkdir -p pvr250/files > /dev/null 2>&1
echo x - pvr250/files/patch-modules::cxm::cxm::Makefile
sed 's/^X//' >pvr250/files/patch-modules::cxm::cxm::Makefile << 'END-of-pvr250/files/patch-modules::cxm::cxm::Makefile'
X--- modules/cxm/cxm/Makefile.orig	Fri Oct 15 20:53:47 2004
X+++ modules/cxm/cxm/Makefile	Fri Oct 15 20:55:03 2004
X@@ -3,5 +3,6 @@
X SRCS	= cxm.c cxm.h cxm_dec_fw.c cxm_enc_fw.c cxm_audio.c cxm_eeprom.c \
X 	  cxm_ir.c cxm_tuner.c cxm_video.c opt_cxm.h \
X 	  bus_if.h device_if.h iicbb_if.h pci_if.h vnode_if.h
X+CFLAGS+= -I../../.. ${FLAGS}
X 
X .include <bsd.kmod.mk>
END-of-pvr250/files/patch-modules::cxm::cxm::Makefile
echo x - pvr250/files/patch-modules::cxm::cxm_iic::Makefile
sed 's/^X//' >pvr250/files/patch-modules::cxm::cxm_iic::Makefile << 'END-of-pvr250/files/patch-modules::cxm::cxm_iic::Makefile'
X--- modules/cxm/cxm_iic/Makefile.orig	Fri Oct 15 20:55:23 2004
X+++ modules/cxm/cxm_iic/Makefile	Fri Oct 15 20:55:43 2004
X@@ -2,5 +2,6 @@
X KMOD	= cxm_iic
X SRCS	= cxm_i2c.c cxm.h \
X 	  opt_cxm.h bus_if.h device_if.h iicbb_if.h pci_if.h
X+CFLAGS  += -I../../.. ${FLAGS}
X 
X .include <bsd.kmod.mk>
END-of-pvr250/files/patch-modules::cxm::cxm_iic::Makefile
echo x - pvr250/files/patch-cxm_i2c.c
sed 's/^X//' >pvr250/files/patch-cxm_i2c.c << 'END-of-pvr250/files/patch-cxm_i2c.c'
X--- dev/cxm/cxm_i2c.c.orig	Sat Nov  6 13:24:40 2004
X+++ dev/cxm/cxm_i2c.c	Sat Nov  6 14:03:12 2004
X@@ -34,6 +34,9 @@
X  */
X 
X #include <sys/param.h>
X+#if __FreeBSD_version >= 503000
X+#include <sys/module.h>
X+#endif
X #include <sys/systm.h>
X #include <sys/malloc.h>
X #include <sys/conf.h>
END-of-pvr250/files/patch-cxm_i2c.c
echo x - pvr250/files/patch-cxm.h
sed 's/^X//' >pvr250/files/patch-cxm.h << 'END-of-pvr250/files/patch-cxm.h'
X--- dev/cxm/cxm.h.orig	Mon Nov  8 23:06:39 2004
X+++ dev/cxm/cxm.h	Mon Nov  8 23:10:56 2004
X@@ -33,6 +33,8 @@
X  * Header file for the Conexant MPEG-2 Codec driver.
X  */
X 
X+#include <sys/param.h>
X+
X #define bswap32(X) ntohl(X)
X 
X #define NUM_ELEMENTS(array) (sizeof(array) / sizeof(*array))
X@@ -250,7 +252,11 @@
X 
X 	enum cxm_source	source;
X 
X+#if __FreeBSD_version >= 502017
X+	struct cdev	*cxm_dev;	/* Device entry for /dev/cxmN */
X+#else
X 	dev_t           cxm_dev;	/* Device entry for /dev/cxmN */
X+#endif
X 
X 	int		is_opened;
X 	int		mpeg;
X@@ -503,8 +509,9 @@
X #define CXM_TUNER_LG_TPI8PSB01N       13
X #define CXM_TUNER_LG_TAPC_H701F       14
X #define CXM_TUNER_LG_TAPC_H001F       15
X+#define CXM_TUNER_MICROTUNE_4049_FM5  16
X 
X-#define CXM_TUNER_TYPES               16
X+#define CXM_TUNER_TYPES               17
X 
X #define CXM_TUNER_AFC_MASK           0x07
X 
X@@ -516,7 +523,7 @@
X 
X #define CXM_TUNER_PHASE_LOCKED       0x40
X 
X-#define CXM_TUNER_TV_SYSTEM_BG       0x01
X+#define CXM_TUNER_TV_SYSTEM_BGH      0x01
X #define CXM_TUNER_TV_SYSTEM_DK       0x02
X #define CXM_TUNER_TV_SYSTEM_I        0x04
X #define CXM_TUNER_TV_SYSTEM_MN       0x08
END-of-pvr250/files/patch-cxm.h
echo x - pvr250/files/patch-cxm_eeprom.c
sed 's/^X//' >pvr250/files/patch-cxm_eeprom.c << 'END-of-pvr250/files/patch-cxm_eeprom.c'
X--- dev/cxm/cxm_eeprom.c.orig	Sat Nov  6 13:24:40 2004
X+++ dev/cxm/cxm_eeprom.c	Sat Nov  6 14:05:23 2004
X@@ -254,6 +254,10 @@
X 			tuner_type = CXM_TUNER_PHILIPS_FM1246;
X 			break;
X 
X+		case 0x34: /* Microtune 4049 FM5 */
X+			tuner_type = CXM_TUNER_MICROTUNE_4049_FM5;
X+			break;
X+
X 		default:
X 			printf("%s: unknown tuner code %#x\n",
X 			       sc->name, tuner_code);
END-of-pvr250/files/patch-cxm_eeprom.c
echo x - pvr250/files/patch-setchannel.c
sed 's/^X//' >pvr250/files/patch-setchannel.c << 'END-of-pvr250/files/patch-setchannel.c'
X--- pvr250-1/setchannel.c.orig	Sat Oct 16 02:16:32 2004
X+++ pvr250-1/setchannel.c	Sat Nov  6 15:33:47 2004
X@@ -1,9 +1,15 @@
X #include <stdio.h>
X #include <fcntl.h>
X+#include <osreldate.h>
X #include <sys/types.h>
X #include <sys/ioctl.h>
X+#if __FreeBSD_version >= 502017
X+#include <dev/bktr/ioctl_bt848.h>
X+#include <dev/bktr/ioctl_meteor.h>
X+#else
X #include <machine/ioctl_bt848.h>
X #include <machine/ioctl_meteor.h>
X+#endif
X #include <unistd.h>
X 
X /****************************************************************************/
X@@ -74,9 +80,9 @@
X     exit (1);
X     }
X 
X-  tfd = open( "/dev/bktr0", O_RDONLY );
X+  tfd = open( "/dev/cxm0", O_RDONLY );
X   if ( tfd < 0 ) {
X-    perror( "open() of /dev/bktr0 failed." );
X+    perror( "open() of /dev/cxm0 failed." );
X     exit(1);
X   }
X 
END-of-pvr250/files/patch-setchannel.c
echo x - pvr250/files/patch-cxm.c
sed 's/^X//' >pvr250/files/patch-cxm.c << 'END-of-pvr250/files/patch-cxm.c'
X--- dev/cxm/cxm.c.orig	Sat Nov  6 13:24:40 2004
X+++ dev/cxm/cxm.c	Sat Nov  6 14:54:07 2004
X@@ -60,8 +60,16 @@
X #include <machine/clock.h>
X #include <machine/resource.h>
X 
X+#if __FreeBSD_version >= 503000
X+#include <sys/module.h>
X+#endif
X+#if __FreeBSD_version >= 502017
X+#include <dev/bktr/ioctl_meteor.h>
X+#include <dev/bktr/ioctl_bt848.h>
X+#else
X #include <machine/ioctl_meteor.h>
X #include <machine/ioctl_bt848.h>
X+#endif
X 
X #include <sys/bus.h>
X #include <sys/rman.h>
X@@ -253,7 +261,11 @@
X 	2,
X 	0,
X 	/* 9.52 Mb/s peak limit to keep bbdmux followed by mplex -f 8 happy */
X+#ifdef MAXBPS
X+	{ 0, 12000000, 12000000 },
X+#else
X 	{ 0, 9000000, 9520000 },
X+#endif
X 	{ 1, 15, 3},
X 	/*
X 	 * Spatial filter = Manual, Temporal filter = Manual
X@@ -274,7 +286,11 @@
X 	2,
X 	0,
X 	/* 9.52 Mb/s peak limit to keep bbdmux followed by mplex -f 8 happy */
X+#ifdef MAXBPS
X+	{ 0, 12000000, 12000000 },
X+#else
X 	{ 0, 9000000, 9520000 },
X+#endif
X 	{ 1, 12, 3},
X 	/*
X 	 * Spatial filter = Manual, Temporal filter = Manual
X@@ -2084,7 +2100,11 @@
X  * 
X  */
X int
X+#if __FreeBSD_version >= 502017
X+cxm_open( struct cdev *dev, int flags, int fmt, d_thread_t *td )
X+#else
X cxm_open( dev_t dev, int flags, int fmt, d_thread_t *td )
X+#endif
X {
X 	int		unit;
X 	struct cxm_softc *sc;
X@@ -2115,7 +2135,11 @@
X  * 
X  */
X int
X+#if __FreeBSD_version >= 502017
X+cxm_close( struct cdev *dev, int flags, int fmt, d_thread_t *td )
X+#else
X cxm_close( dev_t dev, int flags, int fmt, d_thread_t *td )
X+#endif
X {
X 	int		unit;
X 	struct cxm_softc *sc;
X@@ -2151,7 +2175,11 @@
X  * 
X  */
X int
X+#if __FreeBSD_version >= 502017
X+cxm_read( struct cdev *dev, struct uio *uio, int flag )
X+#else
X cxm_read( dev_t dev, struct uio *uio, int flag )
X+#endif
X {
X 	int		buffers_available;
X 	int		buffers_read;
X@@ -2245,7 +2273,11 @@
X  * 
X  */
X int
X+#if __FreeBSD_version >= 502017
X+cxm_ioctl( struct cdev *dev, unsigned long cmd, caddr_t arg,
X+#else
X cxm_ioctl( dev_t dev, unsigned long cmd, caddr_t arg,
X+#endif
X 	   int flag, d_thread_t *td )
X {
X 	int		brightness;
X@@ -2843,7 +2875,11 @@
X }
X 
X 
X+#if __FreeBSD_version >= 502017
X+int cxm_poll( struct cdev *dev, int events, d_thread_t *td)
X+#else
X int cxm_poll( dev_t dev, int events, d_thread_t *td)
X+#endif
X {
X 	int		revents;
X 	int		unit;
END-of-pvr250/files/patch-cxm.c
echo x - pvr250/files/patch-setsize.c
sed 's/^X//' >pvr250/files/patch-setsize.c << 'END-of-pvr250/files/patch-setsize.c'
X--- pvr250-1/setsize.c.orig	Sat Oct 16 02:16:32 2004
X+++ pvr250-1/setsize.c	Sat Nov  6 15:33:37 2004
X@@ -1,9 +1,15 @@
X #include <stdio.h>
X #include <fcntl.h>
X+#include <osreldate.h>
X #include <sys/types.h>
X #include <sys/ioctl.h>
X+#if __FreeBSD_version >= 502017
X+#include <dev/bktr/ioctl_bt848.h>
X+#include <dev/bktr/ioctl_meteor.h>
X+#else
X #include <machine/ioctl_bt848.h>
X #include <machine/ioctl_meteor.h>
X+#endif
X #include <unistd.h>
X #include <stdlib.h>
X 
X@@ -52,9 +58,9 @@
X   afc = -1;
X   status = 0;
X 
X-  tfd = open( "/dev/bktr0", O_RDONLY );
X+  tfd = open( "/dev/cxm0", O_RDONLY );
X   if ( tfd < 0 ) {
X-    perror( "open() of /dev/bktr0 failed." );
X+    perror( "open() of /dev/cxm0 failed." );
X     exit(1);
X   }
X 
END-of-pvr250/files/patch-setsize.c
echo x - pvr250/files/patch-cxm_tuner.c
sed 's/^X//' >pvr250/files/patch-cxm_tuner.c << 'END-of-pvr250/files/patch-cxm_tuner.c'
X--- dev/cxm/cxm_tuner.c.orig	Mon Nov  8 23:06:39 2004
X+++ dev/cxm/cxm_tuner.c	Mon Nov  8 23:12:43 2004
X@@ -102,44 +102,33 @@
X };
X 
X static const struct cxm_tuner_channels
X-bg_air_channels = {
X-	"B/G Broadcast",
X-	CXM_TUNER_TV_SYSTEM_BG,
X+bgh_air_channels = {
X+	"B/G/H Broadcast",
X+	CXM_TUNER_TV_SYSTEM_BGH,
X 	2,
X-	89,
X+	92,
X 	38900,
X-	{ { 82, 175250, 7000 },
X-	  { 80, 55250, 7000 },
X-	  { 79, 217250, 7000 },
X-	  { 77, 209250, 7000 },
X-	  { 76, 138250, 9000 },
X-	  { 75, 102250, 9000 },
X-	  { 73, 86250, 9000 },
X-	  { 72, 64250, 7500 },
X-	  { 70, 49750, 7500 },
X+	{ { 62, 588250, 7000 },
X 	  { 21, 471250, 8000 },
X-	  { 20, 210250, 8500 },
X-	  { 18, 192750, 8500 },
X-	  { 16, 175250, 8000 },
X-	  { 15, 82250, 8500 },
X-	  { 13, 53750, 8500 },
X+	  { 13, 245250, 7000 },
X 	  { 5, 175250, 7000 },
X 	  { 2, 48250, 7000 } }
X };
X 
X static const struct cxm_tuner_channels
X-bg_australia_channels = {
X-	"B/G Australia",
X-	CXM_TUNER_TV_SYSTEM_BG,
X+bh_australia_channels = {
X+	"B/H Australia",
X+	CXM_TUNER_TV_SYSTEM_BGH,
X 	1,
X 	83,
X 	38900,
X 	{ { 28, 527250, 7000 },
X-	  { 10, 209250, 7000 },
X 	  { 6, 175250, 7000 },
X 	  { 4, 95250, 7000 },
X-	  { 3, 86250, 7000 },
X-	  { 1, 57250, 7000 } }
X+	  { 3, 86250, 9000 },
X+	  { 2, 64250, 22000 },
X+	  { 1, 57250, 7000 },
X+	  { 0, 46250, 11000 } }
X };
X 
X static const struct cxm_tuner_channels
X@@ -193,7 +182,7 @@
X const struct cxm_tuner
X cxm_tuners[CXM_TUNER_TYPES] = {
X 	{ "Philips FI1216 MK2",
X-		CXM_TUNER_TV_SYSTEM_BG,
X+		CXM_TUNER_TV_SYSTEM_BGH,
X 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
X 		48250, 855250,
X 		{ { 450000, { 0x8e, 0x30 } },
X@@ -201,9 +190,9 @@
X 		  { 48250, { 0x8e, 0xa0 } } },
X 		0, 0,
X 		{ 0 },
X-		{ &bg_air_channels, NULL } },
X+		{ &bgh_air_channels, NULL } },
X 	{ "Philips FM1216",
X-		CXM_TUNER_TV_SYSTEM_BG,
X+		CXM_TUNER_TV_SYSTEM_BGH,
X 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
X 		48250, 855250,
X 		{ { 450000, { 0xce, 0x30 } },
X@@ -211,12 +200,12 @@
X 		  { 48250, { 0xce, 0xa0 } } },
X 		87500, 108000,
X 		{ 87500, { 0x88, 0xa5 } },
X-		{ &bg_air_channels, NULL } },
X+		{ &bgh_air_channels, NULL } },
X 	{ "Philips FQ1216ME",
X-		CXM_TUNER_TV_SYSTEM_BG | CXM_TUNER_TV_SYSTEM_DK
X+		CXM_TUNER_TV_SYSTEM_BGH | CXM_TUNER_TV_SYSTEM_DK
X 		| CXM_TUNER_TV_SYSTEM_I
X 		| CXM_TUNER_TV_SYSTEM_L | CXM_TUNER_TV_SYSTEM_L_PRIME,
X-		{ { CXM_TUNER_TV_SYSTEM_BG,      0x09 },
X+		{ { CXM_TUNER_TV_SYSTEM_BGH,      0x09 },
X 		  { CXM_TUNER_TV_SYSTEM_DK,      0x09 },
X 		  { CXM_TUNER_TV_SYSTEM_I,       0x01 },
X 		  { CXM_TUNER_TV_SYSTEM_L,       0x0b },
X@@ -227,7 +216,15 @@
X 		  { 48250, { 0x8e, 0xa0 } } },
X 		0, 0,
X 		{ 0 },
X+#ifdef PAL_BGH
X+		{ &bgh_air_channels, NULL } },
X+#elif defined(PAL_BH_AUSTRALIA)
X+		{ &bh_australia_channels, NULL } },
X+#elif defined(PAL_I)
X+		{ &i_air_channels, NULL } },
X+#else
X 		{ &l_air_channels, NULL } },
X+#endif
X 	{ "Philips FI1236 MK2",
X 		CXM_TUNER_TV_SYSTEM_MN,
X 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
X@@ -269,7 +266,7 @@
X 		{ 87500, { 0x88, 0xa5 } },
X 		{ &i_air_channels, NULL } },
X 	{ "Temic 4006 FH5",
X-		CXM_TUNER_TV_SYSTEM_BG,
X+		CXM_TUNER_TV_SYSTEM_BGH,
X 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
X 		48250, 855250,
X 		{ { 454000, { 0x8e, 0x30 } },
X@@ -277,9 +274,9 @@
X 		  { 48250, { 0x8e, 0xa0 } } },
X 		0, 0,
X 		{ 0 },
X-		{ &bg_air_channels, NULL } },
X+		{ &bgh_air_channels, NULL } },
X 	{ "Temic 4009 FR5",
X-		CXM_TUNER_TV_SYSTEM_BG,
X+		CXM_TUNER_TV_SYSTEM_BGH,
X 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
X 		48250, 855250,
X 		{ { 464000, { 0x8e, 0x30 } },
X@@ -287,7 +284,7 @@
X 		  { 48250, { 0x8e, 0xa0 } } },
X 		87500, 108100,
X 		{ 87500, { 0x88, 0xa5 } },
X-		{ &bg_air_channels, NULL } },
X+		{ &bgh_air_channels, NULL } },
X 	{ "Temic 4036 FY5",
X 		CXM_TUNER_TV_SYSTEM_MN,
X 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
X@@ -319,7 +316,7 @@
X 		{ 0 },
X 		{ &i_air_channels, NULL } },
X 	{ "LG Innotek TPI8PSB11D",
X-		CXM_TUNER_TV_SYSTEM_BG,
X+		CXM_TUNER_TV_SYSTEM_BGH,
X 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
X 		48250, 855250,
X 		{ { 450000, { 0x8e, 0x30 } },
X@@ -327,9 +324,9 @@
X 		  { 48250, { 0x8e, 0xa0 } } },
X 		0, 0,
X 		{ 0 },
X-		{ &bg_air_channels, NULL } },
X+		{ &bgh_air_channels, NULL } },
X 	{ "LG Innotek TPI8PSB01N",
X-		CXM_TUNER_TV_SYSTEM_BG,
X+		CXM_TUNER_TV_SYSTEM_BGH,
X 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
X 		48250, 855250,
X 		{ { 450000, { 0x8e, 0x30 } },
X@@ -337,7 +334,7 @@
X 		  { 48250, { 0x8e, 0xa0 } } },
X 		87500, 108000,
X 		{ 87500, { 0x88, 0xa5 } },
X-		{ &bg_air_channels, NULL } },
X+		{ &bgh_air_channels, NULL } },
X 	{ "LG Innotek TAPC-H701F",
X 		CXM_TUNER_TV_SYSTEM_MN,
X 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
X@@ -357,7 +354,31 @@
X 		  { 55250, { 0xce, 0x01 } } },
X 		76000, 108000,
X 		{ 76000, { 0x88, 0x04 } },
X-		{ &us_air_channels, &us_cable_channels } }
X+		{ &us_air_channels, &us_cable_channels } },
X+       { "Microtune 4049 FM5",
X+               CXM_TUNER_TV_SYSTEM_BGH | CXM_TUNER_TV_SYSTEM_DK
X+               | CXM_TUNER_TV_SYSTEM_I
X+               | CXM_TUNER_TV_SYSTEM_L | CXM_TUNER_TV_SYSTEM_L_PRIME,
X+               { { CXM_TUNER_TV_SYSTEM_BGH,      0x0c },
X+                 { CXM_TUNER_TV_SYSTEM_DK,      0x09 },
X+                 { CXM_TUNER_TV_SYSTEM_I,       0x05 },
X+                 { CXM_TUNER_TV_SYSTEM_L,       0x0a },
X+                 { CXM_TUNER_TV_SYSTEM_L_PRIME, 0x0b } },
X+               48250, 855250,
X+               { { 450000, { 0x8e, 0x30 } },
X+                 { 170000, { 0x8e, 0x90 } },
X+                 { 48250, { 0x8e, 0xa0 } } },
X+               0, 0,
X+               { 0 },
X+#ifdef PAL_BGH
X+               { &bgh_air_channels, NULL } }
X+#elif defined(PAL_BH_AUSTRALIA)
X+               { &bh_australia_channels, NULL } }
X+#elif defined(PAL_I)
X+               { &i_air_channels, NULL } }
X+#else
X+               { &l_air_channels, NULL } }
X+#endif
X };
X 
X 
X@@ -404,6 +425,31 @@
X 	return -1;
X }
X 
X+static void microtune_configure(struct cxm_softc *sc) {
X+  unsigned char buf[4];
X+  int rc;
X+  memset(buf,0,sizeof(buf));
X+#ifdef SECAM_L
X+  buf[1]=0x04;
X+#else
X+  buf[1]=0x10;
X+  buf[2]=0x20|0x40;
X+#endif
X+#if defined(PAL_BGH) || defined(PAL_BH_AUSTRALIA)
X+  buf[3]=0x01|0x08;
X+#elif defined(PAL_I)
X+  buf[3]=0x02|0x08;
X+#elif defined(SECAM_L)
X+  buf[3]=0x03|0x08;
X+#else
X+  buf[3]=0x03|0x0C;
X+#endif
X+  buf[1]|=0x40;
X+  buf[1]|=0x80;
X+  buf[2]|=0x10;
X+  if (4!=(rc=cxm_tuner_write(sc->iicbus,CXM_I2C_TUNER_IF,buf,4)))
X+    printf("%s: IIC I/O error: cxm_tuner_write returned %d (should be 4)\n",sc->name,rc);
X+}
X 
X int
X cxm_tuner_init( struct cxm_softc *sc )
X@@ -418,6 +464,8 @@
X 
X 	if (tuner_type < 0 || tuner_type >= NUM_ELEMENTS(cxm_tuners))
X 		return -1;
X+
X+	if (tuner_type == CXM_TUNER_MICROTUNE_4049_FM5) microtune_configure(sc);
X 
X 	sc->tuner = &cxm_tuners[tuner_type];
X 	sc->tuner_channels = sc->tuner->channels.cable
END-of-pvr250/files/patch-cxm_tuner.c
echo x - pvr250/files/patch-cxm.4
sed 's/^X//' >pvr250/files/patch-cxm.4 << 'END-of-pvr250/files/patch-cxm.4'
X--- pvr250-1/cxm.4.orig	Sat Oct 16 02:16:32 2004
X+++ pvr250-1/cxm.4	Sat Nov  6 15:26:52 2004
X@@ -44,6 +44,7 @@
X .Em LG Innotek TPI8PSB01N
X .Em LG Innotek TAPC-H701F
X .Em LG Innotek TAPC-H001F
X+.Em Microtune 4049 FM5
X .Ed
X .Sh EXAMPLES
X To access the video card, just use /dev/bktr0 (for FreeBSD 4.x) or
END-of-pvr250/files/patch-cxm.4
echo x - pvr250/files/patch-cxm_extract_fw.c
sed 's/^X//' >pvr250/files/patch-cxm_extract_fw.c << 'END-of-pvr250/files/patch-cxm_extract_fw.c'
X--- dev/cxm/cxm_extract_fw.c.orig	Sat Nov  6 15:27:42 2004
X+++ dev/cxm/cxm_extract_fw.c	Sat Nov  6 15:30:23 2004
X@@ -44,6 +44,7 @@
X #include <stdio.h>
X #include <stdlib.h>
X #include <string.h>
X+#include <unistd.h>
X #include <sys/types.h>
X #include <sys/mman.h>
X #include <sys/param.h>
X@@ -172,7 +173,7 @@
X 
X   for (ptr = start; ptr != end; ptr++) {
X     if ((end - ptr) >= sizeof (decoder_magic)
X-        && memcmp (ptr, decoder_magic, sizeof (decoder_magic)) == 0)
X+        && memcmp (ptr, decoder_magic, sizeof (decoder_magic)) == 0) {
X       if (! decoder_fw_saved) {
X         if (save_firmware ("cxm_dec_fw", ptr, end - ptr) < 0) {
X           fprintf (stderr, "%s: save_firmware failed\n", MyName);
X@@ -184,9 +185,10 @@
X         fprintf (stderr, "%s: multiple decoder images present\n", MyName);
X         exit (1);
X         }
X+      }
X 
X     if ((end - ptr) >= sizeof (encoder_magic)
X-        && memcmp (ptr, encoder_magic, sizeof (encoder_magic)) == 0)
X+        && memcmp (ptr, encoder_magic, sizeof (encoder_magic)) == 0) {
X       if (! encoder_fw_saved) {
X         if (save_firmware ("cxm_enc_fw", ptr, end - ptr) < 0) {
X           fprintf (stderr, "%s: save_firmware failed\n", MyName);
X@@ -198,6 +200,7 @@
X         fprintf (stderr, "%s: multiple encoder images present\n", MyName);
X         exit (1);
X         }
X+      }
X     }
X 
X   munmap ((caddr_t)start, (size_t)statbuf.st_size);
END-of-pvr250/files/patch-cxm_extract_fw.c
echo x - pvr250/Makefile
sed 's/^X//' >pvr250/Makefile << 'END-of-pvr250/Makefile'
X#
X# New ports collection makefile for:	pvr250
X# Date created:				10 October 2004
X# Whom:					Edwin Groothuis <edwin@mavetju.org>
X#
X# $FreeBSD: ports/multimedia/pvr250/Makefile,v 1.3 2004/10/16 00:43:02 edwin Exp $
X#
X
XPORTNAME=	pvr250
XPORTVERSION=	200408
XPORTREVISION=	2
XCATEGORIES=	multimedia
XMASTER_SITES=	http://www.mavetju.org/download/adopted/
XDISTFILES=	${CXMSHAR} hcwPVRP2.sys ${PVRTOOLS}.tar.gz
X
XMAINTAINER=	edwin@mavetju.org
XCOMMENT=	Hauppauge PVR-250/350 TV cards driver for the cxm device
X
XPVRTOOLS=	pvr250-1
XCXMSHAR=	cxm-200408.shar
X
XWRKSRC=		${WRKDIR}
XUSE_REINPLACE=	yes
X
XIGNOREFILES=	hcwPVRP2.sys
XRESTRICTED_FILES=	hcwPVRP2.sys
XRESTRICTED=	"This port uses a binary driver which is owned by Hauppauge"
XNO_PACKAGE=	${RESTRICTED}
XNO_CDROM=	${RESTRICTED}
X
XOPTIONS=	NTSC_US			"NTSC US Broadcast"	Off \
X		NTSC_US_CABLE		"NTSC US Cable" Off \
X		PAL_BGH			"PAL B/G/H Broadcast" On \
X		PAL_BH_AUSTRALIA	"PAL B/H Australia" Off \
X		PAL_DK			"PAL D/K Broadcast" Off \
X		PAL_I			"PAL I Broadcast" Off \
X		PAL_L			"PAL L Broadcast" Off \
X		SECAM_DK		"SECAM D/K Broadcast" Off \
X		SECAM_L			"SECAM L Broadcast" Off \
X		MAXBPS			"Use 12MBit/s instead od 9.52MBit/s maximum" On
X
XMAN4=		cxm.4
X
Xpre-everything::
X	@${ECHO_CMD} "Some tuners (for example the Philips FQ1216ME and Microtune 4049 FM5) supports multiple standards."
X	@${ECHO_CMD} "Use the following configuration screen (or 'make config') to choose your local  TV channel system if you have such a tuner."
X	@${ECHO_CMD} "At this moment only the Philips FQ1216M and Microtune 4049 FM5 are known to do this. If you don't have  one, just ignore it. If you have one, select one (1) entry."
X	@sleep 5
X
X.include <bsd.port.pre.mk>
X
X.if defined(WITH_NTSC_US)
XFLAGS+=	-DNTSC_US
X.endif
X.if defined(WITH_NTSC_US_CABLE)
XFLAGS+=	-DNTSC_US_CABLE
X.endif
X.if defined(WITH_PAL_BGH)
XFLAGS+=	-DPAL_BGH
X.endif
X.if defined(WITH_PAL_BH_AUSTRALIA)
XFLAGS+=	-DPAL_BH_AUSTRALIA
X.endif
X.if defined(WITH_PAL_DK)
XFLAGS+=	-DPAL_DK
X.endif
X.if defined(WITH_PAL_I)
XFLAGS+=	-DPAL_I
X.endif
X.if defined(WITH_PAL_L)
XFLAGS+=	-DPAL_L
X.endif
X.if defined(WITH_SECAM_DK)
XFLAGS+=	-DPAL_SECAM_DK
X.endif
X.if defined(WITH_SECAM_L)
XFLAGS+=	-DPAL_SECAM_L
X.endif
X.if defined(WITH_MAXBPS)
XFLAGS+=	-DMAXBPS
X.endif
X
X.if ${OSVERSION} < 500000
XMODULESDIR=	/modules
X.else
XMODULESDIR=	/boot/kernel
X.endif
XPLIST_SUB=	MODULESDIR=${MODULESDIR}
X
X.if !exists(${DISTDIR}/hcwPVRP2.sys)
XIGNORE=		You need the file hcwPVRP2.sys from the CD coming with the PVR-250/350 card. Please place this file in ${DISTDIR} and run make again.
X.endif
X
X.if !exists(/usr/src/sys/dev/iicbus/iicbb.c)
XIGNORE=		You need the kernel sources installed to build this module.
X.endif
X
Xpatch-iicbb:
X.if ${OSVERSION} < 500000
X	@if [ -z "`${GREP} cxm_iic /usr/src/sys/dev/iicbus/iicbb.c`" ]; then \
X	    ${PATCH} /usr/src/sys/dev/iicbus/iicbb.c ${WRKDIR}/dev/cxm/Patch.iicbb-fbsd4; \
X	    ${ECHO_CMD} "Patched /usr/src/sys/dev/iicbus/iicbb.c"; \
X	else \
X	    ${ECHO_CMD} "/usr/src/sys/dev/iicbus/iicbb.c was already patched"; \
X	fi
X.else
X	@if [ -z "`${GREP} cxm_iic /usr/src/sys/dev/iicbus/iicbb.c`" ]; then \
X	    ${PATCH} /usr/src/sys/dev/iicbus/iicbb.c ${WRKDIR}/dev/cxm/Patch.iicbb-fbsd5; \
X	    ${ECHO_CMD} "Patched /usr/src/sys/dev/iicbus/iicbb.c"; \
X	else \
X	    ${ECHO_CMD} "/usr/src/sys/dev/iicbus/iicbb.c was already patched"; \
X	fi
X.endif
X
Xdo-extract:
X	${MKDIR} ${WRKDIR}
X	cd ${WRKDIR}; \
X	${SH} ${DISTDIR}/${CXMSHAR}; \
X	${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/${PVRTOOLS}.tar.gz ${EXTRACT_AFTER_ARGS};
X
Xpost-patch:
X.if ${OSVERSION} > 500000
X	${REINPLACE_CMD} -e 's/bktr0/cxm0/' \
X		${WRKDIR}/${PVRTOOLS}/setchannel.c \
X		${WRKDIR}/${PVRTOOLS}/setsize.c
X.endif
X
Xdo-configure:
X	cd ${WRKDIR}/dev/cxm; \
X	${CC} -Wall -o cxm_extract_fw cxm_extract_fw.c; \
X	./cxm_extract_fw ${DISTDIR}/hcwPVRP2.sys
X
Xdo-build:
X	cd ${WRKDIR}/modules/cxm; ${MAKE} FLAGS="${FLAGS}"
X	cd ${WRKDIR}/${PVRTOOLS}; ${MAKE}
X
Xdo-install:
X	${INSTALL_DATA} ${WRKDIR}/modules/cxm/cxm/cxm.ko ${MODULESDIR}
X	${INSTALL_DATA} ${WRKDIR}/modules/cxm/cxm_iic/cxm_iic.ko ${MODULESDIR}
X	${INSTALL_MAN} ${WRKDIR}/${PVRTOOLS}/cxm.4 ${PREFIX}/man/man4/cxm.4
X	${INSTALL_PROGRAM} ${WRKDIR}/${PVRTOOLS}/setchannel ${PREFIX}/bin/pvr250-setchannel
X	${INSTALL_PROGRAM} ${WRKDIR}/${PVRTOOLS}/setsize ${PREFIX}/bin/pvr250-setsize
X.if ${OSVERSION} < 500000
X	cd /dev; \
X	./MAKEDEV bktr0
X.endif
X
Xpost-install:
X	@${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.post.mk>
END-of-pvr250/Makefile
echo x - pvr250/distinfo
sed 's/^X//' >pvr250/distinfo << 'END-of-pvr250/distinfo'
XMD5 (cxm-200408.shar) = a0a766caafef8f93b9adb58d5034cf1c
XSIZE (cxm-200408.shar) = 181292
XMD5 (pvr250-1.tar.gz) = 2340e05199059745e80551ade27cb196
XSIZE (pvr250-1.tar.gz) = 95901
XMD5 (hcwPVRP2.sys) = IGNORE
END-of-pvr250/distinfo
echo x - pvr250/pkg-descr
sed 's/^X//' >pvr250/pkg-descr << 'END-of-pvr250/pkg-descr'
XThis port contains:
X
X- Drivers for the Conexant MPEG-2 Codec driver which can be found
X  on the Hauppauge PVR-250/350 TV cards.
X  These drivers are (c) John Wehle <john@feith.com>
X
X  On FreeBSD 4.x, the device used is /dev/bktr0.
X  On FreeBSD 5.x, the device used is /dev/cxm0
X
X  This driver has been successfully tested on:
X  - FreeBSD 4.10
X  - FreeBSD 5.2.1
X
X- Two simple programs to modify some ioctls on the card: set the
X  channel and set the window size.
X
XNote:
X
X- Note: the maintainer of this port has no inside knowledge of the
X  workings of this software. Please don't contact me about cards
X  which don't work. Please contact me about problems with the port,
X  with possible enhancements, with success stories.
END-of-pvr250/pkg-descr
echo x - pvr250/pkg-message
sed 's/^X//' >pvr250/pkg-message << 'END-of-pvr250/pkg-message'
XPVR-250/350 - Nearly done!
X
XIf you haven't patched /usr/src/sys/dev/iicbus/iicbb.c yet, and
Xrebuild a new kernel, and rebooted, these are the following steps:
X
X    - Run "make patch-iicbb". This will enable cxm to use the i2c bus.
X    - Add this to your kernel configuration file:
X	    DEVICE	iicbus
X	    DEVICE	iicbb
X    - Rebuild your kernel.
X    - Reboot.
X
XNext step is to load the drivers:
X    - Run "kldload cxm_iic"
X    - Run "kldload cxm"
X
XCheck your console (or /var/log/messages if you're running X) and
Xyou should see something like:
X
X    cxm0: <Conexant iTVC15 MPEG Coder> mem ... irq ... at device ... on pci ...
X    cxm_iic0: <Conexant iTVC15 / iTVC16 I2C cnotroller> on cxm0
X    iicbb0: <I2C bit-banging driver> on cxm_iic0
X    cxm0: Philips FI1236M K2 Tuner
X    cxm0: SAA7115 rev 1 video decoder
X    cxm0: MSP3435G-B6 audio decoder
X    cxm0: IR Remote
X
XTo test the card, either do "cat /dev/bktr0 > filename.mpg" (FreeBSD
X4.x) or "cat /dev/cxm0 > filename.mpg" (FreeBSD 5.x).
END-of-pvr250/pkg-message
echo x - pvr250/pkg-plist
sed 's/^X//' >pvr250/pkg-plist << 'END-of-pvr250/pkg-plist'
X@unexec rm %%MODULESDIR%%/cxm.ko
X@unexec rm %%MODULESDIR%%/cxm_iic.ko
Xbin/pvr250-setchannel
Xbin/pvr250-setsize
END-of-pvr250/pkg-plist
exit
--- pvr250.shar ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->edwin 
Responsible-Changed-By: vs 
Responsible-Changed-When: Thu Nov 11 11:14:50 GMT 2004 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73717 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu Nov 11 11:20:01 GMT 2004 
State-Changed-Why:  
Can you please submit it as a diff to the latest version? thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73717 

From: =?iso-8859-2?Q?=A9imun_Mikecin?= <sime@logos.hr>
To: <FreeBSD-gnats-submit@freebsd.org>,
	"Edwin Groothuis" <edwin@FreeBSD.org>
Cc:  
Subject: RE: ports/73717: Update port: multimedia/pvr250 Support Microtune 4049FM5
Date: Fri, 12 Nov 2004 10:41:28 +0100

 This is a diff to the latest version:
 
 diff -urN pvr250.orig/Makefile pvr250/Makefile
 --- pvr250.orig/Makefile	Tue Nov  9 15:53:32 2004
 +++ pvr250/Makefile	Thu Nov 11 20:31:29 2004
 @@ -8,6 +8,7 @@
 =20
  PORTNAME=3D	pvr250
  PORTVERSION=3D	20041107
 +PORTREVISION=3D	1
  CATEGORIES=3D	multimedia
  MASTER_SITES=3D	http://www.mavetju.org/download/adopted/
  DISTFILES=3D	${CXMSHAR} hcwPVRP2.sys ${PVRTOOLS}.tar.gz
 @@ -21,45 +22,58 @@
  WRKSRC=3D		${WRKDIR}
  USE_REINPLACE=3D	yes
 =20
 +IGNOREFILES=3D	hcwPVRP2.sys
  RESTRICTED_FILES=3D	hcwPVRP2.sys
  RESTRICTED=3D	"This port uses a binary driver which is owned by
 Hauppauge"
  NO_PACKAGE=3D	${RESTRICTED}
  NO_CDROM=3D	${RESTRICTED}
 =20
 -OPTIONS=3D	USBROADCAST	"US Broadcast"	Off \
 -		USCABLE		"US Cable" Off \
 -		BGBROADCAST	"B/G Broadcast" Off \
 -		BGAUSTRALIA	"B/G Australia" Off \
 -		IBROADCAST	"I Broadcast" Off \
 -		LBROADCAST	"L Broadcast" Off
 +OPTIONS=3D	NTSC_US			"NTSC US Broadcast"	Off \
 +		NTSC_US_CABLE		"NTSC US Cable" Off \
 +		PAL_BGH			"PAL B/G/H Broadcast" On \
 +		PAL_BG_AUSTRALIA	"PAL B/G Australia" Off \
 +		PAL_DK			"PAL D/K Broadcast" Off \
 +		PAL_I			"PAL I Broadcast" Off \
 +		SECAM_DK		"SECAM D/K Broadcast" Off \
 +		SECAM_L			"SECAM L Broadcast" Off \
 +		MAXBPS			"Use 12MBit/s instead of
 9.52MBit/s maximum" Off
 =20
  MAN4=3D		cxm.4
 =20
  pre-everything::
  	@${ECHO_CMD} "Some tuners (for example the Philips FQ1216M)
 supports multiple standards."
  	@${ECHO_CMD} "Use the following configuration screen (or 'make
 config') to choose your local  TV channel system if you have such a
 tuner."
 -	@${ECHO_CMD} "At this moment only the Philips FQ1216M is known
 to do this. If you don't have  one, just ignore it. If you have one,
 select one (1) entry."
 +	@${ECHO_CMD} "If you don't have  one, just ignore it. If you
 have one, select one (1) entry."
  	@sleep 5
 =20
  .include <bsd.port.pre.mk>
 =20
 -.if defined(WITH_USBROADCAST)
 -EXTRA_PATCHES=3D	${FILESDIR}/patchtuner-usbroadcast
 +.if defined(WITH_NTSC_US)
 +FLAGS+=3D	-DNTSC_US
  .endif
 -.if defined(WITH_USCABLE)
 -EXTRA_PATCHES=3D	${FILESDIR}/patchtuner-uscable
 +.if defined(WITH_NTSC_US_CABLE)
 +FLAGS+=3D	-DNTSC_US_CABLE
  .endif
 -.if defined(WITH_BGBROADCAST)
 -EXTRA_PATCHES=3D	${FILESDIR}/patchtuner-bgbroadcast
 +.if defined(WITH_PAL_BGH)
 +FLAGS+=3D -DPAL_BGH
  .endif
 -.if defined(WITH_BGAUSTRALIA)
 -EXTRA_PATCHES=3D	${FILESDIR}/patchtuner-bgaustralia
 +.if defined(WITH_PAL_BG_AUSTRALIA)
 +FLAGS+=3D -DPAL_BG_AUSTRALIA
  .endif
 -.if defined(WITH_IBROADCAST)
 -EXTRA_PATCHES=3D	${FILESDIR}/patchtuner-ibroadcast
 +.if defined(WITH_PAL_DK)
 +FLAGS+=3D	-DPAL_DK
  .endif
 -.if defined(WITH_LBROADCAST)
 -EXTRA_PATCHES=3D	${FILESDIR}/patchtuner-lbroadcast
 +.if defined(WITH_PAL_I)
 +FLAGS+=3D	-DPAL_I
 +.endif
 +.if defined(WITH_SECAM_DK)
 +FLAGS+=3D	-DSECAM_DK
 +.endif
 +.if defined(WITH_SECAM_L)
 +FLAGS+=3D	-DSECAM_L
 +.endif
 +.if defined(WITH_MAXBPS)
 +FLAGS+=3D	-DMAXBPS
  .endif
 =20
  .if ${OSVERSION} < 500000
 @@ -113,7 +127,7 @@
  	./cxm_extract_fw ${DISTDIR}/hcwPVRP2.sys
 =20
  do-build:
 -	cd ${WRKDIR}/modules/cxm; ${MAKE}
 +	cd ${WRKDIR}/modules/cxm; ${MAKE} FLAGS=3D"${FLAGS}"
  	cd ${WRKDIR}/${PVRTOOLS}; ${MAKE}
 =20
  do-install:
 diff -urN pvr250.orig/distinfo pvr250/distinfo
 --- pvr250.orig/distinfo	Tue Nov  9 15:53:32 2004
 +++ pvr250/distinfo	Thu Nov 11 19:50:06 2004
 @@ -2,5 +2,4 @@
  SIZE (cxm-20041107.shar) =3D 184374
  MD5 (pvr250-1.tar.gz) =3D 2340e05199059745e80551ade27cb196
  SIZE (pvr250-1.tar.gz) =3D 95901
 -MD5 (hcwPVRP2.sys) =3D aa97703bb05e985418bc29fec5b899b9
 -SIZE (hcwPVRP2.sys) =3D 789824
 +MD5 (hcwPVRP2.sys) =3D IGNORE
 diff -urN pvr250.orig/files/patch-cxm.4 pvr250/files/patch-cxm.4
 --- pvr250.orig/files/patch-cxm.4	Thu Jan  1 01:00:00 1970
 +++ pvr250/files/patch-cxm.4	Thu Nov 11 19:49:04 2004
 @@ -0,0 +1,10 @@
 +--- pvr250-1/cxm.4.orig	Sat Oct 16 02:16:32 2004
 ++++ pvr250-1/cxm.4	Sat Nov  6 15:26:52 2004
 +@@ -44,6 +44,7 @@
 + .Em LG Innotek TPI8PSB01N
 + .Em LG Innotek TAPC-H701F
 + .Em LG Innotek TAPC-H001F
 ++.Em Microtune 4049 FM5
 + .Ed
 + .Sh EXAMPLES
 + To access the video card, just use /dev/bktr0 (for FreeBSD 4.x) or
 diff -urN pvr250.orig/files/patch-cxm_tuner.c
 pvr250/files/patch-cxm_tuner.c
 --- pvr250.orig/files/patch-cxm_tuner.c	Thu Jan  1 01:00:00 1970
 +++ pvr250/files/patch-cxm_tuner.c	Thu Nov 11 22:52:39 2004
 @@ -0,0 +1,83 @@
 +--- dev/cxm/cxm_tuner.c.orig	Thu Nov 11 20:00:15 2004
 ++++ dev/cxm/cxm_tuner.c	Thu Nov 11 22:49:50 2004
 +@@ -103,26 +103,14 @@
 +=20
 + static const struct cxm_tuner_channels
 + bg_air_channels =3D {
 +-	"B/G Broadcast",
 ++	"B/G/H Broadcast",
 + 	CXM_TUNER_TV_SYSTEM_BG,
 + 	2,
 +-	89,
 ++	92,
 + 	38900,
 +-	{ { 82, 175250, 7000 },
 +-	  { 80, 55250, 7000 },
 +-	  { 79, 217250, 7000 },
 +-	  { 77, 209250, 7000 },
 +-	  { 76, 138250, 9000 },
 +-	  { 75, 102250, 9000 },
 +-	  { 73, 86250, 9000 },
 +-	  { 72, 64250, 7500 },
 +-	  { 70, 49750, 7500 },
 ++	{ { 62, 588250, 7000 },
 + 	  { 21, 471250, 8000 },
 +-	  { 20, 210250, 8500 },
 +-	  { 18, 192750, 8500 },
 +-	  { 16, 175250, 8000 },
 +-	  { 15, 82250, 8500 },
 +-	  { 13, 53750, 8500 },
 ++	  { 13, 245250, 7000 },
 + 	  { 5, 175250, 7000 },
 + 	  { 2, 48250, 7000 } }
 + };
 +@@ -226,7 +214,15 @@
 + 		  { 48250, { 0x8e, 0xa0 } } },
 + 		0, 0,
 + 		{ 0 },
 ++#ifdef PAL_BGH
 ++		{ &bg_air_channels, NULL } },
 ++#elif defined(PAL_BG_AUSTRALIA)
 ++		{ &bg_australia_channels, NULL } },
 ++#elif defined(PAL_I)
 ++		{ &i_air_channels, NULL } },
 ++#else
 + 		{ &l_air_channels, NULL } },
 ++#endif
 + 	{ "Philips FI1236 MK2",
 + 		{ CXM_TUNER_TV_SYSTEM_MN, cxm_none_system_code_style },
 + 		55250, 801250,
 +@@ -350,18 +346,30 @@
 + 		  | CXM_TUNER_TV_SYSTEM_L | CXM_TUNER_TV_SYSTEM_L_PRIME,
 + 		  cxm_if_system_code_style,
 + 		  { { CXM_TUNER_TV_SYSTEM_BG,      { 0xd4, 0x70, 0x09 }
 },
 ++#ifdef SECAM_DK
 ++		    { CXM_TUNER_TV_SYSTEM_DK,      { 0xd0, 0x70, 0x0f }
 },
 ++#else
 + 		    { CXM_TUNER_TV_SYSTEM_DK,      { 0xd4, 0x70, 0x0b }
 },
 ++#endif
 + 		    { CXM_TUNER_TV_SYSTEM_I,       { 0xd4, 0x70, 0x0a }
 },
 + 		    { CXM_TUNER_TV_SYSTEM_L,       { 0xc4, 0x10, 0x0b }
 },
 + 		    { CXM_TUNER_TV_SYSTEM_L_PRIME, { 0x84, 0x10, 0x13 }
 },
 + 		    { CXM_TUNER_FM_SYSTEM,         { 0xdc, 0x10, 0x1d }
 } } },
 + 		45750, 855250,
 +-		{ { 464000, { 0x88, 0x30 } },
 +-		  { 141000, { 0x88, 0x90 } },
 +-		  { 45750, { 0x88, 0xa0 } } },
 ++		{ { 464000, { 0x8e, 0x30 } },
 ++		  { 141000, { 0x8e, 0x90 } },
 ++		  { 45750, { 0x8e, 0xa0 } } },
 + 		87500, 108100,
 + 		{ 87500, { 0x88, 0xa4 } },
 ++#ifdef PAL_BGH
 ++		{ &bg_air_channels, NULL } }
 ++#elif defined(PAL_BG_AUSTRALIA)
 ++		{ &bg_australia_channels, NULL } }
 ++#elif defined(PAL_I)
 ++		{ &i_air_channels, NULL } }
 ++#else
 + 		{ &l_air_channels, NULL } }
 ++#endif
 + };
 +=20
 +=20
 diff -urN pvr250.orig/files/patch-modules::cxm::cxm::Makefile
 pvr250/files/patch-modules::cxm::cxm::Makefile
 --- pvr250.orig/files/patch-modules::cxm::cxm::Makefile	Fri Oct 15
 14:12:15 2004
 +++ pvr250/files/patch-modules::cxm::cxm::Makefile	Thu Nov 11
 20:41:46 2004
 @@ -4,6 +4,6 @@
   SRCS	=3D cxm.c cxm.h cxm_dec_fw.c cxm_enc_fw.c cxm_audio.c =
 cxm_eeprom.c
 \
   	  cxm_ir.c cxm_tuner.c cxm_video.c opt_cxm.h \
   	  bus_if.h device_if.h iicbb_if.h pci_if.h vnode_if.h
 -+CFLAGS+=3D -I../../..
 ++CFLAGS+=3D -I../../.. ${FLAGS}
  =20
   .include <bsd.kmod.mk>
 diff -urN pvr250.orig/files/patchtuner-bgaustralia
 pvr250/files/patchtuner-bgaustralia
 --- pvr250.orig/files/patchtuner-bgaustralia	Fri Oct 15 14:12:15 2004
 +++ pvr250/files/patchtuner-bgaustralia	Thu Jan  1 01:00:00 1970
 @@ -1,11 +0,0 @@
 ---- dev/cxm/cxm_tuner.c.org	Fri Oct 15 21:31:06 2004
 -+++ dev/cxm/cxm_tuner.c	Fri Oct 15 21:31:24 2004
 -@@ -227,7 +227,7 @@
 - 		  { 48250, { 0x8e, 0xa0 } } },
 - 		0, 0,
 - 		{ 0 },
 --		{ &l_air_channels, NULL } },
 -+		{ &bg_australia_channels, NULL } },
 - 	{ "Philips FI1236 MK2",
 - 		CXM_TUNER_TV_SYSTEM_MN,
 - 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
 diff -urN pvr250.orig/files/patchtuner-bgbroadcast
 pvr250/files/patchtuner-bgbroadcast
 --- pvr250.orig/files/patchtuner-bgbroadcast	Fri Oct 15 14:12:15 2004
 +++ pvr250/files/patchtuner-bgbroadcast	Thu Jan  1 01:00:00 1970
 @@ -1,11 +0,0 @@
 ---- dev/cxm/cxm_tuner.c.org	Fri Oct 15 21:31:06 2004
 -+++ dev/cxm/cxm_tuner.c	Fri Oct 15 21:31:24 2004
 -@@ -227,7 +227,7 @@
 - 		  { 48250, { 0x8e, 0xa0 } } },
 - 		0, 0,
 - 		{ 0 },
 --		{ &l_air_channels, NULL } },
 -+		{ &bg_air_channels, NULL } },
 - 	{ "Philips FI1236 MK2",
 - 		CXM_TUNER_TV_SYSTEM_MN,
 - 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
 diff -urN pvr250.orig/files/patchtuner-ibroadcast
 pvr250/files/patchtuner-ibroadcast
 --- pvr250.orig/files/patchtuner-ibroadcast	Fri Oct 15 14:12:15 2004
 +++ pvr250/files/patchtuner-ibroadcast	Thu Jan  1 01:00:00 1970
 @@ -1,11 +0,0 @@
 ---- dev/cxm/cxm_tuner.c.org	Fri Oct 15 21:31:06 2004
 -+++ dev/cxm/cxm_tuner.c	Fri Oct 15 21:31:24 2004
 -@@ -227,7 +227,7 @@
 - 		  { 48250, { 0x8e, 0xa0 } } },
 - 		0, 0,
 - 		{ 0 },
 --		{ &l_air_channels, NULL } },
 -+		{ &i_air_channels, NULL } },
 - 	{ "Philips FI1236 MK2",
 - 		CXM_TUNER_TV_SYSTEM_MN,
 - 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
 diff -urN pvr250.orig/files/patchtuner-lbroadcast
 pvr250/files/patchtuner-lbroadcast
 --- pvr250.orig/files/patchtuner-lbroadcast	Fri Oct 15 14:12:15 2004
 +++ pvr250/files/patchtuner-lbroadcast	Thu Jan  1 01:00:00 1970
 @@ -1,11 +0,0 @@
 ---- dev/cxm/cxm_tuner.c.org	Fri Oct 15 21:31:06 2004
 -+++ dev/cxm/cxm_tuner.c	Fri Oct 15 21:31:24 2004
 -@@ -227,7 +227,7 @@
 - 		  { 48250, { 0x8e, 0xa0 } } },
 - 		0, 0,
 - 		{ 0 },
 --		{ &l_air_channels, NULL } },
 -+		{ &l_air_channels, NULL } },
 - 	{ "Philips FI1236 MK2",
 - 		CXM_TUNER_TV_SYSTEM_MN,
 - 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
 diff -urN pvr250.orig/files/patchtuner-usbroadcast
 pvr250/files/patchtuner-usbroadcast
 --- pvr250.orig/files/patchtuner-usbroadcast	Fri Oct 15 14:12:15 2004
 +++ pvr250/files/patchtuner-usbroadcast	Thu Jan  1 01:00:00 1970
 @@ -1,11 +0,0 @@
 ---- dev/cxm/cxm_tuner.c.org	Fri Oct 15 21:31:06 2004
 -+++ dev/cxm/cxm_tuner.c	Fri Oct 15 21:31:24 2004
 -@@ -227,7 +227,7 @@
 - 		  { 48250, { 0x8e, 0xa0 } } },
 - 		0, 0,
 - 		{ 0 },
 --		{ &l_air_channels, NULL } },
 -+		{ &us_air_channels, NULL } },
 - 	{ "Philips FI1236 MK2",
 - 		CXM_TUNER_TV_SYSTEM_MN,
 - 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
 diff -urN pvr250.orig/files/patchtuner-uscable
 pvr250/files/patchtuner-uscable
 --- pvr250.orig/files/patchtuner-uscable	Fri Oct 15 14:12:15 2004
 +++ pvr250/files/patchtuner-uscable	Thu Jan  1 01:00:00 1970
 @@ -1,11 +0,0 @@
 ---- dev/cxm/cxm_tuner.c.org	Fri Oct 15 21:31:06 2004
 -+++ dev/cxm/cxm_tuner.c	Fri Oct 15 21:31:24 2004
 -@@ -227,7 +227,7 @@
 - 		  { 48250, { 0x8e, 0xa0 } } },
 - 		0, 0,
 - 		{ 0 },
 --		{ &l_air_channels, NULL } },
 -+		{ &us_cable_channels, NULL } },
 - 	{ "Philips FI1236 MK2",
 - 		CXM_TUNER_TV_SYSTEM_MN,
 - 		{ { 0 }, { 0 }, { 0 }, { 0 }, { 0 } },
 diff -urN pvr250.orig/pkg-descr pvr250/pkg-descr
 --- pvr250.orig/pkg-descr	Fri Oct 15 14:12:15 2004
 +++ pvr250/pkg-descr	Thu Nov 11 20:32:43 2004
 @@ -16,10 +16,6 @@
 =20
  Note:
 =20
 -- The configuration screen is only applicable for the the Philips
 -  FQ1216M tuner. For other tuners ignore this section. Select just
 -  one entry.
 -
  - Note: the maintainer of this port has no inside knowledge of the
    workings of this software. Please don't contact me about cards
    which don't work. Please contact me about problems with the port,
State-Changed-From-To: feedback->closed 
State-Changed-By: edwin 
State-Changed-When: Mon May 2 00:28:08 GMT 2005 
State-Changed-Why:  
Available in the 2005-04-12 version of the port. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=73717 
>Unformatted:
