diff options
author | Robert Lippert <rlippert@google.com> | 2017-05-26 12:45:46 -0700 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-06-06 21:56:36 +0000 |
commit | c70eebe0adfcea264f88ba8d847622c6742bf97e (patch) | |
tree | 33c4f27022709a35bf01ef2e4ec2523caab78b9d /meta-openbmc-machines | |
parent | c2f6f9c66acabc60431b39d289c8ff15b15f2f0f (diff) | |
download | talos-openbmc-c70eebe0adfcea264f88ba8d847622c6742bf97e.tar.gz talos-openbmc-c70eebe0adfcea264f88ba8d847622c6742bf97e.zip |
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>
Diffstat (limited to 'meta-openbmc-machines')
-rwxr-xr-x | meta-openbmc-machines/meta-openpower/meta-ingrasys/meta-zaius/recipes-phosphor/chassis/vcs-control/zaius_vcs.sh | 31 |
1 files changed, 2 insertions, 29 deletions
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 b65b12d1c..49bf0b04f 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 @@ retry() # 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 @@ vcs_set_gpios() 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 @@ vcs_get() ucd_get 0xFB local val=`echo $ucd_reg | grep -i -c 0x0f` echo -e "\tUCD GPIO 6 state=$val" - rebind_ucd } |