blob: c4647a3d93f874e4de39c0f7699b0c4f93dcad84 [file] [log] [blame]
Thomas Gleixnerc942fdd2019-05-27 08:55:06 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Patrick Boettcher4de27302006-04-17 13:22:15 -03002/*
3 * Driver for Microtune MT2060 "Single chip dual conversion broadband tuner"
4 *
5 * Copyright (c) 2006 Olivier DANET <odanet@caramail.com>
Patrick Boettcher4de27302006-04-17 13:22:15 -03006 */
7
8#ifndef MT2060_H
9#define MT2060_H
10
Olivier DANET46f73f92006-08-08 15:48:10 -030011struct dvb_frontend;
12struct i2c_adapter;
Patrick Boettcher4de27302006-04-17 13:22:15 -030013
Antti Palosaari59e8b7a2015-07-26 18:45:05 -030014/*
15 * I2C address
16 * 0x60, ...
17 */
18
19/**
20 * struct mt2060_platform_data - Platform data for the mt2060 driver
21 * @clock_out: Clock output setting. 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1.
22 * @if1: First IF used [MHz]. 0 defaults to 1220.
Antti Palosaari433c4862015-07-26 17:30:07 -030023 * @i2c_write_max: Maximum number of bytes I2C adapter can write at once.
24 * 0 defaults to maximum.
Antti Palosaari59e8b7a2015-07-26 18:45:05 -030025 * @dvb_frontend: DVB frontend.
26 */
27
28struct mt2060_platform_data {
29 u8 clock_out;
30 u16 if1;
Antti Palosaari433c4862015-07-26 17:30:07 -030031 unsigned int i2c_write_max:5;
Antti Palosaari59e8b7a2015-07-26 18:45:05 -030032 struct dvb_frontend *dvb_frontend;
33};
34
35
36/* configuration struct for mt2060_attach() */
Patrick Boettcher4de27302006-04-17 13:22:15 -030037struct mt2060_config {
38 u8 i2c_address;
Patrick Boettcher303cbea2006-09-19 12:51:56 -030039 u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */
Patrick Boettcher4de27302006-04-17 13:22:15 -030040};
41
Arnd Bergmann9b174522015-02-18 14:12:42 -030042#if IS_REACHABLE(CONFIG_MEDIA_TUNER_MT2060)
Patrick Boettcher6958eff2006-09-19 12:51:40 -030043extern struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1);
Trent Piepho6c8c21b2006-10-14 16:21:02 -030044#else
45static inline struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1)
46{
Harvey Harrison271ddbf2008-04-08 23:20:00 -030047 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
Trent Piepho6c8c21b2006-10-14 16:21:02 -030048 return NULL;
49}
Mauro Carvalho Chehab149ef722008-04-29 21:38:46 -030050#endif // CONFIG_MEDIA_TUNER_MT2060
Patrick Boettcher4de27302006-04-17 13:22:15 -030051
52#endif