All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] not use a DiSEqC switch
@ 2017-11-24  8:52 Maksym Veremeyenko
  2017-11-27 19:26 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 3+ messages in thread
From: Maksym Veremeyenko @ 2017-11-24  8:52 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

Hi,

there is a code in function *dvbsat_diseqc_set_input*:

[...]
	/* Negative numbers means to not use a DiSEqC switch */
	if (parms->p.sat_number < 0)
		return 0;
[...]

if it mean /there is no DiSEqC switch/ then LNB's *polarity* and *band* 
settings still should be applied - attached patch fixes that behavior.

if it mean /current DVB is a slave/ i.e. it is connected to LOOP OUT of 
another DVB, so no need to configure anything, then statement above is 
correct and no patches from this email should be applied.

-- 
Maksym Veremeyenko



[-- Attachment #2: 0003-Fix-setting-band-and-polarity-if-sat_number-is-negat.patch --]
[-- Type: text/plain, Size: 1413 bytes --]

From 57ac346433720c0c9b8ce30a32bdfa1df075fede Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <verem@m1.tv>
Date: Fri, 24 Nov 2017 08:59:41 +0100
Subject: [PATCH 3/4] Fix setting band and polarity if sat_number is negative

---
 lib/libdvbv5/dvb-sat.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/libdvbv5/dvb-sat.c b/lib/libdvbv5/dvb-sat.c
index a01db72e..8b2fcf7d 100644
--- a/lib/libdvbv5/dvb-sat.c
+++ b/lib/libdvbv5/dvb-sat.c
@@ -523,10 +523,6 @@ static int dvbsat_diseqc_set_input(struct dvb_v5_fe_parms_priv *parms,
 	struct diseqc_cmd cmd;
 	const struct dvb_sat_lnb_priv *lnb = (void *)parms->p.lnb;
 
-	/* Negative numbers means to not use a DiSEqC switch */
-	if (parms->p.sat_number < 0)
-		return 0;
-
 	dvb_fe_retrieve_parm(&parms->p, DTV_POLARIZATION, &pol);
 	pol_v = (pol == POLARIZATION_V) || (pol == POLARIZATION_R);
 
@@ -558,6 +554,9 @@ static int dvbsat_diseqc_set_input(struct dvb_v5_fe_parms_priv *parms,
 
 	usleep(15 * 1000);
 
+	/* Negative numbers means to not use a DiSEqC switch */
+	if (parms->p.sat_number >= 0)
+	{
 	if (!t)
 		rc = dvbsat_diseqc_write_to_port_group(parms, &cmd, high_band,
 							pol_v, sat_number);
@@ -578,6 +577,7 @@ static int dvbsat_diseqc_set_input(struct dvb_v5_fe_parms_priv *parms,
 			return rc;
 	}
 	usleep(15 * 1000);
+	}
 
 	rc = dvb_fe_sec_tone(&parms->p, tone_on ? SEC_TONE_ON : SEC_TONE_OFF);
 
-- 
2.13.6


[-- Attachment #3: 0004-Fix-indention-from-last-commit.patch --]
[-- Type: text/plain, Size: 1855 bytes --]

From c700e3db0c855a2675b340e1ee1646678b19bcc6 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <verem@m1.tv>
Date: Fri, 24 Nov 2017 09:02:26 +0100
Subject: [PATCH 4/4] Fix indention from last commit

---
 lib/libdvbv5/dvb-sat.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/lib/libdvbv5/dvb-sat.c b/lib/libdvbv5/dvb-sat.c
index 8b2fcf7d..8383cdf7 100644
--- a/lib/libdvbv5/dvb-sat.c
+++ b/lib/libdvbv5/dvb-sat.c
@@ -557,26 +557,26 @@ static int dvbsat_diseqc_set_input(struct dvb_v5_fe_parms_priv *parms,
 	/* Negative numbers means to not use a DiSEqC switch */
 	if (parms->p.sat_number >= 0)
 	{
-	if (!t)
-		rc = dvbsat_diseqc_write_to_port_group(parms, &cmd, high_band,
-							pol_v, sat_number);
-	else
-		rc = dvbsat_scr_odu_channel_change(parms, &cmd, high_band,
-							pol_v, sat_number, t);
-
-	if (rc) {
-		dvb_logerr(_("sending diseq failed"));
-		return rc;
-	}
-	usleep((15 + parms->p.diseqc_wait) * 1000);
-
-	/* miniDiSEqC/Toneburst commands are defined only for up to 2 sattelites */
-	if (parms->p.sat_number < 2) {
-		rc = dvb_fe_diseqc_burst(&parms->p, parms->p.sat_number);
-		if (rc)
+		if (!t)
+			rc = dvbsat_diseqc_write_to_port_group(parms, &cmd, high_band,
+								pol_v, sat_number);
+		else
+			rc = dvbsat_scr_odu_channel_change(parms, &cmd, high_band,
+								pol_v, sat_number, t);
+
+		if (rc) {
+			dvb_logerr(_("sending diseq failed"));
 			return rc;
-	}
-	usleep(15 * 1000);
+		}
+		usleep((15 + parms->p.diseqc_wait) * 1000);
+
+		/* miniDiSEqC/Toneburst commands are defined only for up to 2 sattelites */
+		if (parms->p.sat_number < 2) {
+			rc = dvb_fe_diseqc_burst(&parms->p, parms->p.sat_number);
+			if (rc)
+				return rc;
+		}
+		usleep(15 * 1000);
 	}
 
 	rc = dvb_fe_sec_tone(&parms->p, tone_on ? SEC_TONE_ON : SEC_TONE_OFF);
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-13 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-24  8:52 [PATCH/RFC] not use a DiSEqC switch Maksym Veremeyenko
2017-11-27 19:26 ` Mauro Carvalho Chehab
2017-12-13 13:25   ` Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.