Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *  Driver for Microtune MT2060 "Single chip dual conversion broadband tuner"
0004  *
0005  *  Copyright (c) 2006 Olivier DANET <odanet@caramail.com>
0006  */
0007 
0008 #ifndef MT2060_H
0009 #define MT2060_H
0010 
0011 struct dvb_frontend;
0012 struct i2c_adapter;
0013 
0014 /*
0015  * I2C address
0016  * 0x60, ...
0017  */
0018 
0019 /**
0020  * struct mt2060_platform_data - Platform data for the mt2060 driver
0021  * @clock_out: Clock output setting. 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1.
0022  * @if1: First IF used [MHz]. 0 defaults to 1220.
0023  * @i2c_write_max: Maximum number of bytes I2C adapter can write at once.
0024  *  0 defaults to maximum.
0025  * @dvb_frontend: DVB frontend.
0026  */
0027 
0028 struct mt2060_platform_data {
0029     u8 clock_out;
0030     u16 if1;
0031     unsigned int i2c_write_max:5;
0032     struct dvb_frontend *dvb_frontend;
0033 };
0034 
0035 
0036 /* configuration struct for mt2060_attach() */
0037 struct mt2060_config {
0038     u8 i2c_address;
0039     u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */
0040 };
0041 
0042 #if IS_REACHABLE(CONFIG_MEDIA_TUNER_MT2060)
0043 extern struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1);
0044 #else
0045 static inline struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1)
0046 {
0047     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0048     return NULL;
0049 }
0050 #endif // CONFIG_MEDIA_TUNER_MT2060
0051 
0052 #endif