Skip to contentSkip to conversation

Sony laptop: Some Sony Vaia laptops do not enable wwan power by default.

PATCH In review Tim Gardner 3 participants 3 messages Jul 12, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Sony laptop: Some Sony Vaia laptops do not enable wwan power by default.

Ubuntu has been carrying this patch for a couple of years because I keep forgetting to upstream it. Does anyone think it still makes sense, or should setting WWAN power be done in user space ?

rtg

Signature · 1 line
Tim Gardner [email protected]

From 87db59448467783076b7468a8f8ae3650d08d3a0 Mon Sep 17 00:00:00 2001
From: Tim Gardner <[email protected]>
Date: Tue, 21 Apr 2009 11:09:10 -0600
Subject: [PATCH] Sony laptop: Some Sony Vaia laptops do not enable wwan power by default.

Added quirk to enable wwan power based on DMI information already present in the module. It appears that Vaio's do not enable power to wwan from a cold boot.

---
 drivers/platform/x86/sony-laptop.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
drivers/platform/x86/sony-laptop.c +23 -0
index bbd182e..02265fd 100644
@@ -1879,6 +1879,10 @@ struct sonypi_eventtypes {
 	struct sonypi_event	*events;
 };
 
+struct sony_pic_quirk_entry {
+	u8				set_wwan_power;
+};
+
 struct sony_pic_dev {
 	struct acpi_device		*acpi_dev;
 	struct sony_pic_irq		*cur_irq;
@@ -1889,6 +1893,7 @@ struct sony_pic_dev {
 	struct sonypi_eventtypes	*event_types;
 	int                             (*handle_irq)(const u8, const u8);
 	int				model;
+	struct sony_pic_quirk_entry	*quirks;
 	u16				evport_offset;
 	u8				camera_power;
 	u8				bluetooth_power;
@@ -3315,6 +3320,12 @@ static int sony_pic_add(struct acpi_device *device)
 	if (result)
 		goto err_remove_pf;
 
+	if (spic_dev.quirks && spic_dev.quirks->set_wwan_power) {
+		/*
+		 * Power isn't enabled by default.
+		 */
+		__sony_pic_set_wwanpower(1);
+	}
 	return 0;
 
 err_remove_pf:
@@ -3385,6 +3396,16 @@ static struct acpi_driver sony_pic_driver = {
 		},
 };
 
+static struct sony_pic_quirk_entry sony_pic_vaio_vgn = {
+	.set_wwan_power = 1,
+};
+
+static int dmi_matched(const struct dmi_system_id *dmi)
+{
+	spic_dev.quirks = dmi->driver_data;
+	return 0;
+}
+
 static struct dmi_system_id __initdata sonypi_dmi_table[] = {
 	{
 		.ident = "Sony Vaio",
@@ -3399,6 +3420,8 @@ static struct dmi_system_id __initdata sonypi_dmi_table[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-"),
 		},
+		.callback = dmi_matched,
+		.driver_data = &sony_pic_vaio_vgn,
 	},
 	{ }
 };
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 3 lines · Tim Gardner

Ubuntu has been carrying this patch for a couple of years because I keep forgetting to upstream it. Does anyone think it still makes sense, or should setting WWAN power be done in user space ?

Userspace, but also somebody needs to figure out how to identify whether old-style Vaios support each of these features and expose them as proper rfkill devices.

Signature · 1 line
Matthew Garrett | [email protected]
maintainer
#2 lore raw
Quoted 8 lines · Matthew Garrett
Quoted 3 lines · Tim Gardner

Ubuntu has been carrying this patch for a couple of years because I keep forgetting to upstream it. Does anyone think it still makes sense, or should setting WWAN power be done in user space ?

Userspace, but also somebody needs to figure out how to identify whether old-style Vaios support each of these features and expose them as proper rfkill devices.

the problem with that has always been that we don't know how to probe the SPIC device. We also don't know how to read the state of the rfkill switch. I imagine we could guess but I'm not sure how useful that is.

Signature · 2 lines
mattia
:wq!