Thomas Gleixner | 74ba920 | 2019-05-20 09:19:02 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
Hartmut Birr | aa323ac | 2007-04-21 19:37:17 -0300 | [diff] [blame] | 3 | TDA10021/TDA10023 - Single Chip Cable Channel Receiver driver module |
| 4 | used on the the Siemens DVB-C cards |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | |
| 6 | Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de> |
| 7 | Copyright (C) 2004 Markus Schulz <msc@antzsystem.de> |
Mauro Carvalho Chehab | 9101e62 | 2005-12-12 00:37:24 -0800 | [diff] [blame] | 8 | Support for TDA10021 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | */ |
| 11 | |
Hartmut Birr | aa323ac | 2007-04-21 19:37:17 -0300 | [diff] [blame] | 12 | #ifndef TDA1002x_H |
| 13 | #define TDA1002x_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | |
| 15 | #include <linux/dvb/frontend.h> |
| 16 | |
Antti Palosaari | 4388c3b | 2008-05-17 22:58:04 -0300 | [diff] [blame] | 17 | struct tda1002x_config { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | /* the demodulator's i2c address */ |
| 19 | u8 demod_address; |
Hartmut Birr | dc120b0 | 2007-04-21 19:44:10 -0300 | [diff] [blame] | 20 | u8 invert; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | }; |
| 22 | |
Antti Palosaari | e758886 | 2008-06-09 22:53:04 -0300 | [diff] [blame] | 23 | enum 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 Palosaari | 4388c3b | 2008-05-17 22:58:04 -0300 | [diff] [blame] | 30 | struct 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 Palosaari | e758886 | 2008-06-09 22:53:04 -0300 | [diff] [blame] | 41 | /* MPEG2 TS output mode */ |
| 42 | u8 output_mode; |
| 43 | |
Antti Palosaari | 4388c3b | 2008-05-17 22:58:04 -0300 | [diff] [blame] | 44 | /* input freq offset + baseband conversion type */ |
| 45 | u16 deltaf; |
| 46 | }; |
| 47 | |
Arnd Bergmann | 9b17452 | 2015-02-18 14:12:42 -0300 | [diff] [blame] | 48 | #if IS_REACHABLE(CONFIG_DVB_TDA10021) |
Hartmut Birr | aa323ac | 2007-04-21 19:37:17 -0300 | [diff] [blame] | 49 | extern struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | struct i2c_adapter* i2c, u8 pwm); |
Andrew de Quincey | 102a342 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 51 | #else |
Hartmut Birr | aa323ac | 2007-04-21 19:37:17 -0300 | [diff] [blame] | 52 | static inline struct dvb_frontend* tda10021_attach(const struct tda1002x_config* config, |
Andrew de Quincey | 102a342 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 53 | struct i2c_adapter* i2c, u8 pwm) |
| 54 | { |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 55 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
Andrew de Quincey | 102a342 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 56 | return NULL; |
| 57 | } |
| 58 | #endif // CONFIG_DVB_TDA10021 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
Arnd Bergmann | 9b17452 | 2015-02-18 14:12:42 -0300 | [diff] [blame] | 60 | #if IS_REACHABLE(CONFIG_DVB_TDA10023) |
Antti Palosaari | 4388c3b | 2008-05-17 22:58:04 -0300 | [diff] [blame] | 61 | extern struct dvb_frontend *tda10023_attach( |
| 62 | const struct tda10023_config *config, |
| 63 | struct i2c_adapter *i2c, u8 pwm); |
Hartmut Birr | aa323ac | 2007-04-21 19:37:17 -0300 | [diff] [blame] | 64 | #else |
Antti Palosaari | 4388c3b | 2008-05-17 22:58:04 -0300 | [diff] [blame] | 65 | static inline struct dvb_frontend *tda10023_attach( |
Oliver Endriss | 4ee48c4 | 2008-07-15 19:36:46 -0300 | [diff] [blame] | 66 | const struct tda10023_config *config, |
Antti Palosaari | 4388c3b | 2008-05-17 22:58:04 -0300 | [diff] [blame] | 67 | struct i2c_adapter *i2c, u8 pwm) |
Hartmut Birr | aa323ac | 2007-04-21 19:37:17 -0300 | [diff] [blame] | 68 | { |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 69 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
Hartmut Birr | aa323ac | 2007-04-21 19:37:17 -0300 | [diff] [blame] | 70 | return NULL; |
| 71 | } |
| 72 | #endif // CONFIG_DVB_TDA10023 |
| 73 | |
| 74 | #endif // TDA1002x_H |