thermal: int340x: processor_thermal: Refactor MMIO interface
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Thu, 26 Nov 2020 17:18:26 +0000 (09:18 -0800)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 10 Dec 2020 11:29:47 +0000 (12:29 +0100)
commita5923b6c3137b9d4fc2ea1c997f6e4d51ac5d774
treed37c3635ee9a69f0da21b92af8b72cdb26551256
parente854da4f51117d7340ec621face92e775bcd4d22
thermal: int340x: processor_thermal: Refactor MMIO interface

The Processor Thermal PCI device supports multiple features. Currently
we export only RAPL. But we need more features from this device exposed
for Tiger Lake and Alder Lake based platforms. So re-structure the
current MMIO interface, so that more features can be added cleanly.

No functional changes are expected with this change.

Changes done in this patch:
- Using PCI_DEVICE_DATA(), hence names of defines changed
- Move RAPL MMIO code to its own module
- Move the RAPL MMIO offsets to RAPL MMIO module
- Adjust Kconfig dependency of PROC_THERMAL_MMIO_RAPL
- Per processor driver data now contains the supported features
- Moved all the common data structures and defines to a common header
  file
- This new header file contains all the processor_thermal_* interfaces
- Based on the features supported the module interface is called
- Each module atleast provides one add and one remove function

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20201126171829.945969-1-srinivas.pandruvada@linux.intel.com
drivers/thermal/intel/int340x_thermal/Kconfig
drivers/thermal/intel/int340x_thermal/Makefile
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
drivers/thermal/intel/int340x_thermal/processor_thermal_device.h [new file with mode: 0644]
drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c [new file with mode: 0644]