Lines Matching full:keypad

73 	struct ht16k33_keypad keypad;  member
241 * This gets the keys from keypad and reports it to input subsystem.
244 static bool ht16k33_keypad_scan(struct ht16k33_keypad *keypad) in ht16k33_keypad_scan() argument
246 const unsigned short *keycodes = keypad->dev->keycode; in ht16k33_keypad_scan()
254 rc = i2c_smbus_read_i2c_block_data(keypad->client, 0x40, in ht16k33_keypad_scan()
257 dev_err(&keypad->client->dev, in ht16k33_keypad_scan()
262 for (col = 0; col < keypad->cols; col++) { in ht16k33_keypad_scan()
266 bits_changed = keypad->last_key_state[col] ^ new_state[col]; in ht16k33_keypad_scan()
269 code = MATRIX_SCAN_CODE(row, col, keypad->row_shift); in ht16k33_keypad_scan()
270 input_event(keypad->dev, EV_MSC, MSC_SCAN, code); in ht16k33_keypad_scan()
271 input_report_key(keypad->dev, keycodes[code], in ht16k33_keypad_scan()
275 input_sync(keypad->dev); in ht16k33_keypad_scan()
276 memcpy(keypad->last_key_state, new_state, sizeof(u16) * keypad->cols); in ht16k33_keypad_scan()
283 struct ht16k33_keypad *keypad = dev; in ht16k33_keypad_irq_thread() local
286 wait_event_timeout(keypad->wait, keypad->stopped, in ht16k33_keypad_irq_thread()
287 msecs_to_jiffies(keypad->debounce_ms)); in ht16k33_keypad_irq_thread()
288 if (keypad->stopped) in ht16k33_keypad_irq_thread()
290 } while (ht16k33_keypad_scan(keypad)); in ht16k33_keypad_irq_thread()
297 struct ht16k33_keypad *keypad = input_get_drvdata(dev); in ht16k33_keypad_start() local
299 keypad->stopped = false; in ht16k33_keypad_start()
301 enable_irq(keypad->client->irq); in ht16k33_keypad_start()
308 struct ht16k33_keypad *keypad = input_get_drvdata(dev); in ht16k33_keypad_stop() local
310 keypad->stopped = true; in ht16k33_keypad_stop()
312 wake_up(&keypad->wait); in ht16k33_keypad_stop()
313 disable_irq(keypad->client->irq); in ht16k33_keypad_stop()
317 struct ht16k33_keypad *keypad) in ht16k33_keypad_probe() argument
324 keypad->client = client; in ht16k33_keypad_probe()
325 init_waitqueue_head(&keypad->wait); in ht16k33_keypad_probe()
327 keypad->dev = devm_input_allocate_device(&client->dev); in ht16k33_keypad_probe()
328 if (!keypad->dev) in ht16k33_keypad_probe()
331 input_set_drvdata(keypad->dev, keypad); in ht16k33_keypad_probe()
333 keypad->dev->name = DRIVER_NAME"-keypad"; in ht16k33_keypad_probe()
334 keypad->dev->id.bustype = BUS_I2C; in ht16k33_keypad_probe()
335 keypad->dev->open = ht16k33_keypad_start; in ht16k33_keypad_probe()
336 keypad->dev->close = ht16k33_keypad_stop; in ht16k33_keypad_probe()
339 __set_bit(EV_REP, keypad->dev->evbit); in ht16k33_keypad_probe()
342 &keypad->debounce_ms); in ht16k33_keypad_probe()
358 keypad->rows = rows; in ht16k33_keypad_probe()
359 keypad->cols = cols; in ht16k33_keypad_probe()
360 keypad->row_shift = get_count_order(cols); in ht16k33_keypad_probe()
363 keypad->dev); in ht16k33_keypad_probe()
372 DRIVER_NAME, keypad); in ht16k33_keypad_probe()
379 ht16k33_keypad_stop(keypad->dev); in ht16k33_keypad_probe()
381 err = input_register_device(keypad->dev); in ht16k33_keypad_probe()
456 /* Keypad */ in ht16k33_probe()
458 err = ht16k33_keypad_probe(client, &priv->keypad); in ht16k33_probe()