blob: 60a0952c1bca4d6b7764063372adae9ee2fd3c41 [file] [log] [blame]
Thomas Gleixner74ba9202019-05-20 09:19:02 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Hartmut Birraa323ac2007-04-21 19:37:17 -03003 TDA10021/TDA10023 - Single Chip Cable Channel Receiver driver module
4 used on the the Siemens DVB-C cards
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
6 Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>
7 Copyright (C) 2004 Markus Schulz <msc@antzsystem.de>
Mauro Carvalho Chehab9101e622005-12-12 00:37:24 -08008 Support for TDA10021
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
Linus Torvalds1da177e2005-04-16 15:20:36 -070010*/
11
Hartmut Birraa323ac2007-04-21 19:37:17 -030012#ifndef TDA1002x_H
13#define TDA1002x_H
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
15#include <linux/dvb/frontend.h>
16
Antti Palosaari4388c3b2008-05-17 22:58:04 -030017struct tda1002x_config {
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 /* the demodulator's i2c address */
19 u8 demod_address;
Hartmut Birrdc120b02007-04-21 19:44:10 -030020 u8 invert;
Linus Torvalds1da177e2005-04-16 15:20:36 -070021};
22
Antti Palosaarie7588862008-06-09 22:53:04 -030023enum tda10023_output_mode {
24 TDA10023_OUTPUT_MODE_PARALLEL_A = 0xe0,
25 TDA10023_OUTPUT_MODE_PARALLEL_B = 0xa1,
26 TDA10023_OUTPUT_MODE_PARALLEL_C = 0xa0,
27 TDA10023_OUTPUT_MODE_SERIAL, /* TODO: not implemented */
28};
29
Antti Palosaari4388c3b2008-05-17 22:58:04 -030030struct tda10023_config {
31 /* the demodulator's i2c address */
32 u8 demod_address;
33 u8 invert;
34
35 /* clock settings */
36 u32 xtal; /* defaults: 28920000 */
37 u8 pll_m; /* defaults: 8 */
38 u8 pll_p; /* defaults: 4 */
39 u8 pll_n; /* defaults: 1 */
40
Antti Palosaarie7588862008-06-09 22:53:04 -030041 /* MPEG2 TS output mode */
42 u8 output_mode;
43
Antti Palosaari4388c3b2008-05-17 22:58:04 -030044 /* input freq offset + baseband conversion type */
45 u16 deltaf;
46};
47
Arnd Bergmann9b174522015-02-18 14:12:42 -030048#if IS_REACHABLE(CONFIG_DVB_TDA10021)
Hartmut Birraa323ac2007-04-21 19:37:17 -030049extern struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config,
Linus Torvalds1da177e2005-04-16 15:20:36 -070050 struct i2c_adapter* i2c, u8 pwm);
Andrew de Quincey102a3422006-08-08 09:10:08 -030051#else
Hartmut Birraa323ac2007-04-21 19:37:17 -030052static inline struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config,
Andrew de Quincey102a3422006-08-08 09:10:08 -030053 struct i2c_adapter* i2c, u8 pwm)
54{
Harvey Harrison271ddbf2008-04-08 23:20:00 -030055 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
Andrew de Quincey102a3422006-08-08 09:10:08 -030056 return NULL;
57}
58#endif // CONFIG_DVB_TDA10021
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Arnd Bergmann9b174522015-02-18 14:12:42 -030060#if IS_REACHABLE(CONFIG_DVB_TDA10023)
Antti Palosaari4388c3b2008-05-17 22:58:04 -030061extern struct dvb_frontend *tda10023_attach(
62 const struct tda10023_config *config,
63 struct i2c_adapter *i2c, u8 pwm);
Hartmut Birraa323ac2007-04-21 19:37:17 -030064#else
Antti Palosaari4388c3b2008-05-17 22:58:04 -030065static inline struct dvb_frontend *tda10023_attach(
Oliver Endriss4ee48c42008-07-15 19:36:46 -030066 const struct tda10023_config *config,
Antti Palosaari4388c3b2008-05-17 22:58:04 -030067 struct i2c_adapter *i2c, u8 pwm)
Hartmut Birraa323ac2007-04-21 19:37:17 -030068{
Harvey Harrison271ddbf2008-04-08 23:20:00 -030069 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
Hartmut Birraa323ac2007-04-21 19:37:17 -030070 return NULL;
71}
72#endif // CONFIG_DVB_TDA10023
73
74#endif // TDA1002x_H