• Home
  • Raw
  • Download

Lines Matching full:keypad

73 	struct ht16k33_keypad keypad;  member
251 * This gets the keys from keypad and reports it to input subsystem.
254 static bool ht16k33_keypad_scan(struct ht16k33_keypad *keypad) in ht16k33_keypad_scan() argument
256 const unsigned short *keycodes = keypad->dev->keycode; in ht16k33_keypad_scan()
264 rc = i2c_smbus_read_i2c_block_data(keypad->client, 0x40, in ht16k33_keypad_scan()
267 dev_err(&keypad->client->dev, in ht16k33_keypad_scan()
272 for (col = 0; col < keypad->cols; col++) { in ht16k33_keypad_scan()
276 bits_changed = keypad->last_key_state[col] ^ new_state[col]; in ht16k33_keypad_scan()
279 code = MATRIX_SCAN_CODE(row, col, keypad->row_shift); in ht16k33_keypad_scan()
280 input_event(keypad->dev, EV_MSC, MSC_SCAN, code); in ht16k33_keypad_scan()
281 input_report_key(keypad->dev, keycodes[code], in ht16k33_keypad_scan()
285 input_sync(keypad->dev); in ht16k33_keypad_scan()
286 memcpy(keypad->last_key_state, new_state, sizeof(u16) * keypad->cols); in ht16k33_keypad_scan()
293 struct ht16k33_keypad *keypad = dev; in ht16k33_keypad_irq_thread() local
296 wait_event_timeout(keypad->wait, keypad->stopped, in ht16k33_keypad_irq_thread()
297 msecs_to_jiffies(keypad->debounce_ms)); in ht16k33_keypad_irq_thread()
298 if (keypad->stopped) in ht16k33_keypad_irq_thread()
300 } while (ht16k33_keypad_scan(keypad)); in ht16k33_keypad_irq_thread()
307 struct ht16k33_keypad *keypad = input_get_drvdata(dev); in ht16k33_keypad_start() local
309 keypad->stopped = false; in ht16k33_keypad_start()
311 enable_irq(keypad->client->irq); in ht16k33_keypad_start()
318 struct ht16k33_keypad *keypad = input_get_drvdata(dev); in ht16k33_keypad_stop() local
320 keypad->stopped = true; in ht16k33_keypad_stop()
322 wake_up(&keypad->wait); in ht16k33_keypad_stop()
323 disable_irq(keypad->client->irq); in ht16k33_keypad_stop()
327 struct ht16k33_keypad *keypad) in ht16k33_keypad_probe() argument
334 keypad->client = client; in ht16k33_keypad_probe()
335 init_waitqueue_head(&keypad->wait); in ht16k33_keypad_probe()
337 keypad->dev = devm_input_allocate_device(&client->dev); in ht16k33_keypad_probe()
338 if (!keypad->dev) in ht16k33_keypad_probe()
341 input_set_drvdata(keypad->dev, keypad); in ht16k33_keypad_probe()
343 keypad->dev->name = DRIVER_NAME"-keypad"; in ht16k33_keypad_probe()
344 keypad->dev->id.bustype = BUS_I2C; in ht16k33_keypad_probe()
345 keypad->dev->open = ht16k33_keypad_start; in ht16k33_keypad_probe()
346 keypad->dev->close = ht16k33_keypad_stop; in ht16k33_keypad_probe()
349 __set_bit(EV_REP, keypad->dev->evbit); in ht16k33_keypad_probe()
352 &keypad->debounce_ms); in ht16k33_keypad_probe()
368 keypad->rows = rows; in ht16k33_keypad_probe()
369 keypad->cols = cols; in ht16k33_keypad_probe()
370 keypad->row_shift = get_count_order(cols); in ht16k33_keypad_probe()
373 keypad->dev); in ht16k33_keypad_probe()
382 DRIVER_NAME, keypad); in ht16k33_keypad_probe()
389 ht16k33_keypad_stop(keypad->dev); in ht16k33_keypad_probe()
391 err = input_register_device(keypad->dev); in ht16k33_keypad_probe()
499 err = ht16k33_keypad_probe(client, &priv->keypad); in ht16k33_probe()