dev-keypad.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * linux/arch/arm/plat-samsung/dev-keypad.c
  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. */
  13. #include <linux/platform_device.h>
  14. #include <mach/irqs.h>
  15. #include <mach/map.h>
  16. #include <plat/cpu.h>
  17. #include <plat/devs.h>
  18. #include <plat/keypad.h>
  19. static struct resource samsung_keypad_resources[] = {
  20. [0] = {
  21. .start = SAMSUNG_PA_KEYPAD,
  22. .end = SAMSUNG_PA_KEYPAD + 0x20 - 1,
  23. .flags = IORESOURCE_MEM,
  24. },
  25. [1] = {
  26. .start = IRQ_KEYPAD,
  27. .end = IRQ_KEYPAD,
  28. .flags = IORESOURCE_IRQ,
  29. },
  30. };
  31. struct platform_device samsung_device_keypad = {
  32. .name = "samsung-keypad",
  33. .id = -1,
  34. .num_resources = ARRAY_SIZE(samsung_keypad_resources),
  35. .resource = samsung_keypad_resources,
  36. };
  37. void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd)
  38. {
  39. struct samsung_keypad_platdata *npd;
  40. npd = s3c_set_platdata(pd, sizeof(struct samsung_keypad_platdata),
  41. &samsung_device_keypad);
  42. if (!npd->cfg_gpio)
  43. npd->cfg_gpio = samsung_keypad_cfg_gpio;
  44. }