ckdev 116 drivers/input/keyboard/cros_ec_keyb.c static bool cros_ec_keyb_has_ghosting(struct cros_ec_keyb *ckdev, uint8_t *buf) ckdev 119 drivers/input/keyboard/cros_ec_keyb.c struct device *dev = ckdev->dev; ckdev 120 drivers/input/keyboard/cros_ec_keyb.c uint8_t *valid_keys = ckdev->valid_keys; ckdev 135 drivers/input/keyboard/cros_ec_keyb.c for (col1 = 0; col1 < ckdev->cols; col1++) { ckdev 137 drivers/input/keyboard/cros_ec_keyb.c for (col2 = col1 + 1; col2 < ckdev->cols; col2++) { ckdev 156 drivers/input/keyboard/cros_ec_keyb.c static void cros_ec_keyb_process(struct cros_ec_keyb *ckdev, ckdev 159 drivers/input/keyboard/cros_ec_keyb.c struct input_dev *idev = ckdev->idev; ckdev 164 drivers/input/keyboard/cros_ec_keyb.c if (ckdev->ghost_filter && cros_ec_keyb_has_ghosting(ckdev, kb_state)) { ckdev 170 drivers/input/keyboard/cros_ec_keyb.c dev_dbg(ckdev->dev, "ghosting found\n"); ckdev 174 drivers/input/keyboard/cros_ec_keyb.c for (col = 0; col < ckdev->cols; col++) { ckdev 175 drivers/input/keyboard/cros_ec_keyb.c for (row = 0; row < ckdev->rows; row++) { ckdev 176 drivers/input/keyboard/cros_ec_keyb.c int pos = MATRIX_SCAN_CODE(row, col, ckdev->row_shift); ckdev 180 drivers/input/keyboard/cros_ec_keyb.c old_state = ckdev->old_kb_state[col] & (1 << row); ckdev 182 drivers/input/keyboard/cros_ec_keyb.c dev_dbg(ckdev->dev, ckdev 190 drivers/input/keyboard/cros_ec_keyb.c ckdev->old_kb_state[col] = kb_state[col]; ckdev 192 drivers/input/keyboard/cros_ec_keyb.c input_sync(ckdev->idev); ckdev 205 drivers/input/keyboard/cros_ec_keyb.c static void cros_ec_keyb_report_bs(struct cros_ec_keyb *ckdev, ckdev 209 drivers/input/keyboard/cros_ec_keyb.c struct input_dev *idev = ckdev->bs_idev; ckdev 227 drivers/input/keyboard/cros_ec_keyb.c struct cros_ec_keyb *ckdev = container_of(nb, struct cros_ec_keyb, ckdev 229 drivers/input/keyboard/cros_ec_keyb.c uint8_t mkbp_event_type = ckdev->ec->event_data.event_type & ckdev 239 drivers/input/keyboard/cros_ec_keyb.c if (queued_during_suspend && !device_may_wakeup(ckdev->dev)) ckdev 244 drivers/input/keyboard/cros_ec_keyb.c pm_wakeup_event(ckdev->dev, 0); ckdev 246 drivers/input/keyboard/cros_ec_keyb.c if (ckdev->ec->event_size != ckdev->cols) { ckdev 247 drivers/input/keyboard/cros_ec_keyb.c dev_err(ckdev->dev, ckdev 252 drivers/input/keyboard/cros_ec_keyb.c cros_ec_keyb_process(ckdev, ckdev 253 drivers/input/keyboard/cros_ec_keyb.c ckdev->ec->event_data.data.key_matrix, ckdev 254 drivers/input/keyboard/cros_ec_keyb.c ckdev->ec->event_size); ckdev 258 drivers/input/keyboard/cros_ec_keyb.c pm_wakeup_event(ckdev->dev, 0); ckdev 260 drivers/input/keyboard/cros_ec_keyb.c val = get_unaligned_le32(&ckdev->ec->event_data.data.sysrq); ckdev 261 drivers/input/keyboard/cros_ec_keyb.c dev_dbg(ckdev->dev, "sysrq code from EC: %#x\n", val); ckdev 267 drivers/input/keyboard/cros_ec_keyb.c pm_wakeup_event(ckdev->dev, 0); ckdev 271 drivers/input/keyboard/cros_ec_keyb.c &ckdev->ec->event_data.data.buttons); ckdev 275 drivers/input/keyboard/cros_ec_keyb.c &ckdev->ec->event_data.data.switches); ckdev 278 drivers/input/keyboard/cros_ec_keyb.c cros_ec_keyb_report_bs(ckdev, ev_type, val); ckdev 292 drivers/input/keyboard/cros_ec_keyb.c static void cros_ec_keyb_compute_valid_keys(struct cros_ec_keyb *ckdev) ckdev 295 drivers/input/keyboard/cros_ec_keyb.c int row_shift = ckdev->row_shift; ckdev 296 drivers/input/keyboard/cros_ec_keyb.c unsigned short *keymap = ckdev->idev->keycode; ckdev 299 drivers/input/keyboard/cros_ec_keyb.c BUG_ON(ckdev->idev->keycodesize != sizeof(*keymap)); ckdev 301 drivers/input/keyboard/cros_ec_keyb.c for (col = 0; col < ckdev->cols; col++) { ckdev 302 drivers/input/keyboard/cros_ec_keyb.c for (row = 0; row < ckdev->rows; row++) { ckdev 305 drivers/input/keyboard/cros_ec_keyb.c ckdev->valid_keys[col] |= 1 << row; ckdev 307 drivers/input/keyboard/cros_ec_keyb.c dev_dbg(ckdev->dev, "valid_keys[%02d] = 0x%02x\n", ckdev 308 drivers/input/keyboard/cros_ec_keyb.c col, ckdev->valid_keys[col]); ckdev 390 drivers/input/keyboard/cros_ec_keyb.c static int cros_ec_keyb_query_switches(struct cros_ec_keyb *ckdev) ckdev 392 drivers/input/keyboard/cros_ec_keyb.c struct cros_ec_device *ec_dev = ckdev->ec; ckdev 402 drivers/input/keyboard/cros_ec_keyb.c cros_ec_keyb_report_bs(ckdev, EV_SW, ckdev 419 drivers/input/keyboard/cros_ec_keyb.c struct cros_ec_keyb *ckdev = dev_get_drvdata(dev); ckdev 421 drivers/input/keyboard/cros_ec_keyb.c if (ckdev->bs_idev) ckdev 422 drivers/input/keyboard/cros_ec_keyb.c return cros_ec_keyb_query_switches(ckdev); ckdev 441 drivers/input/keyboard/cros_ec_keyb.c static int cros_ec_keyb_register_bs(struct cros_ec_keyb *ckdev) ckdev 443 drivers/input/keyboard/cros_ec_keyb.c struct cros_ec_device *ec_dev = ckdev->ec; ckdev 444 drivers/input/keyboard/cros_ec_keyb.c struct device *dev = ckdev->dev; ckdev 492 drivers/input/keyboard/cros_ec_keyb.c input_set_drvdata(idev, ckdev); ckdev 493 drivers/input/keyboard/cros_ec_keyb.c ckdev->bs_idev = idev; ckdev 503 drivers/input/keyboard/cros_ec_keyb.c ret = cros_ec_keyb_query_switches(ckdev); ckdev 509 drivers/input/keyboard/cros_ec_keyb.c ret = input_register_device(ckdev->bs_idev); ckdev 527 drivers/input/keyboard/cros_ec_keyb.c static int cros_ec_keyb_register_matrix(struct cros_ec_keyb *ckdev) ckdev 529 drivers/input/keyboard/cros_ec_keyb.c struct cros_ec_device *ec_dev = ckdev->ec; ckdev 530 drivers/input/keyboard/cros_ec_keyb.c struct device *dev = ckdev->dev; ckdev 535 drivers/input/keyboard/cros_ec_keyb.c err = matrix_keypad_parse_properties(dev, &ckdev->rows, &ckdev->cols); ckdev 539 drivers/input/keyboard/cros_ec_keyb.c ckdev->valid_keys = devm_kzalloc(dev, ckdev->cols, GFP_KERNEL); ckdev 540 drivers/input/keyboard/cros_ec_keyb.c if (!ckdev->valid_keys) ckdev 543 drivers/input/keyboard/cros_ec_keyb.c ckdev->old_kb_state = devm_kzalloc(dev, ckdev->cols, GFP_KERNEL); ckdev 544 drivers/input/keyboard/cros_ec_keyb.c if (!ckdev->old_kb_state) ckdev 568 drivers/input/keyboard/cros_ec_keyb.c ckdev->ghost_filter = of_property_read_bool(dev->of_node, ckdev 571 drivers/input/keyboard/cros_ec_keyb.c err = matrix_keypad_build_keymap(NULL, NULL, ckdev->rows, ckdev->cols, ckdev 578 drivers/input/keyboard/cros_ec_keyb.c ckdev->row_shift = get_count_order(ckdev->cols); ckdev 581 drivers/input/keyboard/cros_ec_keyb.c input_set_drvdata(idev, ckdev); ckdev 582 drivers/input/keyboard/cros_ec_keyb.c ckdev->idev = idev; ckdev 583 drivers/input/keyboard/cros_ec_keyb.c cros_ec_keyb_compute_valid_keys(ckdev); ckdev 585 drivers/input/keyboard/cros_ec_keyb.c err = input_register_device(ckdev->idev); ckdev 598 drivers/input/keyboard/cros_ec_keyb.c struct cros_ec_keyb *ckdev; ckdev 604 drivers/input/keyboard/cros_ec_keyb.c ckdev = devm_kzalloc(dev, sizeof(*ckdev), GFP_KERNEL); ckdev 605 drivers/input/keyboard/cros_ec_keyb.c if (!ckdev) ckdev 608 drivers/input/keyboard/cros_ec_keyb.c ckdev->ec = ec; ckdev 609 drivers/input/keyboard/cros_ec_keyb.c ckdev->dev = dev; ckdev 610 drivers/input/keyboard/cros_ec_keyb.c dev_set_drvdata(dev, ckdev); ckdev 612 drivers/input/keyboard/cros_ec_keyb.c err = cros_ec_keyb_register_matrix(ckdev); ckdev 618 drivers/input/keyboard/cros_ec_keyb.c err = cros_ec_keyb_register_bs(ckdev); ckdev 624 drivers/input/keyboard/cros_ec_keyb.c ckdev->notifier.notifier_call = cros_ec_keyb_work; ckdev 625 drivers/input/keyboard/cros_ec_keyb.c err = blocking_notifier_chain_register(&ckdev->ec->event_notifier, ckdev 626 drivers/input/keyboard/cros_ec_keyb.c &ckdev->notifier); ckdev 632 drivers/input/keyboard/cros_ec_keyb.c device_init_wakeup(ckdev->dev, true); ckdev 638 drivers/input/keyboard/cros_ec_keyb.c struct cros_ec_keyb *ckdev = dev_get_drvdata(&pdev->dev); ckdev 640 drivers/input/keyboard/cros_ec_keyb.c blocking_notifier_chain_unregister(&ckdev->ec->event_notifier, ckdev 641 drivers/input/keyboard/cros_ec_keyb.c &ckdev->notifier);