]> Git Repo - linux.git/commitdiff
Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86
authorLinus Torvalds <[email protected]>
Thu, 30 Jan 2014 02:54:05 +0000 (18:54 -0800)
committerLinus Torvalds <[email protected]>
Thu, 30 Jan 2014 02:54:05 +0000 (18:54 -0800)
Pull x86 platform drivers update from Matthew Garrett:
 "Nothing amazingly special here.  Some cleanups, a new driver to
  support a single button on some new HPs, a tiny amount of hardware
  enablement"

* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86:
  ipc: add intel-mid's pci id macros
  hp-wireless: new driver for hp wireless button for Windows 8
  toshiba_acpi: Support RFKILL hotkey scancode
  hp_accel: Add a new PnP ID HPQ6007 for new HP laptops
  sony-laptop: remove unnecessary assigment of len
  fujitsu-laptop: fix error return code
  dell-laptop: Only install the i8042 filter when rfkill is active
  X86 platform: New BayTrail IOSF-SB MBI driver
  drivers: platform: Include appropriate header file in mxm-wmi.c
  drivers: platform: Mark functions as static in hp_accel.c
  dell-laptop: rkill whitelist Precision models
  ipc: simplify platform data approach
  asus-wmi: Convert to use devm_hwmon_device_register_with_groups
  compal-laptop: Use devm_hwmon_device_register_with_groups
  compal-laptop: Replace SENSOR_DEVICE_ATTR with DEVICE_ATTR
  eeepc-laptop: Convert to use devm_hwmon_device_register_with_groups
  compal-laptop: Use devm_kzalloc to allocate local data structure
  dell-laptop: fix to return error code in dell_send_intensity()

1  2 
drivers/platform/x86/asus-wmi.c
drivers/platform/x86/eeepc-laptop.c
drivers/platform/x86/hp_accel.c
drivers/platform/x86/mxm-wmi.c
drivers/platform/x86/sony-laptop.c
drivers/platform/x86/toshiba_acpi.c

index 109f6383040cf99b99430a44a989c129660de8d3,e9e22a51e7031c2525f9ffc846e180d3bfc15d4b..c5e082fb82fa1b3a56b8673f48778bdac8276cac
@@@ -45,7 -45,8 +45,7 @@@
  #include <linux/seq_file.h>
  #include <linux/platform_device.h>
  #include <linux/thermal.h>
 -#include <acpi/acpi_bus.h>
 -#include <acpi/acpi_drivers.h>
 +#include <linux/acpi.h>
  #include <acpi/video.h>
  
  #include "asus-wmi.h"
@@@ -183,7 -184,6 +183,6 @@@ struct asus_wmi 
  
        struct input_dev *inputdev;
        struct backlight_device *backlight_device;
-       struct device *hwmon_device;
        struct platform_device *platform_device;
  
        struct led_classdev wlan_led;
@@@ -605,7 -605,6 +604,7 @@@ static void asus_rfkill_hotplug(struct 
        mutex_unlock(&asus->wmi_lock);
  
        mutex_lock(&asus->hotplug_lock);
 +      pci_lock_rescan_remove();
  
        if (asus->wlan.rfkill)
                rfkill_set_sw_state(asus->wlan.rfkill, blocked);
        }
  
  out_unlock:
 +      pci_unlock_rescan_remove();
        mutex_unlock(&asus->hotplug_lock);
  }
  
@@@ -1072,20 -1070,12 +1071,12 @@@ static ssize_t asus_hwmon_temp1(struct 
        return sprintf(buf, "%d\n", value);
  }
  
- static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO, asus_hwmon_pwm1, NULL, 0);
- static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, asus_hwmon_temp1, NULL, 0);
- static ssize_t
- show_name(struct device *dev, struct device_attribute *attr, char *buf)
- {
-       return sprintf(buf, "asus\n");
- }
- static SENSOR_DEVICE_ATTR(name, S_IRUGO, show_name, NULL, 0);
+ static DEVICE_ATTR(pwm1, S_IRUGO, asus_hwmon_pwm1, NULL);
+ static DEVICE_ATTR(temp1_input, S_IRUGO, asus_hwmon_temp1, NULL);
  
  static struct attribute *hwmon_attributes[] = {
-       &sensor_dev_attr_pwm1.dev_attr.attr,
-       &sensor_dev_attr_temp1_input.dev_attr.attr,
-       &sensor_dev_attr_name.dev_attr.attr,
+       &dev_attr_pwm1.attr,
+       &dev_attr_temp1_input.attr,
        NULL
  };
  
