• Home
  • Raw
  • Download

Lines Matching full:keypad

9  * TC35893 MFD Keypad Controller driver
22 /* Maximum supported keypad matrix row/columns size */
26 /* keypad related Constants */
74 * struct tc35893_keypad_platform_data - platform specific keypad data
81 * @enable_wakeup: specifies if keypad event can wake up system from sleep
96 * struct tc_keypad - data structure used by keypad driver
99 * @board: keypad platform device
103 * @keypad_stopped: holds keypad status
115 static int tc3589x_keypad_init_key_hardware(struct tc_keypad *keypad) in tc3589x_keypad_init_key_hardware() argument
118 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_init_key_hardware()
119 const struct tc3589x_keypad_platform_data *board = keypad->board; in tc3589x_keypad_init_key_hardware()
152 /* Start of initialise keypad GPIOs */ in tc3589x_keypad_init_key_hardware()
192 struct tc_keypad *keypad = dev; in tc3589x_keypad_irq() local
193 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_irq()
212 input_event(keypad->input, EV_MSC, MSC_SCAN, code); in tc3589x_keypad_irq()
213 input_report_key(keypad->input, keypad->keymap[code], !up); in tc3589x_keypad_irq()
214 input_sync(keypad->input); in tc3589x_keypad_irq()
227 static int tc3589x_keypad_enable(struct tc_keypad *keypad) in tc3589x_keypad_enable() argument
229 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_enable()
232 /* pull the keypad module out of reset */ in tc3589x_keypad_enable()
242 /* enable the keypad clock */ in tc3589x_keypad_enable()
258 keypad->keypad_stopped = false; in tc3589x_keypad_enable()
263 static int tc3589x_keypad_disable(struct tc_keypad *keypad) in tc3589x_keypad_disable() argument
265 struct tc3589x *tc3589x = keypad->tc3589x; in tc3589x_keypad_disable()
280 /* disable the keypad module */ in tc3589x_keypad_disable()
285 /* put the keypad module into reset */ in tc3589x_keypad_disable()
288 keypad->keypad_stopped = true; in tc3589x_keypad_disable()
296 struct tc_keypad *keypad = input_get_drvdata(input); in tc3589x_keypad_open() local
298 /* enable the keypad module */ in tc3589x_keypad_open()
299 error = tc3589x_keypad_enable(keypad); in tc3589x_keypad_open()
301 dev_err(&input->dev, "failed to enable keypad module\n"); in tc3589x_keypad_open()
305 error = tc3589x_keypad_init_key_hardware(keypad); in tc3589x_keypad_open()
307 dev_err(&input->dev, "failed to configure keypad module\n"); in tc3589x_keypad_open()
316 struct tc_keypad *keypad = input_get_drvdata(input); in tc3589x_keypad_close() local
318 /* disable the keypad module */ in tc3589x_keypad_close()
319 tc3589x_keypad_disable(keypad); in tc3589x_keypad_close()
338 of_property_read_u32(np, "keypad,num-columns", &cols); in tc3589x_keypad_of_probe()
339 of_property_read_u32(np, "keypad,num-rows", &rows); in tc3589x_keypad_of_probe()
345 "keypad columns/rows not properly specified (%ux%u)\n", in tc3589x_keypad_of_probe()
378 struct tc_keypad *keypad; in tc3589x_keypad_probe() local
385 dev_err(&pdev->dev, "invalid keypad platform data\n"); in tc3589x_keypad_probe()
393 keypad = devm_kzalloc(&pdev->dev, sizeof(struct tc_keypad), in tc3589x_keypad_probe()
395 if (!keypad) in tc3589x_keypad_probe()
404 keypad->board = plat; in tc3589x_keypad_probe()
405 keypad->input = input; in tc3589x_keypad_probe()
406 keypad->tc3589x = tc3589x; in tc3589x_keypad_probe()
423 keypad->keymap = input->keycode; in tc3589x_keypad_probe()
429 input_set_drvdata(input, keypad); in tc3589x_keypad_probe()
431 tc3589x_keypad_disable(keypad); in tc3589x_keypad_probe()
436 "tc3589x-keypad", keypad); in tc3589x_keypad_probe()
450 /* let platform decide if keypad is a wakeup source or not */ in tc3589x_keypad_probe()
454 platform_set_drvdata(pdev, keypad); in tc3589x_keypad_probe()
463 struct tc_keypad *keypad = platform_get_drvdata(pdev); in tc3589x_keypad_suspend() local
466 /* keypad is already off; we do nothing */ in tc3589x_keypad_suspend()
467 if (keypad->keypad_stopped) in tc3589x_keypad_suspend()
472 tc3589x_keypad_disable(keypad); in tc3589x_keypad_suspend()
482 struct tc_keypad *keypad = platform_get_drvdata(pdev); in tc3589x_keypad_resume() local
485 if (!keypad->keypad_stopped) in tc3589x_keypad_resume()
490 tc3589x_keypad_enable(keypad); in tc3589x_keypad_resume()
503 .name = "tc3589x-keypad",
512 MODULE_DESCRIPTION("TC35893 Keypad Driver");
513 MODULE_ALIAS("platform:tc3589x-keypad");