Revert "linuxdvb: rotor - add Max Rotor Movement field to the frontend config"

This reverts commit aaedddc7e0.
This commit is contained in:
Jaroslav Kysela 2014-09-21 09:18:19 +02:00
parent aaedddc7e0
commit dc56784fdd
7 changed files with 27 additions and 46 deletions

View file

@ -157,11 +157,10 @@ const idclass_t linuxdvb_en50494_class =
static int
linuxdvb_en50494_tune
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *sc,
linuxdvb_frontend_t *lfe )
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *sc, int fd )
{
int ret = 0;
int i, fd = lfe->lfe_fe_fd;
int i;
linuxdvb_en50494_t *le = (linuxdvb_en50494_t*) ld;
linuxdvb_lnb_t *lnb = sc->lse_lnb;

View file

@ -154,14 +154,6 @@ const idclass_t linuxdvb_frontend_dvbs_class =
.list = linuxdvb_satconf_type_list,
.def.s = "simple"
},
{
.type = PT_U32,
.id = "max_rotor_move",
.name = "Max Rotor Movement (seconds)",
.off = offsetof(linuxdvb_frontend_t, lfe_max_rotor_move),
.opts = PO_ADVANCED,
.def.u32 = 120
},
{
.id = "networks",
.type = PT_NONE,
@ -257,7 +249,7 @@ linuxdvb_frontend_get_grace ( mpegts_input_t *mi, mpegts_mux_t *mm )
linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)mi;
int r = 5;
if (lfe->lfe_satconf)
r = linuxdvb_satconf_get_grace(lfe, mm);
r = linuxdvb_satconf_get_grace(lfe->lfe_satconf, mm);
return r;
}
@ -1343,7 +1335,6 @@ linuxdvb_frontend_create
lfe->lfe_type = type;
strncpy(lfe->lfe_name, name, sizeof(lfe->lfe_name));
lfe->lfe_name[sizeof(lfe->lfe_name)-1] = '\0';
lfe->lfe_max_rotor_move = 120;
lfe = (linuxdvb_frontend_t*)mpegts_input_create0((mpegts_input_t*)lfe, idc, uuid, conf);
if (!lfe) return NULL;

View file

