[v2 8/9] hwmon: (nct7904) Fix wrong attribute names for temperature.
From: Amy.Shih
Date: Mon Jun 17 2019 - 04:27:09 EST
From: "amy.shih" <amy.shih@xxxxxxxxxxxxxxxx>
Emergency attributes without crit attributes are not acceptable.
In datasheet there are registers labeled "critical", and there is
no mention of "emergency". Thus, set the attribute names from
"temp[1-*]_emergency" and "temp[1-*]_emergency_hyst" to
"temp[1-*]_crit" and "temp[1-*]_crit_hyst".
Signed-off-by: amy.shih <amy.shih@xxxxxxxxxxxxxxxx>
---
Changes in v2:
- Fix wrong attribute names for temperature.
drivers/hwmon/nct7904.c | 48 ++++++++++++++++++++---------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/drivers/hwmon/nct7904.c b/drivers/hwmon/nct7904.c
index c74f919c0181..fc145c73a4e7 100644
--- a/drivers/hwmon/nct7904.c
+++ b/drivers/hwmon/nct7904.c
@@ -407,12 +407,12 @@ static int nct7904_read_temp(struct device *dev, u32 attr, int channel,
reg2 = TEMP_CH1_CH_REG;
reg3 = DTS_T_CPU1_CH_REG;
break;
- case hwmon_temp_emergency:
+ case hwmon_temp_crit:
reg1 = LTD_HV_LL_REG;
reg2 = TEMP_CH1_W_REG;
reg3 = DTS_T_CPU1_W_REG;
break;
- case hwmon_temp_emergency_hyst:
+ case hwmon_temp_crit_hyst:
reg1 = LTD_LV_LL_REG;
reg2 = TEMP_CH1_WH_REG;
reg3 = DTS_T_CPU1_WH_REG;
@@ -454,8 +454,8 @@ static umode_t nct7904_temp_is_visible(const void *_data, u32 attr, int channel)
break;
case hwmon_temp_max:
case hwmon_temp_max_hyst:
- case hwmon_temp_emergency:
- case hwmon_temp_emergency_hyst:
+ case hwmon_temp_crit:
+ case hwmon_temp_crit_hyst:
if (channel < 5) {
if (data->tcpu_mask & BIT(channel))
return 0644;
@@ -516,12 +516,12 @@ static int nct7904_write_temp(struct device *dev, u32 attr, int channel,
reg2 = TEMP_CH1_CH_REG;
reg3 = DTS_T_CPU1_CH_REG;
break;
- case hwmon_temp_emergency:
+ case hwmon_temp_crit:
reg1 = LTD_HV_LL_REG;
reg2 = TEMP_CH1_W_REG;
reg3 = DTS_T_CPU1_W_REG;
break;
- case hwmon_temp_emergency_hyst:
+ case hwmon_temp_crit_hyst:
reg1 = LTD_LV_LL_REG;
reg2 = TEMP_CH1_WH_REG;
reg3 = DTS_T_CPU1_WH_REG;
@@ -799,32 +799,32 @@ static const struct hwmon_channel_info *nct7904_info[] = {
HWMON_PWM_INPUT | HWMON_PWM_ENABLE),
HWMON_CHANNEL_INFO(temp,
HWMON_T_INPUT | HWMON_T_ALARM | HWMON_T_MAX |
- HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_EMERGENCY |
- HWMON_T_EMERGENCY_HYST,
+ HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_CRIT |
+ HWMON_T_CRIT_HYST,
HWMON_T_INPUT | HWMON_T_ALARM | HWMON_T_MAX |
- HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_EMERGENCY |
- HWMON_T_EMERGENCY_HYST,
+ HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_CRIT |
+ HWMON_T_CRIT_HYST,
HWMON_T_INPUT | HWMON_T_ALARM | HWMON_T_MAX |
- HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_EMERGENCY |
- HWMON_T_EMERGENCY_HYST,
+ HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_CRIT |
+ HWMON_T_CRIT_HYST,
HWMON_T_INPUT | HWMON_T_ALARM | HWMON_T_MAX |
- HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_EMERGENCY |
- HWMON_T_EMERGENCY_HYST,
+ HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_CRIT |
+ HWMON_T_CRIT_HYST,
HWMON_T_INPUT | HWMON_T_ALARM | HWMON_T_MAX |
- HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_EMERGENCY |
- HWMON_T_EMERGENCY_HYST,
+ HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_CRIT |
+ HWMON_T_CRIT_HYST,
HWMON_T_INPUT | HWMON_T_ALARM | HWMON_T_MAX |
- HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_EMERGENCY |
- HWMON_T_EMERGENCY_HYST,
+ HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_CRIT |
+ HWMON_T_CRIT_HYST,
HWMON_T_INPUT | HWMON_T_ALARM | HWMON_T_MAX |
- HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_EMERGENCY |
- HWMON_T_EMERGENCY_HYST,
+ HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_CRIT |
+ HWMON_T_CRIT_HYST,
HWMON_T_INPUT | HWMON_T_ALARM | HWMON_T_MAX |
- HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_EMERGENCY |
- HWMON_T_EMERGENCY_HYST,
+ HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_CRIT |
+ HWMON_T_CRIT_HYST,
HWMON_T_INPUT | HWMON_T_ALARM | HWMON_T_MAX |
- HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_EMERGENCY |
- HWMON_T_EMERGENCY_HYST),
+ HWMON_T_MAX_HYST | HWMON_T_TYPE | HWMON_T_CRIT |
+ HWMON_T_CRIT_HYST),
NULL
};
--
2.17.1