dev-usb.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* linux/arch/arm/plat-s3c/dev-usb.c
  2. *
  3. * Copyright 2008 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. * http://armlinux.simtec.co.uk/
  6. *
  7. * S3C series device definition for USB host
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <linux/gfp.h>
  14. #include <linux/kernel.h>
  15. #include <linux/string.h>
  16. #include <linux/platform_device.h>
  17. #include <mach/irqs.h>
  18. #include <mach/map.h>
  19. #include <plat/devs.h>
  20. #include <plat/usb-control.h>
  21. static struct resource s3c_usb_resource[] = {
  22. [0] = {
  23. .start = S3C_PA_USBHOST,
  24. .end = S3C_PA_USBHOST + 0x100 - 1,
  25. .flags = IORESOURCE_MEM,
  26. },
  27. [1] = {
  28. .start = IRQ_USBH,
  29. .end = IRQ_USBH,
  30. .flags = IORESOURCE_IRQ,
  31. }
  32. };
  33. static u64 s3c_device_usb_dmamask = 0xffffffffUL;
  34. struct platform_device s3c_device_ohci = {
  35. .name = "s3c2410-ohci",
  36. .id = -1,
  37. .num_resources = ARRAY_SIZE(s3c_usb_resource),
  38. .resource = s3c_usb_resource,
  39. .dev = {
  40. .dma_mask = &s3c_device_usb_dmamask,
  41. .coherent_dma_mask = 0xffffffffUL
  42. }
  43. };
  44. EXPORT_SYMBOL(s3c_device_ohci);
  45. /**
  46. * s3c_ohci_set_platdata - initialise OHCI device platform data
  47. * @info: The platform data.
  48. *
  49. * This call copies the @info passed in and sets the device .platform_data
  50. * field to that copy. The @info is copied so that the original can be marked
  51. * __initdata.
  52. */
  53. void __init s3c_ohci_set_platdata(struct s3c2410_hcd_info *info)
  54. {
  55. struct s3c2410_hcd_info *npd;
  56. npd = kmemdup(info, sizeof(struct s3c2410_hcd_info), GFP_KERNEL);
  57. if (!npd)
  58. printk(KERN_ERR "%s: no memory for platform data\n", __func__);
  59. s3c_device_ohci.dev.platform_data = npd;
  60. }