}
-static int rtl2832_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
-{
- struct rtl2832_dev *dev = fe->demodulator_priv;
- struct i2c_client *client = dev->client;
- int ret;
-
- dev_dbg(&client->dev, "enable=%d\n", enable);
-
- /* gate already open or close */
- if (dev->i2c_gate_state == enable)
- return 0;
-
- ret = rtl2832_wr_demod_reg(dev, DVBT_IIC_REPEAT, (enable ? 0x1 : 0x0));
- if (ret)
- goto err;
-
- dev->i2c_gate_state = enable;
-
- return ret;
-err:
- dev_dbg(&client->dev, "failed=%d\n", ret);
- return ret;
-}
-
static int rtl2832_set_if(struct dvb_frontend *fe, u32 if_freq)
{
struct rtl2832_dev *dev = fe->demodulator_priv;
if (ret)
goto err;
- dev->i2c_gate_state = false;
-
return;
err:
dev_dbg(&client->dev, "failed=%d\n", ret);
/* terminate possible gate closing */
cancel_delayed_work(&dev->i2c_gate_work);
- if (dev->i2c_gate_state == chan_id)
- return 0;
-
/*
* chan_id 1 is muxed adapter demod provides and chan_id 0 is demod
* itself. We need open gate when request is for chan_id 1. On that case
if (ret)
goto err;
- dev->i2c_gate_state = chan_id;
-
return 0;
err:
dev_dbg(&client->dev, "failed=%d\n", ret);
.read_status = rtl2832_read_status,
.read_snr = rtl2832_read_snr,
.read_ber = rtl2832_read_ber,
-
- .i2c_gate_ctrl = rtl2832_i2c_gate_ctrl,
};
/*