int i2c_dw_eval_lock_support(struct dw_i2c_dev *dev) { acpi_status status; unsigned long long shared_host = 0; acpi_handle handle; if (!dev || !dev->dev) return 0; handle = ACPI_HANDLE(dev->dev); if (!handle) return 0; status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host); if (ACPI_FAILURE(status)) return 0; if (shared_host) { dev_info(dev->dev, "I2C bus managed by PUNIT\n"); dev->acquire_lock = baytrail_i2c_acquire; dev->release_lock = baytrail_i2c_release; dev->pm_runtime_disabled = true; } if (!iosf_mbi_available()) return -EPROBE_DEFER; return 0; }
int i2c_dw_probe_lock_support(struct dw_i2c_dev *dev) { acpi_status status; unsigned long long shared_host = 0; acpi_handle handle; if (!dev || !dev->dev) return 0; handle = ACPI_HANDLE(dev->dev); if (!handle) return 0; status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host); if (ACPI_FAILURE(status)) return 0; if (!shared_host) return 0; if (!iosf_mbi_available()) return -EPROBE_DEFER; dev_info(dev->dev, "I2C bus managed by PUNIT\n"); dev->acquire_lock = baytrail_i2c_acquire; dev->release_lock = baytrail_i2c_release; dev->pm_disabled = true; pm_qos_add_request(&dev->pm_qos, PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE); return 0; }
static bool sdhci_acpi_byt_defer(struct device *dev) { if (!sdhci_acpi_byt()) return false; if (!iosf_mbi_available()) return true; sdhci_acpi_byt_setting(dev); return false; }
/** * imr_init - entry point for IMR driver. * * return: -ENODEV for no IMR support 0 if good to go. */ static int __init imr_init(void) { struct imr_device *idev = &imr_dev; int ret; if (!x86_match_cpu(imr_ids) || !iosf_mbi_available()) return -ENODEV; idev->max_imr = QUARK_X1000_IMR_MAX; idev->reg_base = QUARK_X1000_IMR_REGBASE; idev->init = true; mutex_init(&idev->lock); ret = imr_debugfs_register(idev); if (ret != 0) pr_warn("debugfs register failed!\n"); imr_fixup_memmap(idev); return 0; }