2 * Sony CXD2820R demodulator driver
4 * Copyright (C) 2010 Antti Palosaari <crope@iki.fi>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef CXD2820R_PRIV_H
23 #define CXD2820R_PRIV_H
25 #include <linux/dvb/version.h>
26 #include <media/dvb_frontend.h>
27 #include <media/dvb_math.h>
29 #include <linux/gpio.h>
30 #include <linux/math64.h>
31 #include <linux/regmap.h>
39 #define CXD2820R_CLK 41000000
41 struct cxd2820r_priv
{
42 struct i2c_client
*client
[2];
43 struct regmap
*regmap
[2];
44 struct i2c_adapter
*i2c
;
45 struct dvb_frontend fe
;
51 u64 post_bit_error_prev_dvbv3
;
59 struct gpio_chip gpio_chip
;
62 enum fe_delivery_system delivery_system
;
63 bool last_tune_failed
; /* for switch between T and T2 tune */
68 extern int cxd2820r_debug
;
70 int cxd2820r_gpio(struct dvb_frontend
*fe
, u8
*gpio
);
72 int cxd2820r_wr_reg_val_mask_tab(struct cxd2820r_priv
*priv
,
73 const struct reg_val_mask
*tab
, int tab_len
);
75 int cxd2820r_wr_reg_mask(struct cxd2820r_priv
*priv
, u32 reg
, u8 val
,
78 int cxd2820r_wr_regs(struct cxd2820r_priv
*priv
, u32 reginfo
, u8
*val
,
81 int cxd2820r_wr_regs(struct cxd2820r_priv
*priv
, u32 reginfo
, u8
*val
,
84 int cxd2820r_rd_regs(struct cxd2820r_priv
*priv
, u32 reginfo
, u8
*val
,
87 int cxd2820r_wr_reg(struct cxd2820r_priv
*priv
, u32 reg
, u8 val
);
89 int cxd2820r_rd_reg(struct cxd2820r_priv
*priv
, u32 reg
, u8
*val
);
93 int cxd2820r_get_frontend_c(struct dvb_frontend
*fe
,
94 struct dtv_frontend_properties
*p
);
96 int cxd2820r_set_frontend_c(struct dvb_frontend
*fe
);
98 int cxd2820r_read_status_c(struct dvb_frontend
*fe
, enum fe_status
*status
);
100 int cxd2820r_init_c(struct dvb_frontend
*fe
);
102 int cxd2820r_sleep_c(struct dvb_frontend
*fe
);
104 int cxd2820r_get_tune_settings_c(struct dvb_frontend
*fe
,
105 struct dvb_frontend_tune_settings
*s
);
109 int cxd2820r_get_frontend_t(struct dvb_frontend
*fe
,
110 struct dtv_frontend_properties
*p
);
112 int cxd2820r_set_frontend_t(struct dvb_frontend
*fe
);
114 int cxd2820r_read_status_t(struct dvb_frontend
*fe
, enum fe_status
*status
);
116 int cxd2820r_init_t(struct dvb_frontend
*fe
);
118 int cxd2820r_sleep_t(struct dvb_frontend
*fe
);
120 int cxd2820r_get_tune_settings_t(struct dvb_frontend
*fe
,
121 struct dvb_frontend_tune_settings
*s
);
125 int cxd2820r_get_frontend_t2(struct dvb_frontend
*fe
,
126 struct dtv_frontend_properties
*p
);
128 int cxd2820r_set_frontend_t2(struct dvb_frontend
*fe
);
130 int cxd2820r_read_status_t2(struct dvb_frontend
*fe
, enum fe_status
*status
);
132 int cxd2820r_init_t2(struct dvb_frontend
*fe
);
134 int cxd2820r_sleep_t2(struct dvb_frontend
*fe
);
136 int cxd2820r_get_tune_settings_t2(struct dvb_frontend
*fe
,
137 struct dvb_frontend_tune_settings
*s
);
139 #endif /* CXD2820R_PRIV_H */