Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310149
b: refs/heads/master
c: d6f15ed
h: refs/heads/master
i:
  310147: 10e24f6
v: v3
  • Loading branch information
Marco Chiappero authored and Matthew Garrett committed May 31, 2012
1 parent c3c4e9b commit 8d88f96
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd258c00b96932ce2a81a9bb8bb8e6be997aa2cc
refs/heads/master: d6f15ed876b83a1a0eba1d0473eef58acc95444a
21 changes: 17 additions & 4 deletions trunk/drivers/platform/x86/sony-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ static int sony_nc_rfkill_set(void *data, bool blocked)
int argument = sony_rfkill_address[(long) data] + 0x100;

if (!blocked)
argument |= 0xff0000;
argument |= 0x030000;

return sony_call_snc_handle(sony_rfkill_handle, argument, &result);
}
Expand All @@ -1230,7 +1230,7 @@ static int sony_nc_setup_rfkill(struct acpi_device *device,
enum rfkill_type type;
const char *name;
int result;
bool hwblock;
bool hwblock, swblock;

switch (nc_type) {
case SONY_WIFI:
Expand Down Expand Up @@ -1258,8 +1258,21 @@ static int sony_nc_setup_rfkill(struct acpi_device *device,
if (!rfk)
return -ENOMEM;

sony_call_snc_handle(sony_rfkill_handle, 0x200, &result);
if (sony_call_snc_handle(sony_rfkill_handle, 0x200, &result) < 0) {
rfkill_destroy(rfk);
return -1;
}
hwblock = !(result & 0x1);

if (sony_call_snc_handle(sony_rfkill_handle,
sony_rfkill_address[nc_type],
&result) < 0) {
rfkill_destroy(rfk);
return -1;
}
swblock = !(result & 0x2);

rfkill_init_sw_state(rfk, swblock);
rfkill_set_hw_state(rfk, hwblock);

err = rfkill_register(rfk);
Expand Down Expand Up @@ -1295,7 +1308,7 @@ static void sony_nc_rfkill_update(void)

sony_call_snc_handle(sony_rfkill_handle, argument, &result);
rfkill_set_states(sony_rfkill_devices[i],
!(result & 0xf), false);
!(result & 0x2), false);
}
}

Expand Down

0 comments on commit 8d88f96

Please sign in to comment.