rfkill: don't restore software blocked state on persistent devices
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Tue, 16 Jun 2009 14:39:51 +0000 (15:39 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 19 Jun 2009 15:50:17 +0000 (11:50 -0400)
commit06d5caf47ef4fbd9efdceae33293c42778cb7b0c
tree51bce5f2f9f7aef903c464ac68c80da6f83e2c53
parent7fa20a7f60df0afceafbb8197b5d110507f42c72
rfkill: don't restore software blocked state on persistent devices

The setting of the "persistent" flag is also made more explicit using
a new rfkill_init_sw_state() function, instead of special-casing
rfkill_set_sw_state() when it is called before registration.

Suspend is a bit of a corner case so we try to get away without adding
another hack to rfkill-input - it's going to be removed soon.
If the state does change over suspend, users will simply have to prod
rfkill-input twice in order to toggle the state.

Userspace policy agents will be able to implement a more consistent user
experience.  For example, they can avoid the above problem if they
toggle devices individually.  Then there would be no "global state"
to get out of sync.

Currently there are only two rfkill drivers with persistent soft-blocked
state.  thinkpad-acpi already checks the software state on resume.
eeepc-laptop will require modification.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
CC: Marcel Holtmann <marcel@holtmann.org>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/platform/x86/eeepc-laptop.c
drivers/platform/x86/thinkpad_acpi.c
include/linux/rfkill.h
net/rfkill/core.c