summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0008-bcma-support-for-suspend-and-resume.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2012-02-10 15:32:32 +0100
committerDenys Dmytriyenko <denys@ti.com>2012-02-27 09:04:13 -0500
commitc4eefd753012467261cf221babd2e8639b81d3ca (patch)
tree0f6e09a6b51f410455330f046a8e03787d5a126e /recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0008-bcma-support-for-suspend-and-resume.patch
parent14f31c3c5a19dde049355ced3edd121c31842460 (diff)
downloadmeta-ti-c4eefd753012467261cf221babd2e8639b81d3ca.tar.gz
linux-ti33x-psp 3.2: update to 3.2.5
Runtime tested on a beaglebone A3 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0008-bcma-support-for-suspend-and-resume.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0008-bcma-support-for-suspend-and-resume.patch120
1 files changed, 120 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0008-bcma-support-for-suspend-and-resume.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0008-bcma-support-for-suspend-and-resume.patch
new file mode 100644
index 00000000..fa518499
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0008-bcma-support-for-suspend-and-resume.patch
@@ -0,0 +1,120 @@
1From 84c0b10f18c54e0f669f9ac81872db6aff1e59b4 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3Date: Fri, 9 Dec 2011 22:16:07 +0100
4Subject: [PATCH 08/49] bcma: support for suspend and resume
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9commit 775ab52142b02237a54184238e922251c59a2b5c upstream.
10
11bcma used to lock up machine without enabling PCI or initializing CC.
12
13Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
14Signed-off-by: John W. Linville <linville@tuxdriver.com>
15Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16---
17 drivers/bcma/bcma_private.h | 3 +++
18 drivers/bcma/host_pci.c | 37 +++++++++++++++++++++++++++++++++++++
19 drivers/bcma/main.c | 16 ++++++++++++++++
20 3 files changed, 56 insertions(+), 0 deletions(-)
21
22diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
23index 30a3085..fda56bd 100644
24--- a/drivers/bcma/bcma_private.h
25+++ b/drivers/bcma/bcma_private.h
26@@ -18,6 +18,9 @@ void bcma_bus_unregister(struct bcma_bus *bus);
27 int __init bcma_bus_early_register(struct bcma_bus *bus,
28 struct bcma_device *core_cc,
29 struct bcma_device *core_mips);
30+#ifdef CONFIG_PM
31+int bcma_bus_resume(struct bcma_bus *bus);
32+#endif
33
34 /* scan.c */
35 int bcma_bus_scan(struct bcma_bus *bus);
36diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
37index 1b51d8b..990f5a8 100644
38--- a/drivers/bcma/host_pci.c
39+++ b/drivers/bcma/host_pci.c
40@@ -224,6 +224,41 @@ static void bcma_host_pci_remove(struct pci_dev *dev)
41 pci_set_drvdata(dev, NULL);
42 }
43
44+#ifdef CONFIG_PM
45+static int bcma_host_pci_suspend(struct pci_dev *dev, pm_message_t state)
46+{
47+ /* Host specific */
48+ pci_save_state(dev);
49+ pci_disable_device(dev);
50+ pci_set_power_state(dev, pci_choose_state(dev, state));
51+
52+ return 0;
53+}
54+
55+static int bcma_host_pci_resume(struct pci_dev *dev)
56+{
57+ struct bcma_bus *bus = pci_get_drvdata(dev);
58+ int err;
59+
60+ /* Host specific */
61+ pci_set_power_state(dev, 0);
62+ err = pci_enable_device(dev);
63+ if (err)
64+ return err;
65+ pci_restore_state(dev);
66+
67+ /* Bus specific */
68+ err = bcma_bus_resume(bus);
69+ if (err)
70+ return err;
71+
72+ return 0;
73+}
74+#else /* CONFIG_PM */
75+# define bcma_host_pci_suspend NULL
76+# define bcma_host_pci_resume NULL
77+#endif /* CONFIG_PM */
78+
79 static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
80 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },
81 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) },
82@@ -239,6 +274,8 @@ static struct pci_driver bcma_pci_bridge_driver = {
83 .id_table = bcma_pci_bridge_tbl,
84 .probe = bcma_host_pci_probe,
85 .remove = bcma_host_pci_remove,
86+ .suspend = bcma_host_pci_suspend,
87+ .resume = bcma_host_pci_resume,
88 };
89
90 int __init bcma_host_pci_init(void)
91diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
92index 70c84b9..10f92b3 100644
93--- a/drivers/bcma/main.c
94+++ b/drivers/bcma/main.c
95@@ -240,6 +240,22 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
96 return 0;
97 }
98
99+#ifdef CONFIG_PM
100+int bcma_bus_resume(struct bcma_bus *bus)
101+{
102+ struct bcma_device *core;
103+
104+ /* Init CC core */
105+ core = bcma_find_core(bus, BCMA_CORE_CHIPCOMMON);
106+ if (core) {
107+ bus->drv_cc.setup_done = false;
108+ bcma_core_chipcommon_init(&bus->drv_cc);
109+ }
110+
111+ return 0;
112+}
113+#endif
114+
115 int __bcma_driver_register(struct bcma_driver *drv, struct module *owner)
116 {
117 drv->drv.name = drv->name;
118--
1191.7.7.4
120