Andy Shevchenko | 4b45efe | 2015-07-27 18:04:03 +0300 | [diff] [blame] | 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 | |
| 14 | #ifndef __MFD_INTEL_LPSS_H |
| 15 | #define __MFD_INTEL_LPSS_H |
| 16 | |
Andy Shevchenko | 16b7a09 | 2019-01-24 20:03:28 +0200 | [diff] [blame^] | 17 | #include <linux/pm.h> |
| 18 | |
Andy Shevchenko | 4b45efe | 2015-07-27 18:04:03 +0300 | [diff] [blame] | 19 | struct device; |
| 20 | struct resource; |
Heikki Krogerus | f4d0526 | 2016-03-29 14:52:23 +0300 | [diff] [blame] | 21 | struct property_entry; |
Andy Shevchenko | 4b45efe | 2015-07-27 18:04:03 +0300 | [diff] [blame] | 22 | |
| 23 | struct intel_lpss_platform_info { |
| 24 | struct resource *mem; |
| 25 | int irq; |
| 26 | unsigned long clk_rate; |
| 27 | const char *clk_con_id; |
Heikki Krogerus | f4d0526 | 2016-03-29 14:52:23 +0300 | [diff] [blame] | 28 | struct property_entry *properties; |
Andy Shevchenko | 4b45efe | 2015-07-27 18:04:03 +0300 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | int intel_lpss_probe(struct device *dev, |
| 32 | const struct intel_lpss_platform_info *info); |
| 33 | void intel_lpss_remove(struct device *dev); |
| 34 | |
| 35 | #ifdef CONFIG_PM |
| 36 | int intel_lpss_prepare(struct device *dev); |
| 37 | int intel_lpss_suspend(struct device *dev); |
| 38 | int intel_lpss_resume(struct device *dev); |
| 39 | |
| 40 | #ifdef CONFIG_PM_SLEEP |
| 41 | #define INTEL_LPSS_SLEEP_PM_OPS \ |
| 42 | .prepare = intel_lpss_prepare, \ |
Rafael J. Wysocki | e00952c | 2017-09-25 01:20:35 +0200 | [diff] [blame] | 43 | SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_lpss_suspend, intel_lpss_resume) |
Andy Shevchenko | 47b9192 | 2015-09-14 11:32:47 +0300 | [diff] [blame] | 44 | #else |
| 45 | #define INTEL_LPSS_SLEEP_PM_OPS |
Andy Shevchenko | 4b45efe | 2015-07-27 18:04:03 +0300 | [diff] [blame] | 46 | #endif |
| 47 | |
| 48 | #define INTEL_LPSS_RUNTIME_PM_OPS \ |
| 49 | .runtime_suspend = intel_lpss_suspend, \ |
| 50 | .runtime_resume = intel_lpss_resume, |
| 51 | |
| 52 | #else /* !CONFIG_PM */ |
| 53 | #define INTEL_LPSS_SLEEP_PM_OPS |
| 54 | #define INTEL_LPSS_RUNTIME_PM_OPS |
| 55 | #endif /* CONFIG_PM */ |
| 56 | |
| 57 | #define INTEL_LPSS_PM_OPS(name) \ |
| 58 | const struct dev_pm_ops name = { \ |
| 59 | INTEL_LPSS_SLEEP_PM_OPS \ |
| 60 | INTEL_LPSS_RUNTIME_PM_OPS \ |
| 61 | } |
| 62 | |
| 63 | #endif /* __MFD_INTEL_LPSS_H */ |