18c2ecf20Sopenharmony_ciWhat: /sys/kernel/debug/cec/*/error-inj 28c2ecf20Sopenharmony_ciDate: March 2018 38c2ecf20Sopenharmony_ciContact: Hans Verkuil <hverkuil-cisco@xs4all.nl> 48c2ecf20Sopenharmony_ciDescription: 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciThe CEC Framework allows for CEC error injection commands through 78c2ecf20Sopenharmony_cidebugfs. Drivers that support this will create an error-inj file 88c2ecf20Sopenharmony_cithrough which the error injection commands can be given. 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ciThe basic syntax is as follows: 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ciLeading spaces/tabs are ignored. If the next character is a '#' or the 138c2ecf20Sopenharmony_ciend of the line was reached, then the whole line is ignored. Otherwise 148c2ecf20Sopenharmony_cia command is expected. 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ciIt is up to the driver to decide what commands to implement. The only 178c2ecf20Sopenharmony_ciexception is that the command 'clear' without any arguments must be 188c2ecf20Sopenharmony_ciimplemented and that it will remove all current error injection 198c2ecf20Sopenharmony_cicommands. 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ciThis ensures that you can always do 'echo clear >error-inj' to clear any 228c2ecf20Sopenharmony_cierror injections without having to know the details of the driver-specific 238c2ecf20Sopenharmony_cicommands. 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ciNote that the output of 'error-inj' shall be valid as input to 'error-inj'. 268c2ecf20Sopenharmony_ciSo this must work:: 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci $ cat error-inj >einj.txt 298c2ecf20Sopenharmony_ci $ cat einj.txt >error-inj 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ciOther than these basic rules described above this ABI is not considered 328c2ecf20Sopenharmony_cistable and may change in the future. 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciDrivers that implement this functionality must document the commands as 358c2ecf20Sopenharmony_cipart of the CEC documentation and must keep that documentation up to date 368c2ecf20Sopenharmony_ciwhen changes are made. 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ciThe following CEC error injection implementations exist: 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci- Documentation/userspace-api/media/cec/cec-pin-error-inj.rst 41