diff options
author | Lee, Chun-Yi <joeyli.kernel@gmail.com> | 2011-03-28 04:52:02 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2011-03-28 06:46:12 -0400 |
commit | 8215af019040ce9182728afee9642d8fdeb17f59 (patch) | |
tree | 4cb84e68fb7310b5a474cfb33d910734f1691365 /drivers | |
parent | c8440336fe376036e473554c30f7266987961734 (diff) |
acer-wmi: does not set persistence state by rfkill_init_sw_state
Acer BIOS keeps devices state when system reboot, but reset to default
device states (Wlan on, Bluetooth off, wwan on) if system cold boot.
That means BIOS's initial state is not always real persistence.
So, removed rfkill_init_sw_state because it sets initial state to
persistence then replicate to other new killswitch when rfkill-input
enabled.
After removed it, acer-wmi set initial soft-block state after rfkill
register, and doesn't allow set_block until rfkill initial finished.
Reference: bko#31002
https://bugzilla.kernel.org/show_bug.cgi?id=31002
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: OldÅich JedliÄka <oldium.pro@seznam.cz>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/platform/x86/acer-wmi.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index d798314b81fe..652a84ec36cf 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c | |||
@@ -217,6 +217,7 @@ struct acer_debug { | |||
217 | static struct rfkill *wireless_rfkill; | 217 | static struct rfkill *wireless_rfkill; |
218 | static struct rfkill *bluetooth_rfkill; | 218 | static struct rfkill *bluetooth_rfkill; |
219 | static struct rfkill *threeg_rfkill; | 219 | static struct rfkill *threeg_rfkill; |
220 | static bool rfkill_inited; | ||
220 | 221 | ||
221 | /* Each low-level interface must define at least some of the following */ | 222 | /* Each low-level interface must define at least some of the following */ |
222 | struct wmi_interface { | 223 | struct wmi_interface { |
@@ -1157,9 +1158,13 @@ static int acer_rfkill_set(void *data, bool blocked) | |||
1157 | { | 1158 | { |
1158 | acpi_status status; | 1159 | acpi_status status; |
1159 | u32 cap = (unsigned long)data; | 1160 | u32 cap = (unsigned long)data; |
1160 | status = set_u32(!blocked, cap); | 1161 | |
1161 | if (ACPI_FAILURE(status)) | 1162 | if (rfkill_inited) { |
1162 | return -ENODEV; | 1163 | status = set_u32(!blocked, cap); |
1164 | if (ACPI_FAILURE(status)) | ||
1165 | return -ENODEV; | ||
1166 | } | ||
1167 | |||
1163 | return 0; | 1168 | return 0; |
1164 | } | 1169 | } |
1165 | 1170 | ||
@@ -1183,14 +1188,16 @@ static struct rfkill *acer_rfkill_register(struct device *dev, | |||
1183 | return ERR_PTR(-ENOMEM); | 1188 | return ERR_PTR(-ENOMEM); |
1184 | 1189 | ||
1185 | status = get_device_status(&state, cap); | 1190 | status = get_device_status(&state, cap); |
1186 | if (ACPI_SUCCESS(status)) | ||
1187 | rfkill_init_sw_state(rfkill_dev, !state); | ||
1188 | 1191 | ||
1189 | err = rfkill_register(rfkill_dev); | 1192 | err = rfkill_register(rfkill_dev); |
1190 | if (err) { | 1193 | if (err) { |
1191 | rfkill_destroy(rfkill_dev); | 1194 | rfkill_destroy(rfkill_dev); |
1192 | return ERR_PTR(err); | 1195 | return ERR_PTR(err); |
1193 | } | 1196 | } |
1197 | |||
1198 | if (ACPI_SUCCESS(status)) | ||
1199 | rfkill_set_sw_state(rfkill_dev, !state); | ||
1200 | |||
1194 | return rfkill_dev; | 1201 | return rfkill_dev; |
1195 | } | 1202 | } |
1196 | 1203 | ||
@@ -1225,6 +1232,8 @@ static int acer_rfkill_init(struct device *dev) | |||
1225 | } | 1232 | } |
1226 | } | 1233 | } |
1227 | 1234 | ||
1235 | rfkill_inited = true; | ||
1236 | |||
1228 | schedule_delayed_work(&acer_rfkill_work, round_jiffies_relative(HZ)); | 1237 | schedule_delayed_work(&acer_rfkill_work, round_jiffies_relative(HZ)); |
1229 | 1238 | ||
1230 | return 0; | 1239 | return 0; |