ci_hdrc_zevio.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2013 Daniel Tang <tangrs@tangrs.id.au>
  4. *
  5. * Based off drivers/usb/chipidea/ci_hdrc_msm.c
  6. */
  7. #include <linux/module.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/usb/gadget.h>
  10. #include <linux/usb/chipidea.h>
  11. #include "ci.h"
  12. static struct ci_hdrc_platform_data ci_hdrc_zevio_platdata = {
  13. .name = "ci_hdrc_zevio",
  14. .flags = CI_HDRC_REGS_SHARED | CI_HDRC_FORCE_FULLSPEED,
  15. .capoffset = DEF_CAPOFFSET,
  16. };
  17. static int ci_hdrc_zevio_probe(struct platform_device *pdev)
  18. {
  19. struct platform_device *ci_pdev;
  20. dev_dbg(&pdev->dev, "ci_hdrc_zevio_probe\n");
  21. ci_pdev = ci_hdrc_add_device(&pdev->dev,
  22. pdev->resource, pdev->num_resources,
  23. &ci_hdrc_zevio_platdata);
  24. if (IS_ERR(ci_pdev)) {
  25. dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n");
  26. return PTR_ERR(ci_pdev);
  27. }
  28. platform_set_drvdata(pdev, ci_pdev);
  29. return 0;
  30. }
  31. static int ci_hdrc_zevio_remove(struct platform_device *pdev)
  32. {
  33. struct platform_device *ci_pdev = platform_get_drvdata(pdev);
  34. ci_hdrc_remove_device(ci_pdev);
  35. return 0;
  36. }
  37. static const struct of_device_id ci_hdrc_zevio_dt_ids[] = {
  38. { .compatible = "lsi,zevio-usb", },
  39. { /* sentinel */ }
  40. };
  41. static struct platform_driver ci_hdrc_zevio_driver = {
  42. .probe = ci_hdrc_zevio_probe,
  43. .remove = ci_hdrc_zevio_remove,
  44. .driver = {
  45. .name = "zevio_usb",
  46. .of_match_table = ci_hdrc_zevio_dt_ids,
  47. },
  48. };
  49. MODULE_DEVICE_TABLE(of, ci_hdrc_zevio_dt_ids);
  50. module_platform_driver(ci_hdrc_zevio_driver);
  51. MODULE_LICENSE("GPL v2");