Lines Matching full:keypad
73 struct ht16k33_keypad keypad; member
242 * This gets the keys from keypad and reports it to input subsystem.
245 static bool ht16k33_keypad_scan(struct ht16k33_keypad *keypad) in ht16k33_keypad_scan() argument
247 const unsigned short *keycodes = keypad->dev->keycode; in ht16k33_keypad_scan()
255 rc = i2c_smbus_read_i2c_block_data(keypad->client, 0x40, in ht16k33_keypad_scan()
258 dev_err(&keypad->client->dev, in ht16k33_keypad_scan()
263 for (col = 0; col < keypad->cols; col++) { in ht16k33_keypad_scan()
267 bits_changed = keypad->last_key_state[col] ^ new_state[col]; in ht16k33_keypad_scan()
270 code = MATRIX_SCAN_CODE(row, col, keypad->row_shift); in ht16k33_keypad_scan()
271 input_event(keypad->dev, EV_MSC, MSC_SCAN, code); in ht16k33_keypad_scan()
272 input_report_key(keypad->dev, keycodes[code], in ht16k33_keypad_scan()
276 input_sync(keypad->dev); in ht16k33_keypad_scan()
277 memcpy(keypad->last_key_state, new_state, sizeof(u16) * keypad->cols); in ht16k33_keypad_scan()
284 struct ht16k33_keypad *keypad = dev; in ht16k33_keypad_irq_thread() local
287 wait_event_timeout(keypad->wait, keypad->stopped, in ht16k33_keypad_irq_thread()
288 msecs_to_jiffies(keypad->debounce_ms)); in ht16k33_keypad_irq_thread()
289 if (keypad->stopped) in ht16k33_keypad_irq_thread()
291 } while (ht16k33_keypad_scan(keypad)); in ht16k33_keypad_irq_thread()
298 struct ht16k33_keypad *keypad = input_get_drvdata(dev); in ht16k33_keypad_start() local
300 keypad->stopped = false; in ht16k33_keypad_start()
302 enable_irq(keypad->client->irq); in ht16k33_keypad_start()
309 struct ht16k33_keypad *keypad = input_get_drvdata(dev); in ht16k33_keypad_stop() local
311 keypad->stopped = true; in ht16k33_keypad_stop()
313 wake_up(&keypad->wait); in ht16k33_keypad_stop()
314 disable_irq(keypad->client->irq); in ht16k33_keypad_stop()
318 struct ht16k33_keypad *keypad) in ht16k33_keypad_probe() argument
325 keypad->client = client; in ht16k33_keypad_probe()
326 init_waitqueue_head(&keypad->wait); in ht16k33_keypad_probe()
328 keypad->dev = devm_input_allocate_device(&client->dev); in ht16k33_keypad_probe()
329 if (!keypad->dev) in ht16k33_keypad_probe()
332 input_set_drvdata(keypad->dev, keypad); in ht16k33_keypad_probe()
334 keypad->dev->name = DRIVER_NAME"-keypad"; in ht16k33_keypad_probe()
335 keypad->dev->id.bustype = BUS_I2C; in ht16k33_keypad_probe()
336 keypad->dev->open = ht16k33_keypad_start; in ht16k33_keypad_probe()
337 keypad->dev->close = ht16k33_keypad_stop; in ht16k33_keypad_probe()
340 __set_bit(EV_REP, keypad->dev->evbit); in ht16k33_keypad_probe()
343 &keypad->debounce_ms); in ht16k33_keypad_probe()
359 keypad->rows = rows; in ht16k33_keypad_probe()
360 keypad->cols = cols; in ht16k33_keypad_probe()
361 keypad->row_shift = get_count_order(cols); in ht16k33_keypad_probe()
364 keypad->dev); in ht16k33_keypad_probe()
373 DRIVER_NAME, keypad); in ht16k33_keypad_probe()
380 ht16k33_keypad_stop(keypad->dev); in ht16k33_keypad_probe()
382 err = input_register_device(keypad->dev); in ht16k33_keypad_probe()
462 err = ht16k33_keypad_probe(client, &priv->keypad); in ht16k33_probe()