blob: 062ce95b68b9ade80331f5b0cbb8b977e6ba79fa [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Andy Shevchenko4b45efe2015-07-27 18:04:03 +03002/*
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 Shevchenko4b45efe2015-07-27 18:04:03 +03009 */
10
11#ifndef __MFD_INTEL_LPSS_H
12#define __MFD_INTEL_LPSS_H
13
Andy Shevchenko16b7a092019-01-24 20:03:28 +020014#include <linux/pm.h>
15
Andy Shevchenko4b45efe2015-07-27 18:04:03 +030016struct device;
17struct resource;
Heikki Krogerus03152e32021-03-01 16:42:21 +020018struct software_node;
Andy Shevchenko4b45efe2015-07-27 18:04:03 +030019
20struct intel_lpss_platform_info {
21 struct resource *mem;
Hans de Goedee6b14202021-12-03 12:51:08 +010022 bool ignore_resource_conflicts;
Andy Shevchenko4b45efe2015-07-27 18:04:03 +030023 int irq;
24 unsigned long clk_rate;
25 const char *clk_con_id;
Heikki Krogerus03152e32021-03-01 16:42:21 +020026 const struct software_node *swnode;
Andy Shevchenko4b45efe2015-07-27 18:04:03 +030027};
28
29int intel_lpss_probe(struct device *dev,
30 const struct intel_lpss_platform_info *info);
31void intel_lpss_remove(struct device *dev);
32
33#ifdef CONFIG_PM
34int intel_lpss_prepare(struct device *dev);
35int intel_lpss_suspend(struct device *dev);
36int intel_lpss_resume(struct device *dev);
37
38#ifdef CONFIG_PM_SLEEP
39#define INTEL_LPSS_SLEEP_PM_OPS \
40 .prepare = intel_lpss_prepare, \
Rafael J. Wysockie00952c2017-09-25 01:20:35 +020041 SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_lpss_suspend, intel_lpss_resume)
Andy Shevchenko47b91922015-09-14 11:32:47 +030042#else
43#define INTEL_LPSS_SLEEP_PM_OPS
Andy Shevchenko4b45efe2015-07-27 18:04:03 +030044#endif
45
46#define INTEL_LPSS_RUNTIME_PM_OPS \
47 .runtime_suspend = intel_lpss_suspend, \
48 .runtime_resume = intel_lpss_resume,
49
50#else /* !CONFIG_PM */
51#define INTEL_LPSS_SLEEP_PM_OPS
52#define INTEL_LPSS_RUNTIME_PM_OPS
53#endif /* CONFIG_PM */
54
55#define INTEL_LPSS_PM_OPS(name) \
56const struct dev_pm_ops name = { \
57 INTEL_LPSS_SLEEP_PM_OPS \
58 INTEL_LPSS_RUNTIME_PM_OPS \
59}
60
61#endif /* __MFD_INTEL_LPSS_H */