1 // SPDX-License-Identifier: GPL-2.0
3 * Intel BayTrail PMIC I2C bus semaphore implementation
4 * Copyright (c) 2014, Intel Corporation.
6 #include <linux/device.h>
7 #include <linux/acpi.h>
9 #include <linux/interrupt.h>
11 #include <asm/iosf_mbi.h>
13 #include "i2c-designware-core.h"
15 int i2c_dw_baytrail_probe_lock_support(struct dw_i2c_dev
*dev
)
18 unsigned long long shared_host
= 0;
24 handle
= ACPI_HANDLE(dev
->dev
);
28 status
= acpi_evaluate_integer(handle
, "_SEM", NULL
, &shared_host
);
29 if (ACPI_FAILURE(status
))
35 if (!iosf_mbi_available())
38 dev_info(dev
->dev
, "I2C bus managed by PUNIT\n");
39 dev
->acquire_lock
= iosf_mbi_block_punit_i2c_access
;
40 dev
->release_lock
= iosf_mbi_unblock_punit_i2c_access
;
41 dev
->shared_with_punit
= true;