]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/media/tuner.h
V4L/DVB (5753): Tuner: create struct tuner_operations
[linux-2.6-omap-h63xx.git] / include / media / tuner.h
index 99acf847365caa81d4bab76a3dcd4e954fc145e0..88eaf8930203a1446c04ffcb55807a4334901696 100644 (file)
@@ -23,6 +23,7 @@
 #define _TUNER_H
 
 #include <linux/videodev2.h>
+#include <linux/i2c.h>
 #include <media/tuner-types.h>
 
 extern int tuner_debug;
@@ -123,6 +124,7 @@ extern int tuner_debug;
 #define TUNER_THOMSON_FE6600           72      /* DViCO FusionHDTV DVB-T Hybrid */
 #define TUNER_SAMSUNG_TCPG_6121P30A     73     /* Hauppauge PVR-500 PAL */
 #define TUNER_TDA9887                   74      /* This tuner should be used only internally */
+#define TUNER_TEA5761                  75      /* Only FM Radio Tuner */
 
 /* tv card specific */
 #define TDA9887_PRESENT                (1<<0)
@@ -177,6 +179,19 @@ struct tuner_setup {
        unsigned short  addr;   /* I2C address */
        unsigned int    type;   /* Tuner type */
        unsigned int    mode_mask;  /* Allowed tuner modes */
+       unsigned int    config; /* configuraion for more complex tuners */
+       int (*tuner_callback) (void *dev, int command,int arg);
+};
+
+struct tuner_operations {
+       void (*set_tv_freq)(struct i2c_client *c, unsigned int freq);
+       void (*set_radio_freq)(struct i2c_client *c, unsigned int freq);
+       int  (*has_signal)(struct i2c_client *c);
+       int  (*is_stereo)(struct i2c_client *c);
+       int  (*get_afc)(struct i2c_client *c);
+       void (*tuner_status)(struct i2c_client *c);
+       void (*standby)(struct i2c_client *c);
+       void (*release)(struct i2c_client *c);
 };
 
 struct tuner {
@@ -195,30 +210,15 @@ struct tuner {
        v4l2_std_id  std;
 
        int          using_v4l2;
+       void *priv;
 
        /* used by tda9887 */
        unsigned int       tda9887_config;
-       unsigned char      tda9887_data[4];
 
-       /* used by MT2032 */
-       unsigned int xogc;
-       unsigned int radio_if2;
+       unsigned int config;
+       int (*tuner_callback) (void *dev, int command,int arg);
 
-       /* used by tda8290 */
-       unsigned char tda8290_easy_mode;
-       unsigned char tda827x_lpsel;
-       unsigned char tda827x_addr;
-       unsigned char tda827x_ver;
-       unsigned int sgIF;
-
-       /* function ptrs */
-       void (*set_tv_freq)(struct i2c_client *c, unsigned int freq);
-       void (*set_radio_freq)(struct i2c_client *c, unsigned int freq);
-       int  (*has_signal)(struct i2c_client *c);
-       int  (*is_stereo)(struct i2c_client *c);
-       int  (*get_afc)(struct i2c_client *c);
-       void (*tuner_status)(struct i2c_client *c);
-       void (*standby)(struct i2c_client *c);
+       struct tuner_operations ops;
 };
 
 extern unsigned const int tuner_count;
@@ -227,11 +227,16 @@ extern int microtune_init(struct i2c_client *c);
 extern int xc3028_init(struct i2c_client *c);
 extern int tda8290_init(struct i2c_client *c);
 extern int tda8290_probe(struct i2c_client *c);
-extern int tea5767_tuner_init(struct i2c_client *c);
 extern int default_tuner_init(struct i2c_client *c);
+
 extern int tea5767_autodetection(struct i2c_client *c);
+extern int tea5767_tuner_init(struct i2c_client *c);
+
 extern int tda9887_tuner_init(struct i2c_client *c);
 
+extern int tea5761_tuner_init(struct i2c_client *c);
+extern int tea5761_autodetection(struct i2c_client *c);
+
 #define tuner_warn(fmt, arg...) do {\
        printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
                        i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)