Skip to content

Add Inventec D7054 platform support and update D7032 platform support #1052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 19, 2017
16 changes: 8 additions & 8 deletions device/inventec/x86_64-inventec_d7032q28b-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SfpUtil(SfpUtilBase):

PORT_START = 0
PORT_END = 31
PORTS_IN_BLOCK = 32
PORTS_IN_BLOCK = 32

_port_to_eeprom_mapping = {}
port_to_i2c_mapping = {
Expand Down Expand Up @@ -51,7 +51,7 @@ class SfpUtil(SfpUtilBase):
29: 19,
30: 20,
31: 21
}
}

@property
def port_start(self):
Expand Down Expand Up @@ -91,7 +91,7 @@ def get_presence(self, port_num):
reg_value = int(reg_file.readline().rstrip())

if reg_value == 0:
return True
return True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace remains. Please remove.


return False

Expand All @@ -108,7 +108,7 @@ def get_low_power_mode(self, port_num):
reg_value = int(reg_file.readline().rstrip())

if reg_value == 0:
return False
return False

return True

Expand All @@ -124,13 +124,13 @@ def set_low_power_mode(self, port_num, lpmode):
return False

reg_value = int(reg_file.readline().rstrip())

# LPMode is active high; set or clear the bit accordingly
if lpmode is True:
reg_value = 1
else:
reg_value = 0
reg_value = 0

reg_file.write(hex(reg_value))
reg_file.close()

Expand Down Expand Up @@ -167,4 +167,4 @@ def reset(self, port_num):
reg_file.close()

return True

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing the extra trailing newline, it appears you added spaces? Please remove this line altogether.

12 changes: 6 additions & 6 deletions device/inventec/x86_64-inventec_d7054q28b-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def get_presence(self, port_num):
reg_value = int(reg_file.readline().rstrip())

if reg_value == 0:
return True
return True

return False

Expand All @@ -142,7 +142,7 @@ def get_low_power_mode(self, port_num):
reg_value = int(reg_file.readline().rstrip())

if reg_value == 0:
return False
return False

return True

Expand All @@ -161,13 +161,13 @@ def set_low_power_mode(self, port_num, lpmode):
return False

reg_value = int(reg_file.readline().rstrip())

# LPMode is active high; set or clear the bit accordingly
if lpmode is True:
reg_value = 1
else:
reg_value = 0
reg_value = 0

reg_file.write(hex(reg_value))
reg_file.close()

Expand Down Expand Up @@ -207,4 +207,4 @@ def reset(self, port_num):
reg_file.close()

return True

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing the extra trailing newline, it appears you added spaces? Please remove this line altogether.