Path: blob/master/drivers/media/dvb/frontends/cxd2820r.h
15112 views
/*1* Sony CXD2820R demodulator driver2*3* Copyright (C) 2010 Antti Palosaari <[email protected]>4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License along16* with this program; if not, write to the Free Software Foundation, Inc.,17* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.18*/192021#ifndef CXD2820R_H22#define CXD2820R_H2324#include <linux/dvb/frontend.h>2526#define CXD2820R_GPIO_D (0 << 0) /* disable */27#define CXD2820R_GPIO_E (1 << 0) /* enable */28#define CXD2820R_GPIO_O (0 << 1) /* output */29#define CXD2820R_GPIO_I (1 << 1) /* input */30#define CXD2820R_GPIO_L (0 << 2) /* output low */31#define CXD2820R_GPIO_H (1 << 2) /* output high */3233#define CXD2820R_TS_SERIAL 0x0834#define CXD2820R_TS_SERIAL_MSB 0x2835#define CXD2820R_TS_PARALLEL 0x3036#define CXD2820R_TS_PARALLEL_MSB 0x703738struct cxd2820r_config {39/* Demodulator I2C address.40* Driver determines DVB-C slave I2C address automatically from master41* address.42* Default: none, must set43* Values: 0x6c, 0x6d44*/45u8 i2c_address;4647/* TS output mode.48* Default: none, must set.49* Values:50*/51u8 ts_mode;5253/* IF AGC polarity.54* Default: 055* Values: 0, 156*/57int if_agc_polarity:1;5859/* Spectrum inversion.60* Default: 061* Values: 0, 162*/63int spec_inv:1;6465/* IFs for all used modes.66* Default: none, must set67* Values: <kHz>68*/69u16 if_dvbt_6;70u16 if_dvbt_7;71u16 if_dvbt_8;72u16 if_dvbt2_5;73u16 if_dvbt2_6;74u16 if_dvbt2_7;75u16 if_dvbt2_8;76u16 if_dvbc;7778/* GPIOs for all used modes.79* Default: none, disabled80* Values: <see above>81*/82u8 gpio_dvbt[3];83u8 gpio_dvbt2[3];84u8 gpio_dvbc[3];85};868788#if defined(CONFIG_DVB_CXD2820R) || \89(defined(CONFIG_DVB_CXD2820R_MODULE) && defined(MODULE))90extern struct dvb_frontend *cxd2820r_attach(91const struct cxd2820r_config *config,92struct i2c_adapter *i2c,93struct dvb_frontend *fe94);95extern struct i2c_adapter *cxd2820r_get_tuner_i2c_adapter(96struct dvb_frontend *fe97);98#else99static inline struct dvb_frontend *cxd2820r_attach(100const struct cxd2820r_config *config,101struct i2c_adapter *i2c,102struct dvb_frontend *fe103)104{105printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);106return NULL;107}108static inline struct i2c_adapter *cxd2820r_get_tuner_i2c_adapter(109struct dvb_frontend *fe110)111{112return NULL;113}114115#endif116117#endif /* CXD2820R_H */118119120