svn commit: r365393 - stable/12/sys/arm/allwinner

Andriy Gapon avg at FreeBSD.org
Mon Sep 7 06:21:02 UTC 2020


Author: avg
Date: Mon Sep  7 06:21:01 2020
New Revision: 365393
URL: https://svnweb.freebsd.org/changeset/base/365393

Log:
  MFC r364148: aw_cir: lower activation threshold to support NECx protocol

Modified:
  stable/12/sys/arm/allwinner/aw_cir.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/arm/allwinner/aw_cir.c
==============================================================================
--- stable/12/sys/arm/allwinner/aw_cir.c	Mon Sep  7 06:14:42 2020	(r365392)
+++ stable/12/sys/arm/allwinner/aw_cir.c	Mon Sep  7 06:21:01 2020	(r365393)
@@ -126,8 +126,10 @@ __FBSDID("$FreeBSD$");
 #define	AW_IR_DMAX			53
 
 /* Active Thresholds */
-#define	AW_IR_ACTIVE_T			((0 & 0xff) << 16)
-#define	AW_IR_ACTIVE_T_C		((1 & 0xff) << 23)
+#define	AW_IR_ACTIVE_T_VAL		AW_IR_L1_MIN
+#define	AW_IR_ACTIVE_T			(((AW_IR_ACTIVE_T_VAL - 1) & 0xff) << 16)
+#define	AW_IR_ACTIVE_T_C_VAL		0
+#define	AW_IR_ACTIVE_T_C		((AW_IR_ACTIVE_T_C_VAL & 0xff) << 23)
 
 /* Code masks */
 #define	CODE_MASK			0x00ff00ff
@@ -209,9 +211,9 @@ aw_ir_decode_packets(struct aw_ir_softc *sc)
 		device_printf(sc->dev, "sc->dcnt = %d\n", sc->dcnt);
 
 	/* Find Lead 1 (bit separator) */
-	active_delay = (AW_IR_ACTIVE_T + 1) * (AW_IR_ACTIVE_T_C != 0 ? 128 : 1);
-	len = 0;
-	len += (active_delay >> 1);
+	active_delay = AW_IR_ACTIVE_T_VAL *
+	    (AW_IR_ACTIVE_T_C_VAL != 0 ? 128 : 1);
+	len = active_delay;
 	if (bootverbose)
 		device_printf(sc->dev, "Initial len: %ld\n", len);
 	for (i = 0;  i < sc->dcnt; i++) {


More information about the svn-src-all mailing list