Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9476cdfae61a3c3fa61d06c18dd002b03671ca9f
Commit:     9476cdfae61a3c3fa61d06c18dd002b03671ca9f
Parent:     9f9f0761712928768198278c6cbc5cafe5502d38
Author:     [EMAIL PROTECTED] <[EMAIL PROTECTED]>
AuthorDate: Sat Apr 28 23:21:42 2007 +0900
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Sat Apr 28 22:05:55 2007 -0400

    sony-laptop: add edge modem support (also called WWAN)
    
    Some SZ Vaios have a gsm built-in modem. Allow powering on/off this device.
    Thanks to Joshua Wise for the base code.
    
    Signed-off-by: Mattia Dongili <[EMAIL PROTECTED]>
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/misc/sony-laptop.c |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 5641343..141284d 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -923,6 +923,7 @@ struct sony_pic_dev {
        int                     model;
        u8                      camera_power;
        u8                      bluetooth_power;
+       u8                      wwan_power;
        struct acpi_device      *acpi_dev;
        struct sony_pic_irq     *cur_irq;
        struct sony_pic_ioport  *cur_ioport;
@@ -1330,6 +1331,44 @@ static ssize_t sony_pic_camerapower_show(struct device 
*dev,
        return count;
 }
 
+/* gprs/edge modem (SZ460N and SZ210P), thanks to Joshua Wise */
+static void sony_pic_set_wwanpower(u8 state)
+{
+       state = !!state;
+       mutex_lock(&spic_dev.lock);
+       if (spic_dev.wwan_power == state) {
+               mutex_unlock(&spic_dev.lock);
+               return;
+       }
+       sony_pic_call2(0xB0, state);
+       spic_dev.wwan_power = state;
+       mutex_unlock(&spic_dev.lock);
+}
+
+static ssize_t sony_pic_wwanpower_store(struct device *dev,
+               struct device_attribute *attr,
+               const char *buffer, size_t count)
+{
+       unsigned long value;
+       if (count > 31)
+               return -EINVAL;
+
+       value = simple_strtoul(buffer, NULL, 10);
+       sony_pic_set_wwanpower(value);
+
+       return count;
+}
+
+static ssize_t sony_pic_wwanpower_show(struct device *dev,
+               struct device_attribute *attr, char *buffer)
+{
+       ssize_t count;
+       mutex_lock(&spic_dev.lock);
+       count = snprintf(buffer, PAGE_SIZE, "%d\n", spic_dev.wwan_power);
+       mutex_unlock(&spic_dev.lock);
+       return count;
+}
+
 /* bluetooth subsystem power state */
 static void __sony_pic_set_bluetoothpower(u8 state)
 {
@@ -1412,11 +1451,13 @@ struct device_attribute spic_attr_##_name = 
__ATTR(_name,       \
 
 static SPIC_ATTR(camerapower, 0644);
 static SPIC_ATTR(bluetoothpower, 0644);
+static SPIC_ATTR(wwanpower, 0644);
 static SPIC_ATTR(fanspeed, 0644);
 
 static struct attribute *spic_attributes[] = {
        &spic_attr_camerapower.attr,
        &spic_attr_bluetoothpower.attr,
+       &spic_attr_wwanpower.attr,
        &spic_attr_fanspeed.attr,
        NULL
 };
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to