Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andy Shevchenko | 4b45efe | 2015-07-27 18:04:03 +0300 | [diff] [blame] | 2 | /* |
| 3 | * Intel LPSS core support. |
| 4 | * |
| 5 | * Copyright (C) 2015, Intel Corporation |
| 6 | * |
| 7 | * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
| 8 | * Mika Westerberg <mika.westerberg@linux.intel.com> |
Andy Shevchenko | 4b45efe | 2015-07-27 18:04:03 +0300 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef __MFD_INTEL_LPSS_H |
| 12 | #define __MFD_INTEL_LPSS_H |
| 13 | |
Andy Shevchenko | 16b7a09 | 2019-01-24 20:03:28 +0200 | [diff] [blame] | 14 | #include <linux/pm.h> |
| 15 | |
Andy Shevchenko | 4b45efe | 2015-07-27 18:04:03 +0300 | [diff] [blame] | 16 | struct device; |
| 17 | struct resource; |
Heikki Krogerus | f4d0526 | 2016-03-29 14:52:23 +0300 | [diff] [blame] | 18 | struct property_entry; |
Andy Shevchenko | 4b45efe | 2015-07-27 18:04:03 +0300 | [diff] [blame] | 19 | |
| 20 | struct intel_lpss_platform_info { |
| 21 | struct resource *mem; |
| 22 | int irq; |
| 23 | unsigned long clk_rate; |
| 24 | const char *clk_con_id; |
Heikki Krogerus | f4d0526 | 2016-03-29 14:52:23 +0300 | [diff] [blame] | 25 | struct property_entry *properties; |
Andy Shevchenko | 4b45efe | 2015-07-27 18:04:03 +0300 | [diff] [blame] | 26 | }; |
| 27 | |
| 28 | int intel_lpss_probe(struct device *dev, |
| 29 | const struct intel_lpss_platform_info *info); |
| 30 | void intel_lpss_remove(struct device *dev); |
| 31 | |
| 32 | #ifdef CONFIG_PM |
| 33 | int intel_lpss_prepare(struct device *dev); |
| 34 | int intel_lpss_suspend(struct device *dev); |
| 35 | int intel_lpss_resume(struct device *dev); |
| 36 | |
| 37 | #ifdef CONFIG_PM_SLEEP |
| 38 | #define INTEL_LPSS_SLEEP_PM_OPS \ |
| 39 | .prepare = intel_lpss_prepare, \ |
Rafael J. Wysocki | e00952c | 2017-09-25 01:20:35 +0200 | [diff] [blame] | 40 | SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_lpss_suspend, intel_lpss_resume) |
Andy Shevchenko | 47b9192 | 2015-09-14 11:32:47 +0300 | [diff] [blame] | 41 | #else |
| 42 | #define INTEL_LPSS_SLEEP_PM_OPS |
Andy Shevchenko | 4b45efe | 2015-07-27 18:04:03 +0300 | [diff] [blame] | 43 | #endif |
| 44 | |
| 45 | #define INTEL_LPSS_RUNTIME_PM_OPS \ |
| 46 | .runtime_suspend = intel_lpss_suspend, \ |
| 47 | .runtime_resume = intel_lpss_resume, |
| 48 | |
| 49 | #else /* !CONFIG_PM */ |
| 50 | #define INTEL_LPSS_SLEEP_PM_OPS |
| 51 | #define INTEL_LPSS_RUNTIME_PM_OPS |
| 52 | #endif /* CONFIG_PM */ |
| 53 | |
| 54 | #define INTEL_LPSS_PM_OPS(name) \ |
| 55 | const struct dev_pm_ops name = { \ |
| 56 | INTEL_LPSS_SLEEP_PM_OPS \ |
| 57 | INTEL_LPSS_RUNTIME_PM_OPS \ |
| 58 | } |
| 59 | |
| 60 | #endif /* __MFD_INTEL_LPSS_H */ |