- struct dvb_i2c_bus *i2c = fe->i2c;
-
- switch (cmd) {
- case FE_GET_INFO:
- memcpy(arg, &mt312_info, sizeof(struct dvb_frontend_info));
- break;
-
- case FE_DISEQC_RESET_OVERLOAD:
- return -EOPNOTSUPP;
-
- case FE_DISEQC_SEND_MASTER_CMD:
- return mt312_send_master_cmd(i2c, arg);
-
- case FE_DISEQC_RECV_SLAVE_REPLY:
- if ((long) fe->data == ID_MT312)
- return mt312_recv_slave_reply(i2c, arg);
- else
- return -EOPNOTSUPP;
-
- case FE_DISEQC_SEND_BURST:
- return mt312_send_burst(i2c, (fe_sec_mini_cmd_t) arg);
-
- case FE_SET_TONE:
- return mt312_set_tone(i2c, (fe_sec_tone_mode_t) arg);
-
- case FE_SET_VOLTAGE:
- return mt312_set_voltage(i2c, (fe_sec_voltage_t) arg);
-
- case FE_ENABLE_HIGH_LNB_VOLTAGE:
- return -EOPNOTSUPP;
-
- case FE_READ_STATUS:
- return mt312_read_status(i2c, arg, (long) fe->data);
-
- case FE_READ_BER:
- return mt312_read_bercnt(i2c, arg);
-
- case FE_READ_SIGNAL_STRENGTH:
- return mt312_read_agc(i2c, arg);
-
- case FE_READ_SNR:
- return mt312_read_snr(i2c, arg);
-
- case FE_READ_UNCORRECTED_BLOCKS:
- return mt312_read_ubc(i2c, arg);
-
- case FE_SET_FRONTEND:
- return mt312_set_frontend(i2c, arg, (long) fe->data);
-
- case FE_GET_FRONTEND:
- return mt312_get_frontend(i2c, arg);
-
- case FE_GET_EVENT:
- return -EOPNOTSUPP;
-
- case FE_SLEEP:
- return mt312_sleep(i2c);
-
- case FE_INIT:
- //For the VP310 we should run at 60MHz when ever possible.
- //It should be better to run the mt312 ar lower speed when ever possible, but tunning will be slower. ACCJr 09/29/03
- if ((long)fe->data == ID_MT312)
- return mt312_init(i2c, (long) fe->data, (u8) 90);
- else
- return mt312_init(i2c, (long) fe->data, (u8) 60);
-
- case FE_GET_TUNE_SETTINGS:
- {
- struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg;
- fesettings->min_delay_ms = 50;
- fesettings->step_size = 0;
- fesettings->max_drift = 0;
- return 0;
- }
-
- default:
- return -ENOIOCTLCMD;
- }
-