linux/drivers/media/video/tuner-driver.h
Michael Krufky db8a695658 V4L/DVB (6127): tuner: kill i2c_client interface to tuner sub-drivers
To ease the conversion of the analog tuner sub-drivers into dvb_frontend
style tuner modules, we must remove the i2c_client interface.

dvb_frontend style tuner modules use i2c_transfer directly on the i2c_adapter.

This change only alters the interface between tuner.ko and the tuner
sub-drivers. The v4l2 / i2c_client interface to tuner.ko remains intact.

This patch adds inline functions tuner_i2c_xfer_send, and tuner_i2c_xfer_recv,
to replace i2c_master_send and i2c_master_recv inside the tuner sub-drivers.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Mike Isely <isely@pobox.com>
Acked-by: Steven Toth <stoth@hauppauge.com>
Acked-by: Patrick Boettcher <pb@linuxtv.org>
Acked-by: Jarod Wilson <jwilson@redhat.com>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-09 22:07:34 -03:00

110 lines
3.3 KiB
C

/*
tuner-driver.h - interface for different tuners
Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de)
minor modifications by Ralph Metzler (rjkm@thp.uni-koeln.de)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __TUNER_DRIVER_H__
#define __TUNER_DRIVER_H__
#include <linux/videodev2.h>
#include <linux/i2c.h>
#include "tuner-i2c.h"
extern unsigned const int tuner_count;
struct tuner;
struct tuner_operations {
void (*set_tv_freq)(struct tuner *t, unsigned int freq);
void (*set_radio_freq)(struct tuner *t, unsigned int freq);
int (*has_signal)(struct tuner *t);
int (*is_stereo)(struct tuner *t);
int (*get_afc)(struct tuner *t);
void (*tuner_status)(struct tuner *t);
void (*standby)(struct tuner *t);
void (*release)(struct tuner *t);
};
struct tuner {
/* device */
struct i2c_client i2c;
unsigned int type; /* chip type */
unsigned int mode;
unsigned int mode_mask; /* Combination of allowable modes */
unsigned int tv_freq; /* keep track of the current settings */
unsigned int radio_freq;
unsigned int audmode;
v4l2_std_id std;
int using_v4l2;
void *priv;
/* used by tda9887 */
unsigned int tda9887_config;
unsigned int config;
int (*tuner_callback) (void *dev, int command,int arg);
struct tuner_operations ops;
};
/* ------------------------------------------------------------------------ */
extern int default_tuner_init(struct tuner *t);
extern int tda9887_tuner_init(struct tuner *t);
extern int microtune_init(struct tuner *t);
extern int tda8290_init(struct tuner *t);
extern int tda8290_probe(struct tuner *t);
extern int tea5761_tuner_init(struct tuner *t);
extern int tea5761_autodetection(struct tuner *t);
extern int tea5767_autodetection(struct tuner *t);
extern int tea5767_tuner_init(struct tuner *t);
/* ------------------------------------------------------------------------ */
#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)
#define tuner_info(fmt, arg...) do {\
printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
#define tuner_dbg(fmt, arg...) do {\
extern int tuner_debug; \
if (tuner_debug) \
printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
#endif /* __TUNER_DRIVER_H__ */
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* ---------------------------------------------------------------------------
* Local variables:
* c-basic-offset: 8
* End:
*/