1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * cxd2841er.h
4 *
5 * Sony CXD2441ER digital demodulator driver public definitions
6 *
7 * Copyright 2012 Sony Corporation
8 * Copyright (C) 2014 NetUP Inc.
9 * Copyright (C) 2014 Sergey Kozlov <serjk@netup.ru>
10 * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru>
11 */
12
13 #ifndef CXD2841ER_H
14 #define CXD2841ER_H
15
16 #include <linux/dvb/frontend.h>
17
18 #define CXD2841ER_USE_GATECTRL 1 /* bit 0 */
19 #define CXD2841ER_AUTO_IFHZ 2 /* bit 1 */
20 #define CXD2841ER_TS_SERIAL 4 /* bit 2 */
21 #define CXD2841ER_ASCOT 8 /* bit 3 */
22 #define CXD2841ER_EARLY_TUNE 16 /* bit 4 */
23 #define CXD2841ER_NO_WAIT_LOCK 32 /* bit 5 */
24 #define CXD2841ER_NO_AGCNEG 64 /* bit 6 */
25 #define CXD2841ER_TSBITS 128 /* bit 7 */
26
27 enum cxd2841er_xtal {
28 SONY_XTAL_20500, /* 20.5 MHz */
29 SONY_XTAL_24000, /* 24 MHz */
30 SONY_XTAL_41000 /* 41 MHz */
31 };
32
33 struct cxd2841er_config {
34 u8 i2c_addr;
35 enum cxd2841er_xtal xtal;
36 u32 flags;
37 };
38
39 #if IS_REACHABLE(CONFIG_DVB_CXD2841ER)
40 extern struct dvb_frontend *cxd2841er_attach_s(struct cxd2841er_config *cfg,
41 struct i2c_adapter *i2c);
42
43 extern struct dvb_frontend *cxd2841er_attach_t_c(struct cxd2841er_config *cfg,
44 struct i2c_adapter *i2c);
45 #else
cxd2841er_attach_s(struct cxd2841er_config * cfg,struct i2c_adapter * i2c)46 static inline struct dvb_frontend *cxd2841er_attach_s(
47 struct cxd2841er_config *cfg,
48 struct i2c_adapter *i2c)
49 {
50 pr_warn("%s: driver disabled by Kconfig\n", __func__);
51 return NULL;
52 }
53
cxd2841er_attach_t_c(struct cxd2841er_config * cfg,struct i2c_adapter * i2c)54 static inline struct dvb_frontend *cxd2841er_attach_t_c(
55 struct cxd2841er_config *cfg, struct i2c_adapter *i2c)
56 {
57 pr_warn("%s: driver disabled by Kconfig\n", __func__);
58 return NULL;
59 }
60
61 #endif
62
63 #endif
64