diff options
author | M Chetan Kumar <m.chetan.kumar@linux.intel.com> | 2023-06-08 15:38:03 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-06-12 08:49:22 +0100 |
commit | e4f5073d53be6cec0c654fac98372047efb66947 (patch) | |
tree | 83f840663aead369c60bf90ab31a17b20d979c80 /drivers/net/wwan/iosm/iosm_ipc_trace.c | |
parent | cbb1ca6d5f9a5a4972c4466a4b61e5bed1f4690f (diff) |
net: wwan: iosm: enable runtime pm support for 7560
Adds runtime pm support for 7560.
As part of probe procedure auto suspend is enabled and auto suspend
delay is set to 5000 ms for runtime pm use. Later auto flag is set
to power manage the device at run time.
On successful communication establishment between host and device the
device usage counter is dropped and request to put the device into
sleep state (suspend).
In TX path, the device usage counter is raised and device is moved out
of sleep(resume) for data transmission. In RX path, if the device has
some data to be sent it request host platform to change the power state
by giving PCI PME message.
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wwan/iosm/iosm_ipc_trace.c')
-rw-r--r-- | drivers/net/wwan/iosm/iosm_ipc_trace.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wwan/iosm/iosm_ipc_trace.c b/drivers/net/wwan/iosm/iosm_ipc_trace.c index eeecfa3d10c5..4368373797b6 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_trace.c +++ b/drivers/net/wwan/iosm/iosm_ipc_trace.c @@ -3,7 +3,9 @@ * Copyright (C) 2020-2021 Intel Corporation. */ +#include <linux/pm_runtime.h> #include <linux/wwan.h> + #include "iosm_ipc_trace.h" /* sub buffer size and number of sub buffer */ @@ -97,6 +99,8 @@ static ssize_t ipc_trace_ctrl_file_write(struct file *filp, if (ret) return ret; + pm_runtime_get_sync(ipc_trace->ipc_imem->dev); + mutex_lock(&ipc_trace->trc_mutex); if (val == TRACE_ENABLE && ipc_trace->mode != TRACE_ENABLE) { ipc_trace->channel = ipc_imem_sys_port_open(ipc_trace->ipc_imem, @@ -117,6 +121,10 @@ static ssize_t ipc_trace_ctrl_file_write(struct file *filp, ret = count; unlock: mutex_unlock(&ipc_trace->trc_mutex); + + pm_runtime_mark_last_busy(ipc_trace->ipc_imem->dev); + pm_runtime_put_autosuspend(ipc_trace->ipc_imem->dev); + return ret; } |