blob: 98e4effca8964e60b60b2fda82fcc8e8b45a7c40 [file] [log] [blame]
Mauro Carvalho Chehab6cb45872007-10-02 11:57:03 -03001/* tuner-xc2028
2 *
Mauro Carvalho Chehab33e53162008-04-21 06:58:48 -03003 * Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org)
Mauro Carvalho Chehab6cb45872007-10-02 11:57:03 -03004 * This code is placed under the terms of the GNU General Public License v2
5 */
6
Mauro Carvalho Chehab215b95b2007-10-23 15:24:06 -03007#ifndef __TUNER_XC2028_H__
8#define __TUNER_XC2028_H__
9
10#include "dvb_frontend.h"
11
Mauro Carvalho Chehabde3fe212007-10-24 09:22:08 -030012#define XC2028_DEFAULT_FIRMWARE "xc3028-v27.fw"
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -030013#define XC3028L_DEFAULT_FIRMWARE "xc3028L-v36.fw"
Mauro Carvalho Chehabde3fe212007-10-24 09:22:08 -030014
Mauro Carvalho Chehab66c2d532007-11-25 19:26:36 -030015/* Dmoduler IF (kHz) */
Mauro Carvalho Chehab33e53162008-04-21 06:58:48 -030016#define XC3028_FE_DEFAULT 0 /* Don't load SCODE */
Mauro Carvalho Chehab66c2d532007-11-25 19:26:36 -030017#define XC3028_FE_LG60 6000
18#define XC3028_FE_ATI638 6380
19#define XC3028_FE_OREN538 5380
20#define XC3028_FE_OREN36 3600
21#define XC3028_FE_TOYOTA388 3880
22#define XC3028_FE_TOYOTA794 7940
23#define XC3028_FE_DIBCOM52 5200
24#define XC3028_FE_ZARLINK456 4560
25#define XC3028_FE_CHINA 5200
Mauro Carvalho Chehabb542dfd2007-11-24 11:07:12 -030026
Mauro Carvalho Chehab0975fc62008-09-28 02:24:44 -030027enum firmware_type {
28 XC2028_AUTO = 0, /* By default, auto-detects */
29 XC2028_D2633,
30 XC2028_D2620,
31};
32
Mauro Carvalho Chehabde3fe212007-10-24 09:22:08 -030033struct xc2028_ctrl {
Mauro Carvalho Chehabde3fe212007-10-24 09:22:08 -030034 char *fname;
Mauro Carvalho Chehab352fae12007-11-01 16:56:26 -030035 int max_len;
Mauro Carvalho Chehabe5cc2bf2008-01-08 11:26:59 -030036 int msleep;
Chris Pascoee0f0b372007-11-19 11:22:03 -030037 unsigned int scode_table;
Mauro Carvalho Chehabd74cb252007-11-24 10:20:15 -030038 unsigned int mts :1;
Mauro Carvalho Chehabd74cb252007-11-24 10:20:15 -030039 unsigned int input1:1;
Chris Pascoe3dfefc52007-12-02 10:07:06 -030040 unsigned int vhfbw7:1;
41 unsigned int uhfbw8:1;
Devin Heitmueller93b99922009-08-03 22:52:59 -030042 unsigned int disable_power_mgmt:1;
Mauro Carvalho Chehab2d5024a2009-09-14 10:23:20 -030043 unsigned int read_not_reliable:1;
Mauro Carvalho Chehab66c2d532007-11-25 19:26:36 -030044 unsigned int demod;
Mauro Carvalho Chehab0975fc62008-09-28 02:24:44 -030045 enum firmware_type type:2;
Mauro Carvalho Chehabde3fe212007-10-24 09:22:08 -030046};
47
Michel Ludwiga37b4c92007-11-16 07:46:14 -030048struct xc2028_config {
49 struct i2c_adapter *i2c_adap;
50 u8 i2c_addr;
Mauro Carvalho Chehab71a2ee32007-11-22 12:19:37 -030051 struct xc2028_ctrl *ctrl;
Michel Ludwiga37b4c92007-11-16 07:46:14 -030052};
53
Mauro Carvalho Chehab6cb45872007-10-02 11:57:03 -030054/* xc2028 commands for callback */
55#define XC2028_TUNER_RESET 0
56#define XC2028_RESET_CLK 1
Thierry Reding4d37ece2011-08-04 04:13:59 -030057#define XC2028_I2C_FLUSH 2
Michel Ludwig701672e2007-07-18 10:29:10 -030058
Arnd Bergmann9b174522015-02-18 14:12:42 -030059#if IS_REACHABLE(CONFIG_MEDIA_TUNER_XC2028)
Michael Krufky7972f982007-12-21 16:12:09 -030060extern struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
61 struct xc2028_config *cfg);
Mauro Carvalho Chehab215b95b2007-10-23 15:24:06 -030062#else
Michael Krufky7972f982007-12-21 16:12:09 -030063static inline struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
64 struct xc2028_config *cfg)
Mauro Carvalho Chehab215b95b2007-10-23 15:24:06 -030065{
66 printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
Harvey Harrison7e28adb2008-04-08 23:20:00 -030067 __func__);
Michael Krufky7972f982007-12-21 16:12:09 -030068 return NULL;
Mauro Carvalho Chehab215b95b2007-10-23 15:24:06 -030069}
70#endif
71
72#endif /* __TUNER_XC2028_H__ */