From 2087cdd4267be1433f9aa2363504a8399f877f6b Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Thu, 12 Jan 2006 17:06:49 +0000 Subject: Redesign tuners struct for maximum flexibility From: Michael Krufky - tunertype struct redefined to allow one or more tuner_params structs per tuner definition, one for each video standard. - Each tuner_params struct has an element containing an arbitrary amount of tuner_ranges. (this is needed for dvb tuners - to be handled later) - A tuner_range may be referenced by multiple tuner_params structs. There are many duplicates in here. Reusing tuner_range structs, rather than defining new ones for each tuner, will cut down on memory usage, and is preferred when possible. - tunertype struct contains an element, has_tda988x. We must set this for all tunertypes that contain a tda988x chip, and then we can remove this setting from the various card structs. - Improves tuners array memory usage efficiency. - Right now, all tuners are using the first tuner_params[] array element for analog mode. In the future, we will be merging similar tuner definitions together, such that each tuner definition will have a tuner_params struct for each available video standard. At that point, the tuner_params[] array element will be chosen based on the video standard in use. Signed-off-by: Michael Krufky --- linux/include/media/tuner-types.h | 53 +++++++++++++++++++++++++++++++++++++++ linux/include/media/tuner.h | 3 ++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 linux/include/media/tuner-types.h (limited to 'linux/include') diff --git a/linux/include/media/tuner-types.h b/linux/include/media/tuner-types.h new file mode 100644 index 000000000..e84b23b0d --- /dev/null +++ b/linux/include/media/tuner-types.h @@ -0,0 +1,53 @@ +/* + * descriptions for simple tuners. + */ + +#ifndef __TUNER_TYPES_H__ +#define __TUNER_TYPES_H__ + +enum param_type { + TUNER_PARAM_TYPE_RADIO, \ + TUNER_PARAM_TYPE_PAL, \ + TUNER_PARAM_TYPE_SECAM, \ + TUNER_PARAM_TYPE_NTSC, \ + TUNER_PARAM_TYPE_ATSC, \ + TUNER_PARAM_TYPE_DVBT, \ + TUNER_PARAM_TYPE_DVBS, \ + TUNER_PARAM_TYPE_DVBC +}; + +struct tuner_range { + unsigned short limit; +#if 0 /* to be used when we merge dvb-pll */ + unsigned char config; +#endif + unsigned char cb; +}; + +struct tuner_params { + enum param_type type; +#if 0 /* to be used when we merge dvb-pll */ + u32 min; + u32 max; + + u32 offset + u32 stepsize + + void (*setbw)(u8 *buf, u32 freq, int bandwidth); +#endif + unsigned char config; /* to be moved into struct tuner_range for dvb-pll merge */ + + unsigned int count; + struct tuner_range *ranges; +}; + +struct tunertype { + char *name; + unsigned int has_tda988x:1; + struct tuner_params *params; +}; + +extern struct tunertype tuners[]; +extern unsigned const int tuner_count; + +#endif diff --git a/linux/include/media/tuner.h b/linux/include/media/tuner.h index 12cf1f808..19460ea29 100644 --- a/linux/include/media/tuner.h +++ b/linux/include/media/tuner.h @@ -1,5 +1,5 @@ /* - $Id: tuner.h,v 1.73 2006/01/11 21:01:01 hverkuil Exp $ + $Id: tuner.h,v 1.74 2006/01/12 17:06:49 mkrufky Exp $ tuner.h - definition for different tuners Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de) @@ -24,6 +24,7 @@ #define _TUNER_H #include +#include #define ADDR_UNSET (255) -- cgit v1.2.3