meta-zaius: vcs-control: remove UCD driver bind/unbind hackery
The i2cget/i2cset commands in this script can theoretically
interfere with the linux hwmon driver state so the bind/unbind
around running the i2c commands was added as a defensive measure.
But in reality the linux ucd9000 driver does not touch the GPIO registers
so there is no chance of any interference.
Remove the bind/unbind steps which have had issues in the past and
isntead use '-f' argument to i2cget/i2cset to allow the script to
run even when the hwmon driver is loaded.
Change-Id: I0b3748e263a0578b3da533d75fa2f3ccc3a68b09
Signed-off-by: Robert Lippert <rlippert@google.com>
diff --git a/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control/zaius_vcs.sh b/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control/zaius_vcs.sh
index b65b12d..49bf0b0 100755
--- a/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control/zaius_vcs.sh
+++ b/meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control/zaius_vcs.sh
@@ -24,42 +24,18 @@
# Result stored in $ucd_reg
ucd_get()
{
- retry i2cget -y $ucd_bus $ucd_addr $1 b
+ retry i2cget -f -y $ucd_bus $ucd_addr $1 b
ucd_reg=$retry_output
}
# Usage: ucd_get address value
ucd_set()
{
- retry i2cset -y $ucd_bus $ucd_addr $1 $2 b
-}
-
-unbind_ucd()
-{
- if [ -e $ucd_path/$ucd_driver ]; then
- echo -e "\tUnbinding UCD driver $ucd_driver"
- echo $ucd_driver > $ucd_path/unbind
- else
- echo -e "\tWarning: $ucd_path/$ucd_driver doesn't exist"
- fi
-}
-
-rebind_ucd()
-{
- if [ -e $ucd_path ]; then
- echo -e "\tBinding UCD driver $ucd_driver"
- local i=0
- until [ -d $ucd_path/$ucd_driver ] || [ $i -ge $ucd_retries ]; do
- i=$((i+1))
- echo $ucd_driver > $ucd_path/bind || ret=$?
- done
- if [ ! -d $ucd_path/$ucd_driver ]; then exit $ret; fi
- fi
+ retry i2cset -f -y $ucd_bus $ucd_addr $1 $2 b
}
vcs_set_gpios()
{
- unbind_ucd
echo -e "\tSetting UCD GPIO 5 to $1"
ucd_set 0xFA 5
ucd_set 0xFB $1
@@ -68,13 +44,11 @@
ucd_set 0xFA 6
ucd_set 0xFB $1
ucd_set 0xFB $1
- rebind_ucd
}
vcs_get()
{
echo Reading VCS settings
- unbind_ucd
ucd_set 0xFA 5
ucd_get 0xFB
local val=`echo $ucd_reg | grep -i -c 0x0f`
@@ -83,7 +57,6 @@
ucd_get 0xFB
local val=`echo $ucd_reg | grep -i -c 0x0f`
echo -e "\tUCD GPIO 6 state=$val"
- rebind_ucd
}