diff -ur ivtv-0.3.2a/driver/ivtv-cards.c ivtv-0.3.2a-hack/driver/ivtv-cards.c --- ivtv-0.3.2a/driver/ivtv-cards.c 2004-11-15 15:53:12.000000000 -0600 +++ ivtv-0.3.2a-hack/driver/ivtv-cards.c 2005-01-26 18:43:05.026874520 -0600 @@ -180,6 +180,52 @@ static const int ivtv_pvr_inputs_size = sizeof(ivtv_pvr_inputs) / sizeof(ivtv_pvr_inputs[0]); static const int ivtv_pvr150_inputs_size = sizeof(ivtv_pvr150_inputs) / sizeof(ivtv_pvr150_inputs[0]); +static struct v4l2_input ivtv_pg600_inputs[] = { + { + .index = 0, + .name = "S-Video 0", + .type = V4L2_INPUT_TYPE_CAMERA, + .audioset = 3, + .tuner = 0, + .status = 0, + .std = V4L2_STD_ALL, + },{ + .index = 1, + .name = "Tuner", + .type = V4L2_INPUT_TYPE_TUNER, + .audioset = 3, + .tuner = 0, + .status = 0, + .std = V4L2_STD_ALL, + },{ + .index = 2, + .name = "Composite", + .type = V4L2_INPUT_TYPE_CAMERA, + .audioset = 3, + .tuner = 0, + .status = 0, + .std = V4L2_STD_ALL, + },{ + .index = 3, + .name = "Audio tuner in", + .type = V4L2_INPUT_TYPE_CAMERA, + .audioset = 3, + .tuner = 0, + .status = 0, + .std = V4L2_STD_ALL, + },{ + .index = 4, + .name = "Audio line in", + .type = V4L2_INPUT_TYPE_CAMERA, + .audioset = 3, + .tuner = 0, + .status = 0, + .std = V4L2_STD_ALL, + } +}; + +static const int ivtv_pg600_inputs_size = sizeof(ivtv_pg600_inputs) / sizeof(ivtv_pg600_inputs[0]); + /* Inputs for MPG600/MPG160/M179 cards */ static struct v4l2_input ivtv_mpg_inputs[] = { @@ -256,6 +302,10 @@ if (index >= ivtv_pvr150_inputs_size) return NULL; return &ivtv_pvr150_inputs[index]; + case IVTV_CARD_PG600: + if (index >= ivtv_pg600_inputs_size) + return NULL; + return &ivtv_pg600_inputs[index]; default: if (index >= ivtv_pvr_inputs_size) return NULL; @@ -365,6 +415,7 @@ #define IVTV_MPG600_TUNER_I2C_ADDR 0x60 #define IVTV_MPG160_TUNER_I2C_ADDR 0x60 #define IVTV_M179_TUNER_I2C_ADDR 0x60 +#define IVTV_PG600_TUNER_I2C_ADDR 0xC0 static const struct ivtv_card_pci_info ivtv_pci_pvr150[] = { { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_HAUPPAUGE, 0x8801 }, @@ -405,6 +456,11 @@ { 0, 0, 0 } }; +static const struct ivtv_card_pci_info ivtv_pci_pg600[] = { + { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_DIAMONDMM, 0x0070 }, + { 0, 0, 0 } +}; + static const struct ivtv_card ivtv_card_list[] = { { .type = IVTV_CARD_PVR_150, @@ -448,6 +504,13 @@ .i2c_tuner_addr = IVTV_MPG160_TUNER_I2C_ADDR, .audio_selector = USE_GPIO, .pci_list = ivtv_pci_mpg160, + },{ + .type = IVTV_CARD_PG600, + .name = "YUAN PG600/DIAMOND PVR-550 (CX FALCON2)", + .v4l2_capabilities = V4L2_CAP_ENCODER, + .i2c_tuner_addr = IVTV_PG600_TUNER_I2C_ADDR, + .audio_selector = USE_CX25840, + .pci_list = ivtv_pci_pg600, } }; diff -ur ivtv-0.3.2a/driver/ivtv-controls.c ivtv-0.3.2a-hack/driver/ivtv-controls.c --- ivtv-0.3.2a/driver/ivtv-controls.c 2004-10-31 03:22:38.000000000 -0600 +++ ivtv-0.3.2a-hack/driver/ivtv-controls.c 2005-01-26 18:34:46.928596968 -0600 @@ -282,7 +282,8 @@ /* Also upgrade the digitizer setting */ /* FIXME not obvious how this works * (see ivtv_ctrl_query_freq[]) */ - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_SET_AUDIO, &v); else ivtv_saa7115(itv, DECODER_SET_AUDIO, &v); @@ -377,12 +378,14 @@ case V4L2_CID_BRIGHTNESS: if (v < 0 || v > 255) return -ERANGE; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_GET_PICTURE, &pic); pic.bright = v; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_SET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_SET_PICTURE, &pic); @@ -390,12 +393,14 @@ case V4L2_CID_HUE: if (v < -128 || v > 127) return -ERANGE; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_GET_PICTURE, &pic); pic.hue = v; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_SET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_SET_PICTURE, &pic); @@ -403,12 +408,14 @@ case V4L2_CID_SATURATION: if (v < 0 || v > 127) return -ERANGE; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_GET_PICTURE, &pic); pic.sat = v; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_SET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_SET_PICTURE, &pic); @@ -416,12 +423,14 @@ case V4L2_CID_CONTRAST: if (v < 0 || v > 127) return -ERANGE; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_GET_PICTURE, &pic); pic.contrast = v; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_SET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_SET_PICTURE, &pic); @@ -504,28 +513,32 @@ /* Standard V4L2 controls */ case V4L2_CID_BRIGHTNESS: - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_GET_PICTURE, &pic); vctrl->value = pic.bright; break; case V4L2_CID_HUE: - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_GET_PICTURE, &pic); vctrl->value = pic.hue; break; case V4L2_CID_SATURATION: - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_GET_PICTURE, &pic); vctrl->value = pic.sat; break; case V4L2_CID_CONTRAST: - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_PICTURE, &pic); else ivtv_saa7115(itv, DECODER_GET_PICTURE, &pic); diff -ur ivtv-0.3.2a/driver/ivtv-driver.c ivtv-0.3.2a-hack/driver/ivtv-driver.c --- ivtv-0.3.2a/driver/ivtv-driver.c 2004-12-01 09:42:38.000000000 -0600 +++ ivtv-0.3.2a-hack/driver/ivtv-driver.c 2005-01-26 18:34:48.797312880 -0600 @@ -800,7 +800,8 @@ if (autoload) { ivtv_request_module("tuner"); - if (itv->card->type == IVTV_CARD_PVR_150) { + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) { ivtv_request_module("cx25840"); ivtv_request_module("wm8775"); } else @@ -910,7 +911,9 @@ ivtv_tuner(itv, VIDIOCSFREQ, &freq); /* Change Input to active, 150 needs this, seems right */ - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) + ivtv_cx25840(itv, DECODER_SET_INPUT, &itv->active_input); else ivtv_saa7115(itv, DECODER_SET_INPUT, &itv->active_input); Only in ivtv-0.3.2a-hack/driver: ivtv-driver.c.orig Only in ivtv-0.3.2a-hack/driver: ivtv-driver.c.rej diff -ur ivtv-0.3.2a/driver/ivtv-driver.h ivtv-0.3.2a-hack/driver/ivtv-driver.h --- ivtv-0.3.2a/driver/ivtv-driver.h 2004-12-17 13:52:00.000000000 -0600 +++ ivtv-0.3.2a-hack/driver/ivtv-driver.h 2005-01-26 18:34:48.800312424 -0600 @@ -142,6 +142,7 @@ #define IVTV_CARD_MPG160 4 /* Kuroutoshikou ITVC15-STVLP/YUAN MPG160 iTVC15 based, but does not have tv-out */ #define IVTV_CARD_PVR_150 5 /* wintv pvr 250 */ +#define IVTV_CARD_PG600 6 /* YUAN PG600/DIAMONDMM PVR-550 based on the CX Falcon 2 */ #define NO_AUDIO 0 /* the card can't handle audio */ #define USE_MSP34XX 1 /* switch audio by MSP34XX */ @@ -187,6 +188,9 @@ #define IVTV_MBOX_FIELD_DISPLAYED 8 #define IVTV_MBOX_SIZE 80 +#define IVTV_PCI_ID_DIAMONDMM 0xff92 +#define IVTV_PCI_ID_XTREME550 0x0070 + /* API Command timeout for DMA xfers, divide xfer/timeout, wait for api cmd? */ #define OSD_API_TIMEOUT 500 /* Divide xfer size by this */ #define DEC_API_TIMEOUT 500 /* Divide xfer size by this */ diff -ur ivtv-0.3.2a/driver/ivtv-ioctl.c ivtv-0.3.2a-hack/driver/ivtv-ioctl.c --- ivtv-0.3.2a/driver/ivtv-ioctl.c 2004-11-18 23:11:16.000000000 -0600 +++ ivtv-0.3.2a-hack/driver/ivtv-ioctl.c 2005-01-26 18:34:48.803311968 -0600 @@ -362,14 +362,16 @@ /* ioctls to allow direct access to the saa7115 registers for testing */ case IVTV_IOC_G_SAA7115_REG: - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_REG, arg); else ivtv_saa7115(itv, DECODER_GET_REG, arg); break; case IVTV_IOC_S_SAA7115_REG: - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_SET_REG, arg); else ivtv_saa7115(itv, DECODER_SET_REG, arg); @@ -598,7 +600,8 @@ /* FIXME: only sets resolution for now */ wind.width = itv->width = fmt->fmt.pix.width; wind.height = itv->height = fmt->fmt.pix.height; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_SET_SIZE, &wind); else ivtv_saa7115(itv, DECODER_SET_SIZE, &wind); @@ -698,7 +701,8 @@ we're finished changing inputs. */ down(&stream->mlock); mute_and_pause(itv); - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_SET_INPUT, &inp); else ivtv_saa7115(itv, DECODER_SET_INPUT, &inp); @@ -868,7 +872,8 @@ } /* Digitizer */ - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_SET_NORM, &norm); else ivtv_saa7115(itv, DECODER_SET_NORM, &norm); @@ -937,7 +942,8 @@ vt->rangelow = 0; vt->rangehigh = 0xffffffffUL; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_STATUS, &sig); else ivtv_saa7115(itv, DECODER_GET_STATUS, &sig); Only in ivtv-0.3.2a-hack/driver: ivtv-ioctl.c.orig diff -ur ivtv-0.3.2a/driver/ivtv-streams.c ivtv-0.3.2a-hack/driver/ivtv-streams.c --- ivtv-0.3.2a/driver/ivtv-streams.c 2004-12-17 13:14:49.000000000 -0600 +++ ivtv-0.3.2a-hack/driver/ivtv-streams.c 2005-01-26 18:34:48.806311512 -0600 @@ -598,7 +598,8 @@ int vbi_off = 1 << 31; // VBI combined with scaling doesn't work. - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_SET_VBI, &vbi_off); else ivtv_saa7115(itv, DECODER_SET_VBI, &vbi_off); @@ -610,7 +611,8 @@ } // setup VBI registers - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_SET_VBI, &itv->vbi_service_set_in); else ivtv_saa7115(itv, DECODER_SET_VBI, &itv->vbi_service_set_in); @@ -802,7 +804,8 @@ /* Disable digitizer (saa7115) */ IVTV_DEBUG(IVTV_DEBUG_INFO, "Disabling digitizer\n"); dig=0; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_ENABLE_OUTPUT, &dig); else ivtv_saa7115(itv, DECODER_ENABLE_OUTPUT, &dig); @@ -813,7 +816,8 @@ /* enable digitizer (saa7115) */ IVTV_DEBUG(IVTV_DEBUG_INFO, "Enabling digitizer\n"); dig=1; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_ENABLE_OUTPUT, &dig); else ivtv_saa7115(itv, DECODER_ENABLE_OUTPUT, &dig); diff -ur ivtv-0.3.2a/driver/ivtv-vbi.c ivtv-0.3.2a-hack/driver/ivtv-vbi.c --- ivtv-0.3.2a/driver/ivtv-vbi.c 2004-10-29 01:21:26.000000000 -0500 +++ ivtv-0.3.2a-hack/driver/ivtv-vbi.c 2005-01-26 18:34:48.807311360 -0600 @@ -596,7 +596,8 @@ if (itv->vbi_passthrough & IVTV_SLICED_WSS_625) { int wss; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_WSS, &wss); else ivtv_saa7115(itv, DECODER_GET_WSS, &wss); @@ -613,7 +614,8 @@ u8 c1 = 0, c2 = 0, c3 = 0, c4 = 0; int mode = 0, cc; - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_CC_ODD, &cc); else ivtv_saa7115(itv, DECODER_GET_CC_ODD, &cc); @@ -622,7 +624,8 @@ c1 = cc & 0xff; c2 = cc >> 8; } - if (itv->card->type == IVTV_CARD_PVR_150) + if (itv->card->type == IVTV_CARD_PVR_150 || + itv->card->type == IVTV_CARD_PG600) ivtv_cx25840(itv, DECODER_GET_CC_EVEN, &cc); else ivtv_saa7115(itv, DECODER_GET_CC_EVEN, &cc); Only in ivtv-0.3.2a-hack/driver: tuner.c diff -ur ivtv-0.3.2a/driver/tuner.h ivtv-0.3.2a-hack/driver/tuner.h --- ivtv-0.3.2a/driver/tuner.h 2004-09-09 14:54:19.000000000 -0500 +++ ivtv-0.3.2a-hack/driver/tuner.h 2005-01-24 21:52:43.111739208 -0600 @@ -72,6 +72,7 @@ #define TUNER_TNF_8831BGFF 48 #define TUNER_MICROTUNE_4042FI5 49>----/* FusionHDTV 3 Gold - 4042 FI5 (3X 8147) */ #define TUNER_TCL_2002N 50 +#define TUNER_PHILIPS_FQ1236_MK3 51 #define NOTUNER 0 #define PAL 1 /* PAL_BG */