Skip to contentSkip to conversation

dell_laptop: when the "hardware" switch is disabled, don't actually allow changing the softblock status.

PATCH In review [email protected] 1 participant 1 message Nov 17, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/12 dell_laptop: when the "hardware" switch is disabled, don't actually allow changing the softblock status.

From: Mario Limonciello <[email protected]>

The "hardware" switch is tied directly to a BIOS interface that will connect and disconnect the hardware from the bus.

If you use the software interface to request the BIOS to make these changes, the HW switch will be in an inconsistent state and LEDs may not reflect the state of the HW.

---

 drivers/platform/x86/dell-laptop.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/dell-laptop.c renamed from drivers/platform/x86/dell-laptop.c~dell_laptop-when-the-hardware-switch-is-disabled-dont-actually-allow-changing-the-softblock-status +4 -0
diff -puN drivers/platform/x86/dell-laptop.c~dell_laptop-when-the-hardware-switch-is-disabled-dont-actually-allow-changing-the-softblock-status drivers/platform/x86/dell-laptop.c
@@ -181,6 +181,10 @@ static int dell_rfkill_set(void *data, b
 	unsigned long radio = (unsigned long)data;
 
 	memset(&buffer, 0, sizeof(struct calling_interface_buffer));
+	dell_send_request(&buffer, 17, 11);
+	if (!(buffer.output[1] & BIT(16)))
+		return -EINVAL;
+
 	buffer.input[0] = (1 | (radio<<8) | (disable << 16));
 	dell_send_request(&buffer, 17, 11);
 

_