Skip to content

Commit

Permalink
Merge tag 'acpi-5.17-rc1-3' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/rafael/linux-pm

Pull extra ACPI updates from Rafael Wysocki:
 "These fix and clean up the ACPI CPPC driver on top of the recent
  changes in it merged previously and add some new device IDs to the
  ACPI DPTF driver.

  Specifics:

   - Fix a recently introduced endianness-related issue in the ACPI CPPC
     library and clean it up on top of that (Rafael Wysocki)

   - Add new device IDs for the Raptor Lake SoC to the ACPI DPTF driver
     (Srinivas Pandruvada)"

* tag 'acpi-5.17-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: DPTF: Support Raptor Lake
  ACPI: CPPC: Drop redundant local variable from cpc_read()
  ACPI: CPPC: Fix up I/O port access in cpc_read()
  • Loading branch information
Linus Torvalds committed Jan 22, 2022
2 parents 0809edb + f6f0204 commit 71f1b91
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/acpi/cppc_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,30 +915,31 @@ int __weak cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val)

static int cpc_read(int cpu, struct cpc_register_resource *reg_res, u64 *val)
{
int ret_val = 0;
void __iomem *vaddr = NULL;
int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu);
struct cpc_reg *reg = &reg_res->cpc_entry.reg;

if (reg_res->type == ACPI_TYPE_INTEGER) {
*val = reg_res->cpc_entry.int_value;
return ret_val;
return 0;
}

*val = 0;

if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
u32 width = 8 << (reg->access_width - 1);
u32 val_u32;
acpi_status status;

status = acpi_os_read_port((acpi_io_address)reg->address,
(u32 *)val, width);
&val_u32, width);
if (ACPI_FAILURE(status)) {
pr_debug("Error: Failed to read SystemIO port %llx\n",
reg->address);
return -EFAULT;
}

*val = val_u32;
return 0;
} else if (reg->space_id == ACPI_ADR_SPACE_PLATFORM_COMM && pcc_ss_id >= 0)
vaddr = GET_PCC_VADDR(reg->address, pcc_ss_id);
Expand Down Expand Up @@ -966,10 +967,10 @@ static int cpc_read(int cpu, struct cpc_register_resource *reg_res, u64 *val)
default:
pr_debug("Error: Cannot read %u bit width from PCC for ss: %d\n",
reg->bit_width, pcc_ss_id);
ret_val = -EFAULT;
return -EFAULT;
}

return ret_val;
return 0;
}

static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/dptf/dptf_pch_fivr.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ static int pch_fivr_remove(struct platform_device *pdev)
static const struct acpi_device_id pch_fivr_device_ids[] = {
{"INTC1045", 0},
{"INTC1049", 0},
{"INTC10A3", 0},
{"", 0},
};
MODULE_DEVICE_TABLE(acpi, pch_fivr_device_ids);
Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/dptf/dptf_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ static const struct acpi_device_id int3407_device_ids[] = {
{"INTC1050", 0},
{"INTC1060", 0},
{"INTC1061", 0},
{"INTC10A4", 0},
{"INTC10A5", 0},
{"", 0},
};
MODULE_DEVICE_TABLE(acpi, int3407_device_ids);
Expand Down
6 changes: 6 additions & 0 deletions drivers/acpi/dptf/int340x_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ static const struct acpi_device_id int340x_thermal_device_ids[] = {
{"INTC1050"},
{"INTC1060"},
{"INTC1061"},
{"INTC10A0"},
{"INTC10A1"},
{"INTC10A2"},
{"INTC10A3"},
{"INTC10A4"},
{"INTC10A5"},
{""},
};

Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/fan.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
{"INT3404", }, /* Fan */ \
{"INTC1044", }, /* Fan for Tiger Lake generation */ \
{"INTC1048", }, /* Fan for Alder Lake generation */ \
{"INTC10A2", }, /* Fan for Raptor Lake generation */ \
{"PNP0C0B", } /* Generic ACPI fan */

0 comments on commit 71f1b91

Please sign in to comment.