summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/amd/hsmp/hsmp.h
AgeCommit message (Collapse)Author
2024-10-25platform/x86/amd/hsmp: Make hsmp_pdev static instead of globalSuma Hegde
Instead of making hsmp_pdev global and exporting this symbol from hsmp.c, make it static and create a wrapper function get_hsmp_pdev() to access hsmp_pdev from plat.c and acpi.c. Signed-off-by: Suma Hegde <suma.hegde@amd.com> Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Link: https://lore.kernel.org/r/20241021111428.2676884-11-suma.hegde@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2024-10-25platform/x86/amd/hsmp: Use dev_groups in the driver structureSuma Hegde
Move out of device_add_group() variants, instead assign static array of attribute groups to .dev_groups in platform_driver structure. Then use is_visible to enable only the necessary files on the platform. .read() and .is_bin_visibile() have slightly different implemetations on ACPI and non-ACPI system, so move them to respective files. Signed-off-by: Suma Hegde <suma.hegde@amd.com> Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Link: https://lore.kernel.org/r/20241021111428.2676884-10-suma.hegde@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2024-10-25platform/x86/amd/hsmp: Create separate ACPI, plat and common driversSuma Hegde
Separate the probes for HSMP ACPI and platform device drivers. Provide a Kconfig option to choose between ACPI or the platform device based driver. The common code which is the core part of the HSMP driver maintained at hsmp.c is guarded by AMD_HSMP config and is selected by these two driver configs. This will be built into separate hsmp_common.ko module and acpi as hsmp_acpi and plat as amd_hsmp respectively. Also add "|| COMPILE_TEST" clause in Kconfig to get build coverage for HSMP. Signed-off-by: Suma Hegde <suma.hegde@amd.com> Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Link: https://lore.kernel.org/r/20241021111428.2676884-8-suma.hegde@amd.com [ij: Fixed doc to use pre-formatted text for the ACPI dump.] Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2024-10-22platform/x86/amd/hsmp: Change generic plat_dev name to hsmp_pdevSuma Hegde
plat_dev is a commonly used variable name, since its made as extern now, change it to more specific name. Also change miscdevice hsmp_device to mdev. Signed-off-by: Suma Hegde <suma.hegde@amd.com> Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20241021111428.2676884-7-suma.hegde@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2024-10-22platform/x86/amd/hsmp: Move ACPI code to acpi.cSuma Hegde
An upcoming change splits HSMP driver into ACPI and platform device variants. Prepare for the split by moving ACPI related code to acpi.c from hsmp.c. Common code is kept in hsmp.c. No logical/functional change. We still have one driver at this point, the driver probe will be split in the next patch. Signed-off-by: Suma Hegde <suma.hegde@amd.com> Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20241021111428.2676884-6-suma.hegde@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2024-10-22platform/x86/amd/hsmp: Move platform device specific code to plat.cSuma Hegde
An upcoming change splits HSMP driver into ACPI and platform device variants. Prepare for the split by moving platform device part to plat.c. No functinality/logical changes. Common code which can be used by ACPI and platform device remains in hsmp.c. ACPI code in hsmp.c will be moved to acpi.c in next patch. Signed-off-by: Suma Hegde <suma.hegde@amd.com> Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20241021111428.2676884-5-suma.hegde@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2024-10-22platform/x86/amd/hsmp: Move structure and macros to header fileSuma Hegde
This is in preparation to splitting ACPI and platform device drivers. No logical change, move common structures, macros to hsmp.h, add missed header files, remove unwanted header inclusions, and re-order the header file in hsmp.c file. Signed-off-by: Suma Hegde <suma.hegde@amd.com> Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20241021111428.2676884-4-suma.hegde@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>