pci-mid.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Intel MID platform PM support
  4. *
  5. * Copyright (C) 2016, Intel Corporation
  6. *
  7. * Author: Andy Shevchenko <[email protected]>
  8. */
  9. #include <linux/init.h>
  10. #include <linux/pci.h>
  11. #include <asm/cpu_device_id.h>
  12. #include <asm/intel-family.h>
  13. #include <asm/intel-mid.h>
  14. #include "pci.h"
  15. static bool pci_mid_pm_enabled __read_mostly;
  16. bool pci_use_mid_pm(void)
  17. {
  18. return pci_mid_pm_enabled;
  19. }
  20. int mid_pci_set_power_state(struct pci_dev *pdev, pci_power_t state)
  21. {
  22. return intel_mid_pci_set_power_state(pdev, state);
  23. }
  24. pci_power_t mid_pci_get_power_state(struct pci_dev *pdev)
  25. {
  26. return intel_mid_pci_get_power_state(pdev);
  27. }
  28. /*
  29. * This table should be in sync with the one in
  30. * arch/x86/platform/intel-mid/pwr.c.
  31. */
  32. static const struct x86_cpu_id lpss_cpu_ids[] = {
  33. X86_MATCH_INTEL_FAM6_MODEL(ATOM_SALTWELL_MID, NULL),
  34. X86_MATCH_INTEL_FAM6_MODEL(ATOM_SILVERMONT_MID, NULL),
  35. {}
  36. };
  37. static int __init mid_pci_init(void)
  38. {
  39. const struct x86_cpu_id *id;
  40. id = x86_match_cpu(lpss_cpu_ids);
  41. if (id)
  42. pci_mid_pm_enabled = true;
  43. return 0;
  44. }
  45. arch_initcall(mid_pci_init);