aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/pci-atom_soc.c
blob: 0e6747cae9b0a148f80329eb4fe627c1e487c590 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 * pci-atom_soc.c - register Intel MID PCI plaform ops
 *
 * Copyright (c) 2013, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 */

#include <linux/init.h>
#include <linux/intel_mid_pm.h>
#include <linux/kernel.h>

#include "pci.h"

static pci_power_t mid_pci_choose_state(struct pci_dev *pdev)
{
	return PCI_D3hot;
}

static int mid_pci_sleep_wake(struct pci_dev *dev, bool enable)
{
	return 0;
}

static int mid_pci_run_wake(struct pci_dev *dev, bool enable)
{
	return 0;
}

static struct pci_platform_pm_ops mid_pci_platform_pm = {
	.is_manageable = pmu_pci_power_manageable,
	.choose_state = mid_pci_choose_state,
	.sleep_wake = mid_pci_sleep_wake,
	.run_wake = mid_pci_run_wake,
	.set_state = pmu_pci_set_power_state,
	.choose_state = pmu_pci_choose_state,
};

/**
 * mid_pci_init - It registers callback function for all the PCI devices
 * for platform specific device power on/shutdown acticities.
 */
static int __init mid_pci_init(void)
{
	if (boot_cpu_data.x86 != 6)
		return 0;

	/*
	 * n.b. this model check does not uniquely identify the platform,
	 * and additional checks are necessary inside the pmu driver
	 */
	switch (boot_cpu_data.x86_model) {
	case INTEL_ATOM_MFLD:
	case INTEL_ATOM_CLV:
	case INTEL_ATOM_MRFLD:
	case INTEL_ATOM_MOORFLD:
		pci_set_platform_pm(&mid_pci_platform_pm);
		break;
	}

	return 0;
}
arch_initcall(mid_pci_init);