Re: [PATCH v2 1/3] platform: x86: dell-rbtn: Dell Airplane Mode Switch driver

From: Gabriele Mazzotta
Date: Wed Apr 29 2015 - 06:30:41 EST


On Wednesday 29 April 2015 11:51:04 Pali Rohár wrote:
> This is an ACPI driver for Dell laptops which receive HW switch events.
> It exports rfkill device dell-rbtn which provide correct hard rfkill state.
>
> Alex Hung added code for supporting Dell laptops which have toggle button
> instead HW slider switch. On these laptops toggle button event is reported
> by new input device (instead rfkill) as they do not have hw radio switch.
>
> It looks like those are two different functions (rfkill, input device), but
> Dell BIOS exports them via same ACPI device and uses same ACPI functions.
> So code is in one kernel driver.

I made a patch some time ago that I've just adapted. It allows to
prefer RBTN_SLIDER over RBTN_TOGGLE. The main reason why I'd like to
have the hardware switch is that the BIOS doesn't alter the soft state
of the devices. This comes in handy when the function key controls
multiple radio devices.

Here below the simple patch. Maybe I could improve it and allow a
dynamic switch between RBTN_TOGGLE and RBTN_SLIDER.