Lines Matching +full:bosch +full:- +full:sensortec
1 // SPDX-License-Identifier: GPL-2.0-only
3 * 3-axis accelerometer driver supporting many I2C Bosch-Sensortec chips
14 #include "bmc150-accel.h"
24 * The DUAL250E ACPI device for 360° hinges type 2-in-1s with 1 accelerometer
25 * in the display and 1 in the hinge has an ACPI-method (DSM) to tell the
28 * the keyboard being disabled when the 2-in-1 is turned-on or resumed while
29 * fully folded into tablet mode (which gets detected with a HALL-sensor).
30 * If we don't call this then the keyboard won't work even when the 2-in-1 is
31 * changed to be used in laptop mode after the power-on / resume.
40 #define BMC150_DSM_GUID "7681541e-8827-4239-8d9d-36be7fe12542"
53 struct acpi_device *adev = ACPI_COMPANION(&client->dev); in bmc150_acpi_set_angle_dsm()
66 if (!acpi_check_dsm(adev->handle, &guid, 0, BIT(DUAL250E_SET_ANGLE_FN_INDEX))) in bmc150_acpi_set_angle_dsm()
71 * "ACPI Warning: \_SB.PCI0.I2C2.ACC1._DSM: Argument #4 type mismatch - in bmc150_acpi_set_angle_dsm()
80 obj = acpi_evaluate_dsm(adev->handle, &guid, 0, DUAL250E_SET_ANGLE_FN_INDEX, &args_obj); in bmc150_acpi_set_angle_dsm()
82 dev_err(&client->dev, "Failed to call DSM to enable keyboard and touchpad\n"); in bmc150_acpi_set_angle_dsm()
93 * The EC must see a change for it to re-enable the kbd, so first in bmc150_acpi_enable_keyboard()
111 bmc150_acpi_enable_keyboard(data->second_device); in bmc150_acpi_resume_work()
122 schedule_delayed_work(&data->resume_work, msecs_to_jiffies(1000)); in bmc150_acpi_resume_handler()
133 struct acpi_device *adev = ACPI_COMPANION(&client->dev); in bmc150_acpi_dual_accel_probe()
138 .fwnode = client->dev.fwnode, in bmc150_acpi_dual_accel_probe()
145 * The 2nd accel sits in the base of 2-in-1s. The suffix is static, as in bmc150_acpi_dual_accel_probe()
152 data->second_device = i2c_acpi_new_device(&client->dev, 1, &board_info); in bmc150_acpi_dual_accel_probe()
154 if (!IS_ERR(data->second_device) && bmc150_acpi_enable_keyboard(data->second_device)) { in bmc150_acpi_dual_accel_probe()
155 INIT_DELAYED_WORK(&data->resume_work, bmc150_acpi_resume_work); in bmc150_acpi_dual_accel_probe()
156 data->resume_callback = bmc150_acpi_resume_handler; in bmc150_acpi_dual_accel_probe()
164 if (data->resume_callback) in bmc150_acpi_dual_accel_remove()
165 cancel_delayed_work_sync(&data->resume_work); in bmc150_acpi_dual_accel_remove()
167 i2c_unregister_device(data->second_device); in bmc150_acpi_dual_accel_remove()
181 i2c_check_functionality(client->adapter, I2C_FUNC_I2C) || in bmc150_accel_probe()
182 i2c_check_functionality(client->adapter, in bmc150_accel_probe()
188 dev_err(&client->dev, "Failed to initialize i2c regmap\n"); in bmc150_accel_probe()
193 name = id->name; in bmc150_accel_probe()
194 type = id->driver_data; in bmc150_accel_probe()
197 ret = bmc150_accel_core_probe(&client->dev, regmap, client->irq, in bmc150_accel_probe()
206 if (!id && has_acpi_companion(&client->dev)) in bmc150_accel_probe()
216 bmc150_accel_core_remove(&client->dev); in bmc150_accel_remove()
251 { .compatible = "bosch,bma222" },
252 { .compatible = "bosch,bma222e" },
253 { .compatible = "bosch,bma250e" },
254 { .compatible = "bosch,bma253" },
255 { .compatible = "bosch,bma254" },
256 { .compatible = "bosch,bma255" },
257 { .compatible = "bosch,bma280" },
258 { .compatible = "bosch,bmc150_accel" },
259 { .compatible = "bosch,bmc156_accel" },
260 { .compatible = "bosch,bmi055_accel" },