Lines Matching refs:keypad

93 static int __devinit tc3589x_keypad_init_key_hardware(struct tc_keypad *keypad)  in tc3589x_keypad_init_key_hardware()  argument
96 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_init_key_hardware()
97 u8 settle_time = keypad->board->settle_time; in tc3589x_keypad_init_key_hardware()
98 u8 dbounce_period = keypad->board->debounce_period; in tc3589x_keypad_init_key_hardware()
99 u8 rows = keypad->board->krow & 0xf; /* mask out the nibble */ in tc3589x_keypad_init_key_hardware()
100 u8 column = keypad->board->kcol & 0xf; /* mask out the nibble */ in tc3589x_keypad_init_key_hardware()
103 if (keypad->board->kcol > TC3589x_MAX_KPCOL || in tc3589x_keypad_init_key_hardware()
104 keypad->board->krow > TC3589x_MAX_KPROW || in tc3589x_keypad_init_key_hardware()
105 keypad->board->debounce_period > TC3589x_MAX_DEBOUNCE_SETTLE || in tc3589x_keypad_init_key_hardware()
106 keypad->board->settle_time > TC3589x_MAX_DEBOUNCE_SETTLE) in tc3589x_keypad_init_key_hardware()
174 struct tc_keypad *keypad = dev; in tc3589x_keypad_irq() local
175 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_irq()
194 input_event(keypad->input, EV_MSC, MSC_SCAN, code); in tc3589x_keypad_irq()
195 input_report_key(keypad->input, keypad->keymap[code], !up); in tc3589x_keypad_irq()
196 input_sync(keypad->input); in tc3589x_keypad_irq()
209 static int tc3589x_keypad_enable(struct tc_keypad *keypad) in tc3589x_keypad_enable() argument
211 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_enable()
240 keypad->keypad_stopped = false; in tc3589x_keypad_enable()
245 static int tc3589x_keypad_disable(struct tc_keypad *keypad) in tc3589x_keypad_disable() argument
247 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_disable()
270 keypad->keypad_stopped = true; in tc3589x_keypad_disable()
278 struct tc_keypad *keypad = input_get_drvdata(input); in tc3589x_keypad_open() local
281 error = tc3589x_keypad_enable(keypad); in tc3589x_keypad_open()
287 error = tc3589x_keypad_init_key_hardware(keypad); in tc3589x_keypad_open()
298 struct tc_keypad *keypad = input_get_drvdata(input); in tc3589x_keypad_close() local
301 tc3589x_keypad_disable(keypad); in tc3589x_keypad_close()
307 struct tc_keypad *keypad; in tc3589x_keypad_probe() local
312 plat = tc3589x->pdata->keypad; in tc3589x_keypad_probe()
322 keypad = kzalloc(sizeof(struct tc_keypad), GFP_KERNEL); in tc3589x_keypad_probe()
324 if (!keypad || !input) { in tc3589x_keypad_probe()
330 keypad->board = plat; in tc3589x_keypad_probe()
331 keypad->input = input; in tc3589x_keypad_probe()
332 keypad->tc3589x = tc3589x; in tc3589x_keypad_probe()
338 input->keycode = keypad->keymap; in tc3589x_keypad_probe()
339 input->keycodesize = sizeof(keypad->keymap[0]); in tc3589x_keypad_probe()
340 input->keycodemax = ARRAY_SIZE(keypad->keymap); in tc3589x_keypad_probe()
345 input_set_drvdata(input, keypad); in tc3589x_keypad_probe()
358 "tc3589x-keypad", keypad); in tc3589x_keypad_probe()
376 platform_set_drvdata(pdev, keypad); in tc3589x_keypad_probe()
381 free_irq(irq, keypad); in tc3589x_keypad_probe()
384 kfree(keypad); in tc3589x_keypad_probe()
390 struct tc_keypad *keypad = platform_get_drvdata(pdev); in tc3589x_keypad_remove() local
393 if (!keypad->keypad_stopped) in tc3589x_keypad_remove()
394 tc3589x_keypad_disable(keypad); in tc3589x_keypad_remove()
396 free_irq(irq, keypad); in tc3589x_keypad_remove()
398 input_unregister_device(keypad->input); in tc3589x_keypad_remove()
400 kfree(keypad); in tc3589x_keypad_remove()
409 struct tc_keypad *keypad = platform_get_drvdata(pdev); in tc3589x_keypad_suspend() local
413 if (keypad->keypad_stopped) in tc3589x_keypad_suspend()
418 tc3589x_keypad_disable(keypad); in tc3589x_keypad_suspend()
428 struct tc_keypad *keypad = platform_get_drvdata(pdev); in tc3589x_keypad_resume() local
431 if (!keypad->keypad_stopped) in tc3589x_keypad_resume()
436 tc3589x_keypad_enable(keypad); in tc3589x_keypad_resume()