1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef CXD2820R_PRIV_H
23#define CXD2820R_PRIV_H
24
25#include <linux/dvb/version.h>
26#include "dvb_frontend.h"
27#include "dvb_math.h"
28#include "cxd2820r.h"
29#include <linux/gpio.h>
30
31struct reg_val_mask {
32 u32 reg;
33 u8 val;
34 u8 mask;
35};
36
37struct cxd2820r_priv {
38 struct i2c_adapter *i2c;
39 struct dvb_frontend fe;
40 struct cxd2820r_config cfg;
41
42 bool ber_running;
43
44 u8 bank[2];
45#define GPIO_COUNT 3
46 u8 gpio[GPIO_COUNT];
47#ifdef CONFIG_GPIOLIB
48 struct gpio_chip gpio_chip;
49#endif
50
51 enum fe_delivery_system delivery_system;
52 bool last_tune_failed;
53};
54
55
56
57extern int cxd2820r_debug;
58
59int cxd2820r_gpio(struct dvb_frontend *fe, u8 *gpio);
60
61int cxd2820r_wr_reg_mask(struct cxd2820r_priv *priv, u32 reg, u8 val,
62 u8 mask);
63
64int cxd2820r_wr_regs(struct cxd2820r_priv *priv, u32 reginfo, u8 *val,
65 int len);
66
67int cxd2820r_wr_regs(struct cxd2820r_priv *priv, u32 reginfo, u8 *val,
68 int len);
69
70int cxd2820r_rd_regs(struct cxd2820r_priv *priv, u32 reginfo, u8 *val,
71 int len);
72
73int cxd2820r_wr_reg(struct cxd2820r_priv *priv, u32 reg, u8 val);
74
75int cxd2820r_rd_reg(struct cxd2820r_priv *priv, u32 reg, u8 *val);
76
77
78
79int cxd2820r_get_frontend_c(struct dvb_frontend *fe,
80 struct dtv_frontend_properties *p);
81
82int cxd2820r_set_frontend_c(struct dvb_frontend *fe);
83
84int cxd2820r_read_status_c(struct dvb_frontend *fe, enum fe_status *status);
85
86int cxd2820r_read_ber_c(struct dvb_frontend *fe, u32 *ber);
87
88int cxd2820r_read_signal_strength_c(struct dvb_frontend *fe, u16 *strength);
89
90int cxd2820r_read_snr_c(struct dvb_frontend *fe, u16 *snr);
91
92int cxd2820r_read_ucblocks_c(struct dvb_frontend *fe, u32 *ucblocks);
93
94int cxd2820r_init_c(struct dvb_frontend *fe);
95
96int cxd2820r_sleep_c(struct dvb_frontend *fe);
97
98int cxd2820r_get_tune_settings_c(struct dvb_frontend *fe,
99 struct dvb_frontend_tune_settings *s);
100
101
102
103int cxd2820r_get_frontend_t(struct dvb_frontend *fe,
104 struct dtv_frontend_properties *p);
105
106int cxd2820r_set_frontend_t(struct dvb_frontend *fe);
107
108int cxd2820r_read_status_t(struct dvb_frontend *fe, enum fe_status *status);
109
110int cxd2820r_read_ber_t(struct dvb_frontend *fe, u32 *ber);
111
112int cxd2820r_read_signal_strength_t(struct dvb_frontend *fe, u16 *strength);
113
114int cxd2820r_read_snr_t(struct dvb_frontend *fe, u16 *snr);
115
116int cxd2820r_read_ucblocks_t(struct dvb_frontend *fe, u32 *ucblocks);
117
118int cxd2820r_init_t(struct dvb_frontend *fe);
119
120int cxd2820r_sleep_t(struct dvb_frontend *fe);
121
122int cxd2820r_get_tune_settings_t(struct dvb_frontend *fe,
123 struct dvb_frontend_tune_settings *s);
124
125
126
127int cxd2820r_get_frontend_t2(struct dvb_frontend *fe,
128 struct dtv_frontend_properties *p);
129
130int cxd2820r_set_frontend_t2(struct dvb_frontend *fe);
131
132int cxd2820r_read_status_t2(struct dvb_frontend *fe, enum fe_status *status);
133
134int cxd2820r_read_ber_t2(struct dvb_frontend *fe, u32 *ber);
135
136int cxd2820r_read_signal_strength_t2(struct dvb_frontend *fe, u16 *strength);
137
138int cxd2820r_read_snr_t2(struct dvb_frontend *fe, u16 *snr);
139
140int cxd2820r_read_ucblocks_t2(struct dvb_frontend *fe, u32 *ucblocks);
141
142int cxd2820r_init_t2(struct dvb_frontend *fe);
143
144int cxd2820r_sleep_t2(struct dvb_frontend *fe);
145
146int cxd2820r_get_tune_settings_t2(struct dvb_frontend *fe,
147 struct dvb_frontend_tune_settings *s);
148
149#endif
150