summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/drx39xyj/drxj.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb-frontends/drx39xyj/drxj.c')
-rw-r--r--drivers/media/dvb-frontends/drx39xyj/drxj.c205
1 files changed, 12 insertions, 193 deletions
diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c
index 635698990e28..66a83b83f70e 100644
--- a/drivers/media/dvb-frontends/drx39xyj/drxj.c
+++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c
@@ -20127,187 +20127,6 @@ rw_error:
return -EIO;
}
-/*============================================================================*/
-/**
-* \fn drxj_ctrl()
-* \brief DRXJ specific control function
-* \return Status_t Return status.
-*/
-int
-drxj_ctrl(struct drx_demod_instance *demod, u32 ctrl, void *ctrl_data)
-{
- switch (ctrl) {
- /*======================================================================*/
- case DRX_CTRL_SET_CHANNEL:
- {
- return ctrl_set_channel(demod, (struct drx_channel *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_GET_CHANNEL:
- {
- return ctrl_get_channel(demod, (struct drx_channel *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_SIG_QUALITY:
- {
- return ctrl_sig_quality(demod,
- (struct drx_sig_quality *) ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_SIG_STRENGTH:
- {
- return ctrl_sig_strength(demod, (u16 *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_CONSTEL:
- {
- return ctrl_constel(demod, (struct drx_complex *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_SET_CFG:
- {
- return ctrl_set_cfg(demod, (struct drx_cfg *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_GET_CFG:
- {
- return ctrl_get_cfg(demod, (struct drx_cfg *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_I2C_BRIDGE:
- {
- return ctrl_i2c_bridge(demod, (bool *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_LOCK_STATUS:
- {
- return ctrl_lock_status(demod,
- (enum drx_lock_status *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_SET_STANDARD:
- {
- return ctrl_set_standard(demod,
- (enum drx_standard *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_GET_STANDARD:
- {
- return ctrl_get_standard(demod,
- (enum drx_standard *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_POWER_MODE:
- {
- return ctrl_power_mode(demod, (enum drx_power_mode *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_VERSION:
- {
- return ctrl_version(demod,
- (struct drx_version_list **)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_PROBE_DEVICE:
- {
- return ctrl_probe_device(demod);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_SET_OOB:
- {
- return ctrl_set_oob(demod, (struct drxoob *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_GET_OOB:
- {
- return ctrl_get_oob(demod, (struct drxoob_status *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_SET_UIO_CFG:
- {
- return ctrl_set_uio_cfg(demod, (struct drxuio_cfg *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_GET_UIO_CFG:
- {
- return ctrl_getuio_cfg(demod, (struct drxuio_cfg *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_UIO_READ:
- {
- return ctrl_uio_read(demod, (struct drxuio_data *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_UIO_WRITE:
- {
- return ctrl_uio_write(demod, (struct drxuio_data *)ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_AUD_SET_STANDARD:
- {
- return aud_ctrl_set_standard(demod,
- (enum drx_aud_standard *) ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_AUD_GET_STANDARD:
- {
- return aud_ctrl_get_standard(demod,
- (enum drx_aud_standard *) ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_AUD_GET_STATUS:
- {
- return aud_ctrl_get_status(demod,
- (struct drx_aud_status *) ctrl_data);
- }
- break;
- /*======================================================================*/
- case DRX_CTRL_AUD_BEEP:
- {
- return aud_ctrl_beep(demod, (struct drx_aud_beep *)ctrl_data);
- }
- break;
-
- /*======================================================================*/
- case DRX_CTRL_I2C_READWRITE:
- {
- return ctrl_i2c_write_read(demod,
- (struct drxi2c_data *) ctrl_data);
- }
- break;
- case DRX_CTRL_VALIDATE_UCODE:
- {
- return ctrl_validate_u_code(demod);
- }
- break;
- default:
- return -ENOTSUPP;
- }
- return 0;
-}
-
/*
* Microcode related functions
*/
@@ -20635,7 +20454,7 @@ static int drx39xxj_set_powerstate(struct dvb_frontend *fe, int enable)
else
power_mode = DRX_POWER_DOWN;
- result = drxj_ctrl(demod, DRX_CTRL_POWER_MODE, &power_mode);
+ result = ctrl_power_mode(demod, &power_mode);
if (result != 0) {
pr_err("Power state change failed\n");
return 0;
@@ -20654,7 +20473,7 @@ static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t *status)
*status = 0;
- result = drxj_ctrl(demod, DRX_CTRL_LOCK_STATUS, &lock_status);
+ result = ctrl_lock_status(demod, &lock_status);
if (result != 0) {
pr_err("drx39xxj: could not get lock status!\n");
*status = 0;
@@ -20699,7 +20518,7 @@ static int drx39xxj_read_ber(struct dvb_frontend *fe, u32 *ber)
int result;
struct drx_sig_quality sig_quality;
- result = drxj_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
+ result = ctrl_sig_quality(demod, &sig_quality);
if (result != 0) {
pr_err("drx39xxj: could not get ber!\n");
*ber = 0;
@@ -20718,7 +20537,7 @@ static int drx39xxj_read_signal_strength(struct dvb_frontend *fe,
int result;
struct drx_sig_quality sig_quality;
- result = drxj_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
+ result = ctrl_sig_quality(demod, &sig_quality);
if (result != 0) {
pr_err("drx39xxj: could not get signal strength!\n");
*strength = 0;
@@ -20737,7 +20556,7 @@ static int drx39xxj_read_snr(struct dvb_frontend *fe, u16 *snr)
int result;
struct drx_sig_quality sig_quality;
- result = drxj_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
+ result = ctrl_sig_quality(demod, &sig_quality);
if (result != 0) {
pr_err("drx39xxj: could not read snr!\n");
*snr = 0;
@@ -20755,7 +20574,7 @@ static int drx39xxj_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
int result;
struct drx_sig_quality sig_quality;
- result = drxj_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
+ result = ctrl_sig_quality(demod, &sig_quality);
if (result != 0) {
pr_err("drx39xxj: could not get uc blocks!\n");
*ucblocks = 0;
@@ -20834,7 +20653,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
if (standard != state->current_standard || state->powered_up == 0) {
/* Set the standard (will be powered up if necessary */
- result = drxj_ctrl(demod, DRX_CTRL_SET_STANDARD, &standard);
+ result = ctrl_set_standard(demod, &standard);
if (result != 0) {
pr_err("Failed to set standard! result=%02x\n",
result);
@@ -20851,7 +20670,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
channel.constellation = constellation;
/* program channel */
- result = drxj_ctrl(demod, DRX_CTRL_SET_CHANNEL, &channel);
+ result = ctrl_set_channel(demod, &channel);
if (result != 0) {
pr_err("Failed to set channel!\n");
return -EINVAL;
@@ -20859,7 +20678,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
/* Just for giggles, let's shut off the LNA again.... */
uio_data.uio = DRX_UIO1;
uio_data.value = false;
- result = drxj_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data);
+ result = ctrl_uio_write(demod, &uio_data);
if (result != 0) {
pr_err("Failed to disable LNA!\n");
return 0;
@@ -20905,7 +20724,7 @@ static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
return 0;
}
- result = drxj_ctrl(demod, DRX_CTRL_I2C_BRIDGE, &i2c_gate_state);
+ result = ctrl_i2c_bridge(demod, &i2c_gate_state);
if (result != 0) {
pr_err("drx39xxj: could not open i2c gate [%d]\n",
result);
@@ -21013,7 +20832,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
uio_cfg.uio = DRX_UIO1;
uio_cfg.mode = DRX_UIO_MODE_READWRITE;
/* Configure user-I/O #3: enable read/write */
- result = drxj_ctrl(demod, DRX_CTRL_UIO_CFG, &uio_cfg);
+ result = ctrl_set_uio_cfg(demod, &uio_cfg);
if (result) {
pr_err("Failed to setup LNA GPIO!\n");
goto error;
@@ -21021,7 +20840,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
uio_data.uio = DRX_UIO1;
uio_data.value = false;
- result = drxj_ctrl(demod, DRX_CTRL_UIO_WRITE, &uio_data);
+ result = ctrl_uio_write(demod, &uio_data);
if (result != 0) {
pr_err("Failed to disable LNA!\n");
goto error;