linuxdvb satconf: move voltage settings as last (for LNB polarization)

This commit is contained in:
Jaroslav Kysela 2014-12-14 17:34:34 +01:00
parent 32540dd18b
commit 49e22d400a
2 changed files with 20 additions and 18 deletions

View file

@ -664,7 +664,7 @@ static void linuxdvb_satconf_ele_tune_cb ( void *o );
static int
linuxdvb_satconf_ele_tune ( linuxdvb_satconf_ele_t *lse )
{
int r, i, b;
int r, i, b, pol;
uint32_t f;
linuxdvb_satconf_t *ls = lse->lse_parent;
@ -724,6 +724,24 @@ linuxdvb_satconf_ele_tune ( linuxdvb_satconf_ele_t *lse )
ls->ls_orbital_dir = 0;
}
/* LNB settings */
pol = (lse->lse_lnb) ? lse->lse_lnb->lnb_pol (lse->lse_lnb, lm) & 0x1 : 0;
if (ls->ls_diseqc_full || ls->ls_last_pol != pol + 1) {
ls->ls_last_pol = 0;
/* EN50494 devices have another mechanism to select polarization */
if (!lse->lse_en50494) {
/* Set the voltage */
if (linuxdvb_diseqc_set_volt(lfe->lfe_fe_fd, pol))
return -1;
ls->ls_last_pol = pol + 1;
}
}
/* Set the tone (en50494 don't use tone) */
if (!lse->lse_en50494) {
ls->ls_last_tone_off = 0;

View file

@ -151,27 +151,11 @@ linuxdvb_switch_tune
linuxdvb_switch_t *ls = (linuxdvb_switch_t*)ld;
linuxdvb_satconf_t *lsp = sc->lse_parent;
/* LNB settings */
pol = (sc->lse_lnb) ? sc->lse_lnb->lnb_pol (sc->lse_lnb, lm) & 0x1 : 0;
if (lsp->ls_diseqc_full || lsp->ls_last_pol != pol + 1) {
lsp->ls_last_pol = 0;
/* EN50494 devices have another mechanism to select polarization */
if (!sc->lse_en50494) {
/* Set the voltage */
if (linuxdvb_diseqc_set_volt(fd, pol))
return -1;
lsp->ls_last_pol = pol + 1;
}
}
if (lsp->ls_diseqc_full || lsp->ls_last_switch != sc) {
lsp->ls_last_switch = NULL;
pol = (sc->lse_lnb) ? sc->lse_lnb->lnb_pol (sc->lse_lnb, lm) & 0x1 : 0;
band = (sc->lse_lnb) ? sc->lse_lnb->lnb_band(sc->lse_lnb, lm) & 0x1 : 0;
com = 0xF0 | (ls->ls_committed << 2) | (pol << 1) | band;