2019-06-04 16:11:33 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2015-07-27 23:04:03 +08:00
|
|
|
/*
|
|
|
|
* Intel LPSS core support.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015, Intel Corporation
|
|
|
|
*
|
|
|
|
* Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
|
|
|
* Mika Westerberg <mika.westerberg@linux.intel.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MFD_INTEL_LPSS_H
|
|
|
|
#define __MFD_INTEL_LPSS_H
|
|
|
|
|
2019-01-25 02:03:28 +08:00
|
|
|
#include <linux/pm.h>
|
|
|
|
|
2015-07-27 23:04:03 +08:00
|
|
|
struct device;
|
|
|
|
struct resource;
|
2016-03-29 19:52:23 +08:00
|
|
|
struct property_entry;
|
2015-07-27 23:04:03 +08:00
|
|
|
|
|
|
|
struct intel_lpss_platform_info {
|
|
|
|
struct resource *mem;
|
|
|
|
int irq;
|
|
|
|
unsigned long clk_rate;
|
|
|
|
const char *clk_con_id;
|
2016-03-29 19:52:23 +08:00
|
|
|
struct property_entry *properties;
|
2015-07-27 23:04:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
int intel_lpss_probe(struct device *dev,
|
|
|
|
const struct intel_lpss_platform_info *info);
|
|
|
|
void intel_lpss_remove(struct device *dev);
|
|
|
|
|
|
|
|
#ifdef CONFIG_PM
|
|
|
|
int intel_lpss_prepare(struct device *dev);
|
|
|
|
int intel_lpss_suspend(struct device *dev);
|
|
|
|
int intel_lpss_resume(struct device *dev);
|
|
|
|
|
|
|
|
#ifdef CONFIG_PM_SLEEP
|
|
|
|
#define INTEL_LPSS_SLEEP_PM_OPS \
|
|
|
|
.prepare = intel_lpss_prepare, \
|
2017-09-25 07:20:35 +08:00
|
|
|
SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_lpss_suspend, intel_lpss_resume)
|
2015-09-14 16:32:47 +08:00
|
|
|
#else
|
|
|
|
#define INTEL_LPSS_SLEEP_PM_OPS
|
2015-07-27 23:04:03 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define INTEL_LPSS_RUNTIME_PM_OPS \
|
|
|
|
.runtime_suspend = intel_lpss_suspend, \
|
|
|
|
.runtime_resume = intel_lpss_resume,
|
|
|
|
|
|
|
|
#else /* !CONFIG_PM */
|
|
|
|
#define INTEL_LPSS_SLEEP_PM_OPS
|
|
|
|
#define INTEL_LPSS_RUNTIME_PM_OPS
|
|
|
|
#endif /* CONFIG_PM */
|
|
|
|
|
|
|
|
#define INTEL_LPSS_PM_OPS(name) \
|
|
|
|
const struct dev_pm_ops name = { \
|
|
|
|
INTEL_LPSS_SLEEP_PM_OPS \
|
|
|
|
INTEL_LPSS_RUNTIME_PM_OPS \
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __MFD_INTEL_LPSS_H */
|