thermal/drivers/int340x: processor_thermal: Export mailbox interface
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Mon, 17 May 2021 06:14:40 +0000 (23:14 -0700)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Fri, 11 Jun 2021 09:54:42 +0000 (11:54 +0200)
Export the mailbox interface to be used by other modules. Also change
command id and response from u8 to u32 data type.

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/20210517061441.1921901-2-srinivas.pandruvada@linux.intel.com
drivers/thermal/intel/int340x_thermal/processor_thermal_device.h
drivers/thermal/intel/int340x_thermal/processor_thermal_mbox.c

index b9ed64561aaf131ae73315a2f262c2e26e6a36a3..3161607424f5ebe2b8709ce53ef2f4d1dd76295c 100644 (file)
@@ -79,4 +79,6 @@ void proc_thermal_rfim_remove(struct pci_dev *pdev);
 int proc_thermal_mbox_add(struct pci_dev *pdev, struct proc_thermal_device *proc_priv);
 void proc_thermal_mbox_remove(struct pci_dev *pdev);
 
+int processor_thermal_send_mbox_cmd(struct pci_dev *pdev, u16 cmd_id, u32 cmd_data, u32 *cmd_resp);
+
 #endif
index 990f51f22884b603a1863520e54716da56c5eac4..59e93b04f0a9e119742d567f1958de11236cb997 100644 (file)
@@ -23,7 +23,7 @@
 
 static DEFINE_MUTEX(mbox_lock);
 
-static int send_mbox_cmd(struct pci_dev *pdev, u8 cmd_id, u32 cmd_data, u8 *cmd_resp)
+static int send_mbox_cmd(struct pci_dev *pdev, u16 cmd_id, u32 cmd_data, u32 *cmd_resp)
 {
        struct proc_thermal_device *proc_priv;
        u32 retries, data;
@@ -82,6 +82,12 @@ unlock_mbox:
        return ret;
 }
 
+int processor_thermal_send_mbox_cmd(struct pci_dev *pdev, u16 cmd_id, u32 cmd_data, u32 *cmd_resp)
+{
+       return send_mbox_cmd(pdev, cmd_id, cmd_data, cmd_resp);
+}
+EXPORT_SYMBOL_GPL(processor_thermal_send_mbox_cmd);
+
 /* List of workload types */
 static const char * const workload_types[] = {
        "none",
@@ -147,7 +153,7 @@ static ssize_t workload_type_show(struct device *dev,
                                   char *buf)
 {
        struct pci_dev *pdev = to_pci_dev(dev);
-       u8 cmd_resp;
+       u32 cmd_resp;
        int ret;
 
        ret = send_mbox_cmd(pdev, MBOX_CMD_WORKLOAD_TYPE_READ, 0, &cmd_resp);
@@ -181,7 +187,7 @@ static bool workload_req_created;
 
 int proc_thermal_mbox_add(struct pci_dev *pdev, struct proc_thermal_device *proc_priv)
 {
-       u8 cmd_resp;
+       u32 cmd_resp;
        int ret;
 
        /* Check if there is a mailbox support, if fails return success */