--- zzzz-none-000/linux-5.15.111/drivers/i2c/busses/i2c-designware-baytrail.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/drivers/i2c/busses/i2c-designware-baytrail.c 2024-02-07 10:23:01.000000000 +0000 @@ -9,9 +9,23 @@ #include #include - +#ifdef CONFIG_GMIN_INTEL_MID +#include +#endif #include "i2c-designware-core.h" +#ifdef CONFIG_GMIN_INTEL_MID +static int dw_i2c_acquire_ownership(void) +{ + 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_probe_lock_support(struct dw_i2c_dev *dev) { acpi_status status; @@ -32,12 +46,19 @@ if (!shared_host) return 0; +#ifndef CONFIG_GMIN_INTEL_MID if (!iosf_mbi_available()) return -EPROBE_DEFER; +#endif 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 = iosf_mbi_block_punit_i2c_access; dev->release_lock = iosf_mbi_unblock_punit_i2c_access; +#endif dev->shared_with_punit = true; return 0;