Skip to content

Commit

Permalink
[Edgecore][sonic-platform-modules-accton]Support kernel 6.1 and bookw…
Browse files Browse the repository at this point in the history
…orm (sonic-net#16982)

* [Edgecore][sonic-platform-modules-accton]Support kernel 6.1 and bookworm

* Modify pddf drv code for i2c_remove_callback function fail
  • Loading branch information
jostar-yang authored and saiarcot895 committed Nov 21, 2023
1 parent befd2bd commit 796ce30
Show file tree
Hide file tree
Showing 105 changed files with 373 additions and 717 deletions.
3 changes: 1 addition & 2 deletions platform/broadcom/rules.dep
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ include $(PLATFORM_PATH)/sai.dep
# TODO: re-enable once the following have been updated for bookworm:
# * Nokia
# * Dell
# * Accton
# * Juniper
# * Ragile
include $(PLATFORM_PATH)/platform-modules-s6000.dep
#include $(PLATFORM_PATH)/platform-modules-dell.dep
include $(PLATFORM_PATH)/platform-modules-arista.dep
include $(PLATFORM_PATH)/platform-modules-ingrasys.dep
#include $(PLATFORM_PATH)/platform-modules-accton.dep
include $(PLATFORM_PATH)/platform-modules-accton.dep
include $(PLATFORM_PATH)/platform-modules-alphanetworks.dep
include $(PLATFORM_PATH)/platform-modules-inventec.dep
include $(PLATFORM_PATH)/platform-modules-cel.dep
Expand Down
3 changes: 1 addition & 2 deletions platform/broadcom/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ include $(PLATFORM_PATH)/sai.mk
# TODO: re-enable once the following have been updated for bookworm:
# * Nokia
# * Dell
# * Accton
# * Juniper
# * Ragile
# * Ufispace
#include $(PLATFORM_PATH)/platform-modules-nokia.mk
#include $(PLATFORM_PATH)/platform-modules-dell.mk
include $(PLATFORM_PATH)/platform-modules-arista.mk
#include $(PLATFORM_PATH)/platform-modules-ingrasys.mk
#include $(PLATFORM_PATH)/platform-modules-accton.mk
include $(PLATFORM_PATH)/platform-modules-accton.mk
include $(PLATFORM_PATH)/platform-modules-alphanetworks.mk
#include $(PLATFORM_PATH)/platform-modules-inventec.mk
include $(PLATFORM_PATH)/platform-modules-cel.mk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ static int as4630_54pe_cpld_probe(struct i2c_client *client,
return ret;
}

static int as4630_54pe_cpld_remove(struct i2c_client *client)
static void as4630_54pe_cpld_remove(struct i2c_client *client)
{
struct as4630_54pe_cpld_data *data = i2c_get_clientdata(client);
const struct attribute_group *group = NULL;
Expand All @@ -794,7 +794,6 @@ static int as4630_54pe_cpld_remove(struct i2c_client *client)

kfree(data);

return 0;
}

static int as4630_54pe_cpld_read_internal(struct i2c_client *client, u8 reg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,14 @@ static int as4630_54pe_psu_probe(struct i2c_client *client,
return status;
}

static int as4630_54pe_psu_remove(struct i2c_client *client)
static void as4630_54pe_psu_remove(struct i2c_client *client)
{
struct as4630_54pe_psu_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as4630_54pe_psu_group);
kfree(data);

return 0;
}

enum psu_index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ static int as4630_54te_cpld_probe(struct i2c_client *client,
return ret;
}

static int as4630_54te_cpld_remove(struct i2c_client *client)
static void as4630_54te_cpld_remove(struct i2c_client *client)
{
struct as4630_54te_cpld_data *data = i2c_get_clientdata(client);
const struct attribute_group *group = NULL;
Expand All @@ -797,7 +797,6 @@ static int as4630_54te_cpld_remove(struct i2c_client *client)

kfree(data);

return 0;
}

static int as4630_54te_cpld_read_internal(struct i2c_client *client, u8 reg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,14 @@ static int as4630_54te_psu_probe(struct i2c_client *client,
return status;
}

static int as4630_54te_psu_remove(struct i2c_client *client)
static void as4630_54te_psu_remove(struct i2c_client *client)
{
struct as4630_54te_psu_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as4630_54te_psu_group);
kfree(data);

return 0;
}

enum psu_index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _get_fan_node_val(self, fan_num, node_num):
return None

try:
val_file.close()
val_file.close()
except:
logging.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -153,7 +153,7 @@ def _set_fan_node_val(self, fan_num, node_num, val):
val_file.write(content)

try:
val_file.close()
val_file.close()
except:
logging.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -225,14 +225,3 @@ def get_fan_status(self, fan_num):

return True

#def main():
# fan = FanUtil()
#
# print 'get_size_node_map : %d' % fan.get_size_node_map()
# print 'get_size_path_map : %d' % fan.get_size_path_map()
# for x in range(fan.get_idx_fan_start(), fan.get_num_fans()+1):
# for y in range(fan.get_idx_node_start(), fan.get_num_nodes()+1):
# print fan.get_fan_to_device_path(x, y)
#
#if __name__ == '__main__':
# main()
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _get_thermal_node_val(self, thermal_num):
return None

try:
val_file.close()
val_file.close()
except:
logging.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -109,13 +109,3 @@ def get_thermal_1_val(self):
def get_thermal_2_val(self):
return self._get_thermal_node_val(self.THERMAL_NUM_2_IDX)

#def main():
# thermal = ThermalUtil()
#
# print 'get_size_node_map : %d' % thermal.get_size_node_map()
# print 'get_size_path_map : %d' % thermal.get_size_path_map()
# for x in range(thermal.get_idx_thermal_start(), thermal.get_num_thermals()+1):
# print thermal.get_thermal_to_device_path(x)
#
#if __name__ == '__main__':
# main()
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,14 @@ static int as5712_54x_psu_probe(struct i2c_client *client,
return status;
}

static int as5712_54x_psu_remove(struct i2c_client *client)
static void as5712_54x_psu_remove(struct i2c_client *client)
{
struct as5712_54x_psu_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as5712_54x_psu_group);
kfree(data);

return 0;
}

