eeepc-laptop: add 3G and Wimax CM_ASL values and acpi method names
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/2 eeepc-laptop: add 3G and Wimax CM_ASL values and acpi method names
The asus_acpi module as found in the eeepc 901go redefines the control methods bits. Bits indicating 3G modem and wimax are added between CM_ASL_CARDREADER and CM_ASL_LID. As CM_ASL_LID was unused this does not changes behaviour for older models.
Signed-off-by Janne Grunau <[email protected]>
--- drivers/platform/x86/eeepc-laptop.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/platform/x86/eeepc-laptop.c +4 -2
@@ -85,6 +85,8 @@ enum {CM_ASL_USBPORT3 ,CM_ASL_MODEM ,CM_ASL_CARDREADER , +CM_ASL_3G , +CM_ASL_WIMAX , CM_ASL_LID };
@@ -94,7 +96,7 @@ static const char *cm_getv[] = {NULL ,"PBLG" ,NULL ,NULL ,"CFVG" ,NULL ,NULL ,NULL ,"USBG" ,NULL ,NULL ,"MODG" , -"CRDG" ,"LIDG" +"CRDG" ,"M3GG" ,"WIMG" ,"LIDG" }; static const char *cm_setv[] = {
@@ -103,7 +105,7 @@ static const char *cm_setv[] = {"SDSP" ,"PBLS" ,"HDPS" ,NULL ,"CFVS" ,NULL ,NULL ,NULL ,"USBG" ,NULL ,NULL ,"MODS" , -"CRDS" ,NULL +"CRDS" ,"M3GS" ,"WIMS" ,NULL };#define EEEPC_EC "\\_SB.PCI0.SBRG.EC0."
Signature · 1 line
1.6.0.4
PATCH 2/2 eeepc-laptop: add rfkill support for the 3G modem in Eee PC 901 Go
In reply to a message not in the archiveSigned-off-by Janne Grunau <[email protected]>
--- drivers/platform/x86/eeepc-laptop.c | 56 +++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 deletions(-)
drivers/platform/x86/eeepc-laptop.c +56 -0
@@ -132,6 +132,7 @@ struct eeepc_hotk {u16 *keycode_map;struct rfkill *eeepc_wlan_rfkill;struct rfkill *eeepc_bluetooth_rfkill; +struct rfkill *eeepc_wwan3g_rfkill;struct hotplug_slot *hotplug_slot; };
@@ -352,6 +353,23 @@ static void __init eeepc_enable_camera(void)set_acpi (CM_ASL_CAMERA ,1 ); } +static int eeepc_wwan3g_rfkill_set (void *data,enum rfkill_state state) +{ +if (state ==RFKILL_STATE_SOFT_BLOCKED ) +return set_acpi (CM_ASL_3G ,0 ); +else +return set_acpi (CM_ASL_3G ,1 ); +} + +static int eeepc_wwan3g_rfkill_state (void *data,enum rfkill_state *state) +{ +if (get_acpi (CM_ASL_3G ) ==1 ) + *state =RFKILL_STATE_UNBLOCKED ; +else + *state =RFKILL_STATE_SOFT_BLOCKED ; +return 0 ; +} +/* * Sys helpers */
@@ -869,6 +887,35 @@ static int eeepc_hotk_add(struct acpi_device *device) goto bluetooth_fail; } +if (get_acpi (CM_ASL_3G ) !=-1 ) { + ehotk->eeepc_wwan3g_rfkill = +rfkill_allocate (&device->dev,RFKILL_TYPE_WWAN ); + +if (!ehotk->eeepc_wwan3g_rfkill) + goto wwan_fail; + + ehotk->eeepc_wwan3g_rfkill->name ="eeepc-3g" ; + ehotk->eeepc_wwan3g_rfkill->toggle_radio = + eeepc_wwan3g_rfkill_set; + ehotk->eeepc_wwan3g_rfkill->get_state = + eeepc_wwan3g_rfkill_state; +if (get_acpi (CM_ASL_3G ) ==1 ) { + ehotk->eeepc_wwan3g_rfkill->state = +RFKILL_STATE_UNBLOCKED ; +rfkill_set_default (RFKILL_TYPE_WWAN , +RFKILL_STATE_UNBLOCKED ); + }else { + ehotk->eeepc_wwan3g_rfkill->state = +RFKILL_STATE_SOFT_BLOCKED ; +rfkill_set_default (RFKILL_TYPE_WWAN , +RFKILL_STATE_SOFT_BLOCKED ); + } + + result =rfkill_register (ehotk->eeepc_wwan3g_rfkill); +if (result) + goto wwan_fail; + } + result =eeepc_setup_pci_hotplug ();/* * If we get -EBUSY then something else is handling the PCI hotplug -
@@ -882,6 +929,13 @@ static int eeepc_hotk_add(struct acpi_device *device)return 0 ; pci_fail: +if (ehotk->eeepc_wwan3g_rfkill) +rfkill_unregister (ehotk->eeepc_wwan3g_rfkill); +wwan_fail: +if (ehotk->eeepc_wwan3g_rfkill) { +rfkill_free (ehotk->eeepc_wwan3g_rfkill); + ehotk->eeepc_wwan3g_rfkill =NULL ; + }if (ehotk->eeepc_bluetooth_rfkill)rfkill_unregister (ehotk->eeepc_bluetooth_rfkill); bluetooth_fail:
@@ -1041,6 +1095,8 @@ static void eeepc_rfkill_exit(void)rfkill_unregister (ehotk->eeepc_wlan_rfkill);if (ehotk->eeepc_bluetooth_rfkill)rfkill_unregister (ehotk->eeepc_bluetooth_rfkill); +if (ehotk->eeepc_wwan3g_rfkill) +rfkill_unregister (ehotk->eeepc_wwan3g_rfkill); }static void eeepc_input_exit (void )
Signature · 1 line
1.6.0.4