1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef DRIVERS_I2C_NCT7802Y_CHIP_H
4 #define DRIVERS_I2C_NCT7802Y_CHIP_H
8 #define NCT7802Y_PECI_CNT 2
9 #define NCT7802Y_FAN_CNT 3
10 #define NCT7802Y_RTD_CNT 3
12 /* Remote temperature diode sensors mode */
13 enum nct7802y_rtd_mode
{
20 enum nct7802y_peci_mode
{
27 struct nct7802y_peci_config
{
28 enum nct7802y_peci_mode mode
;
32 enum nct7802y_fan_mode
{
38 enum nct7802y_fan_smartmode
{
39 SMART_FAN_DUTY
= 0, /* Target values given in duty cycle %. */
40 SMART_FAN_RPM
, /* Target values given in RPM. */
43 enum nct7802y_fan_speed
{
44 FAN_SPEED_NORMAL
= 0, /* RPM values <= 12,750. */
45 FAN_SPPED_HIGHSPEED
, /* RPM values <= 25,500. */
48 enum nct7802y_fan_pecierror
{
49 PECI_ERROR_KEEP
= 0, /* Keep current value. */
50 PECI_ERROR_VALUE
, /* Use `pecierror_minduty`. */
51 PECI_ERROR_FULLSPEED
, /* Run PWM at 100% duty cycle. */
54 enum nct7802y_temp_source
{
55 TEMP_SOURCE_REMOTE_1
= 0,
61 TEMP_SOURCE_PROGRAMMABLE_0
,
62 TEMP_SOURCE_PROGRAMMABLE_1
,
65 struct nct7802y_sensors_config
{
67 enum nct7802y_rtd_mode rtd
[NCT7802Y_RTD_CNT
];
70 struct nct7802y_fan_smartconfig
{
71 enum nct7802y_fan_smartmode mode
;
72 enum nct7802y_fan_speed speed
;
73 enum nct7802y_temp_source tempsrc
;
81 struct nct7802y_fan_config
{
82 enum nct7802y_fan_mode mode
;
85 struct nct7802y_fan_smartconfig smart
;
89 /* Implements only those parts currently used by coreboot mainboards. */
90 struct drivers_i2c_nct7802y_config
{
91 struct nct7802y_peci_config peci
[NCT7802Y_PECI_CNT
];
92 struct nct7802y_fan_config fan
[NCT7802Y_FAN_CNT
];
93 struct nct7802y_sensors_config sensors
;
94 enum nct7802y_fan_pecierror on_pecierror
;
98 #endif /* DRIVERS_I2C_NCT7802Y_CHIP_H */