superio/f71869ad: Add temperature sensor type

This patch makes it possible to set the "Temperature Sensor Type Register"
at index 6Bh from the devicetree, allowing the use of thermistors instead of
BJT type sensors.

Register documentation (from page 60 of the F71869 datasheet):

6.6.25 Temperature Sensor Type Register - Index 6Bh
Bit 7-4: reserved
Bit 3: T3_MODE (0: thermistor, 1: BJT [default])
Bit 2: T2_MODE (0: thermistor, 1: BJT [default])
Bit 1: T1_MODE (0: thermistor, 1: BJT [default])
Bit 0: reserved

Change-Id: I6af0d93061ec49aec7a9181cdf7affd60fbdca73
Signed-off-by: Renze Nicolai <renze@rnplus.nl>
Reviewed-on: https://review.coreboot.org/22935
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Renze Nicolai 2017-12-18 20:28:47 +01:00 committed by Felix Held
parent b5b53db8fe
commit 0766d2c228
2 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,7 @@ struct superio_fintek_f71869ad_config {
uint8_t hwm_fan1_seg2_speed_count; uint8_t hwm_fan1_seg2_speed_count;
uint8_t hwm_fan1_seg3_speed_count; uint8_t hwm_fan1_seg3_speed_count;
uint8_t hwm_fan1_temp_map_sel; uint8_t hwm_fan1_temp_map_sel;
uint8_t hwm_temp_sensor_type;
}; };
#endif /* SUPERIO_FINTEK_F71869AD_CHIP_H */ #endif /* SUPERIO_FINTEK_F71869AD_CHIP_H */

View File

@ -50,6 +50,7 @@
#define HWM_FAN1_SEG2_SPEED_COUNT 0xAB #define HWM_FAN1_SEG2_SPEED_COUNT 0xAB
#define HWM_FAN1_SEG3_SPEED_COUNT 0xAC #define HWM_FAN1_SEG3_SPEED_COUNT 0xAC
#define HWM_FAN1_TEMP_MAP_SEL 0xAF #define HWM_FAN1_TEMP_MAP_SEL 0xAF
#define HWM_TEMP_SENSOR_TYPE 0x6B
/* note: multifunc registers need to be tweaked before here */ /* note: multifunc registers need to be tweaked before here */
void f71869ad_hwm_init(struct device *dev) void f71869ad_hwm_init(struct device *dev)
@ -97,6 +98,8 @@ void f71869ad_hwm_init(struct device *dev)
pnp_write_index(port, HWM_FAN1_SEG1_SPEED_COUNT, conf->hwm_fan1_seg1_speed_count); pnp_write_index(port, HWM_FAN1_SEG1_SPEED_COUNT, conf->hwm_fan1_seg1_speed_count);
pnp_write_index(port, HWM_FAN1_SEG2_SPEED_COUNT, conf->hwm_fan1_seg2_speed_count); pnp_write_index(port, HWM_FAN1_SEG2_SPEED_COUNT, conf->hwm_fan1_seg2_speed_count);
pnp_write_index(port, HWM_FAN1_SEG3_SPEED_COUNT, conf->hwm_fan1_seg3_speed_count); pnp_write_index(port, HWM_FAN1_SEG3_SPEED_COUNT, conf->hwm_fan1_seg3_speed_count);
/* Temperature sensor type */
pnp_write_index(port, HWM_TEMP_SENSOR_TYPE, conf->hwm_temp_sensor_type);
pnp_exit_conf_mode(dev); pnp_exit_conf_mode(dev);
} }