if (mode_follower == CEC_MODE_FOLLOWER)
adap->follower_cnt++;
if (mode_follower == CEC_MODE_MONITOR_PIN) {
-#ifdef CONFIG_CEC_PIN
struct cec_event ev = {
.flags = CEC_EVENT_FL_INITIAL_STATE,
};
- ev.event = adap->pin->cur_value ? CEC_EVENT_PIN_CEC_HIGH :
- CEC_EVENT_PIN_CEC_LOW;
+ ev.event = adap->cec_pin_is_high ? CEC_EVENT_PIN_CEC_HIGH :
+ CEC_EVENT_PIN_CEC_LOW;
cec_queue_event_fh(fh, &ev, 0);
-#endif
adap->monitor_pin_cnt++;
}
if (mode_follower == CEC_MODE_EXCL_FOLLOWER ||
return ERR_PTR(-ENOMEM);
strlcpy(adap->name, name, sizeof(adap->name));
adap->phys_addr = CEC_PHYS_ADDR_INVALID;
+ adap->cec_pin_is_high = true;
adap->log_addrs.cec_version = CEC_OP_CEC_VERSION_2_0;
adap->log_addrs.vendor_id = CEC_VENDOR_ID_NONE;
adap->capabilities = caps;
static void cec_pin_update(struct cec_pin *pin, bool v, bool force)
{
- if (!force && v == pin->cur_value)
+ if (!force && v == pin->adap->cec_pin_is_high)
return;
- pin->cur_value = v;
+ pin->adap->cec_pin_is_high = v;
if (atomic_read(&pin->work_pin_events) < CEC_NUM_PIN_EVENTS) {
pin->work_pin_is_high[pin->work_pin_events_wr] = v;
pin->work_pin_ts[pin->work_pin_events_wr] = ktime_get();
if (pin == NULL)
return ERR_PTR(-ENOMEM);
pin->ops = pin_ops;
- pin->cur_value = true;
hrtimer_init(&pin->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
pin->timer.function = cec_pin_timer;
init_waitqueue_head(&pin->kthread_waitq);
u16 la_mask;
bool enabled;
bool monitor_all;
- bool cur_value;
bool rx_eom;
bool enable_irq_failed;
enum cec_pin_state state;
bool needs_hpd;
bool is_configuring;
bool is_configured;
+ bool cec_pin_is_high;
u32 monitor_all_cnt;
u32 monitor_pin_cnt;
u32 follower_cnt;