1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Sony CXD2820R demodulator driver
5 * Copyright (C) 2010 Antti Palosaari <crope@iki.fi>
9 #ifndef CXD2820R_PRIV_H
10 #define CXD2820R_PRIV_H
12 #include <linux/dvb/version.h>
13 #include <media/dvb_frontend.h>
14 #include <linux/int_log.h>
16 #include <linux/gpio/driver.h> /* For gpio_chip */
17 #include <linux/math64.h>
18 #include <linux/regmap.h>
26 #define CXD2820R_CLK 41000000
28 struct cxd2820r_priv
{
29 struct i2c_client
*client
[2];
30 struct regmap
*regmap
[2];
31 struct i2c_adapter
*i2c
;
32 struct dvb_frontend fe
;
38 u64 post_bit_error_prev_dvbv3
;
46 struct gpio_chip gpio_chip
;
49 enum fe_delivery_system delivery_system
;
50 bool last_tune_failed
; /* for switch between T and T2 tune */
55 int cxd2820r_gpio(struct dvb_frontend
*fe
, u8
*gpio
);
57 int cxd2820r_wr_reg_val_mask_tab(struct cxd2820r_priv
*priv
,
58 const struct reg_val_mask
*tab
, int tab_len
);
60 int cxd2820r_wr_reg_mask(struct cxd2820r_priv
*priv
, u32 reg
, u8 val
,
63 int cxd2820r_wr_regs(struct cxd2820r_priv
*priv
, u32 reginfo
, u8
*val
,
66 int cxd2820r_wr_regs(struct cxd2820r_priv
*priv
, u32 reginfo
, u8
*val
,
69 int cxd2820r_rd_regs(struct cxd2820r_priv
*priv
, u32 reginfo
, u8
*val
,
72 int cxd2820r_wr_reg(struct cxd2820r_priv
*priv
, u32 reg
, u8 val
);
74 int cxd2820r_rd_reg(struct cxd2820r_priv
*priv
, u32 reg
, u8
*val
);
78 int cxd2820r_get_frontend_c(struct dvb_frontend
*fe
,
79 struct dtv_frontend_properties
*p
);
81 int cxd2820r_set_frontend_c(struct dvb_frontend
*fe
);
83 int cxd2820r_read_status_c(struct dvb_frontend
*fe
, enum fe_status
*status
);
85 int cxd2820r_init_c(struct dvb_frontend
*fe
);
87 int cxd2820r_sleep_c(struct dvb_frontend
*fe
);
89 int cxd2820r_get_tune_settings_c(struct dvb_frontend
*fe
,
90 struct dvb_frontend_tune_settings
*s
);
94 int cxd2820r_get_frontend_t(struct dvb_frontend
*fe
,
95 struct dtv_frontend_properties
*p
);
97 int cxd2820r_set_frontend_t(struct dvb_frontend
*fe
);
99 int cxd2820r_read_status_t(struct dvb_frontend
*fe
, enum fe_status
*status
);
101 int cxd2820r_init_t(struct dvb_frontend
*fe
);
103 int cxd2820r_sleep_t(struct dvb_frontend
*fe
);
105 int cxd2820r_get_tune_settings_t(struct dvb_frontend
*fe
,
106 struct dvb_frontend_tune_settings
*s
);
110 int cxd2820r_get_frontend_t2(struct dvb_frontend
*fe
,
111 struct dtv_frontend_properties
*p
);
113 int cxd2820r_set_frontend_t2(struct dvb_frontend
*fe
);
115 int cxd2820r_read_status_t2(struct dvb_frontend
*fe
, enum fe_status
*status
);
117 int cxd2820r_init_t2(struct dvb_frontend
*fe
);
119 int cxd2820r_sleep_t2(struct dvb_frontend
*fe
);
121 int cxd2820r_get_tune_settings_t2(struct dvb_frontend
*fe
,
122 struct dvb_frontend_tune_settings
*s
);
124 #endif /* CXD2820R_PRIV_H */