@@@ -1099,9 -1089,9 +1090,9 @@@ static umode_t asus_hwmon_sysfs_is_visi
        int dev_id = -1;
        u32 value = ASUS_WMI_UNSUPPORTED_METHOD;
  
-       if (attr == &sensor_dev_attr_pwm1.dev_attr.attr)
+       if (attr == &dev_attr_pwm1.attr)
                dev_id = ASUS_WMI_DEVID_FAN_CTRL;
-       else if (attr == &sensor_dev_attr_temp1_input.dev_attr.attr)
+       else if (attr == &dev_attr_temp1_input.attr)
                dev_id = ASUS_WMI_DEVID_THERMAL_CTRL;
  
        if (dev_id != -1) {
@@@ -1136,35 -1126,20 +1127,20 @@@ static struct attribute_group hwmon_att
        .is_visible = asus_hwmon_sysfs_is_visible,
        .attrs = hwmon_attributes
  };
- static void asus_wmi_hwmon_exit(struct asus_wmi *asus)
- {
-       struct device *hwmon;
-       hwmon = asus->hwmon_device;
-       if (!hwmon)
-               return;
-       sysfs_remove_group(&hwmon->kobj, &hwmon_attribute_group);
-       hwmon_device_unregister(hwmon);
-       asus->hwmon_device = NULL;
- }
+ __ATTRIBUTE_GROUPS(hwmon_attribute);
  
  static int asus_wmi_hwmon_init(struct asus_wmi *asus)
  {
        struct device *hwmon;
-       int result;
  
-       hwmon = hwmon_device_register(&asus->platform_device->dev);
+       hwmon = hwmon_device_register_with_groups(&asus->platform_device->dev,
+                                                 "asus", asus,
+                                                 hwmon_attribute_groups);
        if (IS_ERR(hwmon)) {
                pr_err("Could not register asus hwmon device\n");
                return PTR_ERR(hwmon);
        }
-       dev_set_drvdata(hwmon, asus);
-       asus->hwmon_device = hwmon;
-       result = sysfs_create_group(&hwmon->kobj, &hwmon_attribute_group);
-       if (result)
-               asus_wmi_hwmon_exit(asus);
-       return result;
+       return 0;
  }
  
  /*
@@@ -1835,7 -1810,6 +1811,6 @@@ fail_backlight
  fail_rfkill:
        asus_wmi_led_exit(asus);
  fail_leds:
-       asus_wmi_hwmon_exit(asus);
  fail_hwmon:
        asus_wmi_input_exit(asus);
  fail_input:
@@@ -1853,7 -1827,6 +1828,6 @@@ static int asus_wmi_remove(struct platf
        wmi_remove_notify_handler(asus->driver->event_guid);
        asus_wmi_backlight_exit(asus);
        asus_wmi_input_exit(asus);
-       asus_wmi_hwmon_exit(asus);
        asus_wmi_led_exit(asus);
        asus_wmi_rfkill_exit(asus);
        asus_wmi_debugfs_exit(asus);
index ed69ec5f36f77b73afb23ff5199c4d2885f29cbe,b2ef152297c9666a021c33784be8b16201f98a3e..399e8c5621923890a43ea81f25fde5d0388f152e
@@@ -28,7 -28,8 +28,7 @@@
  #include <linux/hwmon.h>
  #include <linux/hwmon-sysfs.h>
  #include <linux/slab.h>
 -#include <acpi/acpi_drivers.h>
 -#include <acpi/acpi_bus.h>
 +#include <linux/acpi.h>
  #include <linux/uaccess.h>
  #include <linux/input.h>
  #include <linux/input/sparse-keymap.h>
@@@ -165,7 -166,6 +165,6 @@@ struct eeepc_laptop 
  
        struct platform_device *platform_device;
        struct acpi_device *device;             /* the device we are in */
-       struct device *hwmon_device;
        struct backlight_device *backlight_device;
  
        struct input_dev *inputdev;
@@@ -591,7 -591,6 +590,7 @@@ static void eeepc_rfkill_hotplug(struc
                rfkill_set_sw_state(eeepc->wlan_rfkill, blocked);
  
        mutex_lock(&eeepc->hotplug_lock);
 +      pci_lock_rescan_remove();
  
        if (eeepc->hotplug_slot) {
                port = acpi_get_pci_dev(handle);
@@@ -649,7 -648,6 +648,7 @@@ out_put_dev
        }
  
  out_unlock:
 +      pci_unlock_rescan_remove();
        mutex_unlock(&eeepc->hotplug_lock);
  }
  
