thermal: int340x: processor_thermal: Add interrupt configuration function
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tue, 29 Aug 2023 00:23:41 +0000 (17:23 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 14 Sep 2023 19:52:19 +0000 (21:52 +0200)
commitdd28a3cb92389deb2d5a0ab3e91b97007c8bc366
tree914359fc7d850983e2aed0a8a254992055b20f36
parentb894685cb8e09305b3cb82bc39f2c4a3d154ce3a
thermal: int340x: processor_thermal: Add interrupt configuration function

Some features like workload type prediction and power floor events
require interrupt support to avoid polling. Here interrupts are enabled
and disabled via sending mailbox commands. The mailbox command ID is
0x1E for read and 0x1F for write.

The interrupt configuration will require mutex protection as it involves
read-modify-write operation. Since mutex are already used in the mailbox
read/write functions: send_mbox_write_cmd() and send_mbox_read_cmd(),
there will be double locking. But, this can be avoided by moving mutexes
from mailbox read/write processing functions to the callers:
processor_thermal_send_mbox_[read|write]_cmd().

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[ rjw: Adjust subject, fix up computation ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/intel/int340x_thermal/processor_thermal_device.h
drivers/thermal/intel/int340x_thermal/processor_thermal_mbox.c