intel-lpss.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Intel LPSS core support.
  4. *
  5. * Copyright (C) 2015, Intel Corporation
  6. *
  7. * Authors: Andy Shevchenko <[email protected]>
  8. * Mika Westerberg <[email protected]>
  9. */
  10. #ifndef __MFD_INTEL_LPSS_H
  11. #define __MFD_INTEL_LPSS_H
  12. #include <linux/pm.h>
  13. struct device;
  14. struct resource;
  15. struct software_node;
  16. struct intel_lpss_platform_info {
  17. struct resource *mem;
  18. bool ignore_resource_conflicts;
  19. int irq;
  20. unsigned long clk_rate;
  21. const char *clk_con_id;
  22. const struct software_node *swnode;
  23. };
  24. int intel_lpss_probe(struct device *dev,
  25. const struct intel_lpss_platform_info *info);
  26. void intel_lpss_remove(struct device *dev);
  27. #ifdef CONFIG_PM
  28. int intel_lpss_prepare(struct device *dev);
  29. int intel_lpss_suspend(struct device *dev);
  30. int intel_lpss_resume(struct device *dev);
  31. #ifdef CONFIG_PM_SLEEP
  32. #define INTEL_LPSS_SLEEP_PM_OPS \
  33. .prepare = intel_lpss_prepare, \
  34. SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_lpss_suspend, intel_lpss_resume)
  35. #else
  36. #define INTEL_LPSS_SLEEP_PM_OPS
  37. #endif
  38. #define INTEL_LPSS_RUNTIME_PM_OPS \
  39. .runtime_suspend = intel_lpss_suspend, \
  40. .runtime_resume = intel_lpss_resume,
  41. #else /* !CONFIG_PM */
  42. #define INTEL_LPSS_SLEEP_PM_OPS
  43. #define INTEL_LPSS_RUNTIME_PM_OPS
  44. #endif /* CONFIG_PM */
  45. #define INTEL_LPSS_PM_OPS(name) \
  46. const struct dev_pm_ops name = { \
  47. INTEL_LPSS_SLEEP_PM_OPS \
  48. INTEL_LPSS_RUNTIME_PM_OPS \
  49. }
  50. #endif /* __MFD_INTEL_LPSS_H */