linux-linaro-stable-mx6 icon indicating copy to clipboard operation
linux-linaro-stable-mx6 copied to clipboard

CEC re-patch

Open mk01 opened this issue 11 years ago • 2 comments

and here is libCEC https://github.com/mk01/libcec-1

mk01 avatar Sep 03 '14 00:09 mk01

Thanks for the patch, but this needs to be broken down in to smaller changes that can be followed. There are some obvious problems that I see like have your functions call into the ioctl handler instead of the other way around. At a minimum this needs to be broken up into ioctl's, message handling, error handling. When you remove existing logic checks please comment why in the code or commit message.

linux4kix avatar Sep 06 '14 04:09 linux4kix

here you go with outsourced functionality from ioctl to standalone functions with adapted calls.

for changes follow up it needs to be seen in context of ORIGINAL code which was patched (FSL's default driver from 3.0.35 kernel - https://github.com/mk01/linux-linaro-stable-mx6/commit/35300e7f688194cf088fd5de23fb02e2fa95e629). as already told before trying to follow changes between current code and driver in pull request is nonsense. as there is little relations. looking at this patch back from April does indeed make sense, is easy to follow as it is not changing workflows nor other internals comparing to the original.

  1. it still keeps one cec_msg queue (for pickup from userspace)
  2. it still uses mxc_hdmi_cec_handle to handle all received messages including responds to msgs sent
  3. message written from userland is tracked until we have result of the send (timeout, NACK, ACK) and ends by responding back - because the only error hw can trigger is that sending itself failed - we ignore that error interrupt - we know about that before by reading status register. higher level error handling is solely managed by libCEC including all other actions that might be needed (including resending, taking care of LA reg process and others). cec driver role is there strictly passive (again as it was also before).
  4. hotplug events from display outs are handled unchanged - via the same handler and msg queue.

would this be enough or you really need in written form answer why

if ( X < = 7 )
else
if ( X > 7 && X < 15 )

gets shortened to

if ( X < = 7 )
else
if ( X < 15 )

without impact on result of that simple logical algebra ?

mk01 avatar Sep 12 '14 17:09 mk01