Add role for serial ir receivers

TODO: test role for serial_device=ttyS0 and serial_device=ttyS1
This commit is contained in:
Alexander Grothe
2019-01-01 23:48:31 +01:00
parent 21710fc62b
commit 326c7d3119
8 changed files with 717 additions and 509 deletions

View File

@@ -0,0 +1,2 @@
---
serial_device: ttyS0

View File

@@ -0,0 +1,20 @@
---
- name: apt | install setserial
apt:
name: setserial
- name: load serial_ir on startup
template:
src: roles/serial-ir/modules-load.d/serial_ir.conf.j2
dest: /etc/modules-load.d/serial_ir.conf
- name: serial_ir module options
template:
src: roles/serial-ir/modprobe.d/serial_ir.conf.j2
src: /etc/modprobe.d/serial_ir.conf
- name: setserial options
template:
src: roles/serial-ir/serial.conf.j2
dest: /etc/serial.conf

View File

@@ -0,0 +1,8 @@
#COM1 equivalent, /dev/ttyS0
{% if serial_device == "ttyS0" %}
options serial_ir irq=4 io=0x3f8
{% elif serial_device == "ttyS1" %}
#COM2 equivalent, /dev/ttyS1
options serial_ir irq=3 io=0x2f8
{% endif %}
install serial_ir setserial /dev/{{serial_device}} uart none; /sbin/modprobe --ignore-install serial_ir

View File

@@ -0,0 +1 @@
serial_ir

View File

@@ -0,0 +1,7 @@
{% if serial_device == "ttyS0" %}
#COM1 equivalent, /dev/ttyS0
/dev/ttyS0 uart none
{% elif serial_device == "ttyS1" %}
#COM2 equivalent, /dev/ttyS1
/dev/ttyS1 uart none
{% endif %}

View File

@@ -171,6 +171,9 @@ budget_ci rc-tt-1500 /lib/udev/rc_keymaps/rc-tt-1501
ite-cir rc-rc6-mce /lib/udev/rc_keymaps/rc-rc6-mce
nuvoton-cir rc-rc6-mce /lib/udev/rc_keymaps/rc-rc6-mce
# serial ir (e.g. Atric V5)
serial_ir rc-rc6-mce /lib/udev/rc_keymaps/rc-rc6-mce
# mceusb
mceusb rc-rc6-mce /lib/udev/rc_keymaps/HOPLOrc6