media: cec: Add an interface for hdmi report HPD

Add cec-notifier interface that hdmi can call it when
HPD is occurred.

Change-Id: I0087a879bf3ba65e300c3db3a67ddaa7e22f16ad
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
This commit is contained in:
Algea Cao
2017-12-28 16:22:45 +08:00
committed by Tao Huang
parent f968cdb99b
commit cef745a23a
3 changed files with 15 additions and 0 deletions

View File

@@ -179,6 +179,9 @@ void cec_queue_pin_hpd_event(struct cec_adapter *adap, bool is_high, ktime_t ts)
};
struct cec_fh *fh;
/* hdmi HPD may occur before devnode is registered */
if (!adap->devnode.registered)
return;
mutex_lock(&adap->devnode.lock);
list_for_each_entry(fh, &adap->devnode.fhs, list)
cec_queue_event_fh(fh, &ev, ktime_to_ns(ts));

View File

@@ -113,6 +113,15 @@ void cec_notifier_set_phys_addr_from_edid(struct cec_notifier *n,
}
EXPORT_SYMBOL_GPL(cec_notifier_set_phys_addr_from_edid);
void cec_notifier_repo_cec_hpd(struct cec_notifier *n,
bool hpd_state, ktime_t ts)
{
if (!n)
return;
cec_queue_pin_hpd_event(n->cec_adap, hpd_state, ts);
}
EXPORT_SYMBOL_GPL(cec_notifier_repo_cec_hpd);
void cec_notifier_register(struct cec_notifier *n,
struct cec_adapter *adap,
void (*callback)(struct cec_adapter *adap, u16 pa))

View File

@@ -61,6 +61,9 @@ void cec_notifier_put(struct cec_notifier *n);
*/
void cec_notifier_set_phys_addr(struct cec_notifier *n, u16 pa);
void cec_notifier_repo_cec_hpd(struct cec_notifier *n,
bool hpd_state, ktime_t ts);
/**
* cec_notifier_set_phys_addr_from_edid - set parse the PA from the EDID.
* @n: the CEC notifier