tpec.h 922 B

1234567891011121314151617181920212223242526272829
  1. /* Read-only ThinkPad embedded-controller sensors (X201/Arrandale class). */
  2. #ifndef TPEC_H
  3. #define TPEC_H
  4. #define TPEC_TEMP_COUNT 16
  5. /* Temperatures are indexed like thinkpad_acpi's temp1..temp16:
  6. * temp_c[0..7] come from EC 0x78..0x7F, temp_c[8..15] from EC 0xC0..0xC7.
  7. * -128 means the EC reports the sensor as not present. */
  8. struct tpec_info {
  9. int present;
  10. char vendor[16];
  11. char product[32];
  12. char version[32];
  13. int temp_c[TPEC_TEMP_COUNT];
  14. unsigned int fan_rpm;
  15. unsigned int fan_level; /* raw EC 0x2F value */
  16. };
  17. /* Probe SMBIOS + the EC once on the BSP; logs the result to COM1. Does
  18. * nothing (present = 0) unless SMBIOS identifies a Lenovo/IBM machine and the
  19. * EC answers, so boards without one are never touched. */
  20. void tpec_init(void);
  21. /* Read the current temperatures, fan speed and fan level. present is 0 when
  22. * no ThinkPad EC was found. */
  23. void tpec_read(struct tpec_info *out);
  24. #endif