Lines Matching defs:keypad

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)
117 struct tc3589x *tc3589x = keypad->tc3589x;
118 const struct tc3589x_keypad_platform_data *board = keypad->board;
151 /* Start of initialise keypad GPIOs */
191 struct tc_keypad *keypad = dev;
192 struct tc3589x *tc3589x = keypad->tc3589x;
211 input_event(keypad->input, EV_MSC, MSC_SCAN, code);
212 input_report_key(keypad->input, keypad->keymap[code], !up);
213 input_sync(keypad->input);
226 static int tc3589x_keypad_enable(struct tc_keypad *keypad)
228 struct tc3589x *tc3589x = keypad->tc3589x;
231 /* pull the keypad module out of reset */
241 /* enable the keypad clock */
257 keypad->keypad_stopped = false;
262 static int tc3589x_keypad_disable(struct tc_keypad *keypad)
264 struct tc3589x *tc3589x = keypad->tc3589x;
279 /* disable the keypad module */
284 /* put the keypad module into reset */
287 keypad->keypad_stopped = true;
295 struct tc_keypad *keypad = input_get_drvdata(input);
297 /* enable the keypad module */
298 error = tc3589x_keypad_enable(keypad);
300 dev_err(&input->dev, "failed to enable keypad module\n");
304 error = tc3589x_keypad_init_key_hardware(keypad);
306 dev_err(&input->dev, "failed to configure keypad module\n");
315 struct tc_keypad *keypad = input_get_drvdata(input);
317 /* disable the keypad module */
318 tc3589x_keypad_disable(keypad);
337 of_property_read_u32(np, "keypad,num-columns", &cols);
338 of_property_read_u32(np, "keypad,num-rows", &rows);
344 "keypad columns/rows not properly specified (%ux%u)\n",
377 struct tc_keypad *keypad;
384 dev_err(&pdev->dev, "invalid keypad platform data\n");
392 keypad = devm_kzalloc(&pdev->dev, sizeof(struct tc_keypad),
394 if (!keypad)
403 keypad->board = plat;
404 keypad->input = input;
405 keypad->tc3589x = tc3589x;
422 keypad->keymap = input->keycode;
428 input_set_drvdata(input, keypad);
430 tc3589x_keypad_disable(keypad);
435 "tc3589x-keypad", keypad);
449 /* let platform decide if keypad is a wakeup source or not */
453 platform_set_drvdata(pdev, keypad);
461 struct tc_keypad *keypad = platform_get_drvdata(pdev);
464 /* keypad is already off; we do nothing */
465 if (keypad->keypad_stopped)
470 tc3589x_keypad_disable(keypad);
480 struct tc_keypad *keypad = platform_get_drvdata(pdev);
483 if (!keypad->keypad_stopped)
488 tc3589x_keypad_enable(keypad);
500 .name = "tc3589x-keypad",
510 MODULE_ALIAS("platform:tc3589x-keypad");