dev-ehci.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (C) 2011 Samsung Electronics Co.Ltd
  3. * Author: Joonyoung Shim <jy0922.shim@samsung.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version.
  9. *
  10. */
  11. #include <linux/platform_device.h>
  12. #include <mach/irqs.h>
  13. #include <mach/map.h>
  14. #include <plat/devs.h>
  15. #include <plat/ehci.h>
  16. #include <plat/usb-phy.h>
  17. /* USB EHCI Host Controller registration */
  18. static struct resource s5p_ehci_resource[] = {
  19. [0] = {
  20. .start = S5P_PA_EHCI,
  21. .end = S5P_PA_EHCI + SZ_256 - 1,
  22. .flags = IORESOURCE_MEM,
  23. },
  24. [1] = {
  25. .start = IRQ_USB_HOST,
  26. .end = IRQ_USB_HOST,
  27. .flags = IORESOURCE_IRQ,
  28. }
  29. };
  30. static u64 s5p_device_ehci_dmamask = 0xffffffffUL;
  31. struct platform_device s5p_device_ehci = {
  32. .name = "s5p-ehci",
  33. .id = -1,
  34. .num_resources = ARRAY_SIZE(s5p_ehci_resource),
  35. .resource = s5p_ehci_resource,
  36. .dev = {
  37. .dma_mask = &s5p_device_ehci_dmamask,
  38. .coherent_dma_mask = 0xffffffffUL
  39. }
  40. };
  41. void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd)
  42. {
  43. struct s5p_ehci_platdata *npd;
  44. npd = s3c_set_platdata(pd, sizeof(struct s5p_ehci_platdata),
  45. &s5p_device_ehci);
  46. if (!npd->phy_init)
  47. npd->phy_init = s5p_usb_phy_init;
  48. if (!npd->phy_exit)
  49. npd->phy_exit = s5p_usb_phy_exit;
  50. }