Merge tag 'platform-drivers-x86-v4.13-2' of git://git.infradead.org/linux-platform...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jul 2017 19:28:06 +0000 (12:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jul 2017 19:28:06 +0000 (12:28 -0700)
Pull more x86 platform driver updates from Darren Hart:
 "Add new platform matches for silead_dmi and ideapad-laptop. Several
  constify patches for attribute_group structures. Fixes for peaq-wmi
  and intel_telemetry.

  silead_dmi:
   - Add entry for Ployer Momo7w tablet touchscreen
   - Add touchscreen info for I.T.Works TW891 2-in-1

  toshiba_acpi:
   - constify attribute_group structures.

  asus-wmi:
   - constify attribute_group structures.

  panasonic-laptop:
   - constify attribute_group structures.

  alienware-wmi:
   - constify attribute_group structures.

  samsung-laptop:
   - constify attribute_group structures.

  compal-laptop:
   - constify attribute_group structures.

  fujitsu-laptop:
   - constify attribute_group structures.
   - add NULL check on devm_kzalloc() return value

  peaq-wmi:
   - Fix peaq_ignore_events_counter handling off by 1

  ideapad-laptop:
   - Fix indentation in DMI table
   - Add several models to no_hw_rfkill
   - Add IdeaPad V510-15IKB to no_hw_rfkill

  intel_telemetry:
   - Add debugfs entry for S0ix residency

  intel_telemetry_debugfs:
   - fix some error codes in init
   - fix oops when load/unload module"

* tag 'platform-drivers-x86-v4.13-2' of git://git.infradead.org/linux-platform-drivers-x86:
  platform/x86: silead_dmi: Add entry for Ployer Momo7w tablet touchscreen
  platform/x86: toshiba_acpi: constify attribute_group structures.
  platform/x86: asus-wmi: constify attribute_group structures.
  platform/x86: panasonic-laptop: constify attribute_group structures.
  platform/x86: alienware-wmi: constify attribute_group structures.
  platform/x86: samsung-laptop: constify attribute_group structures.
  platform/x86: compal-laptop: constify attribute_group structures.
  platform/x86: fujitsu-laptop: constify attribute_group structures.
  platform/x86: peaq-wmi: Fix peaq_ignore_events_counter handling off by 1
  platform/x86: fujitsu-laptop: add NULL check on devm_kzalloc() return value
  platform/x86: silead_dmi: Add touchscreen info for I.T.Works TW891 2-in-1
  platform/x86: ideapad-laptop: Fix indentation in DMI table
  platform/x86: ideapad-laptop: Add several models to no_hw_rfkill
  platform/x86: ideapad-laptop: Add IdeaPad V510-15IKB to no_hw_rfkill
  platform/x86: intel_telemetry: Add debugfs entry for S0ix residency
  platform/x86: intel_telemetry_debugfs: fix some error codes in init
  platform/x86: intel_telemetry_debugfs: fix oops when load/unload module

drivers/platform/x86/alienware-wmi.c
drivers/platform/x86/asus-wmi.c
drivers/platform/x86/compal-laptop.c
drivers/platform/x86/fujitsu-laptop.c
drivers/platform/x86/ideapad-laptop.c
drivers/platform/x86/intel_telemetry_debugfs.c
drivers/platform/x86/panasonic-laptop.c
drivers/platform/x86/peaq-wmi.c
drivers/platform/x86/samsung-laptop.c
drivers/platform/x86/silead_dmi.c
drivers/platform/x86/toshiba_acpi.c

index 9866fec78c1c93138934967f1309014dfae89390..0831b428c217549f6d42a6d1543d4ed0cb539535 100644 (file)
@@ -604,7 +604,7 @@ static struct attribute *hdmi_attrs[] = {
        NULL,
 };
 
