A side note:
This code writes to /sys/devices/platform/tegra_cec/cec_logical_addr_config . This file is by default not writable (0644) by a normal user.
Your client (cec-client or kodi) needs to be run as root (not recommended). Or chmod this file to be writable by all users (0666) at startup.
The original implementation was done by https://github.com/BuzzBumbleBee/libcec for an old version of libcec.
I have updated it for the latest libcec code. I have tested this with cec-client and with Kodi 20.01.
( Resolves https://github.com/Pulse-Eight/libcec/issues/533 )
A side note: This code writes to /sys/devices/platform/tegra_cec/cec_logical_addr_config . This file is by default not writable (0644) by a normal user. Your client (cec-client or kodi) needs to be run as root (not recommended). Or chmod this file to be writable by all users (0666) at startup.