Skip to content
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

[centec] fix some bugs on centec tsingma bsp and v682 sonic_platform package #10685

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions platform/centec-arm64/tsingma-bsp/src/ctc-phy/mars.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,6 @@ static struct mdio_device_id __maybe_unused mars_tbl[] = {
};

MODULE_DEVICE_TABLE(mdio, mars_tbl);

MODULE_AUTHOR("Centec, Inc.");
MODULE_LICENSE("GPL");
5 changes: 5 additions & 0 deletions platform/centec-arm64/tsingma-bsp/src/i2c-ctc/i2c-ctc.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,11 @@ static int ctc_i2c_plat_probe(struct platform_device *pdev)
of_property_read_u32(pdev->dev.of_node, "clock-frequency", &clk_freq);

dev->clk_freq = clk_freq;

dev->functionality = I2C_FUNC_10BIT_ADDR | CTC_IC_DEFAULT_FUNCTIONALITY;
dev->master_cfg = CTC_IC_CON_MASTER | CTC_IC_CON_SLAVE_DISABLE |
CTC_IC_CON_RESTART_EN;

if (dev->clk_freq <= 100000)
dev->master_cfg |= CTC_IC_CON_SPEED_STD;
else if (dev->clk_freq <= 400000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def get_presence(self):

try:
with open(self.port_to_eeprom_mapping[self.port_num], mode='rb', buffering=0) as fd:
fd.read()
fd.read(256)
except IOError:
return False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def get_presence(self):

try:
with open(self.port_to_eeprom_mapping[self.port_num], mode='rb', buffering=0) as fd:
fd.read()
fd.read(256)
except IOError:
return False

Expand Down