Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Intel LPSS core support.
0004  *
0005  * Copyright (C) 2015, Intel Corporation
0006  *
0007  * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
0008  *          Mika Westerberg <mika.westerberg@linux.intel.com>
0009  */
0010 
0011 #ifndef __MFD_INTEL_LPSS_H
0012 #define __MFD_INTEL_LPSS_H
0013 
0014 #include <linux/pm.h>
0015 
0016 struct device;
0017 struct resource;
0018 struct software_node;
0019 
0020 struct intel_lpss_platform_info {
0021     struct resource *mem;
0022     bool ignore_resource_conflicts;
0023     int irq;
0024     unsigned long clk_rate;
0025     const char *clk_con_id;
0026     const struct software_node *swnode;
0027 };
0028 
0029 int intel_lpss_probe(struct device *dev,
0030              const struct intel_lpss_platform_info *info);
0031 void intel_lpss_remove(struct device *dev);
0032 
0033 #ifdef CONFIG_PM
0034 int intel_lpss_prepare(struct device *dev);
0035 int intel_lpss_suspend(struct device *dev);
0036 int intel_lpss_resume(struct device *dev);
0037 
0038 #ifdef CONFIG_PM_SLEEP
0039 #define INTEL_LPSS_SLEEP_PM_OPS         \
0040     .prepare = intel_lpss_prepare,      \
0041     SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_lpss_suspend, intel_lpss_resume)
0042 #else
0043 #define INTEL_LPSS_SLEEP_PM_OPS
0044 #endif
0045 
0046 #define INTEL_LPSS_RUNTIME_PM_OPS       \
0047     .runtime_suspend = intel_lpss_suspend,  \
0048     .runtime_resume = intel_lpss_resume,
0049 
0050 #else /* !CONFIG_PM */
0051 #define INTEL_LPSS_SLEEP_PM_OPS
0052 #define INTEL_LPSS_RUNTIME_PM_OPS
0053 #endif /* CONFIG_PM */
0054 
0055 #define INTEL_LPSS_PM_OPS(name)         \
0056 const struct dev_pm_ops name = {        \
0057     INTEL_LPSS_SLEEP_PM_OPS         \
0058     INTEL_LPSS_RUNTIME_PM_OPS       \
0059 }
0060 
0061 #endif /* __MFD_INTEL_LPSS_H */