-static struct attribute_group hdmi_attribute_group = {
+static const struct attribute_group hdmi_attribute_group = {
        .name = "hdmi",
        .attrs = hdmi_attrs,
 };
@@ -660,7 +660,7 @@ static struct attribute *amplifier_attrs[] = {
        NULL,
 };
 
-static struct attribute_group amplifier_attribute_group = {
+static const struct attribute_group amplifier_attribute_group = {
        .name = "amplifier",
        .attrs = amplifier_attrs,
 };
@@ -741,7 +741,7 @@ static struct attribute *deepsleep_attrs[] = {
        NULL,
 };
 
-static struct attribute_group deepsleep_attribute_group = {
+static const struct attribute_group deepsleep_attribute_group = {
        .name = "deepsleep",
        .attrs = deepsleep_attrs,
 };
index 6c7d86074b38409ca726e28d069c39741d795eac..709e3a67391a0b5e79dd5e55e57c4012823a0687 100644 (file)
@@ -1433,7 +1433,7 @@ static umode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj,
        return ok ? attr->mode : 0;
 }
 
-static struct attribute_group hwmon_attribute_group = {
+static const struct attribute_group hwmon_attribute_group = {
        .is_visible = asus_hwmon_sysfs_is_visible,
        .attrs = hwmon_attributes
 };
@@ -1821,7 +1821,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
        return ok ? attr->mode : 0;
 }
 
-static struct attribute_group platform_attribute_group = {
+static const struct attribute_group platform_attribute_group = {
        .is_visible = asus_sysfs_is_visible,
        .attrs = platform_attributes
 };
index e1c2b6d4b24ab5959d816dc1cc772678c42dccb3..a8e4a539e704e2f85c8adb2193b12fd457575a84 100644 (file)
@@ -718,7 +718,7 @@ static struct attribute *compal_platform_attrs[] = {
        &dev_attr_wake_up_mouse.attr,
        NULL
 };
-static struct attribute_group compal_platform_attr_group = {
+static const struct attribute_group compal_platform_attr_group = {
        .attrs = compal_platform_attrs
 };
 
index c1a852847d02671eecdf0255bf6bcd1442a7fded..85de30f93a9cc45c1fe0d634c7f687947e1a39bb 100644 (file)
@@ -317,7 +317,7 @@ static struct attribute *fujitsu_pf_attributes[] = {
        NULL
 };
 
-static struct attribute_group fujitsu_pf_attribute_group = {
+static const struct attribute_group fujitsu_pf_attribute_group = {
        .attrs = fujitsu_pf_attributes
 };
 
@@ -695,6 +695,9 @@ static int acpi_fujitsu_laptop_leds_register(struct acpi_device *device)
        if (call_fext_func(device,
                           FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) {
                led = devm_kzalloc(&device->dev, sizeof(*led), GFP_KERNEL);
+               if (!led)
+                       return -ENOMEM;
+
                led->name = "fujitsu::logolamp";
                led->brightness_set_blocking = logolamp_set;
                led->brightness_get = logolamp_get;
@@ -707,6 +710,9 @@ static int acpi_fujitsu_laptop_leds_register(struct acpi_device *device)
                            FUNC_LEDS, 0x0, 0x0, 0x0) & KEYBOARD_LAMPS) &&
            (call_fext_func(device, FUNC_BUTTONS, 0x0, 0x0, 0x0) == 0x0)) {
                led = devm_kzalloc(&device->dev, sizeof(*led), GFP_KERNEL);
+               if (!led)
+                       return -ENOMEM;
+
                led->name = "fujitsu::kblamps";
                led->brightness_set_blocking = kblamps_set;
                led->brightness_get = kblamps_get;
@@ -723,6 +729,9 @@ static int acpi_fujitsu_laptop_leds_register(struct acpi_device *device)
         */
        if (call_fext_func(device, FUNC_BUTTONS, 0x0, 0x0, 0x0) & BIT(24)) {
                led = devm_kzalloc(&device->dev, sizeof(*led), GFP_KERNEL);
+               if (!led)
+                       return -ENOMEM;
+
                led->name = "fujitsu::radio_led";
                led->brightness_set_blocking = radio_led_set;
                led->brightness_get = radio_led_get;
@@ -741,6 +750,9 @@ static int acpi_fujitsu_laptop_leds_register(struct acpi_device *device)
            (call_fext_func(device,
                            FUNC_LEDS, 0x2, ECO_LED, 0x0) != UNSUPPORTED_CMD)) {
                led = devm_kzalloc(&device->dev, sizeof(*led), GFP_KERNEL);
+               if (!led)
+                       return -ENOMEM;
+
                led->name = "fujitsu::eco_led";
                led->brightness_set_blocking = eco_led_set;
                led->brightness_get = eco_led_get;
index 527e5d9ab9bf80791920214333e2a898aafe025a..603fc60509713dc818b5612d7b8f6eb6238a53dd 100644 (file)
@@ -908,18 +908,95 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
                        DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo G50-30"),
                },
        },
+       {
+               .ident = "Lenovo V310-14IKB",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-14IKB"),
+               },
+       },
+       {
+               .ident = "Lenovo V310-14ISK",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-14ISK"),
+               },
+       },
+       {
+               .ident = "Lenovo V310-15IKB",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-15IKB"),
+               },
+       },
        {
                .ident = "Lenovo V310-15ISK",
                .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-15ISK"),
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-15ISK"),
+               },
+       },
+       {
+               .ident = "Lenovo V510-15IKB",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V510-15IKB"),
+               },
+       },
+       {
+               .ident = "Lenovo ideapad 300-15IBR",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 300-15IBR"),
+               },
+       },
+       {
+               .ident = "Lenovo ideapad 300-15IKB",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 300-15IKB"),
+               },
+       },
+       {
+               .ident = "Lenovo ideapad 300S-11IBR",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 300S-11BR"),
+               },
+       },
+       {
+               .ident = "Lenovo ideapad 310-15ABR",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15ABR"),
+               },
+       },
+       {
+               .ident = "Lenovo ideapad 310-15IAP",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15IAP"),
                },
        },
        {
                .ident = "Lenovo ideapad 310-15IKB",
                .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15IKB"),
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15IKB"),
+               },
+       },
+       {
+               .ident = "Lenovo ideapad 310-15ISK",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15ISK"),
+               },
+       },
+       {
+               .ident = "Lenovo ideapad Y700-14ISK",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700-14ISK"),
                },
        },
        {
index 4cc2f4ea0a25043abbfd205465cd3cedeefffa2b..cd21df982abd63bbc85bdc39cc309512fcc6ec9f 100644 (file)
@@ -710,6 +710,24 @@ static const struct file_operations telem_socstate_ops = {
        .release        = single_release,
 };
 
+static int telem_s0ix_res_get(void *data, u64 *val)
+{
+       u64 s0ix_total_res;
+       int ret;
+
+       ret = intel_pmc_s0ix_counter_read(&s0ix_total_res);
+       if (ret) {
+               pr_err("Failed to read S0ix residency");
+               return ret;
+       }
+
+       *val = s0ix_total_res;
+
+       return 0;
+}
+
+DEFINE_DEBUGFS_ATTRIBUTE(telem_s0ix_fops, telem_s0ix_res_get, NULL, "%llu\n");
+
 static int telem_pss_trc_verb_show(struct seq_file *s, void *unused)
 {
        u32 verbosity;
@@ -938,7 +956,7 @@ static struct notifier_block pm_notifier = {
 static int __init telemetry_debugfs_init(void)
 {
        const struct x86_cpu_id *id;
-       int err = -ENOMEM;
+       int err;
        struct dentry *f;
 
        /* Only APL supported for now */
@@ -958,11 +976,10 @@ static int __init telemetry_debugfs_init(void)
 
        register_pm_notifier(&pm_notifier);
 
+       err = -ENOMEM;
        debugfs_conf->telemetry_dbg_dir = debugfs_create_dir("telemetry", NULL);
-       if (!debugfs_conf->telemetry_dbg_dir) {
-               err = -ENOMEM;
+       if (!debugfs_conf->telemetry_dbg_dir)
                goto out_pm;
-       }
 
        f = debugfs_create_file("pss_info", S_IFREG | S_IRUGO,
                                debugfs_conf->telemetry_dbg_dir, NULL,
@@ -988,6 +1005,14 @@ static int __init telemetry_debugfs_init(void)
                goto out;
        }
 
+       f = debugfs_create_file("s0ix_residency_usec", S_IFREG | S_IRUGO,
+                               debugfs_conf->telemetry_dbg_dir,
+                               NULL, &telem_s0ix_fops);
+       if (!f) {
+               pr_err("s0ix_residency_usec debugfs register failed\n");
+               goto out;
+       }
+
        f = debugfs_create_file("pss_trace_verbosity", S_IFREG | S_IRUGO,
                                debugfs_conf->telemetry_dbg_dir, NULL,
                                &telem_pss_trc_verb_ops);
index 76b0a58e205ba49c735ec6b93805ad6bf9956b11..5c39b3211709bca675216625786bf3967e477ba9 100644 (file)
@@ -437,7 +437,7 @@ static struct attribute *pcc_sysfs_entries[] = {
        NULL,
 };
 
-static struct attribute_group pcc_attr_group = {
+static const struct attribute_group pcc_attr_group = {
        .name   = NULL,         /* put in device directory */
        .attrs  = pcc_sysfs_entries,
 };
index ca75b4dc437e21f2d36fdd2614a065b060dc8dce..77d1f90b079426dfc4f7cb708c19e09b103fed25 100644 (file)
@@ -51,7 +51,7 @@ static void peaq_wmi_poll(struct input_polled_dev *dev)
                return;
        }
 
-       if (peaq_ignore_events_counter && --peaq_ignore_events_counter > 0)
+       if (peaq_ignore_events_counter && --peaq_ignore_events_counter >= 0)
                return;
 
        if (obj.integer.value) {
index 5c4dfe48f03d2bbdf7491a6b91d6b06a245e41ad..0c703feaeb88feb80b5c904481d25222a6b7d801 100644 (file)
@@ -1232,7 +1232,7 @@ static umode_t samsung_sysfs_is_visible(struct kobject *kobj,
        return ok ? attr->mode : 0;
 }
 
-static struct attribute_group platform_attribute_group = {
+static const struct attribute_group platform_attribute_group = {
        .is_visible = samsung_sysfs_is_visible,
        .attrs = platform_attributes
 };
index 3cd3bdfe51df3cc8297d8a22ce699b2a23e3eb13..1157a7b646d66c17682e985eb22d81e6bea7ab45 100644 (file)
@@ -122,6 +122,20 @@ static const struct silead_ts_dmi_data pov_mobii_wintab_p800w_data = {
        .properties     = pov_mobii_wintab_p800w_props,
 };
 
+static const struct property_entry itworks_tw891_props[] = {
+       PROPERTY_ENTRY_U32("touchscreen-size-x", 1600),
+       PROPERTY_ENTRY_U32("touchscreen-size-y", 890),
+       PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
+       PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
+       PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-itworks-tw891.fw"),
+       { }
+};
+
+static const struct silead_ts_dmi_data itworks_tw891_data = {
+       .acpi_name      = "MSSL1680:00",
+       .properties     = itworks_tw891_props,
+};
+
 static const struct dmi_system_id silead_ts_dmi_table[] = {
        {
                /* CUBE iwork8 Air */
@@ -159,6 +173,16 @@ static const struct dmi_system_id silead_ts_dmi_table[] = {
                        DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA04"),
                },
        },
+       {
+               /* Ployer Momo7w (same hardware as the Trekstor ST70416-6) */
+               .driver_data = (void *)&surftab_wintron70_st70416_6_data,
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Shenzhen PLOYER"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "MOMO7W"),
+                       /* Exact match, different versions need different fw */
+                       DMI_MATCH(DMI_BIOS_VERSION, "MOMO.G.WI71C.MABMRBA02"),
+               },
+       },
        {
                /* GP-electronic T701 */
                .driver_data = (void *)&gp_electronic_t701_data,
@@ -187,6 +211,14 @@ static const struct dmi_system_id silead_ts_dmi_table[] = {
                        DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"),
                },
        },
+       {
+               /* I.T.Works TW891 */
+               .driver_data = (void *)&itworks_tw891_data,
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "TW891"),
+               },
+       },
        { },
 };
 
index 88f9f79a7cf605ce6d8624d4f3f6826854cf0796..bb1dcd7fbdeb81902f8b9a395569d1101c342fae 100644 (file)
@@ -2419,7 +2419,7 @@ static umode_t toshiba_sysfs_is_visible(struct kobject *kobj,
        return exists ? attr->mode : 0;
 }
 
-static struct attribute_group toshiba_attr_group = {
+static const struct attribute_group toshiba_attr_group = {
        .is_visible = toshiba_sysfs_is_visible,
        .attrs = toshiba_attributes,
 };