enum psu_index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,14 @@ static int as5712_54x_sfp_probe(struct i2c_client *client,
return status;
}

static int as5712_54x_sfp_remove(struct i2c_client *client)
static void as5712_54x_sfp_remove(struct i2c_client *client)
{
struct as5712_54x_sfp_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as5712_54x_sfp_group);
kfree(data);

return 0;
}

enum port_numbers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ static int as5712_54x_cpld_mux_probe(struct i2c_client *client,
return ret;
}

static int as5712_54x_cpld_mux_remove(struct i2c_client *client)
static void as5712_54x_cpld_mux_remove(struct i2c_client *client)
{
struct i2c_mux_core *muxc = i2c_get_clientdata(client);
struct as5712_54x_cpld_data *data = i2c_mux_priv(muxc);
Expand Down Expand Up @@ -1306,7 +1306,6 @@ static int as5712_54x_cpld_mux_remove(struct i2c_client *client)

i2c_mux_del_adapters(muxc);

return 0;
}

static int as5712_54x_cpld_read_internal(struct i2c_client *client, u8 reg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _get_fan_node_val(self, fan_num, node_num):
return None

try:
val_file.close()
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -166,7 +166,7 @@ def _set_fan_node_val(self, fan_num, node_num, val):
val_file.write(content)

try:
val_file.close()
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -230,14 +230,3 @@ def get_fan_status(self, fan_num):

return True

#def main():
# fan = FanUtil()
#
# print 'get_size_node_map : %d' % fan.get_size_node_map()
# print 'get_size_path_map : %d' % fan.get_size_path_map()
# for x in range(fan.get_idx_fan_start(), fan.get_num_fans()+1):
# for y in range(fan.get_idx_node_start(), fan.get_num_nodes()+1):
# print fan.get_fan_to_device_path(x, y)
#
#if __name__ == '__main__':
# main()
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,21 @@ def _get_thermal_node_val(self, thermal_num):
self.logger.error('GET. unable to open file: %s', str(e))
return None

content = val_file.readline().rstrip()
content = val_file.readline().rstrip()

if content == '':
self.logger.debug('GET. content is NULL. device_path:%s', device_path)
return None
if content == '':
self.logger.debug('GET. content is NULL. device_path:%s', device_path)
return None

try:
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None
try:
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None

return int(content)
return int(content)

return 0


def get_num_thermals(self):
Expand All @@ -112,14 +114,3 @@ def get_thermal_1_val(self):

def get_thermal_2_val(self):
return self._get_thermal_node_val(self.THERMAL_NUM_2_IDX)

#def main():
# thermal = ThermalUtil()
#
# print 'get_size_node_map : %d' % thermal.get_size_node_map()
# print 'get_size_path_map : %d' % thermal.get_size_path_map()
# for x in range(thermal.get_idx_thermal_start(), thermal.get_num_thermals()+1):
# print thermal.get_thermal_to_device_path(x)
#
#if __name__ == '__main__':
# main()
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static int as5812_54t_cpld_probe(struct i2c_client *client,
return status;
}

static int as5812_54t_cpld_remove(struct i2c_client *client)
static void as5812_54t_cpld_remove(struct i2c_client *client)
{
struct as5812_54t_cpld_data *data = i2c_get_clientdata(client);

Expand All @@ -456,7 +456,6 @@ static int as5812_54t_cpld_remove(struct i2c_client *client)
kfree(data);
as5812_54t_cpld_remove_client(client);

return 0;
}

int as5812_54t_cpld_read(unsigned short cpld_addr, u8 reg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,14 @@ static int as5812_54t_psu_probe(struct i2c_client *client,
return status;
}

static int as5812_54t_psu_remove(struct i2c_client *client)
static void as5812_54t_psu_remove(struct i2c_client *client)
{
struct as5812_54t_psu_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as5812_54t_psu_group);
kfree(data);

return 0;
}

enum psu_index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _get_fan_node_val(self, fan_num, node_num):
return None

try:
val_file.close()
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -166,7 +166,7 @@ def _set_fan_node_val(self, fan_num, node_num, val):
val_file.write(content)

try:
val_file.close()
val_file.close()
except:
self.logger.debug('GET. unable to close file. device_path:%s', device_path)
return None
Expand Down Expand Up @@ -230,14 +230,3 @@ def get_fan_status(self, fan_num):

return True

#def main():
# fan = FanUtil()
#
# print 'get_size_node_map : %d' % fan.get_size_node_map()
# print 'get_size_path_map : %d' % fan.get_size_path_map()
# for x in range(fan.get_idx_fan_start(), fan.get_num_fans()+1):
# for y in range(fan.get_idx_node_start(), fan.get_num_nodes()+1):
# print fan.get_fan_to_device_path(x, y)
#
#if __name__ == '__main__':
# main()
Loading

0 comments on commit 796ce30

Please sign in to comment.