blob: 774fc8957bf9a773a353853c849c31cebc18659c [file] [log] [blame]
Thomas Gleixner74ba9202019-05-20 09:19:02 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Steven Toth7bbb1ce2008-04-19 01:06:25 -03002/*
3 NXP TDA10048HN DVB OFDM demodulator driver
4
Steven Toth9e081992009-05-15 21:01:57 -03005 Copyright (C) 2009 Steven Toth <stoth@kernellabs.com>
Steven Toth7bbb1ce2008-04-19 01:06:25 -03006
Steven Toth7bbb1ce2008-04-19 01:06:25 -03007
8*/
9
10#ifndef TDA10048_H
11#define TDA10048_H
12
13#include <linux/dvb/frontend.h>
14#include <linux/firmware.h>
15
16struct tda10048_config {
17
18 /* the demodulator's i2c address */
19 u8 demod_address;
20
21 /* serial/parallel output */
22#define TDA10048_PARALLEL_OUTPUT 0
23#define TDA10048_SERIAL_OUTPUT 1
24 u8 output_mode;
25
26#define TDA10048_BULKWRITE_200 200
27#define TDA10048_BULKWRITE_50 50
28 u8 fwbulkwritelen;
29
30 /* Spectral Inversion */
31#define TDA10048_INVERSION_OFF 0
32#define TDA10048_INVERSION_ON 1
33 u8 inversion;
Steven Tothd1141532009-05-02 11:07:29 -030034
35#define TDA10048_IF_3300 3300
36#define TDA10048_IF_3500 3500
37#define TDA10048_IF_3800 3800
38#define TDA10048_IF_4000 4000
39#define TDA10048_IF_4300 4300
40#define TDA10048_IF_4500 4500
41#define TDA10048_IF_4750 4750
Jose Alberto Regueroc9f88aa2011-08-08 07:35:35 -030042#define TDA10048_IF_5000 5000
Steven Tothd1141532009-05-02 11:07:29 -030043#define TDA10048_IF_36130 36130
Steven Toth9e081992009-05-15 21:01:57 -030044 u16 dtv6_if_freq_khz;
45 u16 dtv7_if_freq_khz;
46 u16 dtv8_if_freq_khz;
Steven Tothd1141532009-05-02 11:07:29 -030047
48#define TDA10048_CLK_4000 4000
49#define TDA10048_CLK_16000 16000
50 u16 clk_freq_khz;
Steven Toth8153c3b2009-05-05 19:30:27 -030051
52 /* Disable I2C gate access */
53 u8 disable_gate_access;
Jose Alberto Regueroc9f88aa2011-08-08 07:35:35 -030054
55 bool no_firmware;
56
57 bool set_pll;
58 u8 pll_m;
59 u8 pll_p;
60 u8 pll_n;
Steven Toth7bbb1ce2008-04-19 01:06:25 -030061};
62
Arnd Bergmann9b174522015-02-18 14:12:42 -030063#if IS_REACHABLE(CONFIG_DVB_TDA10048)
Steven Toth7bbb1ce2008-04-19 01:06:25 -030064extern struct dvb_frontend *tda10048_attach(
65 const struct tda10048_config *config,
66 struct i2c_adapter *i2c);
67#else
68static inline struct dvb_frontend *tda10048_attach(
69 const struct tda10048_config *config,
70 struct i2c_adapter *i2c)
71{
72 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
73 return NULL;
74}
75#endif /* CONFIG_DVB_TDA10048 */
76
77#endif /* TDA10048_H */