Lines Matching full:keypad

102 	struct ht16k33_keypad keypad;  member
369 * This gets the keys from keypad and reports it to input subsystem.
372 static bool ht16k33_keypad_scan(struct ht16k33_keypad *keypad) in ht16k33_keypad_scan() argument
374 const unsigned short *keycodes = keypad->dev->keycode; in ht16k33_keypad_scan()
382 rc = i2c_smbus_read_i2c_block_data(keypad->client, 0x40, in ht16k33_keypad_scan()
385 dev_err(&keypad->client->dev, in ht16k33_keypad_scan()
390 for (col = 0; col < keypad->cols; col++) { in ht16k33_keypad_scan()
394 bits_changed = keypad->last_key_state[col] ^ new_state[col]; in ht16k33_keypad_scan()
397 code = MATRIX_SCAN_CODE(row, col, keypad->row_shift); in ht16k33_keypad_scan()
398 input_event(keypad->dev, EV_MSC, MSC_SCAN, code); in ht16k33_keypad_scan()
399 input_report_key(keypad->dev, keycodes[code], in ht16k33_keypad_scan()
403 input_sync(keypad->dev); in ht16k33_keypad_scan()
404 memcpy(keypad->last_key_state, new_state, sizeof(u16) * keypad->cols); in ht16k33_keypad_scan()
411 struct ht16k33_keypad *keypad = dev; in ht16k33_keypad_irq_thread() local
414 wait_event_timeout(keypad->wait, keypad->stopped, in ht16k33_keypad_irq_thread()
415 msecs_to_jiffies(keypad->debounce_ms)); in ht16k33_keypad_irq_thread()
416 if (keypad->stopped) in ht16k33_keypad_irq_thread()
418 } while (ht16k33_keypad_scan(keypad)); in ht16k33_keypad_irq_thread()
425 struct ht16k33_keypad *keypad = input_get_drvdata(dev); in ht16k33_keypad_start() local
427 keypad->stopped = false; in ht16k33_keypad_start()
429 enable_irq(keypad->client->irq); in ht16k33_keypad_start()
436 struct ht16k33_keypad *keypad = input_get_drvdata(dev); in ht16k33_keypad_stop() local
438 keypad->stopped = true; in ht16k33_keypad_stop()
440 wake_up(&keypad->wait); in ht16k33_keypad_stop()
441 disable_irq(keypad->client->irq); in ht16k33_keypad_stop()
518 struct ht16k33_keypad *keypad) in ht16k33_keypad_probe() argument
525 keypad->client = client; in ht16k33_keypad_probe()
526 init_waitqueue_head(&keypad->wait); in ht16k33_keypad_probe()
528 keypad->dev = devm_input_allocate_device(dev); in ht16k33_keypad_probe()
529 if (!keypad->dev) in ht16k33_keypad_probe()
532 input_set_drvdata(keypad->dev, keypad); in ht16k33_keypad_probe()
534 keypad->dev->name = DRIVER_NAME"-keypad"; in ht16k33_keypad_probe()
535 keypad->dev->id.bustype = BUS_I2C; in ht16k33_keypad_probe()
536 keypad->dev->open = ht16k33_keypad_start; in ht16k33_keypad_probe()
537 keypad->dev->close = ht16k33_keypad_stop; in ht16k33_keypad_probe()
540 __set_bit(EV_REP, keypad->dev->evbit); in ht16k33_keypad_probe()
543 &keypad->debounce_ms); in ht16k33_keypad_probe()
559 keypad->rows = rows; in ht16k33_keypad_probe()
560 keypad->cols = cols; in ht16k33_keypad_probe()
561 keypad->row_shift = get_count_order(cols); in ht16k33_keypad_probe()
564 keypad->dev); in ht16k33_keypad_probe()
573 DRIVER_NAME, keypad); in ht16k33_keypad_probe()
580 ht16k33_keypad_stop(keypad->dev); in ht16k33_keypad_probe()
582 return input_register_device(keypad->dev); in ht16k33_keypad_probe()
756 /* Keypad */ in ht16k33_probe()
758 err = ht16k33_keypad_probe(client, &priv->keypad); in ht16k33_probe()