|
@@ -529,7 +529,7 @@ static int cec_open(struct inode *inode, struct file *filp)
|
|
* Initial events that are automatically sent when the cec device is
|
|
* Initial events that are automatically sent when the cec device is
|
|
* opened.
|
|
* opened.
|
|
*/
|
|
*/
|
|
- struct cec_event ev_state = {
|
|
|
|
|
|
+ struct cec_event ev = {
|
|
.event = CEC_EVENT_STATE_CHANGE,
|
|
.event = CEC_EVENT_STATE_CHANGE,
|
|
.flags = CEC_EVENT_FL_INITIAL_STATE,
|
|
.flags = CEC_EVENT_FL_INITIAL_STATE,
|
|
};
|
|
};
|
|
@@ -569,9 +569,19 @@ static int cec_open(struct inode *inode, struct file *filp)
|
|
filp->private_data = fh;
|
|
filp->private_data = fh;
|
|
|
|
|
|
/* Queue up initial state events */
|
|
/* Queue up initial state events */
|
|
- ev_state.state_change.phys_addr = adap->phys_addr;
|
|
|
|
- ev_state.state_change.log_addr_mask = adap->log_addrs.log_addr_mask;
|
|
|
|
- cec_queue_event_fh(fh, &ev_state, 0);
|
|
|
|
|
|
+ ev.state_change.phys_addr = adap->phys_addr;
|
|
|
|
+ ev.state_change.log_addr_mask = adap->log_addrs.log_addr_mask;
|
|
|
|
+ cec_queue_event_fh(fh, &ev, 0);
|
|
|
|
+#ifdef CONFIG_CEC_PIN
|
|
|
|
+ if (adap->pin && adap->pin->ops->read_hpd) {
|
|
|
|
+ err = adap->pin->ops->read_hpd(adap);
|
|
|
|
+ if (err >= 0) {
|
|
|
|
+ ev.event = err ? CEC_EVENT_PIN_HPD_HIGH :
|
|
|
|
+ CEC_EVENT_PIN_HPD_LOW;
|
|
|
|
+ cec_queue_event_fh(fh, &ev, 0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
|
|
list_add(&fh->list, &devnode->fhs);
|
|
list_add(&fh->list, &devnode->fhs);
|
|
mutex_unlock(&devnode->lock);
|
|
mutex_unlock(&devnode->lock);
|