[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1487169069-15721-8-git-send-email-immortalguardian1@gmail.com>
Date: Wed, 15 Feb 2017 17:31:08 +0300
From: Andrey Drobyshev <immortalguardian1@...il.com>
To: linux-kernel@...r.kernel.org
Cc: gq@...msu.su, giometti@...eenne.com
Subject: [PATCH 7/8] LinuxPPS: pps_gen_parport: Add polarity parameter for inverted signal.
From: Alexander GQ Gerasiov <gq@...msu.su>
On some devices it may be necessary to transmit inverted data. This commit
simply adds polarity parameter to define which state represents presence of
signal: it equals 0 if signal is on the low level (default), or 1 if signal
is on the high level (inverted signal).
Signed-off-by: Alexander GQ Gerasiov <gq@...msu.su>
---
drivers/pps/generators/pps_gen_parport.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/pps/generators/pps_gen_parport.c b/drivers/pps/generators/pps_gen_parport.c
index dcd39fb..7739301 100644
--- a/drivers/pps/generators/pps_gen_parport.c
+++ b/drivers/pps/generators/pps_gen_parport.c
@@ -36,8 +36,8 @@
#define DRVDESC "parallel port PPS signal generator"
-#define SIGNAL 0
-#define NO_SIGNAL PARPORT_CONTROL_STROBE
+#define SIGNAL (polarity?PARPORT_CONTROL_STROBE:0)
+#define NO_SIGNAL (polarity?0:PARPORT_CONTROL_STROBE)
/* module parameters */
@@ -48,6 +48,10 @@ MODULE_PARM_DESC(delay,
"Delay between setting and dropping the signal (ns)");
module_param_named(delay, send_delay, uint, 0);
+static unsigned int polarity;
+MODULE_PARM_DESC(polarity,
+ "Signal is on the low level (0 - default) or on the high level (1).");
+module_param(polarity, uint, 0);
#define SAFETY_INTERVAL 3000 /* set the hrtimer earlier for safety (ns) */
--
2.1.4
Powered by blists - more mailing lists