mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
[as6712-32x] Add thermal sensor for YM2401 PSU
This commit is contained in:
@@ -24,10 +24,8 @@
|
||||
*
|
||||
***********************************************************/
|
||||
#include <unistd.h>
|
||||
#include <onlplib/mmap.h>
|
||||
#include <onlplib/file.h>
|
||||
#include <onlp/platformi/thermali.h>
|
||||
#include <fcntl.h>
|
||||
#include "platform_lib.h"
|
||||
|
||||
#define VALIDATE(_id) \
|
||||
@@ -112,6 +110,9 @@ int
|
||||
onlp_thermali_info_get(onlp_oid_t id, onlp_thermal_info_t* info)
|
||||
{
|
||||
int local_id;
|
||||
int psu_id;
|
||||
psu_type_t psu_type;
|
||||
|
||||
VALIDATE(id);
|
||||
|
||||
local_id = ONLP_OID_ID_GET(id);
|
||||
@@ -124,5 +125,13 @@ onlp_thermali_info_get(onlp_oid_t id, onlp_thermal_info_t* info)
|
||||
return rv;
|
||||
}
|
||||
|
||||
psu_id = local_id - THERMAL_1_ON_PSU1 + 1;
|
||||
psu_type = get_psu_type(psu_id, NULL, 0);
|
||||
|
||||
if (psu_type == PSU_TYPE_AC_3YPOWER_F2B || psu_type == PSU_TYPE_AC_3YPOWER_B2F ) {
|
||||
int rv = psu_ym2401_pmbus_info_get(psu_id, "psu_temp1_input", &info->mcelsius);
|
||||
return rv;
|
||||
}
|
||||
|
||||
return onlp_file_read_int(&info->mcelsius, devfiles[local_id]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user