From 49e22d400ae0760f3d8168ef146a6338c9cb8ef1 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sun, 14 Dec 2014 17:34:34 +0100 Subject: [PATCH] linuxdvb satconf: move voltage settings as last (for LNB polarization) --- src/input/mpegts/linuxdvb/linuxdvb_satconf.c | 20 +++++++++++++++++++- src/input/mpegts/linuxdvb/linuxdvb_switch.c | 18 +----------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index a774d3e5..971482f9 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -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; diff --git a/src/input/mpegts/linuxdvb/linuxdvb_switch.c b/src/input/mpegts/linuxdvb/linuxdvb_switch.c index 35d6ff16..0c73989d 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_switch.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_switch.c @@ -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;