intel-lpss.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Intel LPSS core support.
  3. *
  4. * Copyright (C) 2015, Intel Corporation
  5. *
  6. * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  7. * Mika Westerberg <mika.westerberg@linux.intel.com>
  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. #ifndef __MFD_INTEL_LPSS_H
  14. #define __MFD_INTEL_LPSS_H
  15. struct device;
  16. struct resource;
  17. struct intel_lpss_platform_info {
  18. struct resource *mem;
  19. int irq;
  20. unsigned long clk_rate;
  21. const char *clk_con_id;
  22. };
  23. int intel_lpss_probe(struct device *dev,
  24. const struct intel_lpss_platform_info *info);
  25. void intel_lpss_remove(struct device *dev);
  26. #ifdef CONFIG_PM
  27. int intel_lpss_prepare(struct device *dev);
  28. int intel_lpss_suspend(struct device *dev);
  29. int intel_lpss_resume(struct device *dev);
  30. #ifdef CONFIG_PM_SLEEP
  31. #define INTEL_LPSS_SLEEP_PM_OPS \
  32. .prepare = intel_lpss_prepare, \
  33. .suspend = intel_lpss_suspend, \
  34. .resume = intel_lpss_resume, \
  35. .freeze = intel_lpss_suspend, \
  36. .thaw = intel_lpss_resume, \
  37. .poweroff = intel_lpss_suspend, \
  38. .restore = intel_lpss_resume,
  39. #else
  40. #define INTEL_LPSS_SLEEP_PM_OPS
  41. #endif
  42. #define INTEL_LPSS_RUNTIME_PM_OPS \
  43. .runtime_suspend = intel_lpss_suspend, \
  44. .runtime_resume = intel_lpss_resume,
  45. #else /* !CONFIG_PM */
  46. #define INTEL_LPSS_SLEEP_PM_OPS
  47. #define INTEL_LPSS_RUNTIME_PM_OPS
  48. #endif /* CONFIG_PM */
  49. #define INTEL_LPSS_PM_OPS(name) \
  50. const struct dev_pm_ops name = { \
  51. INTEL_LPSS_SLEEP_PM_OPS \
  52. INTEL_LPSS_RUNTIME_PM_OPS \
  53. }
  54. #endif /* __MFD_INTEL_LPSS_H */