Skip to content

Commit 7dfe984

Browse files
spandruvadarafaeljw
authored andcommitted
thermal: intel: int340x: soc_slider: Set offset only for balanced mode
The slider offset can be set via debugfs for balanced mode. The offset should be only applicable in balanced mode. For other modes, it should be 0 when writing to MMIO offset, Fixes: 8306bca ("thermal: intel: int340x: Add module parameter to change slider offset") Tested-by: Erin Park <[email protected]> Signed-off-by: Srinivas Pandruvada <[email protected]> Cc: 6.18+ <[email protected]> # 6.18+ [ rjw: Subject and changelog tweaks ] Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent c369299 commit 7dfe984

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/thermal/intel/int340x_thermal/processor_thermal_soc_slider.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,21 @@ static inline void write_soc_slider(struct proc_thermal_device *proc_priv, u64 v
176176

177177
static void set_soc_power_profile(struct proc_thermal_device *proc_priv, int slider)
178178
{
179+
u8 offset;
179180
u64 val;
180181

181182
val = read_soc_slider(proc_priv);
182183
val &= ~SLIDER_MASK;
183184
val |= FIELD_PREP(SLIDER_MASK, slider) | BIT(SLIDER_ENABLE_BIT);
184185

186+
if (slider == SOC_SLIDER_VALUE_MINIMUM || slider == SOC_SLIDER_VALUE_MAXIMUM)
187+
offset = 0;
188+
else
189+
offset = slider_offset;
190+
185191
/* Set the slider offset from module params */
186192
val &= ~SLIDER_OFFSET_MASK;
187-
val |= FIELD_PREP(SLIDER_OFFSET_MASK, slider_offset);
193+
val |= FIELD_PREP(SLIDER_OFFSET_MASK, offset);
188194

189195
write_soc_slider(proc_priv, val);
190196
}

0 commit comments

Comments
 (0)