diff -crN ./sys/dev/bktr/bktr_audio.c ./work/bktr_audio.c
*** ./sys/dev/bktr/bktr_audio.c	Thu Oct  2 11:57:24 2008
--- ./work/bktr_audio.c	Wed Dec  3 14:25:08 2008
***************
*** 113,118 ****
--- 113,125 ----
          if ( bktr->card.dpl3518a )
                  msp_dpl_reset( bktr, bktr->dpl_addr );
  
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ 	/* reset the pic16c54 PIC device */
+ 	if(bktr->card.pic16c54)
+ 	{
+ 		pic16c54_write(bktr,PIC16C54,PIC16C54_REG_MISC,PIC16C54_MUTE);
+ 	}
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
  }
  
  
***************
*** 125,136 ****
--- 132,181 ----
  {
  	u_long		temp;
  	volatile u_char	idx;
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ 	static int sel=PIC16C54_TUNER;
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
  
  #if defined( AUDIOMUX_DISCOVER )
  	if ( cmd >= 200 )
  		cmd -= 200;
  	else
  #endif /* AUDIOMUX_DISCOVER */
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ 	/* pic16c54 PIC device */
+ 	if(bktr->card.pic16c54)
+ 	{
+ 		switch(cmd)
+ 		{
+ 			case AUDIO_TUNER:
+ 			case AUDIO_INTERN:
+ 				sel=PIC16C54_TUNER;
+ 				break;
+ 			case AUDIO_EXTERN:
+ 				sel=PIC16C54_LINE;
+ 				break;
+ 			case AUDIO_MUTE:
+ 				pic16c54_write(bktr,PIC16C54,PIC16C54_REG_MISC,PIC16C54_MUTE);
+ 				break;
+ 			case AUDIO_UNMUTE:
+ 				if(sel==PIC16C54_LINE)
+ 				{
+ 					pic16c54_write(bktr,PIC16C54,PIC16C54_REG_MISC,PIC16C54_NOMUTE);
+ 					pic16c54_write(bktr,PIC16C54,PIC16C54_REG_MISC,PIC16C54_LINE);
+ 				}
+ 				else
+ 				{
+ 					pic16c54_write(bktr,PIC16C54,PIC16C54_REG_MISC,PIC16C54_NOMUTE|PIC16C54_TUNER);
+ 				}
+ 				break;
+ 			default:
+ 				printf("%s: audio cmd error %02x\n",bktr_name(bktr),cmd);
+ 				return(-1);
+ 				break;
+ 		}
+ 		return(0);
+ 	}
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
  
  	/* check for existance of audio MUXes */
  	if ( !bktr->card.audiomuxs[ 4 ] )
diff -crN ./sys/dev/bktr/bktr_card.c ./work/bktr_card.c
*** ./sys/dev/bktr/bktr_card.c	Thu Oct  2 11:57:24 2008
--- ./work/bktr_card.c	Wed Dec  3 14:31:38 2008
***************
*** 136,420 ****
   *   these entried MUST be kept in the order defined by the CARD_XXX defines!
   */
  static const struct CARDTYPE cards[] = {
! 
! 	{  CARD_UNKNOWN,			/* the card id */
! 	  "Unknown",				/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,					/* dbx unknown */
! 	   0,
! 	   0,
! 	   0,					/* EEProm unknown */
! 	   0,					/* EEProm unknown */
! 	   { 0, 0, 0, 0, 0 },
! 	   0 },					/* GPIO mask */
! 
! 	{  CARD_MIRO,				/* the card id */
! 	  "Pinnacle/Miro TV",			/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,					/* dbx unknown */
! 	   0,
! 	   0,
! 	   0,					/* EEProm unknown */
! 	   0,					/* size unknown */
! 	   { 0x02, 0x01, 0x00, 0x0a, 1 },	/* audio MUX values */
! 	   0x0f },				/* GPIO mask */
! 
! 	{  CARD_HAUPPAUGE,			/* the card id */
! 	  "Hauppauge WinCast/TV",		/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,					/* dbx is optional */
! 	   0,
! 	   0,
! 	   PFC8582_WADDR,			/* EEProm type */
! 	   (u_char)(256 / EEPROMBLOCKSIZE),	/* 256 bytes */
! 	   { 0x00, 0x02, 0x01, 0x04, 1 },	/* audio MUX values */
! 	   0x0f },				/* GPIO mask */
! 
! 	{  CARD_STB,				/* the card id */
! 	  "STB TV/PCI",				/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,					/* dbx is optional */
! 	   0,
! 	   0,
! 	   X24C01_WADDR,			/* EEProm type */
! 	   (u_char)(128 / EEPROMBLOCKSIZE),	/* 128 bytes */
! 	   { 0x00, 0x01, 0x02, 0x02, 1 }, 	/* audio MUX values */
! 	   0x0f },				/* GPIO mask */
! 
! 	{  CARD_INTEL,				/* the card id */
! 	  "Intel Smart Video III/VideoLogic Captivator PCI", /* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,
! 	   0,
! 	   0,
! 	   0,
! 	   0,
! 	   { 0, 0, 0, 0, 0 }, 			/* audio MUX values */
! 	   0x00 },				/* GPIO mask */
! 
! 	{  CARD_IMS_TURBO,			/* the card id */
! 	  "IMS TV Turbo",			/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,					/* dbx is optional */
! 	   0,
! 	   0,
! 	   PFC8582_WADDR,			/* EEProm type */
! 	   (u_char)(256 / EEPROMBLOCKSIZE),	/* 256 bytes */
! 	   { 0x01, 0x02, 0x01, 0x00, 1 },	/* audio MUX values */
! 	   0x0f },				/* GPIO mask */
! 
! 	{  CARD_AVER_MEDIA,			/* the card id */
! 	  "AVer Media TV/FM",                   /* the 'name' */
! 	   NULL,                                /* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,                                   /* dbx is optional */
! 	   0,
! 	   0,
! 	   0,                                   /* EEProm type */
! 	   0,                                   /* EEProm size */
! 	   { 0x0c, 0x08, 0x04, 0x00, 1 },	/* audio MUX values */
! 	   0x1f },				/* GPIO mask */
! 
! 	{  CARD_OSPREY,				/* the card id */
! 	  "MMAC Osprey",                   	/* the 'name' */
! 	   NULL,                                /* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,                                   /* dbx is optional */
! 	   0,
! 	   0,
! 	   PFC8582_WADDR,			/* EEProm type */
! 	   (u_char)(256 / EEPROMBLOCKSIZE),	/* 256 bytes */
! 	   { 0x00, 0x00, 0x00, 0x00, 0 },	/* audio MUX values */
! 	   0 },					/* GPIO mask */
! 
! 	{  CARD_NEC_PK,                         /* the card id */
! 	  "NEC PK-UG-X017",                     /* the 'name' */
! 	   NULL,                                /* the tuner */
! 	   0,                                   /* the tuner i2c address */
! 	   0,                                   /* dbx is optional */
! 	   0,
! 	   0,
! 	   0,                                   /* EEProm type */
! 	   0,                                   /* EEProm size */
! 	   { 0x01, 0x02, 0x01, 0x00, 1 },	/* audio MUX values */
! 	   0x0f },				/* GPIO mask */
! 
! 	{  CARD_IO_BCTV2,                       /* the card id */
! 	  "I/O DATA GV-BCTV2/PCI",              /* the 'name' */
! 	   NULL,                                /* the tuner */
! 	   0,                                   /* the tuner i2c address */
! 	   0,                                   /* dbx is optional */
! 	   0,
! 	   0,
! 	   0,                                   /* EEProm type */
! 	   0,                                   /* EEProm size */
! 	   { 0x00, 0x00, 0x00, 0x00, 1 },	/* Has special MUX handler */
! 	   0x0f },				/* GPIO mask */
! 
! 	{  CARD_FLYVIDEO,			/* the card id */
! 	  "FlyVideo",				/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,					/* dbx is optional */
! 	   0,					/* msp34xx is optional */
! 	   0,					/* dpl3518a is optional */
! 	   0xac,				/* EEProm type */
! 	   (u_char)(256 / EEPROMBLOCKSIZE),	/* 256 bytes */
! 	   { 0x000, 0x800, 0x400, 0x8dff00, 1 },/* audio MUX values */
! 	   0x8dff00 },				/* GPIO mask */
! 
! 	{  CARD_ZOLTRIX,			/* the card id */
! 	  "Zoltrix",				/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,					/* dbx is optional */
! 	   0,					/* msp34xx is optional */
! 	   0,					/* dpl3518a is optional */
! 	   0,					/* EEProm type */
! 	   0,					/* EEProm size */
! 	   { 0x04, 0x01, 0x00, 0x0a, 1 },	/* audio MUX values */
! 	   0x0f },				/* GPIO mask */
! 
! 	{  CARD_KISS,				/* the card id */
! 	  "KISS TV/FM PCI",			/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,					/* dbx is optional */
! 	   0,					/* msp34xx is optional */
! 	   0,					/* dpl3518a is optional */
! 	   0,					/* EEProm type */
! 	   0,					/* EEProm size */
! 	   { 0x0c, 0x00, 0x0b, 0x0b, 1 },	/* audio MUX values */
! 	   0x0f },				/* GPIO mask */
! 
! 	{  CARD_VIDEO_HIGHWAY_XTREME,		/* the card id */
! 	  "Video Highway Xtreme",		/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,
! 	   0,
! 	   0,
! 	   0,
! 	   0,					/* EEProm type */
! 	   0,					/* EEProm size */
! 	   { 0x00, 0x02, 0x01, 0x04, 1 },	/* audio MUX values */
! 	   0x0f },				/* GPIO mask */
! 
! 	{  CARD_ASKEY_DYNALINK_MAGIC_TVIEW,	/* the card id */
! 	  "Askey/Dynalink Magic TView",		/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,
! 	   0,
! 	   0,
! 	   0,
! 	   0,					/* EEProm type */
! 	   0,					/* EEProm size */
! 	   { 0x400, 0xE00, 0x400, 0xC00, 1 },	/* audio MUX values */
! 	   0xE00 },				/* GPIO mask */
! 
! 	{  CARD_LEADTEK,			/* the card id */
! 	  "Leadtek Winfast TV 2000",		/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,
! 	   0,
! 	   0,
! 	   0,
! 	   0,					/* EEProm type */
! 	   0,					/* EEProm size */
! 	   /* Tuner, Extern, Intern, Mute, Enabled */
! 	   { 0x621000, 0x621000, 0x621000, 0xE21000, 1 }, /* audio MUX values */
! 	   0xfff000 },				/* GPIO mask */
! 
! 	{  CARD_TERRATVPLUS,                    /* the card id */
! 	  "TerraTVplus",                        /* the 'name' */
! 	   NULL,                                /* the tuner */
! 	   0,
! 	   0,
! 	   0,
! 	   0,
! 	   0,					/* EEProm type */
! 	   0,					/* EEProm size */
! 	   { 0x20000, 0x00000, 0x30000, 0x40000, 1 }, /* audio MUX values*/
! 	   0x70000 },                           /* GPIO mask */
! 
! 	{  CARD_IO_BCTV3,                       /* the card id */
! 	  "I/O DATA GV-BCTV3/PCI",              /* the 'name' */
! 	   NULL,                                /* the tuner */
! 	   0,                                   /* the tuner i2c address */
! 	   0,                                   /* dbx is optional */
! 	   0,
! 	   0,
! 	   0,                                   /* EEProm type */
! 	   0,                                   /* EEProm size */
! 	   /* Tuner, Extern, Intern, Mute, Enabled */
! 	   { 0x10000, 0, 0x10000, 0, 1 },	/* audio MUX values */
! 	   0x10f00 },				/* GPIO mask */
! 
! 	{  CARD_AOPEN_VA1000,			/* the card id */
! 	  "AOpen VA1000",			/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,					/* dbx is optional */
! 	   0,
! 	   0,
! 	   0,					/* EEProm unknown */
! 	   0,					/* size unknown */
! 	   { 0x02, 0x00, 0x00, 0x00, 1 },	/* audio MUX values */
! 	   0x18e0 },				/* GPIO mask */
! 
! 	{  CARD_PINNACLE_PCTV_RAVE,		/* the card id */
! 	  "Pinnacle PCTV Rave",			/* the 'name' */
! 	   NULL,				/* the tuner */
! 	   0,					/* the tuner i2c address */
! 	   0,					/* dbx unknown */
! 	   0,
! 	   0,
! 	   0,					/* EEProm unknown */
! 	   0,					/* size unknown */
! 	   { 0x02, 0x01, 0x00, 0x0a, 1 },	/* audio MUX values */
! 	   0x03000F },				/* GPIO mask */
! 
! 	{  CARD_PIXELVIEW_PLAYTV_PAK,       /* the card id */
! 	   "PixelView PlayTV Pak",              /* the 'name' */
! 	    NULL,                               /* the tuner */
! 	    0,                                  /* the tuner i2c address */
! 	    0,                                  /* dbx is optional */
! 	    0,
! 	    0,
! 	    PFC8582_WADDR,                      /* EEProm type */
! 	    (u_char)(256 / EEPROMBLOCKSIZE),    /* 256 bytes */
! 	    { 0x20000, 0x80000, 0, 0xa8000, 1 },        /* audio MUX values */
! 	    0xAA0000 },                         /* GPIO mask */
! 
! 	{  CARD_TERRATVALUE,                    /* the card id */
! 	   "TerraTec TValue",                   /* the 'name' */
! 	   NULL,                                /* the tuner */
! 	   0,                                   /* the tuner i2c address */
! 	   0,                                   /* dbx is optional */
! 	   0,
! 	   0,
! 	   0,                                   /* EEProm type */
! 	   0,                                   /* EEProm size */
! 	   /* Tuner, Extern, Intern, Mute, Enabled */
! 	   { 0x500, 0x900, 0x300, 0x900, 1 },	/* audio MUX values */
! 	   0xffff00 },				/* GPIO mask */
! 
! 	{  CARD_PIXELVIEW_PLAYTV_PRO_REV_4C,    /* the card id */
! 	   "PixelView PlayTV Pro REV-4C ",      /* the 'name' */
! 	   NULL,                                /* the tuner */
! 	   0,                                   /* the tuner i2c address */
! 	   0,                                   /* dbx is optional */
! 	   0,
! 	   0,
! 	   0,                                   /* EEProm type */
! 	   0,                                   /* EEProm size */
! 	   { 0x01, 0x04, 0x01, 0x03, 1 },       /* audio MUX values */
! 	   0x00ffffff },
  };
  
  struct bt848_card_sig bt848_card_signature[1]= {
--- 136,900 ----
   *   these entried MUST be kept in the order defined by the CARD_XXX defines!
   */
  static const struct CARDTYPE cards[] = {
! /*  ================  [START] Modified by K.Kishiro  ================  */
! 	{
! 		CARD_UNKNOWN,
! 		"Unknown",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			0				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00000000			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_MIRO,
! 		"Pinnacle/Miro TV",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000002,		/*  AudioMUX: tuner            */
! 			0x00000001,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x0000000a,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000000f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_HAUPPAUGE,
! 		"Hauppauge WinCast/TV",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		PFC8582_WADDR,
! 		(u_char)(256/EEPROMBLOCKSIZE),
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000002,		/*  AudioMUX: extern(line-in)  */
! 			0x00000001,		/*  AudioMUX: intern(radio)    */
! 			0x00000004,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000000f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_STB,
! 		"STB TV/PCI",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		X24C01_WADDR,
! 		(u_char)(128/EEPROMBLOCKSIZE),
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000001,		/*  AudioMUX: extern(line-in)  */
! 			0x00000002,		/*  AudioMUX: intern(radio)    */
! 			0x00000002,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000000f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_INTEL,
! 		"Intel Smart Video III/VideoLogic Captivator PCI",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			0				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00000000			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_IMS_TURBO,
! 		"IMS TV Turbo",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		PFC8582_WADDR,
! 		(u_char)(256/EEPROMBLOCKSIZE),
! 		{
! 			0x00000001,		/*  AudioMUX: tuner            */
! 			0x00000002,		/*  AudioMUX: extern(line-in)  */
! 			0x00000001,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000000f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_AVER_MEDIA,
! 		"AVer Media TV/FM",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x0000000c,		/*  AudioMUX: tuner            */
! 			0x00000008,		/*  AudioMUX: extern(line-in)  */
! 			0x00000004,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000001f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_OSPREY,
! 		"MMAC Osprey",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		PFC8582_WADDR,
! 		(u_char)(256/EEPROMBLOCKSIZE),
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			0				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00000000			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_NEC_PK,
! 		"NEC PK-UG-X017",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000001,		/*  AudioMUX: tuner            */
! 			0x00000002,		/*  AudioMUX: extern(line-in)  */
! 			0x00000001,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000000f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_IO_BCTV2,
! 		"I/O DATA GV-BCTV2/PCI",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000000f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_FLYVIDEO,
! 		"FlyVideo",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0xac,
! 		(u_char)(256/EEPROMBLOCKSIZE),
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000800,		/*  AudioMUX: extern(line-in)  */
! 			0x00000400,		/*  AudioMUX: intern(radio)    */
! 			0x008dff00,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x008dff00			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_ZOLTRIX,
! 		"Zoltrix",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000004,		/*  AudioMUX: tuner            */
! 			0x00000001,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x0000000a,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000000f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_KISS,
! 		"KISS TV/FM PCI",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x0000000c,		/*  AudioMUX: tuner            */
! 			0x00000000,		/*  AudioMUX: extern(line-in)  */
! 			0x0000000b,		/*  AudioMUX: intern(radio)    */
! 			0x0000000b,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000000f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_VIDEO_HIGHWAY_XTREME,
! 		"Video Highway Xtreme",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000002,		/*  AudioMUX: extern(line-in)  */
! 			0x00000001,		/*  AudioMUX: intern(radio)    */
! 			0x00000004,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000000f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_ASKEY_DYNALINK_MAGIC_TVIEW,
! 		"Askey/Dynalink Magic TView",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000400,		/*  AudioMUX: tuner            */
! 			0x00000e00,		/*  AudioMUX: extern(line-in)  */
! 			0x00000400,		/*  AudioMUX: intern(radio)    */
! 			0x00000c00,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00000e00			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_LEADTEK,
! 		"Leadtek Winfast TV 2000",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00621000,		/*  AudioMUX: tuner            */
! 			0x00621000,		/*  AudioMUX: extern(line-in)  */
! 			0x00621000,		/*  AudioMUX: intern(radio)    */
! 			0x00e21000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00fff000			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_TERRATVPLUS,
! 		"TerraTVplus",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00020000,		/*  AudioMUX: tuner            */
! 			0x00000000,		/*  AudioMUX: extern(line-in)  */
! 			0x00030000,		/*  AudioMUX: intern(radio)    */
! 			0x00040000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00070000			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_IO_BCTV3,
! 		"I/O DATA GV-BCTV3/PCI",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00010000,		/*  AudioMUX: tuner            */
! 			0x00010000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00010f00			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_AOPEN_VA1000,
! 		"AOpen VA1000",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000002,		/*  AudioMUX: tuner            */
! 			0x00000000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x000018e0			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_PINNACLE_PCTV_RAVE,
! 		"Pinnacle PCTV Rave",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000002,		/*  AudioMUX: tuner            */
! 			0x00000001,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x0000000a,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0003000f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_PIXELVIEW_PLAYTV_PAK,
! 		"PixelView PlayTV Pak",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		PFC8582_WADDR,
! 		(u_char)(256/EEPROMBLOCKSIZE),
! 		{
! 			0x00020000,		/*  AudioMUX: tuner            */
! 			0x00080000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x000a8000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00aa0000			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_TERRATVALUE,
! 		"TerraTec TValue",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000500,		/*  AudioMUX: tuner            */
! 			0x00000900,		/*  AudioMUX: extern(line-in)  */
! 			0x00000300,		/*  AudioMUX: intern(radio)    */
! 			0x00000900,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00ffff00			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_PIXELVIEW_PLAYTV_PRO_REV_4C,
! 		"PixelView PlayTV Pro REV-4C",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000001,		/*  AudioMUX: tuner            */
! 			0x00000004,		/*  AudioMUX: extern(line-in)  */
! 			0x00000001,		/*  AudioMUX: intern(radio)    */
! 			0x00000003,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00ffffff			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	/*  ----------------  New Cards  ----------------  */
! 
! 	{
! 		CARD_IO_BCTV4_S,
! 		"I/O DATA GV-BCTV4/PCI",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00010000,		/*  AudioMUX: tuner            */
! 			0x00010000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00010f00			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_IO_BCTV4_A,
! 		"I/O DATA GV-BCTV4/PCI",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00010000,		/*  AudioMUX: tuner            */
! 			0x00010000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00010f00			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_IO_BCTV5,
! 		"I/O DATA GV-BCTV5/PCI",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00010000,		/*  AudioMUX: tuner            */
! 			0x00010000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00010f00			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_IO_BCTV5HI,
! 		"I/O DATA GV-BCTV5HI/PCI",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00010000,		/*  AudioMUX: tuner            */
! 			0x00010000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00010f00			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_IO_BCTV5E,
! 		"I/O DATA GV-BCTV5E/PCI",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00010000,		/*  AudioMUX: tuner            */
! 			0x00010000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00010f00			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_IO_VCP2,
! 		"I/O DATA GV-VCP2/PCI",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			0				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00000000			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_PV951,
! 		"Kuroutoshikou BT878A-TVPCI (ProVideo PV951)",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		1,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			0				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00000000			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_KWTV878,
! 		"Kuroutoshikou BT878A-STVPCI2 (KWORLD KW-TV878-Ultra/M)",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		1,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000000,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			0				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x00000000			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_NEC_PKUGX024_026_034,
! 		"NEC SmartVision Series (PK-UG-X024/X026/X034)",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000101,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000031f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_NEC_PC_BUILTIN_0X80D7,
! 		"NEC PC Built-In TV Card (DeviceID=0x80d7)",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000101,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000031f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_NEC_PC_BUILTIN_0X810D,
! 		"NEC PC Built-In TV Card (DeviceID=0x810d)",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000101,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000031f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_NEC_PC_BUILTIN_0X8114,
! 		"NEC PC Built-In TV Card (DeviceID=0x8114)",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000101,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000031f			/*  AudioMUX: GPIO Mask        */
! 	},
! 
! 	{
! 		CARD_NEC_PC_BUILTIN_0X8147,
! 		"NEC PC Built-In TV Card (DeviceID=0x8147)",
! 		NULL,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		0,
! 		{
! 			0x00000000,		/*  AudioMUX: tuner            */
! 			0x00000101,		/*  AudioMUX: extern(line-in)  */
! 			0x00000000,		/*  AudioMUX: intern(radio)    */
! 			0x00000000,		/*  AudioMUX: mute             */
! 			1				/*  AudioMUX: MUX is present?  */
! 		},
! 		0x0000031f			/*  AudioMUX: GPIO Mask        */
! 	},
! /*  ================  [END]   Modified by K.Kishiro  ================  */
  };
  
  struct bt848_card_sig bt848_card_signature[1]= {
***************
*** 601,630 ****
   * configuration EEPROM used on Bt878/879 cards. They should match the
   * number assigned to the company by the PCI Special Interest Group
   */
  #ifndef __NetBSD__
! #define PCI_VENDOR_HAUPPAUGE	0x0070
! #define PCI_VENDOR_AVERMEDIA	0x1461
! #define PCI_VENDOR_STB		0x10B4
! #define PCI_VENDOR_ASKEY	0x144F
! #define PCI_VENDOR_TERRATEC	0x153B
  #endif
  /* Following not confirmed with http://members.hyperlink.net.au/~chart,
     so not added to NetBSD's pcidevs */
! #define PCI_VENDOR_LEADTEK_ALT	0x6606
! #define PCI_VENDOR_LEADTEK_ALT_2	0x6607
! #define PCI_VENDOR_LEADTEK_ALT_3	0x107d
! #define PCI_VENDOR_FLYVIDEO	0x1851
! #define PCI_VENDOR_FLYVIDEO_2	0x1852
! #define PCI_VENDOR_IODATA	0x10fc
! #define PCI_VENDOR_PINNACLE_ALT	0xBD11	/* They got their own ID backwards? */
! #define PCI_VENDOR_PINNACLE_NEW	0x11BD
! 
! #define MODEL_IODATA_GV_BCTV3_PCI	0x4020
! #define	MODEL_TERRATVALUE_1117		0x1117
! #define MODEL_TERRATVALUE_1118		0x1118
! #define	MODEL_TERRATVALUE_1119		0x1119
! #define	MODEL_TERRATVALUE_111A		0x111a
! #define MODEL_TERRATVALUE_1134		0x1134
  
  void
  probeCard( bktr_ptr_t bktr, int verbose, int unit )
--- 1081,1127 ----
   * configuration EEPROM used on Bt878/879 cards. They should match the
   * number assigned to the company by the PCI Special Interest Group
   */
+ /*  ================  [START] Modified by K.Kishiro  ================  */
  #ifndef __NetBSD__
! #define PCI_VENDOR_HAUPPAUGE			(0x0070)
! #define PCI_VENDOR_AVERMEDIA			(0x1461)
! #define PCI_VENDOR_STB					(0x10b4)
! #define PCI_VENDOR_ASKEY				(0x144f)
! #define PCI_VENDOR_TERRATEC				(0x153B)
  #endif
+ 
  /* Following not confirmed with http://members.hyperlink.net.au/~chart,
     so not added to NetBSD's pcidevs */
! #define PCI_VENDOR_LEADTEK_ALT			(0x6606)
! #define PCI_VENDOR_LEADTEK_ALT_2		(0x6607)
! #define PCI_VENDOR_LEADTEK_ALT_3		(0x107d)
! #define PCI_VENDOR_FLYVIDEO				(0x1851)
! #define PCI_VENDOR_FLYVIDEO_2			(0x1852)
! #define PCI_VENDOR_PINNACLE_ALT			(0xbd11)
! #define PCI_VENDOR_PINNACLE_NEW			(0x11bd)
! #define PCI_VENDOR_IODATA				(0x10fc)
! #define PCI_VENDOR_NEC					(0x1033)
! 
! #define MODEL_IODATA_GV_BCTV3_PCI		(0x4020)
! #define MODEL_IODATA_GV_BCTV4_PCI_S		(0x4050)
! #define MODEL_IODATA_GV_BCTV4_PCI_A		(0x4080)
! #define MODEL_IODATA_GV_BCTV5_PCI		(0x4070)
! #define MODEL_IODATA_GV_BCTV5HI_PCI		(0x4060)
! #define MODEL_IODATA_GV_BCTV5E_PCI		(0xd018)
! #define MODEL_IODATA_GV_VCP2_PCI		(0x4030)
! 
! #define MODEL_NEC_PKUGX024_026_034		(0x80bb)
! #define MODEL_NEC_PC_BUILTIN_0X80D7		(0x80d7)
! #define MODEL_NEC_PC_BUILTIN_0X810D		(0x810d)
! #define MODEL_NEC_PC_BUILTIN_0X8114		(0x8114)
! #define MODEL_NEC_PC_BUILTIN_0X8147		(0x8147)
! 
! #define	MODEL_TERRATVALUE_1117			(0x1117)
! #define MODEL_TERRATVALUE_1118			(0x1118)
! #define	MODEL_TERRATVALUE_1119			(0x1119)
! #define	MODEL_TERRATVALUE_111A			(0x111a)
! #define MODEL_TERRATVALUE_1134			(0x1134)
! /*  ================  [END]   Modified by K.Kishiro  ================  */
  
  void
  probeCard( bktr_ptr_t bktr, int verbose, int unit )
***************
*** 761,774 ****
  		    goto checkTuner;
  		}
  
! 		if (subsystem_vendor_id == PCI_VENDOR_IODATA &&
! 		    subsystem_id == MODEL_IODATA_GV_BCTV3_PCI) {
! 		    bktr->card = cards[ (card = CARD_IO_BCTV3) ];
! 		    bktr->card.eepromAddr = eeprom_i2c_address;
! 		    bktr->card.eepromSize = (u_char)(256 / EEPROMBLOCKSIZE);
! 		    goto checkTuner;
  		}
  
  		if (subsystem_vendor_id == PCI_VENDOR_TERRATEC) {
  		    switch (subsystem_id) {
  			case MODEL_TERRATVALUE_1117:
--- 1258,1361 ----
  		    goto checkTuner;
  		}
  
! /*  ================  [START] Modified by K.Kishiro  ================  */
! 		if(subsystem_vendor_id==PCI_VENDOR_IODATA&&subsystem_id==MODEL_IODATA_GV_BCTV3_PCI)
! 		{
! 			bktr->card=cards[(card=CARD_IO_BCTV3)];
! 			bktr->card.eepromAddr=eeprom_i2c_address;
! 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
! 			goto checkTuner;
! 		}
! 
! 		if(subsystem_vendor_id==PCI_VENDOR_IODATA&&subsystem_id==MODEL_IODATA_GV_BCTV4_PCI_S)
! 		{
! 			bktr->card=cards[(card=CARD_IO_BCTV4_S)];
! 			bktr->card.eepromAddr=eeprom_i2c_address;
! 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
! 			goto checkTuner;
! 		}
! 
! 		if(subsystem_vendor_id==PCI_VENDOR_IODATA&&subsystem_id==MODEL_IODATA_GV_BCTV4_PCI_A)
! 		{
! 			bktr->card=cards[(card=CARD_IO_BCTV4_A)];
! 			bktr->card.eepromAddr=eeprom_i2c_address;
! 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
! 			goto checkTuner;
  		}
  
+ 		if(subsystem_vendor_id==PCI_VENDOR_IODATA&&subsystem_id==MODEL_IODATA_GV_BCTV5_PCI)
+ 		{
+ 			bktr->card=cards[(card=CARD_IO_BCTV5)];
+ 			bktr->card.eepromAddr=eeprom_i2c_address;
+ 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
+ 			goto checkTuner;
+ 		}
+ 
+ 		if(subsystem_vendor_id==PCI_VENDOR_IODATA&&subsystem_id==MODEL_IODATA_GV_BCTV5HI_PCI)
+ 		{
+ 			bktr->card=cards[(card=CARD_IO_BCTV5HI)];
+ 			bktr->card.eepromAddr=eeprom_i2c_address;
+ 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
+ 			goto checkTuner;
+ 		}
+ 
+ 		if(subsystem_vendor_id==PCI_VENDOR_IODATA&&subsystem_id==MODEL_IODATA_GV_BCTV5E_PCI)
+ 		{
+ 			bktr->card=cards[(card=CARD_IO_BCTV5E)];
+ 			bktr->card.eepromAddr=eeprom_i2c_address;
+ 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
+ 			goto checkTuner;
+ 		}
+ 
+ 		if(subsystem_vendor_id==PCI_VENDOR_IODATA&&subsystem_id==MODEL_IODATA_GV_VCP2_PCI)
+ 		{
+ 			bktr->card=cards[(card=CARD_IO_VCP2)];
+ 			bktr->card.eepromAddr=eeprom_i2c_address;
+ 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
+ 			goto checkTuner;
+ 		}
+ 
+ 		if(subsystem_vendor_id==PCI_VENDOR_NEC&&subsystem_id==MODEL_NEC_PKUGX024_026_034)
+ 		{
+ 			bktr->card=cards[(card=CARD_NEC_PKUGX024_026_034)];
+ 			bktr->card.eepromAddr=eeprom_i2c_address;
+ 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
+ 			goto checkTuner;
+ 		}
+ 
+ 		if(subsystem_vendor_id==PCI_VENDOR_NEC&&subsystem_id==MODEL_NEC_PC_BUILTIN_0X80D7)
+ 		{
+ 			bktr->card=cards[(card=CARD_NEC_PC_BUILTIN_0X80D7)];
+ 			bktr->card.eepromAddr=eeprom_i2c_address;
+ 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
+ 			goto checkTuner;
+ 		}
+ 
+ 		if(subsystem_vendor_id==PCI_VENDOR_NEC&&subsystem_id==MODEL_NEC_PC_BUILTIN_0X810D)
+ 		{
+ 			bktr->card=cards[(card=CARD_NEC_PC_BUILTIN_0X810D)];
+ 			bktr->card.eepromAddr=eeprom_i2c_address;
+ 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
+ 			goto checkTuner;
+ 		}
+ 
+ 		if(subsystem_vendor_id==PCI_VENDOR_NEC&&subsystem_id==MODEL_NEC_PC_BUILTIN_0X8114)
+ 		{
+ 			bktr->card=cards[(card=CARD_NEC_PC_BUILTIN_0X8114)];
+ 			bktr->card.eepromAddr=eeprom_i2c_address;
+ 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
+ 			goto checkTuner;
+ 		}
+ 
+ 		if(subsystem_vendor_id==PCI_VENDOR_NEC&&subsystem_id==MODEL_NEC_PC_BUILTIN_0X8147)
+ 		{
+ 			bktr->card=cards[(card=CARD_NEC_PC_BUILTIN_0X8147)];
+ 			bktr->card.eepromAddr=eeprom_i2c_address;
+ 			bktr->card.eepromSize=(u_char)(256/EEPROMBLOCKSIZE);
+ 			goto checkTuner;
+ 		}
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
+ 
  		if (subsystem_vendor_id == PCI_VENDOR_TERRATEC) {
  		    switch (subsystem_id) {
  			case MODEL_TERRATVALUE_1117:
***************
*** 788,793 ****
--- 1375,1389 ----
  		printf("%s: Warning - card vendor 0x%04x (model 0x%04x) unknown.\n",
  		       bktr_name(bktr), subsystem_vendor_id, subsystem_id);
  	    }
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ 		else if(glob_i2cProbe(bktr,PIC16C54)==0)
+ 		{
+ 			bktr->card=cards[(card=CARD_PV951)];
+ 			bktr->card.eepromAddr=0;
+ 			bktr->card.eepromSize=0;
+ 			goto checkTuner;
+ 		}
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
  	    else
  	    {
  		printf("%s: Card has no configuration EEPROM. Cannot determine card make.\n",
***************
*** 1190,1195 ****
--- 1786,1803 ----
  			goto checkDBX;
  		}
  
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ 		if((tuner_make==5)&&(tuner_format==0))
+ 		/*  For M160-C  */
+ 		{
+ 			bktr->card.gpio_mux_bits=0x0000009f;
+ 			/*  Override gpio_mux_bits from (0x0000001f) to (0x0000009f) */
+ 
+ 			tuner=PHILIPS_FI1286_NTSC;
+ 			select_tuner(bktr,tuner);
+ 			goto checkDBX;
+ 		}
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
  	    	printf("%s: Warning - Unknown AVerMedia Tuner Make %d Format %d\n",
  			bktr_name(bktr), tuner_make, tuner_format);
  	    }
***************
*** 1204,1213 ****
  	    goto checkDBX;
  	    break;
  
  	case CARD_IO_BCTV3:
! 	    select_tuner( bktr, ALPS_TSCH5 ); /* ALPS_TSCH6, in fact. */
! 	    goto checkDBX;
! 	    break;
  
  	case CARD_TERRATVALUE:
  	    select_tuner( bktr, PHILIPS_PAL); /* Phlips PAL tuner */
--- 1812,1859 ----
  	    goto checkDBX;
  	    break;
  
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ 
+ 	case CARD_IO_VCP2:
+ 		select_tuner(bktr,NO_TUNER);
+ 		goto checkDBX;
+ 		break;
+ 
  	case CARD_IO_BCTV3:
! 	case CARD_IO_BCTV4_A:
! 		select_tuner(bktr,ALPS_TSCH6);
! 		goto checkDBX;
! 		break;
! 
! 	case CARD_IO_BCTV4_S:
! 	case CARD_NEC_PC_BUILTIN_0X810D:
! 	case CARD_NEC_PC_BUILTIN_0X8114:
! 		select_tuner(bktr,SHARP_2U5JF5540);
! 		goto checkDBX;
! 		break;
! 
! 	case CARD_IO_BCTV5:
! 		select_tuner(bktr,PHILIPS_FR1236_NTSC);
! 		goto checkDBX;
! 		break;
! 
! 	case CARD_IO_BCTV5HI:
! 	case CARD_IO_BCTV5E:
! 	case CARD_PV951:
! 		select_tuner(bktr,PHILIPS_FI1236_NTSC);
! 		goto checkDBX;
! 		break;
! 
! 	case CARD_NEC_PKUGX024_026_034:
! 	case CARD_NEC_PC_BUILTIN_0X80D7:
! 		select_tuner(bktr,ALPS_TSCH4);
! 		goto checkDBX;
! 		break;
! 
! 	case CARD_NEC_PC_BUILTIN_0X8147:
! 		select_tuner(bktr,ALPS_TSCN2);
! 		goto checkDBX;
! /*  ================  [END]   Modified by K.Kishiro  ================  */
  
  	case CARD_TERRATVALUE:
  	    select_tuner( bktr, PHILIPS_PAL); /* Phlips PAL tuner */
diff -crN ./sys/dev/bktr/bktr_card.h ./work/bktr_card.h
*** ./sys/dev/bktr/bktr_card.h	Thu Oct  2 11:57:24 2008
--- ./work/bktr_card.h	Wed Dec  3 14:26:58 2008
***************
*** 82,88 ****
  #define CARD_PIXELVIEW_PLAYTV_PAK	20
  #define CARD_TERRATVALUE	21
  #define	CARD_PIXELVIEW_PLAYTV_PRO_REV_4C	22
! #define Bt848_MAX_CARD		23
   
  #define CARD_IO_GV		CARD_IO_BCTV2
  
--- 82,103 ----
  #define CARD_PIXELVIEW_PLAYTV_PAK	20
  #define CARD_TERRATVALUE	21
  #define	CARD_PIXELVIEW_PLAYTV_PRO_REV_4C	22
! /*  ================  [START] Modified by K.Kishiro  ================  */
! #define CARD_IO_BCTV4_S						(23)
! #define CARD_IO_BCTV4_A						(24)
! #define CARD_IO_BCTV5						(25)
! #define CARD_IO_BCTV5HI						(26)
! #define CARD_IO_BCTV5E						(27)
! #define CARD_IO_VCP2						(28)
! #define CARD_PV951							(29)
! #define CARD_KWTV878						(30)
! #define CARD_NEC_PKUGX024_026_034			(31)
! #define CARD_NEC_PC_BUILTIN_0X80D7			(32)
! #define CARD_NEC_PC_BUILTIN_0X810D			(33)
! #define CARD_NEC_PC_BUILTIN_0X8114			(34)
! #define CARD_NEC_PC_BUILTIN_0X8147			(35)
! #define Bt848_MAX_CARD						(36)
! /*  ================  [END]   Modified by K.Kishiro  ================  */
   
  #define CARD_IO_GV		CARD_IO_BCTV2
  
diff -crN ./sys/dev/bktr/bktr_core.c ./work/bktr_core.c
*** ./sys/dev/bktr/bktr_core.c	Thu Oct  2 11:57:24 2008
--- ./work/bktr_core.c	Wed Dec  3 14:42:34 2008
***************
*** 4063,4068 ****
--- 4063,4071 ----
  	return( (INL(bktr, BKTR_I2C_DATA_CTL) >> 8) & 0xff );
  }
  
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ #endif /* defined(BKTR_USE_FREEBSD_SMBUS) */
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
  /* The MSP34xx Audio chip require i2c bus writes of up to 5 bytes which the */
  /* bt848 automated i2c bus controller cannot handle */
  /* Therefore we need low level control of the i2c bus hardware */
***************
*** 4116,4121 ****
--- 4119,4127 ----
          return( status );
  }
  
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ #if !defined(BKTR_USE_FREEBSD_SMBUS)
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
  static int i2c_read_byte( bktr_ptr_t bktr, unsigned char *data, int last ) {
          int x;
          int bit;
***************
*** 4241,4246 ****
--- 4247,4255 ----
  #endif /* defined(BKTR_USE_FREEBSD_SMBUS) */
  
  
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ #define I2C_SOFTWARE_PROBE
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
  #if defined( I2C_SOFTWARE_PROBE )
  
  /*
***************
*** 4307,4314 ****
--- 4316,4342 ----
  #undef EXTRA_START
  #undef BITD
  
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ int
+ glob_i2cProbe(bktr_ptr_t bktr,int addr)
+ {
+ 	return(i2cProbe(bktr,addr));
+ }
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
  #endif /* I2C_SOFTWARE_PROBE */
  
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ #define BITD		40
+ void
+ pic16c54_write(bktr_ptr_t bktr,int i2c_addr,int addr,int data)
+ {
+ 	i2c_start(bktr);
+ 	i2c_write_byte(bktr,i2c_addr);
+ 	i2c_write_byte(bktr,addr);
+ 	i2c_write_byte(bktr,data);
+ 	i2c_stop(bktr);
+ }
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
  
  #define ABSENT		(-1)
  
diff -crN ./sys/dev/bktr/bktr_core.h ./work/bktr_core.h
*** ./sys/dev/bktr/bktr_core.h	Thu Oct  2 11:57:24 2008
--- ./work/bktr_core.h	Wed Dec  3 14:38:56 2008
***************
*** 94,96 ****
--- 94,100 ----
  int	vbi_close( bktr_ptr_t bktr );
  int	vbi_read( bktr_ptr_t bktr, struct uio *uio, int ioflag );
  
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ int	glob_i2cProbe(bktr_ptr_t bktr,int addr);
+ void	pic16c54_write(bktr_ptr_t bktr,int i2c_addr,int addr,int data);
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
diff -crN ./sys/dev/bktr/bktr_reg.h ./work/bktr_reg.h
*** ./sys/dev/bktr/bktr_reg.h	Thu Oct  2 11:57:24 2008
--- ./work/bktr_reg.h	Wed Dec  3 21:17:46 2008
***************
*** 398,430 ****
  
  /* description of the PHYSICAL tuner */
  struct TUNER {
! 	char*		name;
! 	u_char		type;
! 	u_char		pllControl[4];
! 	u_char		bandLimits[ 2 ];
! 	u_char		bandAddrs[ 4 ];        /* 3 first for the 3 TV 
! 					       ** bands. Last for radio 
! 					       ** band (0x00=NoRadio).
! 					       */
! 
  };
  
  /* description of the card */
  #define EEPROMBLOCKSIZE		32
  struct CARDTYPE {
! 	unsigned int		card_id;	/* card id (from #define's) */
! 	char*			name;
! 	const struct TUNER*	tuner;		/* Tuner details */
! 	u_char			tuner_pllAddr;	/* Tuner i2c address */
! 	u_char			dbx;		/* Has DBX chip? */
! 	u_char			msp3400c;	/* Has msp3400c chip? */
! 	u_char			dpl3518a;	/* Has dpl3518a chip? */
! 	u_char			eepromAddr;
! 	u_char			eepromSize;	/* bytes / EEPROMBLOCKSIZE */
! 	u_int			audiomuxs[ 5 ];	/* tuner, ext (line-in) */
! 						/* int/unused (radio) */
! 						/* mute, present */
! 	u_int			gpio_mux_bits;	/* GPIO mask for audio mux */
  };
  
  struct format_params {
--- 398,443 ----
  
  /* description of the PHYSICAL tuner */
  struct TUNER {
! /*  ================  [START] Modified by K.Kishiro  ================  */
! 	char*		name;			/*  tuner name                                 */
! 	u_char		type;			/*  tuner type                                 */
! 	u_char		pllControl[4];	/*  PLL control bytes                          */
! 								/*    0: for TV (low band)                     */
! 								/*    1: for TV (middle band)                  */
! 								/*    2: for TV (high band)                    */
! 								/*    3: for radio (0x00 means "no radio")     */
! 	u_short		bandLimits[2];  /*  tuner band limits                          */
! 	u_char		bandAddrs[4];	/*  band addresses                             */
! 								/*    0: for TV (low band)                     */
! 								/*    1: for TV (middle band)                  */
! 								/*    2: for TV (high band)                    */
! 								/*    3: for radio (0x00 means "no radio")     */
! 	u_short		IFPCoff;		/*  IFPCoff (active if bandLimits[0,1]!=0x00)  */
! /*  ================  [END]   Modified by K.Kishiro  ================  */
  };
  
  /* description of the card */
  #define EEPROMBLOCKSIZE		32
  struct CARDTYPE {
! /*  ================  [START] Modified by K.Kishiro  ================  */
! 	unsigned int			card_id;		/*  card ID                   */
! 	char*					name;           /*  card name                 */
! 	const struct TUNER*		tuner;			/*  pointer to tuner          */
! 	u_char					tuner_pllAddr;	/*  tuner I2C address         */
! 	u_char					dbx;			/*  has DBX chip?             */
! 	u_char					msp3400c;		/*  has msp3400c chip?        */
! 	u_char					dpl3518a;		/*  has dpl3518a chip?        */
! 	u_char					pic16c54;		/*  has pic16c54 chip?        */
! 	u_char					eepromAddr;     /*  EEPROM address            */
! 	u_char					eepromSize;		/*  EEPROM blocks             */
! 	u_int					audiomuxs[5];	/*  audio MUXs setting        */
! 											/*    0: for tuner            */
! 											/*    1: for extern(line-in)  */
! 											/*    2: for intern/radio     */
! 											/*    3: for mute             */
! 											/*    4: MUX is present?      */
! 	u_int					gpio_mux_bits;	/*  GPIO mask for audio MUX   */
! /*  ================  [END]   Modified by K.Kishiro  ================  */
  };
  
  struct format_params {
***************
*** 730,732 ****
--- 743,758 ----
  #endif
  
  
+ /*  ================  [START] Modified by K.Kishiro  ================  */
+ #define PIC16C54				(0x96)
+ #define PIC16C54_REG_KEYCODE	(0x01)
+ #define PIC16C54_REG_MISC		(0x02)
+ #define PIC16C54_RESETREMOTE	(0x01)
+ #define PIC16C54_MTSMAIN		(0x02)
+ #define PIC16C54_MTSSAP			(0x04)
+ #define PIC16C54_MTSBOTH		(0x08)
+ #define PIC16C54_MUTE			(0x10)
+ #define PIC16C54_NOMUTE			(0x20)
+ #define PIC16C54_TUNER			(0x40)
+ #define PIC16C54_LINE			(0x80)
+ /*  ================  [END]   Modified by K.Kishiro  ================  */
diff -crN ./sys/dev/bktr/bktr_tuner.c ./work/bktr_tuner.c
*** ./sys/dev/bktr/bktr_tuner.c	Thu Oct  2 11:57:24 2008
--- ./work/bktr_tuner.c	Wed Dec  3 14:35:40 2008
***************
*** 140,304 ****
  
  static const struct TUNER tuners[] = {
  /* XXX FIXME: fill in the band-switch crosspoints */
! 	/* NO_TUNER */
! 	{ "<no>",				/* the 'name' */
! 	   TTYPE_XXX,				/* input type */
!  	   { 0x00,				/* control byte for Tuner PLL */
!  	     0x00,
!  	     0x00,
!  	     0x00 },
! 	   { 0x00, 0x00 },			/* band-switch crosspoints */
! 	   { 0x00, 0x00, 0x00,0x00} },		/* the band-switch values */
! 
! 	/* TEMIC_NTSC */
! 	{ "Temic NTSC",				/* the 'name' */
! 	   TTYPE_NTSC,				/* input type */
! 	   { TSA552x_SCONTROL,			/* control byte for Tuner PLL */
! 	     TSA552x_SCONTROL,
! 	     TSA552x_SCONTROL,
! 	     0x00 },
! 	   { 0x00, 0x00},			/* band-switch crosspoints */
! 	   { 0x02, 0x04, 0x01, 0x00 } },	/* the band-switch values */
! 
! 	/* TEMIC_PAL */
! 	{ "Temic PAL",				/* the 'name' */
! 	   TTYPE_PAL,				/* input type */
! 	   { TSA552x_SCONTROL,			/* control byte for Tuner PLL */
! 	     TSA552x_SCONTROL,
! 	     TSA552x_SCONTROL,
! 	     0x00 },
! 	   { 0x00, 0x00 },			/* band-switch crosspoints */
! 	   { 0x02, 0x04, 0x01, 0x00 } },	/* the band-switch values */
! 
! 	/* TEMIC_SECAM */
! 	{ "Temic SECAM",			/* the 'name' */
! 	   TTYPE_SECAM,				/* input type */
! 	   { TSA552x_SCONTROL,			/* control byte for Tuner PLL */
! 	     TSA552x_SCONTROL,
! 	     TSA552x_SCONTROL,
! 	     0x00 },
! 	   { 0x00, 0x00 },			/* band-switch crosspoints */
! 	   { 0x02, 0x04, 0x01,0x00 } },		/* the band-switch values */
! 
! 	/* PHILIPS_NTSC */
! 	{ "Philips NTSC",			/* the 'name' */
! 	   TTYPE_NTSC,				/* input type */
! 	   { TSA552x_SCONTROL,			/* control byte for Tuner PLL */
! 	     TSA552x_SCONTROL,
! 	     TSA552x_SCONTROL,
! 	     0x00 },
! 	   { 0x00, 0x00 },			/* band-switch crosspoints */
! 	   { 0xa0, 0x90, 0x30, 0x00 } },	/* the band-switch values */
! 
! 	/* PHILIPS_PAL */
! 	{ "Philips PAL",			/* the 'name' */
! 	   TTYPE_PAL,				/* input type */
! 	   { TSA552x_SCONTROL,			/* control byte for Tuner PLL */
! 	     TSA552x_SCONTROL,
! 	     TSA552x_SCONTROL,
! 	     0x00 },
! 	   { 0x00, 0x00 },			/* band-switch crosspoints */
! 	   { 0xa0, 0x90, 0x30, 0x00 } },	/* the band-switch values */
! 
! 	/* PHILIPS_SECAM */
! 	{ "Philips SECAM",			/* the 'name' */
! 	   TTYPE_SECAM,				/* input type */
! 	   { TSA552x_SCONTROL,			/* control byte for Tuner PLL */
! 	     TSA552x_SCONTROL,
! 	     TSA552x_SCONTROL,
! 	     0x00 },
! 	   { 0x00, 0x00 },			/* band-switch crosspoints */
! 	   { 0xa7, 0x97, 0x37, 0x00 } },	/* the band-switch values */
! 
! 	/* TEMIC_PAL I */
! 	{ "Temic PAL I",			/* the 'name' */
! 	   TTYPE_PAL,				/* input type */
! 	   { TSA552x_SCONTROL,			/* control byte for Tuner PLL */
! 	     TSA552x_SCONTROL,
! 	     TSA552x_SCONTROL,
! 	     0x00 },
! 	   { 0x00, 0x00 },			/* band-switch crosspoints */
! 	   { 0x02, 0x04, 0x01,0x00 } },		/* the band-switch values */
! 
! 	/* PHILIPS_PALI */
! 	{ "Philips PAL I",			/* the 'name' */
! 	   TTYPE_PAL,				/* input type */
! 	   { TSA552x_SCONTROL,			/* control byte for Tuner PLL */
! 	     TSA552x_SCONTROL,
! 	     TSA552x_SCONTROL,
! 	     0x00 },
!           { 0x00, 0x00 },                      /* band-switch crosspoints */
!           { 0xa0, 0x90, 0x30,0x00 } },         /* the band-switch values */
! 
!        /* PHILIPS_FR1236_NTSC */
!        { "Philips FR1236 NTSC FM",             /* the 'name' */
!           TTYPE_NTSC,                          /* input type */
! 	  { TSA552x_FCONTROL,			/* control byte for Tuner PLL */
! 	    TSA552x_FCONTROL,
! 	    TSA552x_FCONTROL,
! 	    TSA552x_RADIO  },
!           { 0x00, 0x00 },			/* band-switch crosspoints */
! 	  { 0xa0, 0x90, 0x30,0xa4 } },		/* the band-switch values */
! 
! 	/* PHILIPS_FR1216_PAL */
! 	{ "Philips FR1216 PAL FM" ,		/* the 'name' */
! 	   TTYPE_PAL,				/* input type */
! 	   { TSA552x_FCONTROL,			/* control byte for Tuner PLL */
! 	     TSA552x_FCONTROL,
! 	     TSA552x_FCONTROL,
! 	     TSA552x_RADIO },
! 	   { 0x00, 0x00 },			/* band-switch crosspoints */
! 	   { 0xa0, 0x90, 0x30, 0xa4 } },	/* the band-switch values */
! 
! 	/* PHILIPS_FR1236_SECAM */
! 	{ "Philips FR1236 SECAM FM",		/* the 'name' */
! 	   TTYPE_SECAM,				/* input type */
! 	   { TSA552x_FCONTROL,			/* control byte for Tuner PLL */
! 	     TSA552x_FCONTROL,
! 	     TSA552x_FCONTROL,
! 	     TSA552x_RADIO },
! 	   { 0x00, 0x00 },			/* band-switch crosspoints */
! 	   { 0xa7, 0x97, 0x37, 0xa4 } },	/* the band-switch values */
! 
!         /* ALPS TSCH5 NTSC */
!         { "ALPS TSCH5 NTSC FM",                 /* the 'name' */
!            TTYPE_NTSC,                          /* input type */
!            { TSCH5_FCONTROL,                    /* control byte for Tuner PLL */
!              TSCH5_FCONTROL,
!              TSCH5_FCONTROL,
!              TSCH5_RADIO },
!            { 0x00, 0x00 },                      /* band-switch crosspoints */
!            { 0x14, 0x12, 0x11, 0x04 } },        /* the band-switch values */
! 
!         /* ALPS TSBH1 NTSC */
!         { "ALPS TSBH1 NTSC",                    /* the 'name' */
!            TTYPE_NTSC,                          /* input type */
!            { TSBH1_FCONTROL,                    /* control byte for Tuner PLL */
!              TSBH1_FCONTROL,
!              TSBH1_FCONTROL,
!              0x00 },
!            { 0x00, 0x00 },                      /* band-switch crosspoints */
!            { 0x01, 0x02, 0x08, 0x00 } },        /* the band-switch values */
! 
! 	/* MT2032 Microtune */
! 	{ "MT2032",				/* the 'name' */
! 	   TTYPE_PAL,				/* input type */
! 	   { TSA552x_SCONTROL,			/* control byte for Tuner PLL */
! 	     TSA552x_SCONTROL,
! 	     TSA552x_SCONTROL,
! 	     0x00 },
! 	   { 0x00, 0x00 },			/* band-switch crosspoints */
! 	   { 0xa0, 0x90, 0x30, 0x00 } },	/* the band-switch values */
! 
! 	 /* LG TPI8PSB12P PAL */
! 	 { "LG TPI8PSB12P PAL",                 /* the 'name' */
! 	   TTYPE_PAL,                           /* input type */
! 	   { TSA552x_SCONTROL,                  /* control byte for Tuner PLL */
! 	     TSA552x_SCONTROL,
! 	     TSA552x_SCONTROL,
! 	     0x00 },
! 	   { 0x00, 0x00 },                      /* band-switch crosspoints */
! 	   { 0xa0, 0x90, 0x30, 0x8e } },        /* the band-switch values */
  };
  
  
--- 140,346 ----
  
  static const struct TUNER tuners[] = {
  /* XXX FIXME: fill in the band-switch crosspoints */
! /*  ================  [START] Modified by K.Kishiro  ================  */
! 	{
! 		"<no>",
! 		TTYPE_XXX,
! 		{0x00,0x00,0x00,0x00},
! 		{0,0},
! 		{0x00,0x00,0x00,0x00},
! 		0,
! 	},
! 
! 	{	"Temic NTSC",
! 		TTYPE_NTSC,
! 		{TSA552x_SCONTROL,TSA552x_SCONTROL,TSA552x_SCONTROL,0x00},
! 		{0,0},
! 		{0x02,0x04,0x01,0x00},
! 		0,
! 	},
! 
! 	{
! 		"Temic PAL",
! 		TTYPE_PAL,
! 		{TSA552x_SCONTROL,TSA552x_SCONTROL,TSA552x_SCONTROL,0x00},
! 		{0,0},
! 		{0x02,0x04,0x01,0x00},
! 		0,
! 	},
! 
! 	{
! 		"Temic SECAM",
! 		TTYPE_SECAM,
! 		{TSA552x_SCONTROL,TSA552x_SCONTROL,TSA552x_SCONTROL,0x00},
! 		{0,0},
! 		{0x02,0x04,0x01,0x00},
! 		0,
! 	},
! 
! 	{
! 		"Philips NTSC",
! 		TTYPE_NTSC,
! 		{TSA552x_SCONTROL,TSA552x_SCONTROL,TSA552x_SCONTROL,0x00},
! 		{0,0},
! 		{0xa0,0x90,0x30,0x00},
! 		0,
! 	},
! 
! 	{
! 		"Philips PAL",
! 		TTYPE_PAL,
! 		{TSA552x_SCONTROL,TSA552x_SCONTROL,TSA552x_SCONTROL,0x00},
! 		{0,0},
! 		{0xa0,0x90,0x30,0x00},
! 		0,
! 	},
! 
! 	{
! 		"Philips SECAM",
! 		TTYPE_SECAM,
! 		{TSA552x_SCONTROL,TSA552x_SCONTROL,TSA552x_SCONTROL,0x00},
! 		{0,0},
! 		{0xa7,0x97,0x37,0x00},
! 		0,
! 	},
! 
! 	{
! 		"Temic PAL I",
! 		TTYPE_PAL,
! 		{TSA552x_SCONTROL,TSA552x_SCONTROL,TSA552x_SCONTROL,0x00},
! 		{0,0},
! 		{0x02,0x04,0x01,0x00},
! 		0,
! 	},
! 
! 	{
! 		"Philips PAL I",
! 		TTYPE_PAL,
! 		{TSA552x_SCONTROL,TSA552x_SCONTROL,TSA552x_SCONTROL,0x00},
! 		{0,0},
! 		{0xa0,0x90,0x30,0x00},
! 		0,
! 	},
! 
! 	{
! 		"Philips FR1236 NTSC FM",
! 		TTYPE_NTSC,
! 		{TSA552x_FCONTROL,TSA552x_FCONTROL,TSA552x_FCONTROL,TSA552x_RADIO},
! 		{(157.25*16),(451.25*16)},
! 		{0xa0,0x90,0x30,0xa4},
! 		732,
! 	},
! 
! 	{
! 		"Philips FR1216 PAL FM",
! 		TTYPE_PAL,
! 		{TSA552x_FCONTROL,TSA552x_FCONTROL,TSA552x_FCONTROL,TSA552x_RADIO},
! 		{0,0},
! 		{0xa0,0x90,0x30,0xa4},
! 		0,
! 	},
! 
! 	{
! 		"Philips FR1236 SECAM FM",
! 		TTYPE_SECAM,
! 		{TSA552x_FCONTROL,TSA552x_FCONTROL,TSA552x_FCONTROL,TSA552x_RADIO},
! 		{0,0},
! 		{0xa7,0x97,0x37,0xa4},
! 		0,
! 	},
! 
! 	{
! 		"ALPS TSCH5 NTSC FM",
! 		TTYPE_NTSC,
! 		{TSCH5_FCONTROL,TSCH5_FCONTROL,TSCH5_FCONTROL,TSCH5_RADIO},
! 		{0,0},
! 		{0x14,0x12,0x11,0x04},
! 		0,
! 	},
! 
! 	{
! 		"ALPS TSBH1 NTSC",
! 		TTYPE_NTSC,
! 		{TSBH1_FCONTROL,TSBH1_FCONTROL,TSBH1_FCONTROL,0x00},
! 		{0,0},
! 		{0x01,0x02,0x08,0x00},
! 		0,
! 	},
! 
! 	{
! 		"MT2032",
! 		TTYPE_PAL,
! 		{TSA552x_SCONTROL,TSA552x_SCONTROL,TSA552x_SCONTROL,0x00},
! 		{0,0},
! 		{0xa0,0x90,0x30,0x00},
! 		0,
! 	},
! 
! 	{
! 		"LG TPI8PSB12P PAL",
! 		TTYPE_PAL,
! 		{TSA552x_SCONTROL,TSA552x_SCONTROL,TSA552x_SCONTROL,0x00},
! 		{0,0},
! 		{0xa0,0x90,0x30,0x8e},
! 		0,
! 	},
! 
! 	/*  ----------------  New Tuners  ----------------  */
! 
! 	{
! 		"Philips FI1236 NTSC",
! 		TTYPE_NTSC,
! 		{0x8e,0x8e,0x8e,0x00},
! 		{(157.25*16),(451.25*16)},
! 		{0xa0,0x90,0x30,0x00},
! 		732,
! 	},
! 
! 	{
! 		"Philips FI1286 NTSC",
! 		TTYPE_NTSC,
! 		{0x8e,0x8e,0x8e,0x00},
! 		{0,0},
! 		{0xa0,0x90,0x30,0x00},
! 		940,
! 	},
! 
! 	{
! 		"ALPS TSCH4 NTSC",
! 		TTYPE_NTSC,
! 		{0x82,0x82,0x82,0x00},
! 		{(137.25*16),(385.25*16)},
! 		{0x14,0x12,0x11,0x00},
! 		732,
! 	},
! 
! 	{
! 		"ALPS TSCH6 NTSC",
! 		TTYPE_NTSC,
! 		{0x82,0x82,0x82,0x00},
! 		{(137.25*16),(385.25*16)},
! 		{0x14,0x12,0x11,0x00},
! 		732,
! 	},
! 
! 	{
! 		"ALPS TSCN2 NTSC",
! 		TTYPE_NTSC,
! 		{0x82,0x82,0x82,0x00},
! 		{(137.25*16),(385.25*16)},
! 		{0x14,0x12,0x11,0x00},
! 		732,
! 	},
! 
! 	{
! 		"SHARP 2U5JF5540 NTSC",
! 		TTYPE_NTSC,
! 		{0xce,0xce,0xce,0x00},
! 		{(137.25*16),(317.25*16)},
! 		{0x01,0x02,0x08,0x00},
! 		940,
! 	},
! 
! /*  ================  [END]   Modified by K.Kishiro  ================  */
  };
  
  
***************
*** 820,831 ****
  		 * select the band based on frequency
  		 * XXX FIXME: get the cross-over points from the tuner struct
  		 */
! 		if ( frequency < (160 * FREQFACTOR  ) )
! 		    band_select = LOW_BAND;
! 		else if ( frequency < (454 * FREQFACTOR ) )
! 		    band_select = MID_BAND;
  		else
! 		    band_select = HIGH_BAND;
  
  #if defined( TEST_TUNER_AFC )
  		if ( bktr->tuner.afc )
--- 862,899 ----
  		 * select the band based on frequency
  		 * XXX FIXME: get the cross-over points from the tuner struct
  		 */
! /*  ================  [START] Modified by K.Kishiro  ================  */
! 		if((tuner->bandLimits[0]==0)&&(tuner->bandLimits[1]==0))
! 		{
! 			if(frequency<(160*FREQFACTOR))
! 			{
! 				band_select=LOW_BAND;
! 			}
! 			else if(frequency<(454*FREQFACTOR))
! 			{
! 				band_select=MID_BAND;
! 			}
! 			else
! 			{
! 				band_select=HIGH_BAND;
! 			}
! 		}
  		else
! 		{
! 			if(frequency<(tuner->bandLimits[0]))
! 			{
! 				band_select=LOW_BAND;
! 			}
! 			else if(frequency<(tuner->bandLimits[1]))
! 			{
! 				band_select=MID_BAND;
! 			}
! 			else
! 			{
! 				band_select=HIGH_BAND;
! 			}
! 		}
! /*  ================  [END]   Modified by K.Kishiro  ================  */
  
  #if defined( TEST_TUNER_AFC )
  		if ( bktr->tuner.afc )
***************
*** 840,846 ****
  		 * fortunatly, frequency is passed in as MHz * 16
  		 * and the TBL_IF frequency is also stored in MHz * 16
  		 */
! 		N = frequency + TBL_IF;
  
  		/* set the address of the PLL */
  		addr    = bktr->card.tuner_pllAddr;
--- 908,923 ----
  		 * fortunatly, frequency is passed in as MHz * 16
  		 * and the TBL_IF frequency is also stored in MHz * 16
  		 */
! /*  ================  [START] Modified by K.Kishiro  ================  */
! 		if(tuner->IFPCoff==0)
! 		{
! 			N=frequency+TBL_IF;
! 		}
! 		else
! 		{
! 			N=frequency+(tuner->IFPCoff);
! 		}
! /*  ================  [END]   Modified by K.Kishiro  ================  */
  
  		/* set the address of the PLL */
  		addr    = bktr->card.tuner_pllAddr;
***************
*** 864,872 ****
  #if defined( TEST_TUNER_AFC )
  			oldFrequency = frequency;
  #endif
! 			if ( (N = do_afc( bktr, addr, N )) < 0 ) {
! 			    /* AFC failed, restore requested frequency */
! 			    N = frequency + TBL_IF;
  #if defined( TEST_TUNER_AFC )
  			    printf("%s: do_afc: failed to lock\n",
  				   bktr_name(bktr));
--- 941,959 ----
  #if defined( TEST_TUNER_AFC )
  			oldFrequency = frequency;
  #endif
! /*  ================  [START] Modified by K.Kishiro  ================  */
! 			if((N=do_afc(bktr,addr,N))<0)
! 			/* AFC failed, restore requested frequency */
! 			{
! 				if(tuner->IFPCoff==0)
! 				{
! 					N=frequency+TBL_IF;
! 				}
! 				else
! 				{
! 					N=frequency+(tuner->IFPCoff);
! 				}
! /*  ================  [END]   Modified by K.Kishiro  ================  */
  #if defined( TEST_TUNER_AFC )
  			    printf("%s: do_afc: failed to lock\n",
  				   bktr_name(bktr));
***************
*** 874,880 ****
  			    i2cWrite( bktr, addr, (N>>8) & 0x7f, N & 0xff );
  			}
  			else
! 			    frequency = N - TBL_IF;
  #if defined( TEST_TUNER_AFC )
   printf("%s: do_afc: returned freq %d (%d %% %d)\n", bktr_name(bktr), frequency, frequency / 16, frequency % 16);
  			    afcDelta = frequency - oldFrequency;
--- 961,978 ----
  			    i2cWrite( bktr, addr, (N>>8) & 0x7f, N & 0xff );
  			}
  			else
! /*  ================  [START] Modified by K.Kishiro  ================  */
! 			{
! 				if(tuner->IFPCoff==0)
! 				{
! 					frequency=N-TBL_IF;
! 				}
! 				else
! 				{
! 					frequency=N-(tuner->IFPCoff);
! 				}
! 			}
! /*  ================  [END]   Modified by K.Kishiro  ================  */
  #if defined( TEST_TUNER_AFC )
   printf("%s: do_afc: returned freq %d (%d %% %d)\n", bktr_name(bktr), frequency, frequency / 16, frequency % 16);
  			    afcDelta = frequency - oldFrequency;
diff -crN ./sys/dev/bktr/bktr_tuner.h ./work/bktr_tuner.h
*** ./sys/dev/bktr/bktr_tuner.h	Thu Oct  2 11:57:24 2008
--- ./work/bktr_tuner.h	Wed Dec  3 14:32:34 2008
***************
*** 61,67 ****
  #define ALPS_TSBH1		13
  #define TUNER_MT2032		14
  #define	LG_TPI8PSB12P_PAL	15
! #define Bt848_MAX_TUNER		16
  
  /* experimental code for Automatic Frequency Control */ 
  #define TUNER_AFC
--- 61,75 ----
  #define ALPS_TSBH1		13
  #define TUNER_MT2032		14
  #define	LG_TPI8PSB12P_PAL	15
! /*  ================  [START] Modified by K.Kishiro  ================  */
! #define PHILIPS_FI1236_NTSC		(16)
! #define PHILIPS_FI1286_NTSC		(17)
! #define ALPS_TSCH4				(18)
! #define ALPS_TSCH6				(19)
! #define ALPS_TSCN2				(20)
! #define SHARP_2U5JF5540			(21)
! #define Bt848_MAX_TUNER			(22)
! /*  ================  [END]   Modified by K.Kishiro  ================  */
  
  /* experimental code for Automatic Frequency Control */ 
  #define TUNER_AFC
