keypad.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Samsung Platform - Keypad platform data definitions
  3. *
  4. * Copyright (C) 2010 Samsung Electronics Co.Ltd
  5. * Author: Joonyoung Shim <jy0922.shim@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. */
  12. #ifndef __PLAT_SAMSUNG_KEYPAD_H
  13. #define __PLAT_SAMSUNG_KEYPAD_H
  14. #include <linux/input/matrix_keypad.h>
  15. #define SAMSUNG_MAX_ROWS 8
  16. #define SAMSUNG_MAX_COLS 8
  17. /**
  18. * struct samsung_keypad_platdata - Platform device data for Samsung Keypad.
  19. * @keymap_data: pointer to &matrix_keymap_data.
  20. * @rows: number of keypad row supported.
  21. * @cols: number of keypad col supported.
  22. * @no_autorepeat: disable key autorepeat.
  23. * @wakeup: controls whether the device should be set up as wakeup source.
  24. * @cfg_gpio: configure the GPIO.
  25. *
  26. * Initialisation data specific to either the machine or the platform
  27. * for the device driver to use or call-back when configuring gpio.
  28. */
  29. struct samsung_keypad_platdata {
  30. const struct matrix_keymap_data *keymap_data;
  31. unsigned int rows;
  32. unsigned int cols;
  33. bool no_autorepeat;
  34. bool wakeup;
  35. void (*cfg_gpio)(unsigned int rows, unsigned int cols);
  36. };
  37. /**
  38. * samsung_keypad_set_platdata - Set platform data for Samsung Keypad device.
  39. * @pd: Platform data to register to device.
  40. *
  41. * Register the given platform data for use with Samsung Keypad device.
  42. * The call will copy the platform data, so the board definitions can
  43. * make the structure itself __initdata.
  44. */
  45. extern void samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd);
  46. /* defined by architecture to configure gpio. */
  47. extern void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols);
  48. #endif /* __PLAT_SAMSUNG_KEYPAD_H */