diff options
author | Charles Boyer <Charles.Boyer@fii-usa.com> | 2022-02-09 18:17:35 +0300 |
---|---|---|
committer | Charles Boyer <Charles.Boyer@fii-usa.com> | 2022-04-21 22:53:53 +0300 |
commit | af721717cd78b780c3eaa4be767b75a575951d7f (patch) | |
tree | 4bfe49c3e09b15d1012cfb617cec63636aa4772f /meta-fii/meta-kudo/recipes-phosphor | |
parent | 3d071ee73fe297f86833ac2db25384852255ac01 (diff) | |
download | openbmc-af721717cd78b780c3eaa4be767b75a575951d7f.tar.xz |
meta-fii: meta-kudo: Use I2C array definitions in kudo-lib.sh
Adds the I2C bus and address in array form to kudo-lib.sh, and
replaces the hardcoded values with references across Kudo layer.
Signed-off-by: Charles Boyer <Charles.Boyer@fii-usa.com>
Change-Id: I69bbff444e013e61d7f7fd5051612a6d4adc8ded
Diffstat (limited to 'meta-fii/meta-kudo/recipes-phosphor')
-rw-r--r-- | meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/bin/pwm_init.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/bin/pwm_init.sh b/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/bin/pwm_init.sh index 5394cb6c8f..1e0682f8e7 100644 --- a/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/bin/pwm_init.sh +++ b/meta-fii/meta-kudo/recipes-phosphor/fans/pwm-init/bin/pwm_init.sh @@ -2,6 +2,10 @@ # # Set all fans to pwm mode. +# Provide source directive to shellcheck. +# shellcheck source=meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-lib.sh +source /usr/libexec/kudo-fw/kudo-lib.sh + # Set all pwm_enable to 1 find /sys/class/hwmon/hwmon*/ -name 'pwm*_enable' -exec bash -c 'echo "$1" && echo 1 > "$1" && cat "$1"' -- {} \; @@ -11,10 +15,10 @@ do awk '{print $1}') # Set Fan PWM Rate-of-Change Bits(bits 4:2) to 000b # Register 08h to 0Dh - oriRegVal=$(i2cget -y -f 18 0x2c \ + oriRegVal=$(i2cget -y -f "${I2C_FANCTRL[0]}" 0x"${I2C_FANCTRL[1]}" \ "${fan_pwm_rate_of_change}") updateVal=$((oriRegVal & 0xe3)) updateVal=0x$(printf "%x" ${updateVal}) - i2cset -y -f 18 0x2c \ + i2cset -y -f "${I2C_FANCTRL[0]}" 0x"${I2C_FANCTRL[1]}" \ "${fan_pwm_rate_of_change}" "${updateVal}" done |