On 7/26/22 17:13, Hans Verkuil wrote:
[...]
FYI: you can easily test cec-gpio by adding something along these lines to the dts:
cec-gpio {
compatible = "cec-gpio";
cec-gpios = <&gpio 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
};
(this is from a Raspberry Pi). As long as the cec-gpios pin can be configured as a
pull up, then you're OK. It doesn't have to be connected to anything.
If the cec-gpio driver is enabled as well, then you should see a /dev/cec0 device.
If you can run 'cec-ctl --playback -p 1.0.0.0', then it works.
Another driver that switches direction is drivers/gpu/drm/i2c/tda998x_drv.c
where the irq line has to be configured as an output during calibration.
See tda998x_cec_calibration().
Does this look OK ?
$ cec-ctl --playback -p 1.0.0.0
Driver Info:
Driver Name : cec-gpio
Adapter Name : cec-gpio
Capabilities : 0x000000af
Physical Address
Logical Addresses
Transmit
Passthrough
Monitor All
Monitor Pin
Driver version : 5.19.0
Available Logical Addresses: 4
Connector Info : None
Physical Address : 1.0.0.0
Logical Address Mask : 0x0010
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : 'Playback'
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 4 (Playback Device 1)
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
$ cec-compliance
Driver Info:
Driver Name : cec-gpio
Adapter Name : cec-gpio
Capabilities : 0x000000af
Physical Address
Logical Addresses
Transmit
Passthrough
Monitor All
Monitor Pin
Driver version : 5.19.0
Available Logical Addresses: 4
Connector Info : None
Physical Address : 1.0.0.0
Logical Address Mask : 0x0010
CEC Version : 2.0
Vendor ID : 0x000c03 (HDMI)
OSD Name : 'Playback'
Logical Addresses : 1 (Allow RC Passthrough)
Logical Address : 4 (Playback Device 1)
Primary Device Type : Playback
Logical Address Type : Playback
All Device Types : Playback
RC TV Profile : None
Device Features :
None
Compliance test for cec-gpio device /dev/cec0:
The test results mean the following:
OK Supported correctly by the device.
OK (Not Supported) Not supported and not mandatory for the
device.
OK (Presumed) Presumably supported. Manually check to
confirm.
OK (Unexpected) Supported correctly but is not expected
to be supported for this device.
OK (Refused) Supported by the device, but was refused.
OK (Expected Failure) Failed but this was expected (see -e option).
FAIL Failed and was expected to be supported
by this device.
Find remote devices:
Polling: OK
FAIL: No remote devices found, exiting.