diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2014-03-18 16:51:55 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-03 19:20:23 -0400 |
commit | 4fcbc99b7565f915bea58e14b5e6f089bf9abf16 (patch) | |
tree | d65a1bc5fe48a022f43a9f22b7eb71af5201c315 /drivers/misc/mei/hbm.c | |
parent | d1db0eea852497762cab43b905b879dfcd3b8987 (diff) |
mei: implement power gating isolation hbm layer
Add send message functions and receive dispatch stubs
for power gating isolation hbm protocol.
The protocol consist of requests for entering and exiting
the power gating isolation state and their responses.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/hbm.c')
-rw-r--r-- | drivers/misc/mei/hbm.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c index 4960288e543a..a16b47c855aa 100644 --- a/drivers/misc/mei/hbm.c +++ b/drivers/misc/mei/hbm.c | |||
@@ -14,6 +14,7 @@ | |||
14 | * | 14 | * |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/export.h> | ||
17 | #include <linux/pci.h> | 18 | #include <linux/pci.h> |
18 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
19 | #include <linux/wait.h> | 20 | #include <linux/wait.h> |
@@ -289,6 +290,34 @@ static int mei_hbm_prop_req(struct mei_device *dev) | |||
289 | return 0; | 290 | return 0; |
290 | } | 291 | } |
291 | 292 | ||
293 | /* | ||
294 | * mei_hbm_pg - sends pg command | ||
295 | * | ||
296 | * @dev: the device structure | ||
297 | * @pg_cmd: the pg command code | ||
298 | * | ||
299 | * This function returns -EIO on write failure | ||
300 | */ | ||
301 | int mei_hbm_pg(struct mei_device *dev, u8 pg_cmd) | ||
302 | { | ||
303 | struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr; | ||
304 | struct hbm_power_gate *req; | ||
305 | const size_t len = sizeof(struct hbm_power_gate); | ||
306 | int ret; | ||
307 | |||
308 | mei_hbm_hdr(mei_hdr, len); | ||
309 | |||
310 | req = (struct hbm_power_gate *)dev->wr_msg.data; | ||
311 | memset(req, 0, len); | ||
312 | req->hbm_cmd = pg_cmd; | ||
313 | |||
314 | ret = mei_write_message(dev, mei_hdr, dev->wr_msg.data); | ||
315 | if (ret) | ||
316 | dev_err(&dev->pdev->dev, "power gate command write failed.\n"); | ||
317 | return ret; | ||
318 | } | ||
319 | EXPORT_SYMBOL_GPL(mei_hbm_pg); | ||
320 | |||
292 | /** | 321 | /** |
293 | * mei_hbm_stop_req - send stop request message | 322 | * mei_hbm_stop_req - send stop request message |
294 | * | 323 | * |
@@ -701,6 +730,18 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr) | |||
701 | mei_hbm_cl_flow_control_res(dev, flow_control); | 730 | mei_hbm_cl_flow_control_res(dev, flow_control); |
702 | break; | 731 | break; |
703 | 732 | ||
733 | case MEI_PG_ISOLATION_ENTRY_RES_CMD: | ||
734 | dev_dbg(&dev->pdev->dev, "power gate isolation entry response received\n"); | ||
735 | if (waitqueue_active(&dev->wait_pg)) | ||
736 | wake_up(&dev->wait_pg); | ||
737 | break; | ||
738 | |||
739 | case MEI_PG_ISOLATION_EXIT_REQ_CMD: | ||
740 | dev_dbg(&dev->pdev->dev, "power gate isolation exit request received\n"); | ||
741 | if (waitqueue_active(&dev->wait_pg)) | ||
742 | wake_up(&dev->wait_pg); | ||
743 | break; | ||
744 | |||
704 | case HOST_CLIENT_PROPERTIES_RES_CMD: | 745 | case HOST_CLIENT_PROPERTIES_RES_CMD: |
705 | dev_dbg(&dev->pdev->dev, "hbm: properties response: message received.\n"); | 746 | dev_dbg(&dev->pdev->dev, "hbm: properties response: message received.\n"); |
706 | 747 | ||