Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Intel MID platform PM support
0004  *
0005  * Copyright (C) 2016, Intel Corporation
0006  *
0007  * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
0008  */
0009 
0010 #include <linux/init.h>
0011 #include <linux/pci.h>
0012 
0013 #include <asm/cpu_device_id.h>
0014 #include <asm/intel-family.h>
0015 #include <asm/intel-mid.h>
0016 
0017 #include "pci.h"
0018 
0019 static bool pci_mid_pm_enabled __read_mostly;
0020 
0021 bool pci_use_mid_pm(void)
0022 {
0023     return pci_mid_pm_enabled;
0024 }
0025 
0026 int mid_pci_set_power_state(struct pci_dev *pdev, pci_power_t state)
0027 {
0028     return intel_mid_pci_set_power_state(pdev, state);
0029 }
0030 
0031 pci_power_t mid_pci_get_power_state(struct pci_dev *pdev)
0032 {
0033     return intel_mid_pci_get_power_state(pdev);
0034 }
0035 
0036 /*
0037  * This table should be in sync with the one in
0038  * arch/x86/platform/intel-mid/pwr.c.
0039  */
0040 static const struct x86_cpu_id lpss_cpu_ids[] = {
0041     X86_MATCH_INTEL_FAM6_MODEL(ATOM_SALTWELL_MID, NULL),
0042     X86_MATCH_INTEL_FAM6_MODEL(ATOM_SILVERMONT_MID, NULL),
0043     {}
0044 };
0045 
0046 static int __init mid_pci_init(void)
0047 {
0048     const struct x86_cpu_id *id;
0049 
0050     id = x86_match_cpu(lpss_cpu_ids);
0051     if (id)
0052         pci_mid_pm_enabled = true;
0053 
0054     return 0;
0055 }
0056 arch_initcall(mid_pci_init);