Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /* Frontend part of the Linux driver for the WideView/ Yakumo/ Hama/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Typhoon/ Yuan DVB-T USB2.0 receiver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (C) 2005 Patrick Boettcher <patrick.boettcher@posteo.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include "dtt200u.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) struct dtt200u_fe_state {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 	struct dvb_usb_device *d;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 	enum fe_status stat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 	struct dtv_frontend_properties fep;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 	struct dvb_frontend frontend;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 	unsigned char data[80];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 	struct mutex data_mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) static int dtt200u_fe_read_status(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 				  enum fe_status *stat)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	struct dtt200u_fe_state *state = fe->demodulator_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	mutex_lock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	state->data[0] = GET_TUNE_STATUS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	ret = dvb_usb_generic_rw(state->d, state->data, 1, state->data, 3, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	if (ret < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 		*stat = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 		mutex_unlock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	switch (state->data[0]) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 		case 0x01:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 			*stat = FE_HAS_SIGNAL | FE_HAS_CARRIER |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 				FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 		case 0x00: /* pending */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 			*stat = FE_TIMEDOUT; /* during set_frontend */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 		case 0x02: /* failed */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 			*stat = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	mutex_unlock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) static int dtt200u_fe_read_ber(struct dvb_frontend* fe, u32 *ber)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	struct dtt200u_fe_state *state = fe->demodulator_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	mutex_lock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	state->data[0] = GET_VIT_ERR_CNT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	ret = dvb_usb_generic_rw(state->d, state->data, 1, state->data, 3, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	if (ret >= 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		*ber = (state->data[0] << 16) | (state->data[1] << 8) | state->data[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	mutex_unlock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) static int dtt200u_fe_read_unc_blocks(struct dvb_frontend* fe, u32 *unc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	struct dtt200u_fe_state *state = fe->demodulator_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	mutex_lock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	state->data[0] = GET_RS_UNCOR_BLK_CNT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	ret = dvb_usb_generic_rw(state->d, state->data, 1, state->data, 2, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	if (ret >= 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		*unc = (state->data[0] << 8) | state->data[1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	mutex_unlock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) static int dtt200u_fe_read_signal_strength(struct dvb_frontend* fe, u16 *strength)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	struct dtt200u_fe_state *state = fe->demodulator_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	mutex_lock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	state->data[0] = GET_AGC;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	ret = dvb_usb_generic_rw(state->d, state->data, 1, state->data, 1, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	if (ret >= 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		*strength = (state->data[0] << 8) | state->data[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	mutex_unlock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) static int dtt200u_fe_read_snr(struct dvb_frontend* fe, u16 *snr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	struct dtt200u_fe_state *state = fe->demodulator_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	mutex_lock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	state->data[0] = GET_SNR;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	ret = dvb_usb_generic_rw(state->d, state->data, 1, state->data, 1, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	if (ret >= 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		*snr = ~((state->data[0] << 8) | state->data[0]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	mutex_unlock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) static int dtt200u_fe_init(struct dvb_frontend* fe)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	struct dtt200u_fe_state *state = fe->demodulator_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	mutex_lock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	state->data[0] = SET_INIT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	ret = dvb_usb_generic_write(state->d, state->data, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	mutex_unlock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) static int dtt200u_fe_sleep(struct dvb_frontend* fe)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	return dtt200u_fe_init(fe);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) static int dtt200u_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	tune->min_delay_ms = 1500;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	tune->step_size = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	tune->max_drift = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) static int dtt200u_fe_set_frontend(struct dvb_frontend *fe)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	struct dtt200u_fe_state *state = fe->demodulator_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	u16 freq = fep->frequency / 250000;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	mutex_lock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	state->data[0] = SET_BANDWIDTH;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	switch (fep->bandwidth_hz) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	case 8000000:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		state->data[1] = 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	case 7000000:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		state->data[1] = 7;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	case 6000000:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		state->data[1] = 6;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		ret = -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		goto ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	ret = dvb_usb_generic_write(state->d, state->data, 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		goto ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	state->data[0] = SET_RF_FREQ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	state->data[1] = freq & 0xff;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	state->data[2] = (freq >> 8) & 0xff;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	ret = dvb_usb_generic_write(state->d, state->data, 3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		goto ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) ret:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	mutex_unlock(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) static int dtt200u_fe_get_frontend(struct dvb_frontend* fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 				   struct dtv_frontend_properties *fep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	struct dtt200u_fe_state *state = fe->demodulator_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	memcpy(fep, &state->fep, sizeof(struct dtv_frontend_properties));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) static void dtt200u_fe_release(struct dvb_frontend* fe)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	struct dtt200u_fe_state *state = (struct dtt200u_fe_state*) fe->demodulator_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	kfree(state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) static const struct dvb_frontend_ops dtt200u_fe_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	struct dtt200u_fe_state* state = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	/* allocate memory for the internal state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	state = kzalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	if (state == NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 		goto error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	deb_info("attaching frontend dtt200u\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	state->d = d;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	mutex_init(&state->data_mutex);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	memcpy(&state->frontend.ops,&dtt200u_fe_ops,sizeof(struct dvb_frontend_ops));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	state->frontend.demodulator_priv = state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	return &state->frontend;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) error:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) static const struct dvb_frontend_ops dtt200u_fe_ops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	.delsys = { SYS_DVBT },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	.info = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 		.name			= "WideView USB DVB-T",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 		.frequency_min_hz	=  44250 * kHz,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		.frequency_max_hz	= 867250 * kHz,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 		.frequency_stepsize_hz	=    250 * kHz,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		.caps = FE_CAN_INVERSION_AUTO |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 				FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 				FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 				FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 				FE_CAN_TRANSMISSION_MODE_AUTO |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 				FE_CAN_GUARD_INTERVAL_AUTO |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 				FE_CAN_RECOVER |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 				FE_CAN_HIERARCHY_AUTO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	.release = dtt200u_fe_release,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	.init = dtt200u_fe_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	.sleep = dtt200u_fe_sleep,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 	.set_frontend = dtt200u_fe_set_frontend,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	.get_frontend = dtt200u_fe_get_frontend,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	.get_tune_settings = dtt200u_fe_get_tune_settings,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 	.read_status = dtt200u_fe_read_status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	.read_ber = dtt200u_fe_read_ber,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	.read_signal_strength = dtt200u_fe_read_signal_strength,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	.read_snr = dtt200u_fe_read_snr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	.read_ucblocks = dtt200u_fe_read_unc_blocks,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) };