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