Set OccActive property on application start

Host sends OCC active status command just once as part
of power on operation and when that is sent, occ control
application binds the device. As part of bind, a sysfs
file gets created that would be used to communicate the
occ error status back to user.

If occ control application terminates and restarts, then
it needs some way to set OccActive property and this commit
adds that support.

Solution is to check if the device is already bound by checking
the presence of the OCC_HWMON_PATH/occ<number>-dev0 and set the
property if found

Fixes openbmc/openbmc#2238

Change-Id: I920b52e3970cc91af50b5bc68ead44c66eab8944
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
3 files changed