@ -103,15 +103,14 @@ linuxdvb_lnb_standard_pol
static int
linuxdvb_lnb_standard_tune
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls,
linuxdvb_frontend_t *lfe )
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
{
/* en50494 does not use the voltage tune. this is happend in the switch */
if (ls->lse_en50494)
return 0;
int pol = linuxdvb_lnb_standard_pol((linuxdvb_lnb_t*)ld, lm);
return linuxdvb_diseqc_set_volt(lfe->lfe_fe_fd, pol);
return linuxdvb_diseqc_set_volt(fd, pol);
}
/*
@ -153,11 +152,10 @@ linuxdvb_lnb_bandstack_pol
static int
linuxdvb_lnb_bandstack_tune
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls,
linuxdvb_frontend_t *lfe )
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
{
int pol = linuxdvb_lnb_bandstack_pol((linuxdvb_lnb_t*)ld, lm);
return linuxdvb_diseqc_set_volt(lfe->lfe_fe_fd, pol);
return linuxdvb_diseqc_set_volt(fd, pol);
}
/* **************************************************************************

View file

@ -111,7 +111,6 @@ struct linuxdvb_frontend
* Configuration
*/
int lfe_powersave;
uint32_t lfe_max_rotor_move;
/*
* Satconf (DVB-S only)
@ -192,10 +191,9 @@ struct linuxdvb_diseqc
idnode_t ld_id;
const char *ld_type;
linuxdvb_satconf_ele_t *ld_satconf;
int (*ld_grace) (linuxdvb_diseqc_t *ld, dvb_mux_t *lm,
linuxdvb_frontend_t *lfe);
int (*ld_grace) (linuxdvb_diseqc_t *ld, dvb_mux_t *lm);
int (*ld_tune) (linuxdvb_diseqc_t *ld, dvb_mux_t *lm,
linuxdvb_satconf_ele_t *ls, linuxdvb_frontend_t *lfe);
linuxdvb_satconf_ele_t *ls, int fd);
};
struct linuxdvb_lnb
@ -320,7 +318,7 @@ int linuxdvb_satconf_get_priority
( linuxdvb_satconf_t *ls, mpegts_mux_t *mm );
int linuxdvb_satconf_get_grace
( linuxdvb_frontend_t *lfe, mpegts_mux_t *mm );
( linuxdvb_satconf_t *ls, mpegts_mux_t *mm );
void linuxdvb_satconf_post_stop_mux( linuxdvb_satconf_t *ls );

View file

@ -131,14 +131,14 @@ const idclass_t linuxdvb_rotor_usals_class =
static int
linuxdvb_rotor_grace
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_frontend_t *lfe )
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm )
{
linuxdvb_rotor_t *lr = (linuxdvb_rotor_t*)ld;
linuxdvb_satconf_t *ls = ld->ld_satconf->lse_parent;
int newpos, curpos, delta;
if (!ls->ls_orbital_dir || lr->lr_rate == 0)
return lfe->lfe_max_rotor_move;
return 120;
if (idnode_is_instance(&lr->ld_id, &linuxdvb_rotor_gotox_class))
newpos = lr->lr_position; /* GotoX */
@ -183,8 +183,7 @@ linuxdvb_rotor_check_orbital_pos
/* GotoX */
static int
linuxdvb_rotor_gotox_tune
( linuxdvb_rotor_t *lr, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls,
linuxdvb_frontend_t *lfe )
( linuxdvb_rotor_t *lr, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
{
int i;
@ -192,7 +191,7 @@ linuxdvb_rotor_gotox_tune
return 0;
for (i = 0; i <= ls->lse_parent->ls_diseqc_repeats; i++) {
if (linuxdvb_diseqc_send(lfe->lfe_fe_fd, 0xE0, 0x31, 0x6B, 1, (int)lr->lr_position)) {
if (linuxdvb_diseqc_send(fd, 0xE0, 0x31, 0x6B, 1, (int)lr->lr_position)) {
tvherror("diseqc", "failed to set GOTOX pos %d", lr->lr_position);
return -1;
}
@ -201,14 +200,13 @@ linuxdvb_rotor_gotox_tune
tvhdebug("diseqc", "rotor GOTOX pos %d sent", lr->lr_position);
return linuxdvb_rotor_grace((linuxdvb_diseqc_t*)lr, lm, lfe);
return linuxdvb_rotor_grace((linuxdvb_diseqc_t*)lr,lm);
}
/* USALS */
static int
linuxdvb_rotor_usals_tune
( linuxdvb_rotor_t *lr, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls,
linuxdvb_frontend_t *lfe )
( linuxdvb_rotor_t *lr, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
{
/*
* Code originally written in PR #238 by Jason Millard jsm174
@ -265,14 +263,14 @@ linuxdvb_rotor_usals_tune
motor_angle, (motor_angle > 0.0) ? "counter-" : "");
for (i = 0; i <= ls->lse_parent->ls_diseqc_repeats; i++) {
if (linuxdvb_diseqc_send(lfe->lfe_fe_fd, 0xE0, 0x31, 0x6E, 2, angle_1, angle_2)) {
if (linuxdvb_diseqc_send(fd, 0xE0, 0x31, 0x6E, 2, angle_1, angle_2)) {
tvherror("diseqc", "failed to send USALS command");
return -1;
}
usleep(25000);
}
return linuxdvb_rotor_grace((linuxdvb_diseqc_t*)lr, lm, lfe);
return linuxdvb_rotor_grace((linuxdvb_diseqc_t*)lr,lm);
#undef TO_RAD
#undef TO_DEG
@ -280,13 +278,12 @@ linuxdvb_rotor_usals_tune
static int
linuxdvb_rotor_tune
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls,
linuxdvb_frontend_t *lfe )
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
{
linuxdvb_rotor_t *lr = (linuxdvb_rotor_t*)ld;
/* Force to 18v (quicker movement) */
if (ioctl(lfe->lfe_fe_fd, FE_SET_VOLTAGE, SEC_VOLTAGE_18)) {
if (ioctl(fd, FE_SET_VOLTAGE, SEC_VOLTAGE_18)) {
tvherror("diseqc", "failed to set 18v for rotor movement");
return -1;
}
@ -294,10 +291,10 @@ linuxdvb_rotor_tune
/* GotoX */
if (idnode_is_instance(&lr->ld_id, &linuxdvb_rotor_gotox_class))
return linuxdvb_rotor_gotox_tune(lr, lm, ls, lfe);
return linuxdvb_rotor_gotox_tune(lr, lm, ls, fd);
/* USALS */
return linuxdvb_rotor_usals_tune(lr, lm, ls, lfe);
return linuxdvb_rotor_usals_tune(lr, lm, ls, fd);
}
/* **************************************************************************

View file

@ -590,9 +590,8 @@ linuxdvb_satconf_post_stop_mux
int
linuxdvb_satconf_get_grace
( linuxdvb_frontend_t *lfe, mpegts_mux_t *mm )
( linuxdvb_satconf_t *ls, mpegts_mux_t *mm )
{
linuxdvb_satconf_t *ls = lfe->lfe_satconf;
linuxdvb_satconf_ele_t *lse = linuxdvb_satconf_find_ele(ls, mm);
int i, r = 10;
linuxdvb_diseqc_t *lds[] = {
@ -605,7 +604,7 @@ linuxdvb_satconf_get_grace
/* Add diseqc delay */
for (i = 0; i < 3; i++) {
if (lds[i] && lds[i]->ld_grace)
r += lds[i]->ld_grace(lds[i], (dvb_mux_t*)mm, lfe);
r += lds[i]->ld_grace(lds[i], (dvb_mux_t*)mm);
}
return r;
@ -645,7 +644,7 @@ linuxdvb_satconf_ele_tune ( linuxdvb_satconf_ele_t *lse )
/* Diseqc */
for (i = ls->ls_diseqc_idx; i < ARRAY_SIZE(lds); i++) {
if (!lds[i]) continue;
r = lds[i]->ld_tune(lds[i], lm, lse, lfe);
r = lds[i]->ld_tune(lds[i], lm, lse, lfe->lfe_fe_fd);
/* Error */
if (r < 0) return r;

View file

@ -144,10 +144,9 @@ const idclass_t linuxdvb_switch_class =
static int
linuxdvb_switch_tune
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *sc,
linuxdvb_frontend_t *lfe )
( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *sc, int fd )
{
int i, com, r1 = 0, r2 = 0, fd = lfe->lfe_fe_fd;
int i, com, r1 = 0, r2 = 0;
int pol, band;
linuxdvb_switch_t *ls = (linuxdvb_switch_t*)ld;