Commit 98f803cf authored by Jeff Chase's avatar Jeff Chase Committed by Mauro Carvalho Chehab

media: cec: add adap_controls_phys_addr option

Use of the cec notifier framework is required to support
CEC_CAP_CONNECTOR_INFO but some devices do not want physical address
updates from the notifier. This adds an option to allow registering
with a cec notifier without getting address updates.

[hans: document the new adap_controls_phys_addr bool]
Signed-off-by: default avatarJeff Chase <jnchase@google.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 7f52faab
...@@ -116,7 +116,8 @@ cec_notifier_conn_register(struct device *hdmi_dev, const char *port_name, ...@@ -116,7 +116,8 @@ cec_notifier_conn_register(struct device *hdmi_dev, const char *port_name,
else else
memset(&n->conn_info, 0, sizeof(n->conn_info)); memset(&n->conn_info, 0, sizeof(n->conn_info));
if (n->cec_adap) { if (n->cec_adap) {
cec_phys_addr_invalidate(n->cec_adap); if (!n->cec_adap->adap_controls_phys_addr)
cec_phys_addr_invalidate(n->cec_adap);
cec_s_conn_info(n->cec_adap, conn_info); cec_s_conn_info(n->cec_adap, conn_info);
} }
mutex_unlock(&n->lock); mutex_unlock(&n->lock);
...@@ -133,7 +134,8 @@ void cec_notifier_conn_unregister(struct cec_notifier *n) ...@@ -133,7 +134,8 @@ void cec_notifier_conn_unregister(struct cec_notifier *n)
memset(&n->conn_info, 0, sizeof(n->conn_info)); memset(&n->conn_info, 0, sizeof(n->conn_info));
n->phys_addr = CEC_PHYS_ADDR_INVALID; n->phys_addr = CEC_PHYS_ADDR_INVALID;
if (n->cec_adap) { if (n->cec_adap) {
cec_phys_addr_invalidate(n->cec_adap); if (!n->cec_adap->adap_controls_phys_addr)
cec_phys_addr_invalidate(n->cec_adap);
cec_s_conn_info(n->cec_adap, NULL); cec_s_conn_info(n->cec_adap, NULL);
} }
mutex_unlock(&n->lock); mutex_unlock(&n->lock);
...@@ -158,7 +160,8 @@ cec_notifier_cec_adap_register(struct device *hdmi_dev, const char *port_name, ...@@ -158,7 +160,8 @@ cec_notifier_cec_adap_register(struct device *hdmi_dev, const char *port_name,
n->cec_adap = adap; n->cec_adap = adap;
adap->conn_info = n->conn_info; adap->conn_info = n->conn_info;
adap->notifier = n; adap->notifier = n;
cec_s_phys_addr(adap, n->phys_addr, false); if (!adap->adap_controls_phys_addr)
cec_s_phys_addr(adap, n->phys_addr, false);
mutex_unlock(&n->lock); mutex_unlock(&n->lock);
return n; return n;
} }
...@@ -185,7 +188,7 @@ void cec_notifier_set_phys_addr(struct cec_notifier *n, u16 pa) ...@@ -185,7 +188,7 @@ void cec_notifier_set_phys_addr(struct cec_notifier *n, u16 pa)
mutex_lock(&n->lock); mutex_lock(&n->lock);
n->phys_addr = pa; n->phys_addr = pa;
if (n->cec_adap) if (n->cec_adap && !n->cec_adap->adap_controls_phys_addr)
cec_s_phys_addr(n->cec_adap, n->phys_addr, false); cec_s_phys_addr(n->cec_adap, n->phys_addr, false);
mutex_unlock(&n->lock); mutex_unlock(&n->lock);
} }
......
...@@ -172,6 +172,11 @@ struct cec_adap_ops { ...@@ -172,6 +172,11 @@ struct cec_adap_ops {
* @is_configured: the CEC adapter is configured (i.e. has claimed LAs) * @is_configured: the CEC adapter is configured (i.e. has claimed LAs)
* @cec_pin_is_high: if true then the CEC pin is high. Only used with the * @cec_pin_is_high: if true then the CEC pin is high. Only used with the
* CEC pin framework. * CEC pin framework.
* @adap_controls_phys_addr: if true, then the CEC adapter controls the
* physical address, i.e. the CEC hardware can detect HPD changes and
* read the EDID and is not dependent on an external HDMI driver.
* Drivers that need this can set this field to true after the
* cec_allocate_adapter() call.
* @last_initiator: the initiator of the last transmitted message. * @last_initiator: the initiator of the last transmitted message.
* @monitor_all_cnt: number of filehandles monitoring all msgs * @monitor_all_cnt: number of filehandles monitoring all msgs
* @monitor_pin_cnt: number of filehandles monitoring pin changes * @monitor_pin_cnt: number of filehandles monitoring pin changes
...@@ -222,6 +227,7 @@ struct cec_adapter { ...@@ -222,6 +227,7 @@ struct cec_adapter {
bool is_configuring; bool is_configuring;
bool is_configured; bool is_configured;
bool cec_pin_is_high; bool cec_pin_is_high;
bool adap_controls_phys_addr;
u8 last_initiator; u8 last_initiator;
u32 monitor_all_cnt; u32 monitor_all_cnt;
u32 monitor_pin_cnt; u32 monitor_pin_cnt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment