summaryrefslogtreecommitdiffstats
path: root/occ_status.cpp
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-06-28 19:17:28 +0530
committerVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-07-06 14:56:34 +0000
commit32e84e98efd51509aa18ab2f3538bcbc6689bb0d (patch)
treed19c0e92e84fc4bdda35fcf4811341706e3136ff /occ_status.cpp
parent307d80b3d78efc669f38a63938371adcc6934391 (diff)
downloadopenpower-occ-control-32e84e98efd51509aa18ab2f3538bcbc6689bb0d.tar.gz
openpower-occ-control-32e84e98efd51509aa18ab2f3538bcbc6689bb0d.zip
Add Support to do device bind and unbind based on OCC status
Fixes openbmc/openbmc#1698 Change-Id: Iaa33c3065b0358b62e3ec7e39d4b57c6b9d181e1 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'occ_status.cpp')
-rw-r--r--occ_status.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/occ_status.cpp b/occ_status.cpp
index a78ea47..ca8a1f9 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -7,6 +7,19 @@ namespace occ
// Handles updates to occActive property
bool Status::occActive(bool value)
{
+ if (value != this->occActive())
+ {
+ if (value)
+ {
+ // Bind the device
+ device.bind();
+ }
+ else
+ {
+ // Do the unbind
+ device.unBind();
+ }
+ }
return Base::Status::occActive(value);
}
OpenPOWER on IntegriCloud