2.5. ioctl CEC_ADAP_G_CAPS

2.5.1. Name

CEC_ADAP_G_CAPS - Query device capabilities

2.5.2. Synopsis

int ioctl(int fd, CEC_ADAP_G_CAPS, struct cec_caps *argp)

2.5.3. Arguments

File descriptor returned by open().


2.5.4. Description


This documents the proposed CEC API. This API is not yet finalized and is currently only available as a staging kernel module.

All cec devices must support ioctl CEC_ADAP_G_CAPS. To query device information, applications call the ioctl with a pointer to a struct cec_caps. The driver fills the structure and returns the information to the application. The ioctl never fails.

struct cec_caps
char driver[32] The name of the cec adapter driver.
char name[32] The name of this CEC adapter. The combination driver and name must be unique.
__u32 capabilities The capabilities of the CEC adapter, see CEC Capabilities Flags.
__u32 version CEC Framework API version, formatted with the KERNEL_VERSION() macro.
CEC Capabilities Flags
CEC_CAP_PHYS_ADDR 0x00000001

Userspace has to configure the physical address by calling ioctl CEC_ADAP_S_PHYS_ADDR. If this capability isn’t set, then setting the physical address is handled by the kernel whenever the EDID is set (for an HDMI receiver) or read (for an HDMI transmitter).

CEC_CAP_LOG_ADDRS 0x00000002

Userspace has to configure the logical addresses by calling ioctl CEC_ADAP_S_LOG_ADDRS. If this capability isn’t set, then the kernel will have configured this.


Userspace can transmit CEC messages by calling ioctl CEC_TRANSMIT. This implies that userspace can be a follower as well, since being able to transmit messages is a prerequisite of becoming a follower. If this capability isn’t set, then the kernel will handle all CEC transmits and process all CEC messages it receives.


Userspace can use the passthrough mode by calling ioctl CEC_S_MODE.

CEC_CAP_RC 0x00000010

This adapter supports the remote control protocol.


The CEC hardware can monitor all messages, not just directed and broadcast messages.

2.5.5. Return Value

On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.