Skip to content

Commit

Permalink
[pddf]: Adding PDDF common framework enhancements. (#12863)
Browse files Browse the repository at this point in the history
- Consolidating multiple read functions in a PSU driver on the basis of byte, word or block read,
- Enhancing PDDF parsing script support for CPU and PCH temperature reading,
- Adding missing methods in PDDF common APIs

Why I did it
- PSU driver changes are to optimize the code and increase the code coverage
- PDDF parser script enhancements to accommodate the CPU and PCH temp reading using hwmon device path
- Some of the new APIs were missing from the PDDF common platform classes

How I did it
Added code changes and verified them on AS7816 adn AS7726 platforms.
  • Loading branch information
FuzailBrcm authored Dec 17, 2022
1 parent 372a7c8 commit abc8ed8
Show file tree
Hide file tree
Showing 10 changed files with 308 additions and 430 deletions.
16 changes: 3 additions & 13 deletions platform/pddf/i2c/modules/include/pddf_psu_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,8 @@ extern void get_psu_duplicate_sysfs(int idx, char *str);
extern ssize_t psu_show_default(struct device *dev, struct device_attribute *da, char *buf);
extern ssize_t psu_store_default(struct device *dev, struct device_attribute *da, const char *buf, size_t count);

extern int sonic_i2c_get_psu_present_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_power_good_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_model_name_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_mfr_id_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_serial_num_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_fan_dir_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_v_out_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_i_out_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_p_out_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_fan1_speed_rpm_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_temp1_input_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_v_in_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_i_in_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_byte_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_block_default(void *client, PSU_DATA_ATTR *adata, void *data);
extern int sonic_i2c_get_psu_word_default(void *client, PSU_DATA_ATTR *adata, void *data);

#endif
5 changes: 5 additions & 0 deletions platform/pddf/i2c/modules/include/pddf_psu_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ enum psu_sysfs_attributes {
PSU_SERIAL_NUM,
PSU_FAN_DIR,
PSU_V_OUT,
PSU_V_OUT_MIN,
PSU_V_OUT_MAX,
PSU_I_OUT,
PSU_P_OUT, /* This is in micro watts to comply with lm-sensors */
PSU_P_OUT_MAX,
PSU_FAN1_SPEED,
PSU_TEMP1_INPUT,
PSU_TEMP1_HIGH_THRESHOLD,
PSU_V_IN,
PSU_I_IN,
PSU_P_IN,
PSU_ATTR_MAX
};

Expand Down
Loading

0 comments on commit abc8ed8

Please sign in to comment.