On Tue, 16 Dec 2025, Krishna Chomal wrote: > On Mon, Dec 15, 2025 at 04:25:17PM +0200, Ilpo Järvinen wrote: > > Thank you for the patch but it looks this approach to add mappings using > > if()s to handle variations should be replaced with something better. > > Thank you for the feedback. I agree that stacking if/else statements for > board variations is not a scalable idea. > > For V2, I plan to refactor this driver to use DMI system ID table's > driver_data field to handle the profile mapping (at least for > victus_s_thermal_profile_boards in this patch). > > The implementation will introduce a `struct thermal_profile_params` to > hold the specific thermal values (Performance/Balanced/Low-Power). Then > I can convert victus_s_thermal_profile_boards from a simple string > array to a `struct dmi_system_id[]` array, where each entry maps a DMI > Board Name to its specific thermal_profile_params via driver_data. > > Then platform_profile_victus_s_set_ec can simply retrieve the correct > parameters via dmi_first_match(), removing the need for nested if()s. > > I feel this restructuring makes the code much cleaner and makes the > thermal profile choice for new boards explicit. Does this plan look like > the right direction for V2? Yes, something along those lines. There's also one similar attempt pending in the patchwork, so this hopefully can solve that case as well: https://patchwork.kernel.org/project/platform-driver-x86/patch/20250731213529.27378-1-noahpro@gmail.com/ Thanks for taking up this task. :-) -- i.