media: cec/core: add a new CEC_LOG_ADDRS_FL_CONFIG_FAILED flag

If claiming a logical address fails, then set the
CEC_LOG_ADDRS_FL_CONFIG_FAILED flag. This makes it possible for
userspace to detect this corner case.

Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Hans Verkuil
2026-07-10 13:07:34 +02:00
committed by Mauro Carvalho Chehab
parent 350308a05f
commit cba1728208
3 changed files with 12 additions and 0 deletions

View File

@@ -185,6 +185,13 @@ logical address types are already defined will return with error ``EBUSY``.
are CEC devices that can only handle CDC messages.
All other messages are ignored.
* .. _`CEC-LOG-ADDRS-FL-CONFIG-FAILED`:
- ``CEC_LOG_ADDRS_FL_CONFIG_FAILED``
- 8
- If this flag is set, then the CEC device failed to claim a free logical
address and is in the unconfigured state. This can never happen if
``CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK`` was set as well.
.. tabularcolumns:: |p{7.8cm}|p{1.0cm}|p{8.5cm}|

View File

@@ -1482,6 +1482,7 @@ static int cec_config_thread_func(void *arg)
dprintk(1, "physical address: %x.%x.%x.%x, claim %d logical addresses\n",
cec_phys_addr_exp(adap->phys_addr), las->num_log_addrs);
las->log_addr_mask = 0;
las->flags &= ~CEC_LOG_ADDRS_FL_CONFIG_FAILED;
if (las->log_addr_type[0] == CEC_LOG_ADDR_TYPE_UNREGISTERED)
goto configured;
@@ -1614,6 +1615,8 @@ static int cec_config_thread_func(void *arg)
unconfigure:
for (i = 0; i < las->num_log_addrs; i++)
las->log_addr[i] = CEC_LOG_ADDR_INVALID;
if (adap->phys_addr != CEC_PHYS_ADDR_INVALID)
las->flags |= CEC_LOG_ADDRS_FL_CONFIG_FAILED;
cec_adap_unconfigure(adap);
adap->is_configuring = false;
adap->must_reconfigure = false;

View File

@@ -403,6 +403,8 @@ struct cec_log_addrs {
#define CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU (1 << 1)
/* CDC-Only device: supports only CDC messages */
#define CEC_LOG_ADDRS_FL_CDC_ONLY (1 << 2)
/* Configuration failed */
#define CEC_LOG_ADDRS_FL_CONFIG_FAILED (1 << 3)
/**
* struct cec_drm_connector_info - tells which drm connector is