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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'hwmon-for-v6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

- it87: Fix voltage scaling for chips with 10.9mV ADCs

- xgene: Fix ioremap and memremap leak

- peci/cputemp: Fix miscalculated DTS temperature for SKX

- hwmon core: fix potential sensor registration failure with thermal
subsystem if of_node is missing

* tag 'hwmon-for-v6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon (it87): Fix voltage scaling for chips with 10.9mV ADCs
hwmon: (xgene) Fix ioremap and memremap leak
hwmon: fix potential sensor registration fail if of_node is missing
hwmon: (peci/cputemp) Fix miscalculated DTS for SKX

+22 -11
+5 -2
drivers/hwmon/hwmon.c
··· 757 757 struct hwmon_device *hwdev; 758 758 const char *label; 759 759 struct device *hdev; 760 + struct device *tdev = dev; 760 761 int i, err, id; 761 762 762 763 /* Complain about invalid characters in hwmon name attribute */ ··· 827 826 hwdev->name = name; 828 827 hdev->class = &hwmon_class; 829 828 hdev->parent = dev; 830 - hdev->of_node = dev ? dev->of_node : NULL; 829 + while (tdev && !tdev->of_node) 830 + tdev = tdev->parent; 831 + hdev->of_node = tdev ? tdev->of_node : NULL; 831 832 hwdev->chip = chip; 832 833 dev_set_drvdata(hdev, drvdata); 833 834 dev_set_name(hdev, HWMON_ID_FORMAT, id); ··· 841 838 842 839 INIT_LIST_HEAD(&hwdev->tzdata); 843 840 844 - if (dev && dev->of_node && chip && chip->ops->read && 841 + if (hdev->of_node && chip && chip->ops->read && 845 842 chip->info[0]->type == hwmon_chip && 846 843 (chip->info[0]->config[0] & HWMON_C_REGISTER_TZ)) { 847 844 err = hwmon_thermal_register_sensors(hdev);
+3 -1
drivers/hwmon/it87.c
··· 515 515 #define has_six_temp(data) ((data)->features & FEAT_SIX_TEMP) 516 516 #define has_vin3_5v(data) ((data)->features & FEAT_VIN3_5V) 517 517 #define has_conf_noexit(data) ((data)->features & FEAT_CONF_NOEXIT) 518 + #define has_scaling(data) ((data)->features & (FEAT_12MV_ADC | \ 519 + FEAT_10_9MV_ADC)) 518 520 519 521 struct it87_sio_data { 520 522 int sioaddr; ··· 3136 3134 "Detected broken BIOS defaults, disabling PWM interface\n"); 3137 3135 3138 3136 /* Starting with IT8721F, we handle scaling of internal voltages */ 3139 - if (has_12mv_adc(data)) { 3137 + if (has_scaling(data)) { 3140 3138 if (sio_data->internal & BIT(0)) 3141 3139 data->in_scaled |= BIT(3); /* in3 is AVCC */ 3142 3140 if (sio_data->internal & BIT(1))
+7 -1
drivers/hwmon/peci/cputemp.c
··· 537 537 .thermal_margin_to_millidegree = &dts_eight_dot_eight_to_millidegree, 538 538 }; 539 539 540 + static const struct cpu_info cpu_skx = { 541 + .reg = &resolved_cores_reg_hsx, 542 + .min_peci_revision = 0x33, 543 + .thermal_margin_to_millidegree = &dts_ten_dot_six_to_millidegree, 544 + }; 545 + 540 546 static const struct cpu_info cpu_icx = { 541 547 .reg = &resolved_cores_reg_icx, 542 548 .min_peci_revision = 0x40, ··· 564 558 }, 565 559 { 566 560 .name = "peci_cpu.cputemp.skx", 567 - .driver_data = (kernel_ulong_t)&cpu_hsx, 561 + .driver_data = (kernel_ulong_t)&cpu_skx, 568 562 }, 569 563 { 570 564 .name = "peci_cpu.cputemp.icx",
+7 -7
drivers/hwmon/xgene-hwmon.c
··· 698 698 ctx->comm_base_addr = pcc_chan->shmem_base_addr; 699 699 if (ctx->comm_base_addr) { 700 700 if (version == XGENE_HWMON_V2) 701 - ctx->pcc_comm_addr = (void __force *)ioremap( 702 - ctx->comm_base_addr, 703 - pcc_chan->shmem_size); 701 + ctx->pcc_comm_addr = (void __force *)devm_ioremap(&pdev->dev, 702 + ctx->comm_base_addr, 703 + pcc_chan->shmem_size); 704 704 else 705 - ctx->pcc_comm_addr = memremap( 706 - ctx->comm_base_addr, 707 - pcc_chan->shmem_size, 708 - MEMREMAP_WB); 705 + ctx->pcc_comm_addr = devm_memremap(&pdev->dev, 706 + ctx->comm_base_addr, 707 + pcc_chan->shmem_size, 708 + MEMREMAP_WB); 709 709 } else { 710 710 dev_err(&pdev->dev, "Failed to get PCC comm region\n"); 711 711 rc = -ENODEV;