@@@ -1068,7 -1066,7 +1067,7 @@@ static ssize_t show_sys_hwmon(int (*get
        {                                                               \
                return store_sys_hwmon(_get, buf, count);               \
        }                                                               \
-       static SENSOR_DEVICE_ATTR(_name, _mode, show_##_name, store_##_name, 0);
+       static DEVICE_ATTR(_name, _mode, show_##_name, store_##_name);
  
  EEEPC_CREATE_SENSOR_ATTR(fan1_input, S_IRUGO, eeepc_get_fan_rpm, NULL);
  EEEPC_CREATE_SENSOR_ATTR(pwm1, S_IRUGO | S_IWUSR,
  EEEPC_CREATE_SENSOR_ATTR(pwm1_enable, S_IRUGO | S_IWUSR,
                         eeepc_get_fan_ctrl, eeepc_set_fan_ctrl);
  
- static ssize_t
- show_name(struct device *dev, struct device_attribute *attr, char *buf)
- {
-       return sprintf(buf, "eeepc\n");
- }
- static SENSOR_DEVICE_ATTR(name, S_IRUGO, show_name, NULL, 0);
- static struct attribute *hwmon_attributes[] = {
-       &sensor_dev_attr_pwm1.dev_attr.attr,
-       &sensor_dev_attr_fan1_input.dev_attr.attr,
-       &sensor_dev_attr_pwm1_enable.dev_attr.attr,
-       &sensor_dev_attr_name.dev_attr.attr,
+ static struct attribute *hwmon_attrs[] = {
+       &dev_attr_pwm1.attr,
+       &dev_attr_fan1_input.attr,
+       &dev_attr_pwm1_enable.attr,
        NULL
  };
- static struct attribute_group hwmon_attribute_group = {
-       .attrs = hwmon_attributes
- };
- static void eeepc_hwmon_exit(struct eeepc_laptop *eeepc)
- {
-       struct device *hwmon;
-       hwmon = eeepc->hwmon_device;
-       if (!hwmon)
-               return;
-       sysfs_remove_group(&hwmon->kobj,
-                          &hwmon_attribute_group);
-       hwmon_device_unregister(hwmon);
-       eeepc->hwmon_device = NULL;
- }
+ ATTRIBUTE_GROUPS(hwmon);
  
  static int eeepc_hwmon_init(struct eeepc_laptop *eeepc)
  {
+       struct device *dev = &eeepc->platform_device->dev;
        struct device *hwmon;
-       int result;
  
-       hwmon = hwmon_device_register(&eeepc->platform_device->dev);
+       hwmon = devm_hwmon_device_register_with_groups(dev, "eeepc", NULL,
+                                                      hwmon_groups);
        if (IS_ERR(hwmon)) {
                pr_err("Could not register eeepc hwmon device\n");
-               eeepc->hwmon_device = NULL;
                return PTR_ERR(hwmon);
        }
-       eeepc->hwmon_device = hwmon;
-       result = sysfs_create_group(&hwmon->kobj,
-                                   &hwmon_attribute_group);
-       if (result)
-               eeepc_hwmon_exit(eeepc);
-       return result;
+       return 0;
  }
  
  /*
@@@ -1480,7 -1449,6 +1450,6 @@@ static int eeepc_acpi_add(struct acpi_d
  fail_rfkill:
        eeepc_led_exit(eeepc);
  fail_led:
-       eeepc_hwmon_exit(eeepc);
  fail_hwmon:
        eeepc_input_exit(eeepc);
  fail_input:
@@@ -1500,7 -1468,6 +1469,6 @@@ static int eeepc_acpi_remove(struct acp
        eeepc_backlight_exit(eeepc);
        eeepc_rfkill_exit(eeepc);
        eeepc_input_exit(eeepc);
-       eeepc_hwmon_exit(eeepc);
        eeepc_led_exit(eeepc);
        eeepc_platform_exit(eeepc);
  
index aff4d0670edfec733e131c0137fd82f70e0d2206,7c75777af8eb972b398e4d69284c8bcc21cc0cfa..3dc934438c28f9082144ded5f346f39e3716f4db
@@@ -36,7 -36,7 +36,7 @@@
  #include <linux/uaccess.h>
  #include <linux/leds.h>
  #include <linux/atomic.h>
 -#include <acpi/acpi_drivers.h>
 +#include <linux/acpi.h>
  #include "../../misc/lis3lv02d/lis3lv02d.h"
  
  #define DRIVER_NAME     "hp_accel"
@@@ -77,6 -77,7 +77,7 @@@ static inline void delayed_sysfs_set(st
  static struct acpi_device_id lis3lv02d_device_ids[] = {
        {"HPQ0004", 0}, /* HP Mobile Data Protection System PNP */
        {"HPQ6000", 0}, /* HP Mobile Data Protection System PNP */
+       {"HPQ6007", 0}, /* HP Mobile Data Protection System PNP */
        {"", 0},
  };
  MODULE_DEVICE_TABLE(acpi, lis3lv02d_device_ids);
@@@ -88,7 -89,7 +89,7 @@@
   *
   * Returns 0 on success.
   */
- int lis3lv02d_acpi_init(struct lis3lv02d *lis3)
static int lis3lv02d_acpi_init(struct lis3lv02d *lis3)
  {
        struct acpi_device *dev = lis3->bus_priv;
        if (acpi_evaluate_object(dev->handle, METHOD_NAME__INI,
   *
   * Returns 0 on success.
   */
- int lis3lv02d_acpi_read(struct lis3lv02d *lis3, int reg, u8 *ret)
static int lis3lv02d_acpi_read(struct lis3lv02d *lis3, int reg, u8 *ret)
  {
        struct acpi_device *dev = lis3->bus_priv;
        union acpi_object arg0 = { ACPI_TYPE_INTEGER };
   *
   * Returns 0 on success.
   */
- int lis3lv02d_acpi_write(struct lis3lv02d *lis3, int reg, u8 val)
static int lis3lv02d_acpi_write(struct lis3lv02d *lis3, int reg, u8 val)
  {
        struct acpi_device *dev = lis3->bus_priv;
        unsigned long long ret; /* Not used when writting */
index 3c59c0a3ee0f0f2d57a895f853d6915c37d39822,7503d2b9b0730d287966d8716ca57a717db7b3db..f4bad83053a9d5972e504a1cc4c0f80c8f6ba96b
@@@ -20,7 -20,9 +20,8 @@@
  #include <linux/kernel.h>
  #include <linux/module.h>
  #include <linux/init.h>
 -#include <acpi/acpi_bus.h>
 -#include <acpi/acpi_drivers.h>
+ #include <linux/mxm-wmi.h>
 +#include <linux/acpi.h>
  
  MODULE_AUTHOR("Dave Airlie");
  MODULE_DESCRIPTION("MXM WMI Driver");
index 563e4f595f836c1d1ad966688d61c33e4a8d33d5,61fa755b7efb8b0d21a1312994bf51f46a54af14..8f8551a63cc0b6de1bbb55a63ad538e760b72b63
@@@ -61,6 -61,9 +61,6 @@@
  #include <linux/workqueue.h>
  #include <linux/acpi.h>
  #include <linux/slab.h>
 -#include <acpi/acpi_drivers.h>
 -#include <acpi/acpi_bus.h>
 -#include <asm/uaccess.h>
  #include <linux/sonypi.h>
  #include <linux/sony-laptop.h>
  #include <linux/rfkill.h>
@@@ -68,7 -71,6 +68,7 @@@
  #include <linux/poll.h>
  #include <linux/miscdevice.h>
  #endif
 +#include <asm/uaccess.h>
  
  #define dprintk(fmt, ...)                     \
  do {                                          \
@@@ -789,7 -791,7 +789,7 @@@ static int sony_nc_buffer_call(acpi_han
                void *buffer, size_t buflen)
  {
        int ret = 0;
-       size_t len = len;
+       size_t len;
        union acpi_object *object = __call_snc_method(handle, name, value);
  
        if (!object)
index 7ad1ed091f9225fc572a1b70fde9ecf622d06ad1,5d23ca263f5cac2262649aedb5b3062f470c326c..90dd7645a9e504449fd837ec1ad280775fc84ae9
  #include <linux/slab.h>
  #include <linux/workqueue.h>
  #include <linux/i8042.h>
 -
 +#include <linux/acpi.h>
  #include <asm/uaccess.h>
  
 -#include <acpi/acpi_drivers.h>
 -
  MODULE_AUTHOR("John Belmonte");
  MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver");
  MODULE_LICENSE("GPL");
@@@ -149,6 -151,7 +149,7 @@@ static const struct acpi_device_id tosh
  MODULE_DEVICE_TABLE(acpi, toshiba_device_ids);
  
  static const struct key_entry toshiba_acpi_keymap[] = {
+       { KE_KEY, 0x9e, { KEY_RFKILL } },
        { KE_KEY, 0x101, { KEY_MUTE } },
        { KE_KEY, 0x102, { KEY_ZOOMOUT } },
        { KE_KEY, 0x103, { KEY_ZOOMIN } },
This page took 0.074161 seconds and 4 git commands to generate.