+#define REG 0x2e /* The register to read/write */
+#define DEV 0x07 /* Register: Logical device select */
+#define VAL 0x2f /* The value to read/write */
+#define PME 0x04 /* The device with the fan registers in it */
+#define DEVID 0x20 /* Register: Device ID */
+
+static inline void
+superio_outb(int reg, int val)
+{
+ outb(reg, REG);
+ outb(val, VAL);
+}
+
+static inline int
+superio_inb(int reg)
+{
+ outb(reg, REG);
+ return inb(VAL);
+}
+
+static inline void
+superio_select(void)
+{
+ outb(DEV, REG);
+ outb(PME, VAL);
+}
+
+static inline void
+superio_enter(void)
+{
+ outb(0x87, REG);
+ outb(0x01, REG);
+ outb(0x55, REG);
+ outb(0x55, REG);
+}
+
+static inline void
+superio_exit(void)
+{
+ outb(0x02, REG);
+ outb(0x02, VAL);
+}
+
+/* just IT8712F for now - this should be extended to support the other
+ chips as well */
+#define IT8712F_DEVID 0x8712
+#define IT87_ACT_REG 0x30
+#define IT87_BASE_REG 0x60