Lines Matching full:keypad

93 	struct ht16k33_keypad keypad;  member
325 * This gets the keys from keypad and reports it to input subsystem.
328 static bool ht16k33_keypad_scan(struct ht16k33_keypad *keypad) in ht16k33_keypad_scan() argument
330 const unsigned short *keycodes = keypad->dev->keycode; in ht16k33_keypad_scan()
338 rc = i2c_smbus_read_i2c_block_data(keypad->client, 0x40, in ht16k33_keypad_scan()
341 dev_err(&keypad->client->dev, in ht16k33_keypad_scan()
346 for (col = 0; col < keypad->cols; col++) { in ht16k33_keypad_scan()
350 bits_changed = keypad->last_key_state[col] ^ new_state[col]; in ht16k33_keypad_scan()
353 code = MATRIX_SCAN_CODE(row, col, keypad->row_shift); in ht16k33_keypad_scan()
354 input_event(keypad->dev, EV_MSC, MSC_SCAN, code); in ht16k33_keypad_scan()
355 input_report_key(keypad->dev, keycodes[code], in ht16k33_keypad_scan()
359 input_sync(keypad->dev); in ht16k33_keypad_scan()
360 memcpy(keypad->last_key_state, new_state, sizeof(u16) * keypad->cols); in ht16k33_keypad_scan()
367 struct ht16k33_keypad *keypad = dev; in ht16k33_keypad_irq_thread() local
370 wait_event_timeout(keypad->wait, keypad->stopped, in ht16k33_keypad_irq_thread()
371 msecs_to_jiffies(keypad->debounce_ms)); in ht16k33_keypad_irq_thread()
372 if (keypad->stopped) in ht16k33_keypad_irq_thread()
374 } while (ht16k33_keypad_scan(keypad)); in ht16k33_keypad_irq_thread()
381 struct ht16k33_keypad *keypad = input_get_drvdata(dev); in ht16k33_keypad_start() local
383 keypad->stopped = false; in ht16k33_keypad_start()
385 enable_irq(keypad->client->irq); in ht16k33_keypad_start()
392 struct ht16k33_keypad *keypad = input_get_drvdata(dev); in ht16k33_keypad_stop() local
394 keypad->stopped = true; in ht16k33_keypad_stop()
396 wake_up(&keypad->wait); in ht16k33_keypad_stop()
397 disable_irq(keypad->client->irq); in ht16k33_keypad_stop()
494 struct ht16k33_keypad *keypad) in ht16k33_keypad_probe() argument
501 keypad->client = client; in ht16k33_keypad_probe()
502 init_waitqueue_head(&keypad->wait); in ht16k33_keypad_probe()
504 keypad->dev = devm_input_allocate_device(dev); in ht16k33_keypad_probe()
505 if (!keypad->dev) in ht16k33_keypad_probe()
508 input_set_drvdata(keypad->dev, keypad); in ht16k33_keypad_probe()
510 keypad->dev->name = DRIVER_NAME"-keypad"; in ht16k33_keypad_probe()
511 keypad->dev->id.bustype = BUS_I2C; in ht16k33_keypad_probe()
512 keypad->dev->open = ht16k33_keypad_start; in ht16k33_keypad_probe()
513 keypad->dev->close = ht16k33_keypad_stop; in ht16k33_keypad_probe()
516 __set_bit(EV_REP, keypad->dev->evbit); in ht16k33_keypad_probe()
519 &keypad->debounce_ms); in ht16k33_keypad_probe()
535 keypad->rows = rows; in ht16k33_keypad_probe()
536 keypad->cols = cols; in ht16k33_keypad_probe()
537 keypad->row_shift = get_count_order(cols); in ht16k33_keypad_probe()
540 keypad->dev); in ht16k33_keypad_probe()
549 DRIVER_NAME, keypad); in ht16k33_keypad_probe()
556 ht16k33_keypad_stop(keypad->dev); in ht16k33_keypad_probe()
558 return input_register_device(keypad->dev); in ht16k33_keypad_probe()
698 /* Keypad */ in ht16k33_probe()
700 err = ht16k33_keypad_probe(client, &priv->keypad); in ht16k33_probe()