1*4882a593SmuzhiyunWhat: /sys/kernel/debug/cec/*/error-inj 2*4882a593SmuzhiyunDate: March 2018 3*4882a593SmuzhiyunContact: Hans Verkuil <hverkuil-cisco@xs4all.nl> 4*4882a593SmuzhiyunDescription: 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunThe CEC Framework allows for CEC error injection commands through 7*4882a593Smuzhiyundebugfs. Drivers that support this will create an error-inj file 8*4882a593Smuzhiyunthrough which the error injection commands can be given. 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunThe basic syntax is as follows: 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunLeading spaces/tabs are ignored. If the next character is a '#' or the 13*4882a593Smuzhiyunend of the line was reached, then the whole line is ignored. Otherwise 14*4882a593Smuzhiyuna command is expected. 15*4882a593Smuzhiyun 16*4882a593SmuzhiyunIt is up to the driver to decide what commands to implement. The only 17*4882a593Smuzhiyunexception is that the command 'clear' without any arguments must be 18*4882a593Smuzhiyunimplemented and that it will remove all current error injection 19*4882a593Smuzhiyuncommands. 20*4882a593Smuzhiyun 21*4882a593SmuzhiyunThis ensures that you can always do 'echo clear >error-inj' to clear any 22*4882a593Smuzhiyunerror injections without having to know the details of the driver-specific 23*4882a593Smuzhiyuncommands. 24*4882a593Smuzhiyun 25*4882a593SmuzhiyunNote that the output of 'error-inj' shall be valid as input to 'error-inj'. 26*4882a593SmuzhiyunSo this must work:: 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun $ cat error-inj >einj.txt 29*4882a593Smuzhiyun $ cat einj.txt >error-inj 30*4882a593Smuzhiyun 31*4882a593SmuzhiyunOther than these basic rules described above this ABI is not considered 32*4882a593Smuzhiyunstable and may change in the future. 33*4882a593Smuzhiyun 34*4882a593SmuzhiyunDrivers that implement this functionality must document the commands as 35*4882a593Smuzhiyunpart of the CEC documentation and must keep that documentation up to date 36*4882a593Smuzhiyunwhen changes are made. 37*4882a593Smuzhiyun 38*4882a593SmuzhiyunThe following CEC error injection implementations exist: 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun- Documentation/userspace-api/media/cec/cec-pin-error-inj.rst 41