History log of /freebsd-head/sys/arm/allwinner/aw_cir.c
Revision Date Author Comments
7bf4075614f7e4f207aee1dfbba8b8c047e8d3c7 12-Aug-2020 avg <avg@FreeBSD.org> aw_cir: in the pulse encoding the actual length is one greater than value

While here change type of some variables from long to int, it's sufficient.
Also, add length reporting to a couple of debug printfs.

MFC after: 3 weeks
87f861af04cb6f8b2ddff6b48fdbfc1df0af00dc 12-Aug-2020 avg <avg@FreeBSD.org> aw_cir: lower activation threshold to support NECx protocol

In NECx the leading mark has length of 8T as opposed to 16T in NEC,
where T is 562.5 us. So, 4.5 ms.
Our threshold was set to 128 * 42.7 us (derived from the sampling
frequency of 3/128 MHz). So, ~5.5 ms.

The new threshold is set to AW_IR_L1_MIN. I think that's a good enough
lower bound for detecting the leading pulse.

Also, calculations of active_delay (which is activation delay) are fixed.
Previously they would be wrong if AW_IR_ACTIVE_T was anything but zero,
because the value was already bit-shifted.

Finally, I am not sure why the activation delay was divided by two when
calculating the initial pulse length. I have not found anything that
would explain or justify it. So, I removed that division.

MFC after: 3 weeks
796399b2027dc30bc6f315a44c45cea29ca561a5 12-Aug-2020 avg <avg@FreeBSD.org> aw_cir: minor cleanups

MFC after: 1 week
8baf3779b6d05362da92b0270b98cb6a0286455b 12-Aug-2020 avg <avg@FreeBSD.org> aw_cir: add support for allwinner,sun6i-a31-ir (found, e.g., on h3)

MFC after: 1 week
37d3f591ee3a847a41bd1a06db279dd4c731ad7c 17-Feb-2020 dim <dim@FreeBSD.org> Merge r358030 from the clang1000-import branch:

Work around new clang 10.0.0 -Werror warning:

sys/arm/allwinner/aw_cir.c:208:41: error: converting the result of '<<' to a boolean; did you mean '((1 & 255) << 23) != 0'? [-Werror,-Wint-in-bool-context]
active_delay = (AW_IR_ACTIVE_T + 1) * (AW_IR_ACTIVE_T_C ? 128 : 1);
^
sys/arm/allwinner/aw_cir.c:130:39: note: expanded from macro 'AW_IR_ACTIVE_T_C'
#define AW_IR_ACTIVE_T_C ((1 & 0xff) << 23)
^

Add the != 0 part to indicate that we indeed want to compare against
zero.

MFC after: 3 days
5f266560d80b9b6c0ae2c86f3a67aceb22454b73 17-Feb-2020 dim <dim@FreeBSD.org> Work around new clang 10.0.0 -Werror warning:

sys/arm/allwinner/aw_cir.c:208:41: error: converting the result of '<<' to a boolean; did you mean '((1 & 255) << 23) != 0'? [-Werror,-Wint-in-bool-context]
active_delay = (AW_IR_ACTIVE_T + 1) * (AW_IR_ACTIVE_T_C ? 128 : 1);
^
sys/arm/allwinner/aw_cir.c:130:39: note: expanded from macro 'AW_IR_ACTIVE_T_C'
#define AW_IR_ACTIVE_T_C ((1 & 0xff) << 23)
^

Add the != 0 part to indicate that we indeed want to compare against
zero.
a5e409a3220652d4f69b595a6f9c74bcbf2cfc86 19-Apr-2017 ganbold <ganbold@FreeBSD.org> Use hwreset_get_by_ofw_idx() function instead, since there is
no reset-names dts property defined for IR in case of H3 SoC.
That way IR works on H3 SoC based board.
Tested on Orangepi mini 2 board.
85a60b4eb310064d7fccfdba510afd1248f27de9 25-Mar-2017 ganbold <ganbold@FreeBSD.org> Fix and add comments to match selected frequency sample.
Add debug printfs when bootverbose is used.
No functional changes.
99881c494f077c7e3f39e746c4fa4fc8e53c230c 14-Nov-2016 andrew <andrew@FreeBSD.org> Stop including fdt_common.h from the arm code when it's unneeded.

Sponsored by: ABT Systems Ltd
f250b31b8f8d2d71b3f3f5edb051647b4833f030 04-Nov-2016 manu <manu@FreeBSD.org> Fix r308306 by spelling variable correctly.
bbe2cf06a3eba6422ecd3be2416068dced4aac18 04-Nov-2016 manu <manu@FreeBSD.org> Set rst_apb to NULL to avoid panic when release.
84ca5cfc2b99ca6bc0d5371c569e259448ddf1c2 27-Oct-2016 ganbold <ganbold@FreeBSD.org> Add support for Allwinner Consumer IR interface.
RX is supported now and the driver is using evdev framework.
It was tested on Cubieboard2 (A20 SoC) using lirc
with dfrobot's IR remote controller.