--- ../alsa-kernel/soc/soc-core.c	2009-12-18 14:00:11.000000000 +0100
+++ soc-core.c	2009-12-18 14:08:12.000000000 +0100
@@ -1,3 +1,8 @@
+#include "adriver.h"
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27)
+/* HACK HACK - debugfs_remove_recursive() isn't defined */
+#undef CONFIG_DEBUG_FS
+#endif
 /*
  * soc-core.c  --  ALSA SoC Audio Layer
  *
@@ -1236,21 +1241,43 @@
 	return 0;
 }
 
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 30)
 static const struct dev_pm_ops soc_pm_ops = {
 	.suspend = soc_suspend,
 	.resume = soc_resume,
 	.poweroff = soc_poweroff,
 };
+#else
+#ifdef CONFIG_PM
+static int soc_old_suspend(struct platform_device *pdev, pm_message_t state)
+{
+	return soc_suspend(&pdev->dev);
+}
+static int soc_old_resume(struct platform_device *pdev)
+{
+	return soc_resume(&pdev->dev);
+}
+#else
+#define soc_old_suspend		NULL
+#define soc_old_resume		NULL
+#endif
+#endif /* < 2.6.30 */
 
 /* ASoC platform driver */
 static struct platform_driver soc_driver = {
 	.driver		= {
 		.name		= "soc-audio",
 		.owner		= THIS_MODULE,
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 30)
 		.pm		= &soc_pm_ops,
+#endif
 	},
 	.probe		= soc_probe,
 	.remove		= soc_remove,
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 30)
+	.suspend = soc_old_suspend,
+	.resume = soc_old_resume,
+#endif
 };
 
 /* create a new pcm */
