summaryrefslogtreecommitdiffstats
path: root/device
diff options
context:
space:
mode:
Diffstat (limited to 'device')
-rw-r--r--device/pnp_raw.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/device/pnp_raw.c b/device/pnp_raw.c
index 1fd7b3bea6b9..653c467ad45f 100644
--- a/device/pnp_raw.c
+++ b/device/pnp_raw.c
@@ -52,7 +52,8 @@ void rawpnp_exit_ext_func_mode(u16 port)
*
* This is done by writing the register number to the port, and the value
* into port + 1. This code assumes that the data port is always the
- * config-port plus 1, but luckily this is true for pretty much all devices.
+ * config-port plus 1, but luckily this is true for pretty much all devices, since
+ * it is part of the standard.
*
* @param port The device I/O port.
* @param reg The register number.
@@ -65,6 +66,24 @@ void rawpnp_write_config(u16 port, u8 reg, u8 value)
}
/**
+ * Read an 8-bit pnp config value
+ *
+ * This is done by writing the register number to the port, and the value
+ * into port + 1. This code assumes that the data port is always the
+ * config-port plus 1, but luckily this is true for pretty much all devices, since
+ * it is part of the standard.
+ *
+ * @param port The device I/O port.
+ * @param reg The register number.
+ * @returns value of the register
+ */
+u8 rawpnp_read_config(u16 port, u8 reg)
+{
+ outb(reg, port);
+ return inb(port + 1);
+}
+
+/**
* Select a logical device.
*
* PNP has up to 16 logical devices. They are selected by writing the