blob: d77b59f5a839c072207d8f9e609b953f4f58c6a1 [file] [log] [blame]
Kozlov Sergeya6dc60ff2015-07-28 11:33:03 -03001/*
2 * cxd2841er.h
3 *
4 * Sony CXD2441ER digital demodulator driver public definitions
5 *
6 * Copyright 2012 Sony Corporation
7 * Copyright (C) 2014 NetUP Inc.
8 * Copyright (C) 2014 Sergey Kozlov <serjk@netup.ru>
9 * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 */
21
22#ifndef CXD2841ER_H
23#define CXD2841ER_H
24
Kozlov Sergeya6dc60ff2015-07-28 11:33:03 -030025#include <linux/dvb/frontend.h>
26
Daniel Scheller03ab1bd2017-04-09 16:38:18 -030027#define CXD2841ER_USE_GATECTRL 1 /* bit 0 */
28#define CXD2841ER_AUTO_IFHZ 2 /* bit 1 */
29#define CXD2841ER_TS_SERIAL 4 /* bit 2 */
Daniel Scheller7afe5102017-04-09 16:38:19 -030030#define CXD2841ER_ASCOT 8 /* bit 3 */
Daniel Scheller763f8572017-04-09 16:38:20 -030031#define CXD2841ER_EARLY_TUNE 16 /* bit 4 */
Daniel Schellere3943aa2017-04-09 16:38:21 -030032#define CXD2841ER_NO_WAIT_LOCK 32 /* bit 5 */
Daniel Schellerc7518d12017-04-09 16:38:16 -030033
Abylay Ospan83808c22016-03-22 19:20:34 -030034enum cxd2841er_xtal {
35 SONY_XTAL_20500, /* 20.5 MHz */
36 SONY_XTAL_24000, /* 24 MHz */
37 SONY_XTAL_41000 /* 41 MHz */
38};
39
Kozlov Sergeya6dc60ff2015-07-28 11:33:03 -030040struct cxd2841er_config {
41 u8 i2c_addr;
Abylay Ospan83808c22016-03-22 19:20:34 -030042 enum cxd2841er_xtal xtal;
Daniel Scheller050863a2017-04-09 16:38:15 -030043 u32 flags;
Kozlov Sergeya6dc60ff2015-07-28 11:33:03 -030044};
45
46#if IS_REACHABLE(CONFIG_DVB_CXD2841ER)
47extern struct dvb_frontend *cxd2841er_attach_s(struct cxd2841er_config *cfg,
48 struct i2c_adapter *i2c);
49
Abylay Ospan3f3b48a2016-05-14 00:08:40 -030050extern struct dvb_frontend *cxd2841er_attach_t_c(struct cxd2841er_config *cfg,
Kozlov Sergeya6dc60ff2015-07-28 11:33:03 -030051 struct i2c_adapter *i2c);
Kozlov Sergeya6dc60ff2015-07-28 11:33:03 -030052#else
53static inline struct dvb_frontend *cxd2841er_attach_s(
54 struct cxd2841er_config *cfg,
55 struct i2c_adapter *i2c)
56{
Abylay Ospan83808c22016-03-22 19:20:34 -030057 pr_warn("%s: driver disabled by Kconfig\n", __func__);
Kozlov Sergeya6dc60ff2015-07-28 11:33:03 -030058 return NULL;
59}
60
Abylay Ospan3f3b48a2016-05-14 00:08:40 -030061static inline struct dvb_frontend *cxd2841er_attach_t_c(
Abylay Ospan83808c22016-03-22 19:20:34 -030062 struct cxd2841er_config *cfg, struct i2c_adapter *i2c)
63{
64 pr_warn("%s: driver disabled by Kconfig\n", __func__);
65 return NULL;
66}
67
Kozlov Sergeya6dc60ff2015-07-28 11:33:03 -030068#endif
69
70#endif