Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'platform-drivers-x86-v4.6-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver fixes from Darren Hart:
"An S4 fix for intel-hid, new platform 'quirk' for hp_accel, a fix for
broader support of ACPI resources for the Intel P-unit, and a few
uninitialized variable fixes.

intel p-unit:
- decouple telemetry driver from the optional IPC resources

thinkpad_acpi:
- Silence an uninitialized variable warning

intel_telemetry_pltdrv:
- Silence an uninitialized variable warning

hp_accel:
- Silence an uninitialized variable warning
- Add support for HP ProBook 440 G3

intel-hid:
- add a workaround to ignore an event after waking up from S4"

* tag 'platform-drivers-x86-v4.6-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
platform:x86 decouple telemetry driver from the optional IPC resources
thinkpad_acpi: Silence an uninitialized variable warning
intel_telemetry_pltdrv: Silence an uninitialized variable warning
hp_accel: Silence an uninitialized variable warning
hp_accel: Add support for HP ProBook 440 G3
intel-hid: add a workaround to ignore an event after waking up from S4.

+65 -45
+5 -1
drivers/platform/x86/hp_accel.c
··· 127 127 arg0.integer.value = reg; 128 128 129 129 status = acpi_evaluate_integer(dev->handle, "ALRD", &args, &lret); 130 + if (ACPI_FAILURE(status)) 131 + return -EINVAL; 130 132 *ret = lret; 131 - return (status != AE_OK) ? -EINVAL : 0; 133 + return 0; 132 134 } 133 135 134 136 /** ··· 175 173 DEFINE_CONV(normal, 1, 2, 3); 176 174 DEFINE_CONV(y_inverted, 1, -2, 3); 177 175 DEFINE_CONV(x_inverted, -1, 2, 3); 176 + DEFINE_CONV(x_inverted_usd, -1, 2, -3); 178 177 DEFINE_CONV(z_inverted, 1, 2, -3); 179 178 DEFINE_CONV(xy_swap, 2, 1, 3); 180 179 DEFINE_CONV(xy_rotated_left, -2, 1, 3); ··· 239 236 AXIS_DMI_MATCH("HP8710", "HP Compaq 8710", y_inverted), 240 237 AXIS_DMI_MATCH("HDX18", "HP HDX 18", x_inverted), 241 238 AXIS_DMI_MATCH("HPB432x", "HP ProBook 432", xy_rotated_left), 239 + AXIS_DMI_MATCH("HPB440G3", "HP ProBook 440 G3", x_inverted_usd), 242 240 AXIS_DMI_MATCH("HPB442x", "HP ProBook 442", xy_rotated_left), 243 241 AXIS_DMI_MATCH("HPB452x", "HP ProBook 452", y_inverted), 244 242 AXIS_DMI_MATCH("HPB522x", "HP ProBook 522", xy_swap),
+2
drivers/platform/x86/intel-hid.c
··· 91 91 } 92 92 93 93 static const struct dev_pm_ops intel_hid_pl_pm_ops = { 94 + .freeze = intel_hid_pl_suspend_handler, 95 + .restore = intel_hid_pl_resume_handler, 94 96 .suspend = intel_hid_pl_suspend_handler, 95 97 .resume = intel_hid_pl_resume_handler, 96 98 };
+22 -26
drivers/platform/x86/intel_pmc_ipc.c
··· 687 687 ipcdev.acpi_io_size = size; 688 688 dev_info(&pdev->dev, "io res: %pR\n", res); 689 689 690 - /* This is index 0 to cover BIOS data register */ 691 690 punit_res = punit_res_array; 691 + /* This is index 0 to cover BIOS data register */ 692 692 res = platform_get_resource(pdev, IORESOURCE_MEM, 693 693 PLAT_RESOURCE_BIOS_DATA_INDEX); 694 694 if (!res) { ··· 698 698 *punit_res = *res; 699 699 dev_info(&pdev->dev, "punit BIOS data res: %pR\n", res); 700 700 701 + /* This is index 1 to cover BIOS interface register */ 701 702 res = platform_get_resource(pdev, IORESOURCE_MEM, 702 703 PLAT_RESOURCE_BIOS_IFACE_INDEX); 703 704 if (!res) { 704 705 dev_err(&pdev->dev, "Failed to get res of punit BIOS iface\n"); 705 706 return -ENXIO; 706 707 } 707 - /* This is index 1 to cover BIOS interface register */ 708 708 *++punit_res = *res; 709 709 dev_info(&pdev->dev, "punit BIOS interface res: %pR\n", res); 710 710 711 + /* This is index 2 to cover ISP data register, optional */ 711 712 res = platform_get_resource(pdev, IORESOURCE_MEM, 712 713 PLAT_RESOURCE_ISP_DATA_INDEX); 713 - if (!res) { 714 - dev_err(&pdev->dev, "Failed to get res of punit ISP data\n"); 715 - return -ENXIO; 714 + ++punit_res; 715 + if (res) { 716 + *punit_res = *res; 717 + dev_info(&pdev->dev, "punit ISP data res: %pR\n", res); 716 718 } 717 - /* This is index 2 to cover ISP data register */ 718 - *++punit_res = *res; 719 - dev_info(&pdev->dev, "punit ISP data res: %pR\n", res); 720 719 720 + /* This is index 3 to cover ISP interface register, optional */ 721 721 res = platform_get_resource(pdev, IORESOURCE_MEM, 722 722 PLAT_RESOURCE_ISP_IFACE_INDEX); 723 - if (!res) { 724 - dev_err(&pdev->dev, "Failed to get res of punit ISP iface\n"); 725 - return -ENXIO; 723 + ++punit_res; 724 + if (res) { 725 + *punit_res = *res; 726 + dev_info(&pdev->dev, "punit ISP interface res: %pR\n", res); 726 727 } 727 - /* This is index 3 to cover ISP interface register */ 728 - *++punit_res = *res; 729 - dev_info(&pdev->dev, "punit ISP interface res: %pR\n", res); 730 728 729 + /* This is index 4 to cover GTD data register, optional */ 731 730 res = platform_get_resource(pdev, IORESOURCE_MEM, 732 731 PLAT_RESOURCE_GTD_DATA_INDEX); 733 - if (!res) { 734 - dev_err(&pdev->dev, "Failed to get res of punit GTD data\n"); 735 - return -ENXIO; 732 + ++punit_res; 733 + if (res) { 734 + *punit_res = *res; 735 + dev_info(&pdev->dev, "punit GTD data res: %pR\n", res); 736 736 } 737 - /* This is index 4 to cover GTD data register */ 738 - *++punit_res = *res; 739 - dev_info(&pdev->dev, "punit GTD data res: %pR\n", res); 740 737 738 + /* This is index 5 to cover GTD interface register, optional */ 741 739 res = platform_get_resource(pdev, IORESOURCE_MEM, 742 740 PLAT_RESOURCE_GTD_IFACE_INDEX); 743 - if (!res) { 744 - dev_err(&pdev->dev, "Failed to get res of punit GTD iface\n"); 745 - return -ENXIO; 741 + ++punit_res; 742 + if (res) { 743 + *punit_res = *res; 744 + dev_info(&pdev->dev, "punit GTD interface res: %pR\n", res); 746 745 } 747 - /* This is index 5 to cover GTD interface register */ 748 - *++punit_res = *res; 749 - dev_info(&pdev->dev, "punit GTD interface res: %pR\n", res); 750 746 751 747 res = platform_get_resource(pdev, IORESOURCE_MEM, 752 748 PLAT_RESOURCE_IPC_INDEX);
+32 -16
drivers/platform/x86/intel_punit_ipc.c
··· 227 227 struct resource *res; 228 228 void __iomem *addr; 229 229 230 + /* 231 + * The following resources are required 232 + * - BIOS_IPC BASE_DATA 233 + * - BIOS_IPC BASE_IFACE 234 + */ 230 235 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 231 236 addr = devm_ioremap_resource(&pdev->dev, res); 232 237 if (IS_ERR(addr)) ··· 244 239 return PTR_ERR(addr); 245 240 punit_ipcdev->base[BIOS_IPC][BASE_IFACE] = addr; 246 241 242 + /* 243 + * The following resources are optional 244 + * - ISPDRIVER_IPC BASE_DATA 245 + * - ISPDRIVER_IPC BASE_IFACE 246 + * - GTDRIVER_IPC BASE_DATA 247 + * - GTDRIVER_IPC BASE_IFACE 248 + */ 247 249 res = platform_get_resource(pdev, IORESOURCE_MEM, 2); 248 - addr = devm_ioremap_resource(&pdev->dev, res); 249 - if (IS_ERR(addr)) 250 - return PTR_ERR(addr); 251 - punit_ipcdev->base[ISPDRIVER_IPC][BASE_DATA] = addr; 250 + if (res) { 251 + addr = devm_ioremap_resource(&pdev->dev, res); 252 + if (!IS_ERR(addr)) 253 + punit_ipcdev->base[ISPDRIVER_IPC][BASE_DATA] = addr; 254 + } 252 255 253 256 res = platform_get_resource(pdev, IORESOURCE_MEM, 3); 254 - addr = devm_ioremap_resource(&pdev->dev, res); 255 - if (IS_ERR(addr)) 256 - return PTR_ERR(addr); 257 - punit_ipcdev->base[ISPDRIVER_IPC][BASE_IFACE] = addr; 257 + if (res) { 258 + addr = devm_ioremap_resource(&pdev->dev, res); 259 + if (!IS_ERR(addr)) 260 + punit_ipcdev->base[ISPDRIVER_IPC][BASE_IFACE] = addr; 261 + } 258 262 259 263 res = platform_get_resource(pdev, IORESOURCE_MEM, 4); 260 - addr = devm_ioremap_resource(&pdev->dev, res); 261 - if (IS_ERR(addr)) 262 - return PTR_ERR(addr); 263 - punit_ipcdev->base[GTDRIVER_IPC][BASE_DATA] = addr; 264 + if (res) { 265 + addr = devm_ioremap_resource(&pdev->dev, res); 266 + if (!IS_ERR(addr)) 267 + punit_ipcdev->base[GTDRIVER_IPC][BASE_DATA] = addr; 268 + } 264 269 265 270 res = platform_get_resource(pdev, IORESOURCE_MEM, 5); 266 - addr = devm_ioremap_resource(&pdev->dev, res); 267 - if (IS_ERR(addr)) 268 - return PTR_ERR(addr); 269 - punit_ipcdev->base[GTDRIVER_IPC][BASE_IFACE] = addr; 271 + if (res) { 272 + addr = devm_ioremap_resource(&pdev->dev, res); 273 + if (!IS_ERR(addr)) 274 + punit_ipcdev->base[GTDRIVER_IPC][BASE_IFACE] = addr; 275 + } 270 276 271 277 return 0; 272 278 }
+1 -1
drivers/platform/x86/intel_telemetry_pltdrv.c
··· 659 659 static int telemetry_plt_set_sampling_period(u8 pss_period, u8 ioss_period) 660 660 { 661 661 u32 telem_ctrl = 0; 662 - int ret; 662 + int ret = 0; 663 663 664 664 mutex_lock(&(telm_conf->telem_lock)); 665 665 if (ioss_period) {
+3 -1
drivers/platform/x86/thinkpad_acpi.c
··· 7972 7972 fan_update_desired_level(s); 7973 7973 mutex_unlock(&fan_mutex); 7974 7974 7975 + if (rc) 7976 + return rc; 7975 7977 if (status) 7976 7978 *status = s; 7977 7979 7978 - return rc; 7980 + return 0; 7979 7981 } 7980 7982 7981 7983 static int fan_get_speed(unsigned int *speed)