diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-01-08 23:07:29 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-08 16:40:47 -0800 |
commit | 115ba28c5e075c6bffd8106a2b5e23db88d0c3b5 (patch) | |
tree | 20e0f51fbbc9669f960e40ddc443fa2a4e3a4f56 /drivers/misc/mei/init.c | |
parent | 9ea73ddd4f144952b8f69fac93dc592ea48e4113 (diff) | |
download | linux-3.10-115ba28c5e075c6bffd8106a2b5e23db88d0c3b5.tar.gz linux-3.10-115ba28c5e075c6bffd8106a2b5e23db88d0c3b5.tar.bz2 linux-3.10-115ba28c5e075c6bffd8106a2b5e23db88d0c3b5.zip |
mei: abstract host and device readieness
Add mei_host_set_ready function to enable the device
and is_ready function to query the host and me readiness
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/init.c')
-rw-r--r-- | drivers/misc/mei/init.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c index 5c2054d06f6..d0ee02ac820 100644 --- a/drivers/misc/mei/init.c +++ b/drivers/misc/mei/init.c @@ -131,18 +131,18 @@ int mei_hw_init(struct mei_device *dev) goto out; } - if (!(((dev->host_hw_state & H_RDY) == H_RDY) && - ((dev->me_hw_state & ME_RDY_HRA) == ME_RDY_HRA))) { + if (!(mei_host_is_ready(dev) && mei_me_is_ready(dev))) { dev->dev_state = MEI_DEV_DISABLED; + dev_dbg(&dev->pdev->dev, "host_hw_state = 0x%08x, me_hw_state = 0x%08x.\n", dev->host_hw_state, dev->me_hw_state); - if (!(dev->host_hw_state & H_RDY)) - dev_dbg(&dev->pdev->dev, "host turn off H_RDY.\n"); + if (!mei_host_is_ready(dev)) + dev_dbg(&dev->pdev->dev, "host is not ready.\n"); - if (!(dev->me_hw_state & ME_RDY_HRA)) - dev_dbg(&dev->pdev->dev, "ME turn off ME_RDY.\n"); + if (!mei_me_is_ready(dev)) + dev_dbg(&dev->pdev->dev, "ME is not ready.\n"); dev_err(&dev->pdev->dev, "link layer initialization failed.\n"); ret = -ENODEV; @@ -159,9 +159,7 @@ int mei_hw_init(struct mei_device *dev) dev->recvd_msg = false; dev_dbg(&dev->pdev->dev, "host_hw_state = 0x%08x, me_hw_state = 0x%08x.\n", dev->host_hw_state, dev->me_hw_state); - dev_dbg(&dev->pdev->dev, "ME turn on ME_RDY and host turn on H_RDY.\n"); dev_dbg(&dev->pdev->dev, "link layer has been established.\n"); - dev_dbg(&dev->pdev->dev, "MEI start success.\n"); ret = 0; out: |