mb/google/brya: Switch to using device pointers using alias names
This change replaces the device tree walks with device pointers by adding alias for dptf_policy generic device in the tree. Change-Id: I8fd5476a9cea84ab8b2678167b3e0504eecacf6c Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/57739 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
@@ -11,18 +11,14 @@
|
|||||||
|
|
||||||
#define MILLIWATTS_TO_WATTS 1000
|
#define MILLIWATTS_TO_WATTS 1000
|
||||||
|
|
||||||
|
WEAK_DEV_PTR(dptf_policy);
|
||||||
|
|
||||||
void variant_update_power_limits(const struct cpu_power_limits *limits, size_t num_entries)
|
void variant_update_power_limits(const struct cpu_power_limits *limits, size_t num_entries)
|
||||||
{
|
{
|
||||||
if (!num_entries)
|
if (!num_entries)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const struct device_path policy_path[] = {
|
const struct device *policy_dev = DEV_PTR(dptf_policy);
|
||||||
{ .type = DEVICE_PATH_PCI, .pci.devfn = SA_DEVFN_DPTF},
|
|
||||||
{ .type = DEVICE_PATH_GENERIC, .generic.id = 0}
|
|
||||||
};
|
|
||||||
|
|
||||||
const struct device *policy_dev = find_dev_nested_path(pci_root_bus(),
|
|
||||||
policy_path, ARRAY_SIZE(policy_path));
|
|
||||||
if (!policy_dev)
|
if (!policy_dev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -137,7 +137,7 @@ chip soc/intel/alderlake
|
|||||||
register "options.fan.fine_grained_control" = "1"
|
register "options.fan.fine_grained_control" = "1"
|
||||||
register "options.fan.step_size" = "2"
|
register "options.fan.step_size" = "2"
|
||||||
|
|
||||||
device generic 0 on end
|
device generic 0 alias dptf_policy on end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
device ref ipu on
|
device ref ipu on
|
||||||
|
@@ -72,7 +72,7 @@ chip soc/intel/alderlake
|
|||||||
[2] = { 16, 1000 },
|
[2] = { 16, 1000 },
|
||||||
[3] = { 8, 500 }
|
[3] = { 8, 500 }
|
||||||
}"
|
}"
|
||||||
device generic 0 on end
|
device generic 0 alias dptf_policy on end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
device ref cnvi_wifi on
|
device ref cnvi_wifi on
|
||||||
|
@@ -100,7 +100,7 @@ chip soc/intel/alderlake
|
|||||||
register "options.fan.fine_grained_control" = "1"
|
register "options.fan.fine_grained_control" = "1"
|
||||||
register "options.fan.step_size" = "2"
|
register "options.fan.step_size" = "2"
|
||||||
|
|
||||||
device generic 0 on end
|
device generic 0 alias dptf_policy on end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
device ref ipu on
|
device ref ipu on
|
||||||
|
@@ -107,7 +107,7 @@ chip soc/intel/alderlake
|
|||||||
[2] = { 16, 1000 },
|
[2] = { 16, 1000 },
|
||||||
[3] = { 8, 500 }
|
[3] = { 8, 500 }
|
||||||
}"
|
}"
|
||||||
device generic 0 on end
|
device generic 0 alias dptf_policy on end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
device ref cnvi_wifi on
|
device ref cnvi_wifi on
|
||||||
|
@@ -113,7 +113,7 @@ chip soc/intel/alderlake
|
|||||||
[2] = { 16, 1000 },
|
[2] = { 16, 1000 },
|
||||||
[3] = { 8, 500 }
|
[3] = { 8, 500 }
|
||||||
}"
|
}"
|
||||||
device generic 0 on end
|
device generic 0 alias dptf_policy on end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
device ref ipu on
|
device ref ipu on
|
||||||
|
Reference in New Issue
Block a user