Index: soundwire-1.2.2/hda/hdac_component.c
===================================================================
--- soundwire-1.2.2.orig/hda/hdac_component.c
+++ soundwire-1.2.2/hda/hdac_component.c
@@ -5,6 +5,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/component.h>
+#include <linux/version.h>
 #include <dkms/sound/core.h>
 #include <dkms/sound/hdaudio.h>
 #include <dkms/sound/hda_component.h>
@@ -81,20 +82,38 @@ void snd_hdac_display_power(struct hdac_
 
 	if (bus->display_power_status) {
 		if (!bus->display_power_active) {
-
-			if (acomp->ops->get_power)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
+			unsigned long cookie = -1;
+#endif
+			if (acomp->ops->get_power) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
+				cookie = acomp->ops->get_power(acomp->dev);
+#else
 				acomp->ops->get_power(acomp->dev);
+#endif
+			}
 
 			snd_hdac_set_codec_wakeup(bus, true);
 			snd_hdac_set_codec_wakeup(bus, false);
-			bus->display_power_active = true;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
+			bus->display_power_active = cookie;
+#else
+			bus->display_power_active = 1;
+#endif
 		}
 	} else {
 		if (bus->display_power_active) {
-
-			if (acomp->ops->put_power)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
+			unsigned long cookie = bus->display_power_active;
+#endif
+			if (acomp->ops->put_power) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
+				acomp->ops->put_power(acomp->dev, cookie);
+#else
 				acomp->ops->put_power(acomp->dev);
-			bus->display_power_active = false;
+#endif
+			}
+			bus->display_power_active = 0;
 		}
 	}
  unlock:
@@ -332,8 +351,13 @@ int snd_hdac_acomp_exit(struct hdac_bus
 	if (!acomp)
 		return 0;
 
-	if (WARN_ON(bus->display_power_active) && acomp->ops)
+	if (WARN_ON(bus->display_power_active) && acomp->ops) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
+		acomp->ops->put_power(acomp->dev, bus->display_power_active);
+#else
 		acomp->ops->put_power(acomp->dev);
+#endif
+	}
 
 	bus->display_power_active = 0;
 	bus->display_power_status = 0;
Index: soundwire-1.2.2/soundwire/mipi_disco.c
===================================================================
--- soundwire-1.2.2.orig/soundwire/mipi_disco.c
+++ soundwire-1.2.2/soundwire/mipi_disco.c
@@ -19,15 +19,18 @@
 
 #include <linux/device.h>
 #include <linux/property.h>
+#include <linux/version.h>
 #include <linux/mod_devicetable.h>
 #include <dkms/linux/soundwire/sdw.h>
 #include "bus.h"
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
 static inline int fwnode_property_count_u32(const struct fwnode_handle *fwnode,
 					    const char *propname)
 {
 	return fwnode_property_read_u32_array(fwnode, propname, NULL, 0);
 }
+#endif
 
 /**
  * sdw_master_read_prop() - Read Master properties
