Seastone: fix platform fan psu and temperature issues (#12567)

Why I did it:
Fix multiple seastone platform issues caused by sonic kernel upgrade.

How I did it:
Get gpio base id with new label path in gpio sys fs.

How to verify it:
After the change, show platform fan/psustatus/temperature works well.
This commit is contained in:
Ikki Zhu 2022-12-06 01:44:55 +08:00 committed by mssonicbld
parent 3d9dcf5294
commit 776cb55d96
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ class Fan(FanBase):
def __get_gpio_base(self):
for r in os.listdir(GPIO_DIR):
label_path = os.path.join(GPIO_DIR, r, "label")
label_path = os.path.join(GPIO_DIR, r, "device/name")
if "gpiochip" in r and GPIO_LABEL in \
self._api_helper.read_txt_file(label_path):
return int(r[8:], 10)

View File

@ -69,7 +69,7 @@ class Psu(PsuBase):
def __get_gpio_base(self):
for r in os.listdir(GPIO_DIR):
label_path = os.path.join(GPIO_DIR, r, "label")
label_path = os.path.join(GPIO_DIR, r, "device/name")
if "gpiochip" in r and GPIO_LABEL in self._api_helper.read_txt_file(label_path):
return int(r[8:], 10)
return 216 # Reserve