diff options
Diffstat (limited to 'v4l_experimental/pvrusb2')
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-audio.c | 4 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-demod.c | 4 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-eeprom.c | 166 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c | 4 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-main.c | 4 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-tuner.c | 10 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-version.h | 4 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-video-v4l.c | 6 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-video-v4l.h | 4 |
9 files changed, 9 insertions, 197 deletions
diff --git a/v4l_experimental/pvrusb2/pvrusb2-audio.c b/v4l_experimental/pvrusb2/pvrusb2-audio.c index e48b4973e..4d98207ef 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-audio.c +++ b/v4l_experimental/pvrusb2/pvrusb2-audio.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-audio.c,v 1.6 2006/01/03 05:56:32 mcisely Exp $ + * $Id: pvrusb2-audio.c,v 1.7 2006/01/14 19:09:50 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -27,9 +27,7 @@ #include "msp3400.h" #include <linux/videodev.h> #include <media/audiochip.h> -#ifndef PVR2_SUPPRESS_V4L2COMMON #include <media/v4l2-common.h> -#endif struct pvr2_msp3400_handler { struct pvr2_hdw *hdw; diff --git a/v4l_experimental/pvrusb2/pvrusb2-demod.c b/v4l_experimental/pvrusb2/pvrusb2-demod.c index f11a21cd4..42f3340f7 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-demod.c +++ b/v4l_experimental/pvrusb2/pvrusb2-demod.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-demod.c,v 1.3 2006/01/03 05:56:32 mcisely Exp $ + * $Id: pvrusb2-demod.c,v 1.4 2006/01/14 19:09:50 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -28,9 +28,7 @@ #include "compat.h" #include <linux/videodev.h> #include <media/tuner.h> -#ifndef PVR2_SUPPRESS_V4L2COMMON #include <media/v4l2-common.h> -#endif struct pvr2_demod_handler { diff --git a/v4l_experimental/pvrusb2/pvrusb2-eeprom.c b/v4l_experimental/pvrusb2/pvrusb2-eeprom.c index e963cf480..9df9fd3eb 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-eeprom.c +++ b/v4l_experimental/pvrusb2/pvrusb2-eeprom.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-eeprom.c,v 1.4 2005/12/02 13:32:17 mcisely Exp $ + * $Id: pvrusb2-eeprom.c,v 1.5 2006/01/14 19:09:50 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -74,45 +74,7 @@ */ -#ifdef PVR2_EEPROM_INDIRECT -/*VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV*/ -/* BEGIN INDIRECT METHOD */ - -#include "pvrusb2-i2c.h" - -/* Use I2C client interface to retrieve usable information from within - * tveeprom. This tends to be more stable than directly calling. */ - -int pvr2_eeprom_analyze(struct pvr2_hdw *hdw) -{ - u32 props[5]; - int stat; - stat = pvr2_i2c_tveeprom_cmd(hdw,0,props); - if (stat < 0) { - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "Failed to retrieve eeprom data stat=%d",stat); - return stat; - } - - trace_eeprom("eeprom client query results:"); - trace_eeprom("tuner_type=%d",props[0]); - trace_eeprom("tuner_formats=0x%x",props[1]); - trace_eeprom("model=%d",props[2]); - trace_eeprom("revision=%d",props[3]); - trace_eeprom("has_radio=%d",props[4]); - - hdw->tuner_type = props[0]; - hdw->video_standards = props[1]; - - return 0; -} - -/* END INDIRECT METHOD */ -/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ -#endif /* PVR2_EEPROM_INDIRECT */ - -#ifndef PVR2_EEPROM_INDIRECT /* Stuff common to direct approach of operation tveeprom */ @@ -179,7 +141,6 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw) } -#ifndef PVR2_EEPROM_IVTV /*VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV*/ /* BEGIN DIRECT METHOD, V4L ONLY */ @@ -230,136 +191,11 @@ int pvr2_eeprom_analyze(struct pvr2_hdw *hdw) /* END DIRECT METHOD, V4L ONLY */ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ -#endif /* PVR2_EEPROM_IVTV */ - - - - -#ifdef PVR2_EEPROM_IVTV -/*VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV*/ -/* BEGIN DIRECT METHOD, V4L OR IVTV */ - -/* Directly call eeprom analysis function within tveeprom. This has - portability issues because the internal API has been changing. We - have to do something positively gross here. The two variants of - tveeprom that we deal with (ivtv and v4l) use completely different - definitions for the tveeprom structure. To accomodate this, we'll - allocate enough storage for the larger of the two, initialize it to - bad but predictable data, and then call the analysis function. - Upon return, we'll check how much data was changed and use that as - a hint to determine exactly which tveeprom structure had been - used. Did I say this was ugly? It's disgusting. */ - - -/* This has to be an EXACT(!!) match with the tveeprom structure - defined in our local copy of tveeprom.c. */ -struct tveeprom_ivtv { - u32 has_radio; - - u32 tuner_type; - u32 tuner_formats; - - u32 digitizer; - u32 digitizer_formats; - - u32 audio_processor; - u32 decoder_processor; - /* a_p_fmts? */ - - u32 model; - u32 revision; - u32 serial_number; - char rev_str[5]; -}; - -int pvr2_eeprom_analyze(struct pvr2_hdw *hdw) -{ - u8 *eeprom; - unsigned tcnt; - int tp; - union { - struct tveeprom v4l; - struct tveeprom_ivtv ivtv; - } tvdata; - memset(&tvdata,0x93,sizeof(tvdata)); - eeprom = pvr2_eeprom_fetch(hdw); - if (!eeprom) return -EINVAL; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14) - { - struct i2c_client fake_client; - /* Newer version expects a useless client interface */ - fake_client.addr = PVR_EEPROM_I2C_ADDR; - fake_client.adapter = &hdw->i2c_adap; - tveeprom_hauppauge_analog(&fake_client, - (struct tveeprom *)&tvdata,eeprom); - } -#else - tveeprom_hauppauge_analog((struct tveeprom *)&tvdata,eeprom); -#endif - - /* Now figure out which structure was used */ - for (tcnt = 0; tcnt < sizeof(tvdata); tcnt++) { - if (((unsigned char *)(&tvdata))[sizeof(tvdata) - (tcnt+1)] != - 0x93) { - break; - } - } - tcnt = sizeof(tvdata) - tcnt; - - if (sizeof(tvdata.ivtv) < sizeof(tvdata.v4l)) { - tp = 0; - if (tcnt > sizeof(tvdata.ivtv)) tp = 1; - } else { - tp = 1; - if (tcnt > sizeof(tvdata.v4l)) tp = 0; - } - - if (tp) { - /* v4l */ - trace_eeprom("eeprom detected v4l tveeprom module"); - trace_eeprom("eeprom direct call results:"); - trace_eeprom("has_radio=%d",tvdata.v4l.has_radio); - trace_eeprom("tuner_type=%d",tvdata.v4l.tuner_type); - trace_eeprom("tuner_formats=0x%x",tvdata.v4l.tuner_formats); - trace_eeprom("audio_processor=%d",tvdata.v4l.audio_processor); - trace_eeprom("model=%d",tvdata.v4l.model); - trace_eeprom("revision=%d",tvdata.v4l.revision); - trace_eeprom("serial_number=%d",tvdata.v4l.serial_number); - trace_eeprom("rev_str=%s",tvdata.v4l.rev_str); - hdw->tuner_type = tvdata.v4l.tuner_type; - hdw->serial_number = tvdata.v4l.serial_number; - hdw->video_standards = tvdata.v4l.tuner_formats; - } else { - /* ivtv */ - trace_eeprom("eeprom detected ivtv tveeprom module"); - trace_eeprom("eeprom direct call results:"); - trace_eeprom("has_radio=%d",tvdata.ivtv.has_radio); - trace_eeprom("tuner_type=%d",tvdata.ivtv.tuner_type); - trace_eeprom("tuner_formats=0x%x",tvdata.ivtv.tuner_formats); - trace_eeprom("audio_processor=%d",tvdata.ivtv.audio_processor); - trace_eeprom("model=%d",tvdata.ivtv.model); - trace_eeprom("revision=%d",tvdata.ivtv.revision); - trace_eeprom("serial_number=%d",tvdata.ivtv.serial_number); - trace_eeprom("rev_str=%s",tvdata.ivtv.rev_str); - hdw->tuner_type = tvdata.ivtv.tuner_type; - hdw->serial_number = tvdata.ivtv.serial_number; - hdw->video_standards = tvdata.ivtv.tuner_formats; - } - - kfree(eeprom); - - return 0; -} - -/* END DIRECT METHOD, V4L OR IVTV */ -/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ -#endif /* PVR2_EEPROM_V4L */ -#endif /* PVR2_EEPROM_INDIRECT */ static v4l2_std_id std_choices[] = { diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c b/v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c index 03b6872cc..dedb1ed24 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c +++ b/v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-i2c-chips-v4l2.c,v 1.1 2006/01/01 08:26:03 mcisely Exp $ + * $Id: pvrusb2-i2c-chips-v4l2.c,v 1.2 2006/01/14 19:09:50 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -66,13 +66,11 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) return; } } -#ifndef PVR2_SUPPRESS_SAA711X if (id == I2C_DRIVERID_SAA711X) { if (pvr2_i2c_decoder_v4l_setup(hdw,cp)) { return; } } -#endif /* This is a really horrid way to identify the tda9887 driver, however (1) its assigned id is -1 which is completely useless to us, and (2) perhaps tda9887 is going to disappear soon anyway. diff --git a/v4l_experimental/pvrusb2/pvrusb2-main.c b/v4l_experimental/pvrusb2/pvrusb2-main.c index aa6fa7c9d..0c856207b 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-main.c +++ b/v4l_experimental/pvrusb2/pvrusb2-main.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-main.c,v 1.4 2006/01/09 06:54:46 mcisely Exp $ + * $Id: pvrusb2-main.c,v 1.5 2006/01/14 19:09:50 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -31,7 +31,6 @@ #include <linux/usb.h> #include <linux/videodev.h> -#include "pvrusb2-version.h" #include "pvrusb2-hdw.h" #include "pvrusb2-context.h" #include "pvrusb2-debug.h" @@ -40,6 +39,7 @@ #define DRIVER_AUTHOR "Mike Isely <isely@pobox.com>" #define DRIVER_DESC "Hauppauge WinTV-PVR-USB2 MPEG2 Encoder/Tuner" +#define DRIVER_VERSION "V4L in-tree version" #define DEFAULT_DEBUG_MASK (PVR2_TRACE_ERROR_LEGS| \ PVR2_TRACE_INFO| \ diff --git a/v4l_experimental/pvrusb2/pvrusb2-tuner.c b/v4l_experimental/pvrusb2/pvrusb2-tuner.c index b02b35954..5223bfcb0 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-tuner.c +++ b/v4l_experimental/pvrusb2/pvrusb2-tuner.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-tuner.c,v 1.10 2006/01/03 06:00:57 mcisely Exp $ + * $Id: pvrusb2-tuner.c,v 1.11 2006/01/14 19:09:50 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -28,9 +28,7 @@ #include "compat.h" #include <linux/videodev.h> #include <media/tuner.h> -#ifndef PVR2_SUPPRESS_V4L2COMMON #include <media/v4l2-common.h> -#endif struct pvr2_tuner_handler { struct pvr2_hdw *hdw; @@ -43,21 +41,15 @@ struct pvr2_tuner_handler { static void set_type(struct pvr2_tuner_handler *ctxt) { struct pvr2_hdw *hdw = ctxt->hdw; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) struct tuner_setup setup; -#endif pvr2_trace(PVR2_TRACE_CHIPS,"i2c tuner set_type(%d)",hdw->tuner_type); if (((int)(hdw->tuner_type)) < 0) return; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) setup.addr = ADDR_UNSET; setup.type = hdw->tuner_type; setup.mode_mask = T_RADIO | T_ANALOG_TV; /* We may really want mode_mask to be T_ANALOG_TV for now */ pvr2_i2c_client_cmd(ctxt->client,TUNER_SET_TYPE_ADDR,&setup); -#else - pvr2_i2c_client_cmd(ctxt->client,TUNER_SET_TYPE,&hdw->tuner_type); -#endif ctxt->type_update_fl = 0; } diff --git a/v4l_experimental/pvrusb2/pvrusb2-version.h b/v4l_experimental/pvrusb2/pvrusb2-version.h deleted file mode 100644 index 9978219d4..000000000 --- a/v4l_experimental/pvrusb2/pvrusb2-version.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _INCLUDED_PVRUSB2_DRIVER_VERSION -#define _INCLUDED_PVRUSB2_DRIVER_VERSION -#define DRIVER_VERSION "20051231 (from v4l tree)" -#endif diff --git a/v4l_experimental/pvrusb2/pvrusb2-video-v4l.c b/v4l_experimental/pvrusb2/pvrusb2-video-v4l.c index 4b21094a0..2e3f84cac 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-video-v4l.c +++ b/v4l_experimental/pvrusb2/pvrusb2-video-v4l.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-video-v4l.c,v 1.8 2006/01/03 05:56:32 mcisely Exp $ + * $Id: pvrusb2-video-v4l.c,v 1.9 2006/01/14 19:09:50 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -30,14 +30,11 @@ #include "pvrusb2-video-v4l.h" -#ifndef PVR2_SUPPRESS_SAA711X #include "pvrusb2-hdw-internal.h" #include "pvrusb2-debug.h" #include <linux/videodev.h> -#ifndef PVR2_SUPPRESS_V4L2COMMON #include <media/v4l2-common.h> -#endif #include <linux/errno.h> #include <linux/slab.h> @@ -229,7 +226,6 @@ int pvr2_i2c_decoder_v4l_setup(struct pvr2_hdw *hdw, } -#endif /* PVR2_SUPPRESS_SAA711X */ /* diff --git a/v4l_experimental/pvrusb2/pvrusb2-video-v4l.h b/v4l_experimental/pvrusb2/pvrusb2-video-v4l.h index fe4679f48..b47e64791 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-video-v4l.h +++ b/v4l_experimental/pvrusb2/pvrusb2-video-v4l.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-video-v4l.h,v 1.2 2006/01/01 08:26:03 mcisely Exp $ + * $Id: pvrusb2-video-v4l.h,v 1.3 2006/01/14 19:09:50 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -34,13 +34,11 @@ #include "compat.h" -#ifndef PVR2_SUPPRESS_SAA711X #include "pvrusb2-i2c-core.h" int pvr2_i2c_decoder_v4l_setup(struct pvr2_hdw *,struct pvr2_i2c_client *); -#endif /* PVR2_SUPPRESS_SAA711X */ #endif /* __PVRUSB2_VIDEO_V4L_H */ |