Ok. I'll prepare the patches for adding the new ioctl, in a way that it will
also handle the legacy methods, and post for review.
This don't solve the issue about how to signalize to kernel that more than one
input device is needed.
As the userspace will request the creation of those keymaps, we need some way
to receive such requests from userspace.
I can see a few ways for doing it:
1) create a control device for the irrcv device as a hole,
that would handle such requests via ioctl (/dev/irctl[0-9]* ?)
2) create a read/write sysfs node that would indicate the number of event/keymaps
associated with a given IR. By writing a bigger number, it would create new devices.
By writing a smaller number, it will delete some maps. There's an issue though:
what criteria would be used to delete? The newly created ones?
3) create a fixed number of event devices, and add a sysfs attribute to enable
or disable it;
4) create a fixed number of sysfs attributes to represent the keymaps. For example:
/sys/class/irrcv/irrcv0/keymap0/enabled
...
/sys/class/irrcv/irrcv0/keymap7/enabled
The input/event node will be created only when the enabled=1.
I don't like (2) or (3), because removing a table with (2) may end by removing the wrong
table, and (3) will create more event interfaces than probably needed by the majority
of IR users.
maybe (4) is the better one.
--
Cheers,
Mauro
--