]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
HID: i2c-hid: Put ACPI enumerated devices in D3 on shutdown
authorHans de Goede <hdegoede@redhat.com>
Mon, 26 Oct 2020 15:46:06 +0000 (16:46 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 29 Oct 2020 11:48:55 +0000 (12:48 +0100)
commit5c7e02a896689407555b3a10d6ed87369c70916e
tree75c4f84238929741dc58bb1f81ebcdf4f34ee7ed
parent1811977cb11354aef8cbd13e35ff50db716728a4
HID: i2c-hid: Put ACPI enumerated devices in D3 on shutdown

The i2c-hid driver would quietly fail to probe the i2c-hid sensor-hub
with an ACPI device-id of SMO91D0 every other boot.

Specifically, the i2c_smbus_read_byte() "Make sure there is something at
this address" check would fail every other boot.

It seems that the BIOS does not properly reset/power-cycle the device
leaving it in a confused state where it refuses to respond to i2c-xfers.
On boots where probing the device failed, the driver-core puts the device
in D3 after the probe-failure, which causes the probe to succeed the next
boot.

Putting the device in D3 from the shutdown-handler fixes the sensors not
working every other boot.

This has been tested on both a Lenovo Miix 2-10 and a Dell Venue 8 Pro 5830
both of which use an i2c-hid sensor-hub with an ACPI id of SMO91D0.

Note that it is safe to call acpi_device_set_power() with a NULL pointer
as first argument, so on none ACPI enumerated devices this change is a
no-op.

Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/i2c-hid/i2c-hid-core.c