mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 01:07:01 +00:00
Merge pull request #327 from zhouzi88/swl-4346
change FAN RPM MAX so fan max percentage won't exceed 100%
This commit is contained in:
@@ -29,6 +29,9 @@ cdefs: &cdefs
|
||||
- POWERPC_ACCTON_AS5710_54X_CONFIG_INCLUDE_DEBUG:
|
||||
doc: "Include debug tool."
|
||||
default: 0
|
||||
- POWERPC_ACCTON_AS5710_54X_CONFIG_SYS_FAN_FRONT_RPM_MAX:
|
||||
doc: "Maximum system fan(Front) rpm."
|
||||
default: 19725
|
||||
|
||||
definitions:
|
||||
cdefs:
|
||||
|
||||
@@ -99,6 +99,16 @@
|
||||
#define POWERPC_ACCTON_AS5710_54X_CONFIG_INCLUDE_DEBUG 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* POWERPC_ACCTON_AS5710_54X_CONFIG_SYS_FAN_FRONT_RPM_MAX
|
||||
*
|
||||
* Maximum system fan(Front) rpm. */
|
||||
|
||||
|
||||
#ifndef POWERPC_ACCTON_AS5710_54X_CONFIG_SYS_FAN_FRONT_RPM_MAX
|
||||
#define POWERPC_ACCTON_AS5710_54X_CONFIG_SYS_FAN_FRONT_RPM_MAX 19725
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <onlplib/mmap.h>
|
||||
#include <fcntl.h>
|
||||
#include "platform_lib.h"
|
||||
#include "powerpc_accton_as5710_54x/powerpc_accton_as5710_54x_config.h"
|
||||
|
||||
#define PREFIX_PATH_ON_MAIN_BROAD "/sys/class/hwmon/hwmon11/"
|
||||
#define PREFIX_PATH_ON_PSU "/sys/bus/i2c/devices/"
|
||||
@@ -190,7 +191,7 @@ _onlp_fani_info_get_fan(int local_id, onlp_fan_info_t* info)
|
||||
info->rpm = (info->rpm + atoi(r_data))/2;
|
||||
|
||||
/* get speed percentage from rpm */
|
||||
info->percentage = (info->rpm * 100)/16800;
|
||||
info->percentage = (info->rpm * 100)/POWERPC_ACCTON_AS5710_54X_CONFIG_SYS_FAN_FRONT_RPM_MAX;
|
||||
|
||||
/* check present */
|
||||
if (info->rpm > 0)
|
||||
|
||||
@@ -49,6 +49,11 @@ powerpc_accton_as5710_54x_config_settings_t powerpc_accton_as5710_54x_config_set
|
||||
{ __powerpc_accton_as5710_54x_config_STRINGIFY_NAME(POWERPC_ACCTON_AS5710_54X_CONFIG_INCLUDE_DEBUG), __powerpc_accton_as5710_54x_config_STRINGIFY_VALUE(POWERPC_ACCTON_AS5710_54X_CONFIG_INCLUDE_DEBUG) },
|
||||
#else
|
||||
{ POWERPC_ACCTON_AS5710_54X_CONFIG_INCLUDE_DEBUG(__powerpc_accton_as5710_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef POWERPC_ACCTON_AS5710_54X_CONFIG_SYS_FAN_FRONT_RPM_MAX
|
||||
{ __powerpc_accton_as5710_54x_config_STRINGIFY_NAME(POWERPC_ACCTON_AS5710_54X_CONFIG_SYS_FAN_FRONT_RPM_MAX), __powerpc_accton_as5710_54x_config_STRINGIFY_VALUE(POWERPC_ACCTON_AS5710_54X_CONFIG_SYS_FAN_FRONT_RPM_MAX) },
|
||||
#else
|
||||
{ POWERPC_ACCTON_AS5710_54X_CONFIG_SYS_FAN_FRONT_RPM_MAX(__powerpc_accton_as5710_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -29,7 +29,9 @@ cdefs: &cdefs
|
||||
- X86_64_ACCTON_AS5812_54T_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION:
|
||||
doc: "Assume chassis fan direction is the same as the PSU fan direction."
|
||||
default: 0
|
||||
|
||||
- x86_64_accton_as5812_54t_CONFIG_SYS_FAN_FRONT_RPM_MAX:
|
||||
doc: "Maximum system fan(Front) rpm."
|
||||
default: 21500
|
||||
|
||||
definitions:
|
||||
cdefs:
|
||||
|
||||
@@ -99,6 +99,16 @@
|
||||
#define X86_64_ACCTON_AS5812_54T_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* x86_64_accton_as5812_54t_CONFIG_SYS_FAN_FRONT_RPM_MAX
|
||||
*
|
||||
* Maximum system fan(Front) rpm. */
|
||||
|
||||
|
||||
#ifndef x86_64_accton_as5812_54t_CONFIG_SYS_FAN_FRONT_RPM_MAX
|
||||
#define x86_64_accton_as5812_54t_CONFIG_SYS_FAN_FRONT_RPM_MAX 21500
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <onlplib/file.h>
|
||||
#include <fcntl.h>
|
||||
#include "platform_lib.h"
|
||||
#include "x86_64_accton_as5812_54t/x86_64_accton_as5812_54t_config.h"
|
||||
|
||||
#define PREFIX_PATH_ON_MAIN_BOARD "/sys/devices/platform/as5812_54t_fan/"
|
||||
#define PREFIX_PATH_ON_PSU "/sys/bus/i2c/devices/"
|
||||
@@ -191,7 +192,7 @@ _onlp_fani_info_get_fan(int local_id, onlp_fan_info_t* info)
|
||||
info->rpm = (info->rpm + atoi(r_data))/2;
|
||||
|
||||
/* get speed percentage from rpm */
|
||||
info->percentage = (info->rpm * 100)/16800;
|
||||
info->percentage = (info->rpm * 100)/x86_64_accton_as5812_54t_CONFIG_SYS_FAN_FRONT_RPM_MAX;
|
||||
|
||||
/* check present */
|
||||
if (info->rpm > 0)
|
||||
|
||||
@@ -49,6 +49,11 @@ x86_64_accton_as5812_54t_config_settings_t x86_64_accton_as5812_54t_config_setti
|
||||
{ __x86_64_accton_as5812_54t_config_STRINGIFY_NAME(X86_64_ACCTON_AS5812_54T_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION), __x86_64_accton_as5812_54t_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5812_54T_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION) },
|
||||
#else
|
||||
{ X86_64_ACCTON_AS5812_54T_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION(__x86_64_accton_as5812_54t_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef x86_64_accton_as5812_54t_CONFIG_SYS_FAN_FRONT_RPM_MAX
|
||||
{ __x86_64_accton_as5812_54t_config_STRINGIFY_NAME(x86_64_accton_as5812_54t_CONFIG_SYS_FAN_FRONT_RPM_MAX), __x86_64_accton_as5812_54t_config_STRINGIFY_VALUE(x86_64_accton_as5812_54t_CONFIG_SYS_FAN_FRONT_RPM_MAX) },
|
||||
#else
|
||||
{ x86_64_accton_as5812_54t_CONFIG_SYS_FAN_FRONT_RPM_MAX(__x86_64_accton_as5812_54t_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -29,7 +29,9 @@ cdefs: &cdefs
|
||||
- X86_64_ACCTON_AS5812_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION:
|
||||
doc: "Assume chassis fan direction is the same as the PSU fan direction."
|
||||
default: 0
|
||||
|
||||
- x86_64_accton_as5812_54x_CONFIG_SYS_FAN_FRONT_RPM_MAX:
|
||||
doc: "Maximum system fan(Front) rpm."
|
||||
default: 21500
|
||||
|
||||
definitions:
|
||||
cdefs:
|
||||
|
||||
@@ -99,6 +99,16 @@
|
||||
#define X86_64_ACCTON_AS5812_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* x86_64_accton_as5812_54x_CONFIG_SYS_FAN_FRONT_RPM_MAX
|
||||
*
|
||||
* Maximum system fan(Front) rpm. */
|
||||
|
||||
|
||||
#ifndef x86_64_accton_as5812_54x_CONFIG_SYS_FAN_FRONT_RPM_MAX
|
||||
#define x86_64_accton_as5812_54x_CONFIG_SYS_FAN_FRONT_RPM_MAX 21500
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <onlplib/file.h>
|
||||
#include <fcntl.h>
|
||||
#include "platform_lib.h"
|
||||
#include "x86_64_accton_as5812_54x/x86_64_accton_as5812_54x_config.h"
|
||||
|
||||
#define PREFIX_PATH_ON_MAIN_BOARD "/sys/devices/platform/as5812_54x_fan/"
|
||||
#define PREFIX_PATH_ON_PSU "/sys/bus/i2c/devices/"
|
||||
@@ -191,7 +192,7 @@ _onlp_fani_info_get_fan(int local_id, onlp_fan_info_t* info)
|
||||
info->rpm = (info->rpm + atoi(r_data))/2;
|
||||
|
||||
/* get speed percentage from rpm */
|
||||
info->percentage = (info->rpm * 100)/16800;
|
||||
info->percentage = (info->rpm * 100)/x86_64_accton_as5812_54x_CONFIG_SYS_FAN_FRONT_RPM_MAX;
|
||||
|
||||
/* check present */
|
||||
if (info->rpm > 0)
|
||||
|
||||
@@ -49,6 +49,11 @@ x86_64_accton_as5812_54x_config_settings_t x86_64_accton_as5812_54x_config_setti
|
||||
{ __x86_64_accton_as5812_54x_config_STRINGIFY_NAME(X86_64_ACCTON_AS5812_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION), __x86_64_accton_as5812_54x_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5812_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION) },
|
||||
#else
|
||||
{ X86_64_ACCTON_AS5812_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION(__x86_64_accton_as5812_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef x86_64_accton_as5812_54x_CONFIG_SYS_FAN_FRONT_RPM_MAX
|
||||
{ __x86_64_accton_as5812_54x_config_STRINGIFY_NAME(x86_64_accton_as5812_54x_CONFIG_SYS_FAN_FRONT_RPM_MAX), __x86_64_accton_as5812_54x_config_STRINGIFY_VALUE(x86_64_accton_as5812_54x_CONFIG_SYS_FAN_FRONT_RPM_MAX) },
|
||||
#else
|
||||
{ x86_64_accton_as5812_54x_CONFIG_SYS_FAN_FRONT_RPM_MAX(__x86_64_accton_as5812_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user