src/include: Add missing includes
[coreboot.git] / src / include / superio / hwm5_conf.h
blob9102de29612f0c3d130c27a35226fd1c66152bbc
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef DEVICE_PNP_HWM5_CONF_H
4 #define DEVICE_PNP_HWM5_CONF_H
6 #include <device/pnp.h>
7 #include <stdint.h>
9 /* The address/data register pair for the indirect/indexed IO space of the
10 * hardware monitor (HWM) that does temperature and voltage sensing and fan
11 * control in ITE, Nuvoton and Winbond super IO chips aren't at offset 0 and 1
12 * of the corresponding IO address region, but at offset 5 and 6. */
15 * u8 pnp_read_hwm5_index(u16 port, u8 reg)
16 * Description:
17 * This routine reads indexed I/O registers. The reg byte is written
18 * to the index register at I/O address = port + 5. The result is then
19 * read from the data register at I/O address = port + 6.
21 * Parameters:
22 * @param[in] u16 base = The I/O address of the port index register.
23 * @param[in] u8 reg = The offset within the indexed space.
24 * @param[out] u8 result = The value read back from the data register.
26 static inline u8 pnp_read_hwm5_index(u16 base, u8 reg)
28 return pnp_read_index(base + 5, reg);
32 * void pnp_write_hwm5_index(u16 port, u8 reg, u8 value)
33 * Description:
34 * This routine writes indexed I/O registers. The reg byte is written
35 * to the index register at I/O address = port + 5. The value byte is then
36 * written to the data register at I/O address = port + 6.
38 * Parameters:
39 * @param[in] u16 base = The address of the port index register.
40 * @param[in] u8 reg = The offset within the indexed space.
41 * @param[in] u8 value = The value to be written to the data register.
43 static inline void pnp_write_hwm5_index(u16 base, u8 reg, u8 value)
45 pnp_write_index(base + 5, reg, value);
48 #endif /* DEVICE_PNP_HWM5_CONF_H */