diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py index 66fe58543f..be286bd9ea 100644 --- a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py @@ -10,6 +10,8 @@ try: except ImportError as e: raise ImportError(str(e) + "- required module not found") +QSFP_PWR_CTRL_ADDR = 93 + class PddfSfp(SfpOptoeBase): """ @@ -194,8 +196,18 @@ class PddfSfp(SfpOptoeBase): else: lpmode = False else: - # Use common SfpOptoeBase implementation for get_lpmode - lpmode = super().get_lpmode() + xcvr_id = self._xcvr_api_factory._get_id() + if xcvr_id is not None: + if xcvr_id == 0x18 or xcvr_id == 0x19 or xcvr_id == 0x1e: + # QSFP-DD or OSFP + # Use common SfpOptoeBase implementation for get_lpmode + lpmode = super().get_lpmode() + elif xcvr_id == 0x11 or xcvr_id == 0x0d or xcvr_id == 0x0c: + # QSFP28, QSFP+, QSFP + power_set = self.get_power_set() + power_override = self.get_power_override() + # By default the lpmode pin is pulled high as mentioned in the sff community + return power_set if power_override else True return lpmode @@ -321,8 +333,18 @@ class PddfSfp(SfpOptoeBase): except IOError as e: status = False else: - # Use common SfpOptoeBase implementation for set_lpmode - status = super().set_lpmode(lpmode) + xcvr_id = self._xcvr_api_factory._get_id() + if xcvr_id is not None: + if xcvr_id == 0x18 or xcvr_id == 0x19 or xcvr_id == 0x1e: + # QSFP-DD or OSFP + # Use common SfpOptoeBase implementation for set_lpmode + status = super().set_lpmode(lpmode) + elif xcvr_id == 0x11 or xcvr_id == 0x0d or xcvr_id == 0x0c: + # QSFP28, QSFP+, QSFP + if lpmode is True: + self.set_power_override(True, True) + else: + self.set_power_override(True, False) return status