Commit 8e7d3543 authored by Ike Panhc's avatar Ike Panhc Committed by Matthew Garrett
Browse files

ideapad: check VPC bit before sync rfkill hw status



Check VPC bit to make sure the HW rfkill is touched.

Signed-off-by: default avatarIke Panhc <ike.pan@canonical.com>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 6a09f21d
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -379,8 +379,22 @@ static int ideapad_acpi_remove(struct acpi_device *adevice, int type)

static void ideapad_acpi_notify(struct acpi_device *adevice, u32 event)
{
	acpi_handle handle = adevice->handle;
	unsigned long vpc1, vpc2, vpc_bit;

	if (read_ec_data(handle, 0x10, &vpc1))
		return;
	if (read_ec_data(handle, 0x1A, &vpc2))
		return;

	vpc1 = (vpc2 << 8) | vpc1;
	for (vpc_bit = 0; vpc_bit < 16; vpc_bit++) {
		if (test_bit(vpc_bit, &vpc1)) {
			if (vpc_bit == 9)
				ideapad_sync_rfk_state(adevice);
		}
	}
}

static struct acpi_driver ideapad_acpi_driver = {
	.name = "ideapad_acpi",