Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
linuxdvb satconf: move voltage settings as last (for LNB polarization)
  • Loading branch information
perexg committed Dec 14, 2014
1 parent 32540dd commit 49e22d4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
20 changes: 19 additions & 1 deletion src/input/mpegts/linuxdvb/linuxdvb_satconf.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
18 changes: 1 addition & 17 deletions src/input/mpegts/linuxdvb/linuxdvb_switch.c
Expand Up @@ -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;

Expand Down

0 comments on commit 49e22d4

Please sign in to comment.