tc3589x-keypad.c (ff85f707ac49ad77b7cf8dcef38e7fcd468ca3d6) tc3589x-keypad.c (1422731dbc14063fc7083cb090108c0d95267361)
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Jayeeta Banerjee <jayeeta.banerjee@stericsson.com>
5 * Author: Sundar Iyer <sundar.iyer@stericsson.com>
6 *
7 * License Terms: GNU General Public License, version 2
8 *

--- 282 unchanged lines hidden (view full) ---

291static void tc3589x_keypad_close(struct input_dev *input)
292{
293 struct tc_keypad *keypad = input_get_drvdata(input);
294
295 /* disable the keypad module */
296 tc3589x_keypad_disable(keypad);
297}
298
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Jayeeta Banerjee <jayeeta.banerjee@stericsson.com>
5 * Author: Sundar Iyer <sundar.iyer@stericsson.com>
6 *
7 * License Terms: GNU General Public License, version 2
8 *

--- 282 unchanged lines hidden (view full) ---

291static void tc3589x_keypad_close(struct input_dev *input)
292{
293 struct tc_keypad *keypad = input_get_drvdata(input);
294
295 /* disable the keypad module */
296 tc3589x_keypad_disable(keypad);
297}
298
299#ifdef CONFIG_OF
300static const struct tc3589x_keypad_platform_data *
301tc3589x_keypad_of_probe(struct device *dev)
302{
303 struct device_node *np = dev->of_node;
304 struct tc3589x_keypad_platform_data *plat;
305 u32 cols, rows;
306 u32 debounce_ms;
307 int proplen;

--- 33 unchanged lines hidden (view full) ---

341 plat->debounce_period = TC_KPD_DEBOUNCE_PERIOD;
342
343 plat->settle_time = TC_KPD_SETTLE_TIME;
344 /* FIXME: should be property of the IRQ resource? */
345 plat->irqtype = IRQF_TRIGGER_FALLING;
346
347 return plat;
348}
299static const struct tc3589x_keypad_platform_data *
300tc3589x_keypad_of_probe(struct device *dev)
301{
302 struct device_node *np = dev->of_node;
303 struct tc3589x_keypad_platform_data *plat;
304 u32 cols, rows;
305 u32 debounce_ms;
306 int proplen;

--- 33 unchanged lines hidden (view full) ---

340 plat->debounce_period = TC_KPD_DEBOUNCE_PERIOD;
341
342 plat->settle_time = TC_KPD_SETTLE_TIME;
343 /* FIXME: should be property of the IRQ resource? */
344 plat->irqtype = IRQF_TRIGGER_FALLING;
345
346 return plat;
347}
349#else
350static inline const struct tc3589x_keypad_platform_data *
351tc3589x_keypad_of_probe(struct device *dev)
352{
353 return ERR_PTR(-ENODEV);
354}
355#endif
356
348
357
358static int tc3589x_keypad_probe(struct platform_device *pdev)
359{
360 struct tc3589x *tc3589x = dev_get_drvdata(pdev->dev.parent);
361 struct tc_keypad *keypad;
362 struct input_dev *input;
363 const struct tc3589x_keypad_platform_data *plat;
364 int error, irq;
365

--- 40 unchanged lines hidden (view full) ---

406 keypad->keymap = input->keycode;
407
408 input_set_capability(input, EV_MSC, MSC_SCAN);
409 if (!plat->no_autorepeat)
410 __set_bit(EV_REP, input->evbit);
411
412 input_set_drvdata(input, keypad);
413
349static int tc3589x_keypad_probe(struct platform_device *pdev)
350{
351 struct tc3589x *tc3589x = dev_get_drvdata(pdev->dev.parent);
352 struct tc_keypad *keypad;
353 struct input_dev *input;
354 const struct tc3589x_keypad_platform_data *plat;
355 int error, irq;
356

--- 40 unchanged lines hidden (view full) ---

397 keypad->keymap = input->keycode;
398
399 input_set_capability(input, EV_MSC, MSC_SCAN);
400 if (!plat->no_autorepeat)
401 __set_bit(EV_REP, input->evbit);
402
403 input_set_drvdata(input, keypad);
404
414 error = request_threaded_irq(irq, NULL, tc3589x_keypad_irq,
415 plat->irqtype | IRQF_ONESHOT,
416 "tc3589x-keypad", keypad);
405 error = request_threaded_irq(irq, NULL,
406 tc3589x_keypad_irq, plat->irqtype,
407 "tc3589x-keypad", keypad);
417 if (error < 0) {
418 dev_err(&pdev->dev,
419 "Could not allocate irq %d,error %d\n",
420 irq, error);
421 goto err_free_mem;
422 }
423
424 error = input_register_device(input);

--- 94 unchanged lines hidden ---
408 if (error < 0) {
409 dev_err(&pdev->dev,
410 "Could not allocate irq %d,error %d\n",
411 irq, error);
412 goto err_free_mem;
413 }
414
415 error = input_register_device(input);

--- 94 unchanged lines hidden ---