dev-ts.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* linux/arch/arm/mach-s3c64xx/dev-ts.c
  2. *
  3. * Copyright (c) 2008 Simtec Electronics
  4. * http://armlinux.simtec.co.uk/
  5. * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
  6. *
  7. * Adapted by Maurus Cuelenaere for s3c64xx
  8. *
  9. * S3C64XX series device definition for touchscreen device
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/string.h>
  17. #include <linux/platform_device.h>
  18. #include <mach/irqs.h>
  19. #include <mach/map.h>
  20. #include <plat/devs.h>
  21. #include <plat/ts.h>
  22. static struct resource s3c_ts_resource[] = {
  23. [0] = {
  24. .start = SAMSUNG_PA_ADC,
  25. .end = SAMSUNG_PA_ADC + SZ_256 - 1,
  26. .flags = IORESOURCE_MEM,
  27. },
  28. [1] = {
  29. .start = IRQ_TC,
  30. .end = IRQ_TC,
  31. .flags = IORESOURCE_IRQ,
  32. },
  33. };
  34. struct platform_device s3c_device_ts = {
  35. .name = "s3c64xx-ts",
  36. .id = -1,
  37. .num_resources = ARRAY_SIZE(s3c_ts_resource),
  38. .resource = s3c_ts_resource,
  39. };
  40. void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
  41. {
  42. struct s3c2410_ts_mach_info *npd;
  43. if (!pd) {
  44. printk(KERN_ERR "%s: no platform data\n", __func__);
  45. return;
  46. }
  47. npd = kmemdup(pd, sizeof(struct s3c2410_ts_mach_info), GFP_KERNEL);
  48. if (!npd)
  49. printk(KERN_ERR "%s: no memory for platform data\n", __func__);
  50. s3c_device_ts.dev.platform_data = npd;
  51. }