--- zzzz-none-000/linux-4.9.279/drivers/i2c/busses/i2c-designware-baytrail.c	2021-08-08 06:38:54.000000000 +0000
+++ puma7-atom-6591-750/linux-4.9.279/drivers/i2c/busses/i2c-designware-baytrail.c	2023-02-08 11:43:42.000000000 +0000
@@ -18,7 +18,9 @@
 #include <linux/interrupt.h>
 
 #include <asm/iosf_mbi.h>
-
+#ifdef CONFIG_GMIN_INTEL_MID
+#include <asm/intel_mid_pcihelpers.h>
+#endif
 #include "i2c-designware-core.h"
 
 #define SEMAPHORE_TIMEOUT	100
@@ -26,6 +28,7 @@
 #define PUNIT_SEMAPHORE_BIT	BIT(0)
 #define PUNIT_SEMAPHORE_ACQUIRE	BIT(1)
 
+#ifndef CONFIG_GMIN_INTEL_MID
 static unsigned long acquired;
 
 static int get_sem(struct device *dev, u32 *sem)
@@ -121,6 +124,18 @@
 		jiffies_to_msecs(jiffies - acquired));
 }
 
+#else          //#ifdef CONFIG_GMIN_INTEL_MID
+static int dw_i2c_acquire_ownership(struct dw_i2c_dev *dev)
+{       
+	return intel_mid_dw_i2c_acquire_ownership();
+}
+       
+static void dw_i2c_release_ownership(struct dw_i2c_dev *dev)
+{       
+	intel_mid_dw_i2c_release_ownership();
+}       
+#endif
+
 int i2c_dw_eval_lock_support(struct dw_i2c_dev *dev)
 {
 	acpi_status status;
@@ -140,13 +155,19 @@
 
 	if (shared_host) {
 		dev_info(dev->dev, "I2C bus managed by PUNIT\n");
+#ifdef CONFIG_GMIN_INTEL_MID
+        	dev->acquire_lock = dw_i2c_acquire_ownership;
+		dev->release_lock = dw_i2c_release_ownership;
+#else
 		dev->acquire_lock = baytrail_i2c_acquire;
 		dev->release_lock = baytrail_i2c_release;
+#endif
 		dev->pm_runtime_disabled = true;
 	}
 
+#ifndef CONFIG_GMIN_INTEL_MID
 	if (!iosf_mbi_available())
 		return -EPROBE_DEFER;
-
+#endif
 	return 0;
 }