CEC is just i2c which is a bus. In fact you can hook regular i2c devices up to an HDMI port and communicate with them. You’ll need a resistor and shouldn’t draw more than 50 mA.
I always assumed that it was a separate i2c bus per HDMI link and that it was the AVR’s job to handle a request from something and send the right requests to everything else.
Much like i2c, any message put on the bus is transmitted to everything on the bus.
Version 1.0 and later of the HDMI spec even mandate that you have to connect those pins across all HDMI ports on your device even if you don't do anything with them.
Okay, now I’m curious. If the pins are just connected across all ports, how does the AVR tell which CEC-speaking device is on which port? Chip select or similar pins?
Answering my own question: CEC is electrically unrelated to DDC/EDID. The EDID data tells each source its physical address, and then the devices negotiate over CEC to choose logical addresses and announce their physical addresses. This is one way to design a network, but it’s not what I would have done.
I wonder if a malfunction in this process is responsible for my AVR sometimes auto-switching to the wrong source.