Semi-failed attempt to modify for the 4.14 kernel

This commit is contained in:
Jeffrey Townsend
2018-10-26 00:07:34 +00:00
parent 1f7629399c
commit 0ce144ca07
2 changed files with 13 additions and 16 deletions

View File

@@ -28,8 +28,8 @@
#include "arm_accton_as4610_log.h"
#define CHASSIS_THERMAL_COUNT 1
#define CHASSIS_PSU_COUNT 2
#define CHASSIS_THERMAL_COUNT 1
#define CHASSIS_PSU_COUNT 2
#define PSU1_ID 1
#define PSU2_ID 2
@@ -46,7 +46,7 @@
#define PSU1_AC_EEPROM_NODE(node) PSU1_AC_EEPROM_PREFIX#node
#define PSU2_AC_EEPROM_NODE(node) PSU2_AC_EEPROM_PREFIX#node
#define IDPROM_PATH "/sys/devices/1803b000.i2c/i2c-1/i2c-9/9-0050/eeprom"
#define IDPROM_PATH "/sys/devices/platform/axi/1803b000.i2c/i2c-1/i2c-9/9-0050/eeprom"
int deviceNodeWriteInt(char *filename, int value, int data_len);
int deviceNodeReadBinary(char *filename, char *buffer, int buf_size, int data_len);
@@ -97,4 +97,3 @@ typedef enum platform_id_e {
extern platform_id_t platform_id;
#endif /* __PLATFORM_LIB_H__ */

View File

@@ -63,11 +63,11 @@ enum onlp_thermal_id
static char* last_path[] = /* must map with onlp_thermal_id */
{
"reserved",
"9-0048/temp1_input",
"8-0058/psu_temp1_input",
"8-0059/psu_temp1_input",
"9-0048*temp1_input",
"8-0058*psu_temp1_input",
"8-0059*psu_temp1_input",
};
/* Static values */
static onlp_thermal_info_t linfo[] = {
{ }, /* Not used */
@@ -107,9 +107,7 @@ onlp_thermali_init(void)
int
onlp_thermali_info_get(onlp_oid_t id, onlp_thermal_info_t* info)
{
int fd, len, nbytes = 10, temp_base=1, local_id;
char r_data[10] = {0};
char fullpath[50] = {0};
int local_id;
VALIDATE(id);
local_id = ONLP_OID_ID_GET(id);
@@ -119,12 +117,12 @@ onlp_thermali_info_get(onlp_oid_t id, onlp_thermal_info_t* info)
*info = linfo[local_id];
/* get fullpath */
sprintf(fullpath, "%s%s", prefix_path, last_path[local_id]);
OPEN_READ_FILE(fd, fullpath, r_data, nbytes, len);
info->mcelsius = atoi(r_data) / temp_base;
onlp_file_read_int(&info->mcelsius, "%s%s", prefix_path, last_path[local_id]);
//sprintf(fullpath, "%s%s", prefix_path, last_path[local_id]);
//AIM_LOG_MSG("%s", fullpath);
//OPEN_READ_FILE(fd, fullpath, r_data, nbytes, len);
//info->mcelsius = atoi(r_data) / temp_base;
DEBUG_PRINT("\n[Debug][%s][%d][save data: %d]\n", __FUNCTION__, __LINE__, info->mcelsius);
return ONLP_STATUS_OK;
}