Lines Matching full:keypad

8  * TC35893 MFD Keypad Controller driver
21 /* Maximum supported keypad matrix row/columns size */
25 /* keypad related Constants */
73 * struct tc3589x_keypad_platform_data - platform specific keypad data
80 * @enable_wakeup: specifies if keypad event can wake up system from sleep
95 * struct tc_keypad - data structure used by keypad driver
98 * @board: keypad platform device
102 * @keypad_stopped: holds keypad status
114 static int tc3589x_keypad_init_key_hardware(struct tc_keypad *keypad) in tc3589x_keypad_init_key_hardware() argument
117 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_init_key_hardware()
118 const struct tc3589x_keypad_platform_data *board = keypad->board; in tc3589x_keypad_init_key_hardware()
151 /* Start of initialise keypad GPIOs */ in tc3589x_keypad_init_key_hardware()
191 struct tc_keypad *keypad = dev; in tc3589x_keypad_irq() local
192 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_irq()
211 input_event(keypad->input, EV_MSC, MSC_SCAN, code); in tc3589x_keypad_irq()
212 input_report_key(keypad->input, keypad->keymap[code], !up); in tc3589x_keypad_irq()
213 input_sync(keypad->input); in tc3589x_keypad_irq()
226 static int tc3589x_keypad_enable(struct tc_keypad *keypad) in tc3589x_keypad_enable() argument
228 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_enable()
231 /* pull the keypad module out of reset */ in tc3589x_keypad_enable()
241 /* enable the keypad clock */ in tc3589x_keypad_enable()
257 keypad->keypad_stopped = false; in tc3589x_keypad_enable()
262 static int tc3589x_keypad_disable(struct tc_keypad *keypad) in tc3589x_keypad_disable() argument
264 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_disable()
279 /* disable the keypad module */ in tc3589x_keypad_disable()
284 /* put the keypad module into reset */ in tc3589x_keypad_disable()
287 keypad->keypad_stopped = true; in tc3589x_keypad_disable()
295 struct tc_keypad *keypad = input_get_drvdata(input); in tc3589x_keypad_open() local
297 /* enable the keypad module */ in tc3589x_keypad_open()
298 error = tc3589x_keypad_enable(keypad); in tc3589x_keypad_open()
300 dev_err(&input->dev, "failed to enable keypad module\n"); in tc3589x_keypad_open()
304 error = tc3589x_keypad_init_key_hardware(keypad); in tc3589x_keypad_open()
306 dev_err(&input->dev, "failed to configure keypad module\n"); in tc3589x_keypad_open()
315 struct tc_keypad *keypad = input_get_drvdata(input); in tc3589x_keypad_close() local
317 /* disable the keypad module */ in tc3589x_keypad_close()
318 tc3589x_keypad_disable(keypad); in tc3589x_keypad_close()
337 of_property_read_u32(np, "keypad,num-columns", &cols); in tc3589x_keypad_of_probe()
338 of_property_read_u32(np, "keypad,num-rows", &rows); in tc3589x_keypad_of_probe()
344 "keypad columns/rows not properly specified (%ux%u)\n", in tc3589x_keypad_of_probe()
377 struct tc_keypad *keypad; in tc3589x_keypad_probe() local
384 dev_err(&pdev->dev, "invalid keypad platform data\n"); in tc3589x_keypad_probe()
392 keypad = devm_kzalloc(&pdev->dev, sizeof(struct tc_keypad), in tc3589x_keypad_probe()
394 if (!keypad) in tc3589x_keypad_probe()
403 keypad->board = plat; in tc3589x_keypad_probe()
404 keypad->input = input; in tc3589x_keypad_probe()
405 keypad->tc3589x = tc3589x; in tc3589x_keypad_probe()
422 keypad->keymap = input->keycode; in tc3589x_keypad_probe()
428 input_set_drvdata(input, keypad); in tc3589x_keypad_probe()
430 tc3589x_keypad_disable(keypad); in tc3589x_keypad_probe()
435 "tc3589x-keypad", keypad); in tc3589x_keypad_probe()
449 /* let platform decide if keypad is a wakeup source or not */ in tc3589x_keypad_probe()
453 platform_set_drvdata(pdev, keypad); in tc3589x_keypad_probe()
462 struct tc_keypad *keypad = platform_get_drvdata(pdev); in tc3589x_keypad_suspend() local
465 /* keypad is already off; we do nothing */ in tc3589x_keypad_suspend()
466 if (keypad->keypad_stopped) in tc3589x_keypad_suspend()
471 tc3589x_keypad_disable(keypad); in tc3589x_keypad_suspend()
481 struct tc_keypad *keypad = platform_get_drvdata(pdev); in tc3589x_keypad_resume() local
484 if (!keypad->keypad_stopped) in tc3589x_keypad_resume()
489 tc3589x_keypad_enable(keypad); in tc3589x_keypad_resume()
502 .name = "tc3589x-keypad",
511 MODULE_DESCRIPTION("TC35893 Keypad Driver");
512 MODULE_ALIAS("platform:tc3589x-keypad");