Commit 4bdec23f authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'hwmon-for-v6.3-rc4' of...

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
parents 65aca32e 968b66ff
...@@ -757,6 +757,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, ...@@ -757,6 +757,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
struct hwmon_device *hwdev; struct hwmon_device *hwdev;
const char *label; const char *label;
struct device *hdev; struct device *hdev;
struct device *tdev = dev;
int i, err, id; int i, err, id;
/* Complain about invalid characters in hwmon name attribute */ /* Complain about invalid characters in hwmon name attribute */
...@@ -826,7 +827,9 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, ...@@ -826,7 +827,9 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
hwdev->name = name; hwdev->name = name;
hdev->class = &hwmon_class; hdev->class = &hwmon_class;
hdev->parent = dev; hdev->parent = dev;
hdev->of_node = dev ? dev->of_node : NULL; while (tdev && !tdev->of_node)
tdev = tdev->parent;
hdev->of_node = tdev ? tdev->of_node : NULL;
hwdev->chip = chip; hwdev->chip = chip;
dev_set_drvdata(hdev, drvdata); dev_set_drvdata(hdev, drvdata);
dev_set_name(hdev, HWMON_ID_FORMAT, id); dev_set_name(hdev, HWMON_ID_FORMAT, id);
...@@ -838,7 +841,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata, ...@@ -838,7 +841,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
INIT_LIST_HEAD(&hwdev->tzdata); INIT_LIST_HEAD(&hwdev->tzdata);
if (dev && dev->of_node && chip && chip->ops->read && if (hdev->of_node && chip && chip->ops->read &&
chip->info[0]->type == hwmon_chip && chip->info[0]->type == hwmon_chip &&
(chip->info[0]->config[0] & HWMON_C_REGISTER_TZ)) { (chip->info[0]->config[0] & HWMON_C_REGISTER_TZ)) {
err = hwmon_thermal_register_sensors(hdev); err = hwmon_thermal_register_sensors(hdev);
......
...@@ -515,6 +515,8 @@ static const struct it87_devices it87_devices[] = { ...@@ -515,6 +515,8 @@ static const struct it87_devices it87_devices[] = {
#define has_six_temp(data) ((data)->features & FEAT_SIX_TEMP) #define has_six_temp(data) ((data)->features & FEAT_SIX_TEMP)
#define has_vin3_5v(data) ((data)->features & FEAT_VIN3_5V) #define has_vin3_5v(data) ((data)->features & FEAT_VIN3_5V)
#define has_conf_noexit(data) ((data)->features & FEAT_CONF_NOEXIT) #define has_conf_noexit(data) ((data)->features & FEAT_CONF_NOEXIT)
#define has_scaling(data) ((data)->features & (FEAT_12MV_ADC | \
FEAT_10_9MV_ADC))
struct it87_sio_data { struct it87_sio_data {
int sioaddr; int sioaddr;
...@@ -3134,7 +3136,7 @@ static int it87_probe(struct platform_device *pdev) ...@@ -3134,7 +3136,7 @@ static int it87_probe(struct platform_device *pdev)
"Detected broken BIOS defaults, disabling PWM interface\n"); "Detected broken BIOS defaults, disabling PWM interface\n");
/* Starting with IT8721F, we handle scaling of internal voltages */ /* Starting with IT8721F, we handle scaling of internal voltages */
if (has_12mv_adc(data)) { if (has_scaling(data)) {
if (sio_data->internal & BIT(0)) if (sio_data->internal & BIT(0))
data->in_scaled |= BIT(3); /* in3 is AVCC */ data->in_scaled |= BIT(3); /* in3 is AVCC */
if (sio_data->internal & BIT(1)) if (sio_data->internal & BIT(1))
......
...@@ -537,6 +537,12 @@ static const struct cpu_info cpu_hsx = { ...@@ -537,6 +537,12 @@ static const struct cpu_info cpu_hsx = {
.thermal_margin_to_millidegree = &dts_eight_dot_eight_to_millidegree, .thermal_margin_to_millidegree = &dts_eight_dot_eight_to_millidegree,
}; };
static const struct cpu_info cpu_skx = {
.reg = &resolved_cores_reg_hsx,
.min_peci_revision = 0x33,
.thermal_margin_to_millidegree = &dts_ten_dot_six_to_millidegree,
};
static const struct cpu_info cpu_icx = { static const struct cpu_info cpu_icx = {
.reg = &resolved_cores_reg_icx, .reg = &resolved_cores_reg_icx,
.min_peci_revision = 0x40, .min_peci_revision = 0x40,
...@@ -558,7 +564,7 @@ static const struct auxiliary_device_id peci_cputemp_ids[] = { ...@@ -558,7 +564,7 @@ static const struct auxiliary_device_id peci_cputemp_ids[] = {
}, },
{ {
.name = "peci_cpu.cputemp.skx", .name = "peci_cpu.cputemp.skx",
.driver_data = (kernel_ulong_t)&cpu_hsx, .driver_data = (kernel_ulong_t)&cpu_skx,
}, },
{ {
.name = "peci_cpu.cputemp.icx", .name = "peci_cpu.cputemp.icx",
......
...@@ -698,14 +698,14 @@ static int xgene_hwmon_probe(struct platform_device *pdev) ...@@ -698,14 +698,14 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
ctx->comm_base_addr = pcc_chan->shmem_base_addr; ctx->comm_base_addr = pcc_chan->shmem_base_addr;
if (ctx->comm_base_addr) { if (ctx->comm_base_addr) {
if (version == XGENE_HWMON_V2) if (version == XGENE_HWMON_V2)
ctx->pcc_comm_addr = (void __force *)ioremap( ctx->pcc_comm_addr = (void __force *)devm_ioremap(&pdev->dev,
ctx->comm_base_addr, ctx->comm_base_addr,
pcc_chan->shmem_size); pcc_chan->shmem_size);
else else
ctx->pcc_comm_addr = memremap( ctx->pcc_comm_addr = devm_memremap(&pdev->dev,
ctx->comm_base_addr, ctx->comm_base_addr,
pcc_chan->shmem_size, pcc_chan->shmem_size,
MEMREMAP_WB); MEMREMAP_WB);
} else { } else {
dev_err(&pdev->dev, "Failed to get PCC comm region\n"); dev_err(&pdev->dev, "Failed to get PCC comm region\n");
rc = -ENODEV; rc = -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment