This backports the patch below by simply ignoring support for it
for older kernels.
commit
da68c4eb258cd9f3f0b8aeb7e46b8118bb6358b6
Author: Nicolas Pitre <nico@fluxnic.net>
Date: Fri Mar 5 13:43:31 2010 -0800
sdio: introduce API for special power management features
This patch series provides the core changes needed to allow SDIO cards to
remain powered and active while the host system is suspended, and let them
wake up the host system when needed. This is used to implement
wake-on-lan with SDIO wireless cards at the moment. Patches to add that
support to the libertas driver will be posted separately.
This patch:
Some SDIO cards have the ability to keep on running autonomously when the
host system is suspended, and wake it up when needed. This however
requires that the host controller preserve power to the card, and
configure itself appropriately for wake-up.
There is however 4 layers of abstractions involved: the host controller
driver, the MMC core code, the SDIO card management code, and the actual
SDIO function driver. To make things simple and manageable, host drivers
must advertise their PM capabilities with a feature bitmask, then function
drivers can query and set those features from their suspend method. Then
each layer in the suspend call chain is expected to act upon those bits
accordingly.
[akpm@linux-foundation.org: fix typo in comment]
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mcgrof@tux ~/compat (git::master)$ ckmake
Trying kernel 3.4.0-030400rc1-generic [OK]
Trying kernel 3.3.0-030300rc2-generic [OK]
Trying kernel 3.2.2-030202-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.18-030018-generic [OK]
Trying kernel 2.6.39-
02063904-generic [OK]
Trying kernel 2.6.38-
02063808-generic [OK]
Trying kernel 2.6.37-
02063706-generic [OK]
Trying kernel 2.6.36-
02063604-generic [OK]
Trying kernel 2.6.35-
02063512-generic [OK]
Trying kernel 2.6.34-
02063410-generic [OK]
Trying kernel 2.6.33-
02063305-generic [OK]
Trying kernel 2.6.32-
02063255-generic [OK]
Trying kernel 2.6.31-
02063113-generic [OK]
Trying kernel 2.6.30-
02063010-generic [OK]
Trying kernel 2.6.29-
02062906-generic [OK]
Trying kernel 2.6.28-
02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat-$(CONFIG_COMPAT_KERNEL_2_6_29) += compat-2.6.29.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_32) += compat-2.6.32.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_33) += compat-2.6.33.o
+compat-$(CONFIG_COMPAT_KERNEL_2_6_34) += compat-2.6.34.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_35) += compat-2.6.35.o
compat-$(CONFIG_COMPAT_KERNEL_2_6_36) += compat-2.6.36.o
--- /dev/null
+#ifndef LINUX_26_34_COMPAT_PRIVATE_H
+#define LINUX_26_34_COMPAT_PRIVATE_H
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34))
+
+#include <linux/mmc/sdio_func.h>
+
+void init_compat_mmc_pm_flags(void);
+
+#else /* Kernels >= 2.6.34 */
+
+static inline void init_compat_mmc_pm_flags(void)
+{
+}
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)) */
+
+#endif /* LINUX_26_34_COMPAT_PRIVATE_H */
}
EXPORT_SYMBOL_GPL(compat_dependency_symbol);
+
static int __init compat_init(void)
{
/* pm-qos for kernels <= 2.6.24, this is a no-op on newer kernels */
compat_pm_qos_power_init();
compat_system_workqueue_create();
+ init_compat_mmc_pm_flags();
printk(KERN_INFO
COMPAT_PROJECT " backport release: "
#include <linux/netdevice.h>
#include <linux/usb.h>
+#include <linux/mmc/sdio_func.h>
+
+/*
+ * Backports da68c4eb25
+ * sdio: introduce API for special power management features
+ *
+ * We wimply carry around the data structures and flags, and
+ * make the host return no flags set by the driver.
+ */
+typedef unsigned int mmc_pm_flag_t;
+
+#define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */
+#define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */
+
+extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
+extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
+
+void init_compat_mmc_pm_flags(void);
#define netdev_mc_count(dev) ((dev)->mc_count)
#define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0)
static inline int usb_disable_autosuspend(struct usb_device *udev)
{ return 0; }
-#define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */
-#define sdio_set_host_pm_flags(a, b) 0
-
#define rcu_dereference_protected(p, c) (p)
#define rcu_access_pointer(p) ACCESS_ONCE(p)
}
#endif /* #ifdef CONFIG_PROVE_LOCKING */
+#else /* Kernels >= 2.6.34 */
+
+static inline void init_compat_mmc_pm_flags(void)
+{
+}
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)) */
+
#endif /* LINUX_26_34_COMPAT_H */