/*
 * Realtek RTL2830 demodulator driver
 *
 * Copyright (c) 2008 Realtek
 * Copyright (c) 2008 Jan Hoogenraad, Barnaby Shearer, Andy Hasper
 * Copyright (C) 2009 Antti Palosaari <crope@iki.fi>
 *
 *    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.
 *
 *
 * Thanks to Realtek for a lot of support we received !
 */

#ifndef RTL2830_H
#define RTL2830_H

#include <linux/dvb/frontend.h>

struct rtl2830_config {
	/* demodulator's I2C address */
	u8 demod_address;

	/* intermediate frequency Hz */
	/* 4570000, 4571429, 36000000, 36125000, 36166667, 44000000 */
	u32 if_freq;

	u32 crystal_freq; // Hz

	/* RF spectrum inversion */
	u8 rf_spec_inv:1;

	u8 vtop;

	u8 krf;

	u8 agc_targ_val;

	u8 rtl2830;
	u8 rtl2832;
};

#if defined(CONFIG_DVB_RTL2830) || \
	(defined(CONFIG_DVB_RTL2830_MODULE) && defined(MODULE))
extern struct dvb_frontend *rtl2830_attach(const struct rtl2830_config *config,
	struct i2c_adapter *i2c);
#else
static inline struct dvb_frontend *rtl2830_attach(
	const struct rtl2830_config *config, struct i2c_adapter *i2c)
{
	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
	return NULL;
}
#endif /* CONFIG_DVB_RTL2830 */

#endif /* RTL2830_H */
