Index: uspace/drv/char/pc-lpt/Makefile
===================================================================
--- uspace/drv/char/pc-lpt/Makefile	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
+++ uspace/drv/char/pc-lpt/Makefile	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2018 Jiri Svoboda
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+USPACE_PREFIX = ../../..
+LIBS = drv
+BINARY = pc-lpt
+
+SOURCES = \
+	main.c \
+	pc-lpt.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/drv/char/pc-lpt/doc/doxygroups.h
===================================================================
--- uspace/drv/char/pc-lpt/doc/doxygroups.h	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
+++ uspace/drv/char/pc-lpt/doc/doxygroups.h	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
@@ -0,0 +1,4 @@
+/** @addtogroup uspace_drv_pc_lpt pc-lpt
+ * @brief PC parallel port driver
+ * @ingroup drvs
+ */
Index: uspace/drv/char/pc-lpt/main.c
===================================================================
--- uspace/drv/char/pc-lpt/main.c	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
+++ uspace/drv/char/pc-lpt/main.c	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2018 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup uspace_drv_pc_lpt
+ * @{
+ */
+/** @file PC parallel port driver
+ */
+
+#include <ddf/driver.h>
+#include <ddf/log.h>
+#include <device/hw_res_parsed.h>
+#include <errno.h>
+#include <stdio.h>
+
+#include "pc-lpt.h"
+
+#define NAME  "pc-lpt"
+
+static errno_t pc_lpt_dev_add(ddf_dev_t *dev);
+static errno_t pc_lpt_dev_remove(ddf_dev_t *dev);
+static errno_t pc_lpt_dev_gone(ddf_dev_t *dev);
+static errno_t pc_lpt_fun_online(ddf_fun_t *fun);
+static errno_t pc_lpt_fun_offline(ddf_fun_t *fun);
+
+static driver_ops_t driver_ops = {
+	.dev_add = pc_lpt_dev_add,
+	.dev_remove = pc_lpt_dev_remove,
+	.dev_gone = pc_lpt_dev_gone,
+	.fun_online = pc_lpt_fun_online,
+	.fun_offline = pc_lpt_fun_offline
+};
+
+static driver_t pc_lpt_driver = {
+	.name = NAME,
+	.driver_ops = &driver_ops
+};
+
+static errno_t pc_lpt_get_res(ddf_dev_t *dev, pc_lpt_res_t *res)
+{
+	async_sess_t *parent_sess;
+	hw_res_list_parsed_t hw_res;
+	errno_t rc;
+
+	parent_sess = ddf_dev_parent_sess_get(dev);
+	if (parent_sess == NULL)
+		return ENOMEM;
+
+	hw_res_list_parsed_init(&hw_res);
+	rc = hw_res_get_list_parsed(parent_sess, &hw_res, 0);
+	if (rc != EOK)
+		return rc;
+
+	if (hw_res.io_ranges.count != 1) {
+		rc = EINVAL;
+		goto error;
+	}
+
+	res->base = RNGABS(hw_res.io_ranges.ranges[0]);
+
+	if (hw_res.irqs.count != 1) {
+		rc = EINVAL;
+		goto error;
+	}
+
+	res->irq = hw_res.irqs.irqs[0];
+
+	return EOK;
+error:
+	hw_res_list_parsed_clean(&hw_res);
+	return rc;
+}
+
+static errno_t pc_lpt_dev_add(ddf_dev_t *dev)
+{
+	pc_lpt_t *pc_lpt;
+	pc_lpt_res_t res;
+	errno_t rc;
+
+	ddf_msg(LVL_DEBUG, "pc_lpt_dev_add(%p)", dev);
+
+	pc_lpt = ddf_dev_data_alloc(dev, sizeof(pc_lpt_t));
+	if (pc_lpt == NULL) {
+		ddf_msg(LVL_ERROR, "Failed allocating soft state.");
+		return ENOMEM;
+	}
+
+	pc_lpt->dev = dev;
+
+	rc = pc_lpt_get_res(dev, &res);
+	if (rc != EOK) {
+		ddf_msg(LVL_ERROR, "Failed getting hardware resource list.");
+		return EIO;
+	}
+
+	return pc_lpt_add(pc_lpt, &res);
+}
+
+static errno_t pc_lpt_dev_remove(ddf_dev_t *dev)
+{
+	pc_lpt_t *pc_lpt = (pc_lpt_t *)ddf_dev_data_get(dev);
+
+	ddf_msg(LVL_DEBUG, "pc_lpt_dev_remove(%p)", dev);
+
+	return pc_lpt_remove(pc_lpt);
+}
+
+static errno_t pc_lpt_dev_gone(ddf_dev_t *dev)
+{
+	pc_lpt_t *pc_lpt = (pc_lpt_t *)ddf_dev_data_get(dev);
+
+	ddf_msg(LVL_DEBUG, "pc_lpt_dev_gone(%p)", dev);
+
+	return pc_lpt_gone(pc_lpt);
+}
+
+static errno_t pc_lpt_fun_online(ddf_fun_t *fun)
+{
+	ddf_msg(LVL_DEBUG, "pc_lpt_fun_online()");
+	return ddf_fun_online(fun);
+}
+
+static errno_t pc_lpt_fun_offline(ddf_fun_t *fun)
+{
+	ddf_msg(LVL_DEBUG, "pc_lpt_fun_offline()");
+	return ddf_fun_offline(fun);
+}
+
+int main(int argc, char *argv[])
+{
+	printf(NAME ": PC parallel port driver\n");
+	ddf_log_init(NAME);
+	return ddf_driver_main(&pc_lpt_driver);
+}
+
+/** @}
+ */
Index: uspace/drv/char/pc-lpt/pc-lpt.c
===================================================================
--- uspace/drv/char/pc-lpt/pc-lpt.c	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
+++ uspace/drv/char/pc-lpt/pc-lpt.c	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2018 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @file
+ * @brief PC parallel port driver.
+ */
+
+#include <async.h>
+#include <bitops.h>
+#include <ddf/driver.h>
+#include <ddf/log.h>
+#include <ddi.h>
+#include <errno.h>
+#include <fibril_synch.h>
+#include <io/chardev_srv.h>
+
+#include "pc-lpt.h"
+#include "pc-lpt_hw.h"
+
+static void pc_lpt_connection(ipc_call_t *, void *);
+
+static errno_t pc_lpt_read(chardev_srv_t *, void *, size_t, size_t *);
+static errno_t pc_lpt_write(chardev_srv_t *, const void *, size_t, size_t *);
+
+static chardev_ops_t pc_lpt_chardev_ops = {
+	.read = pc_lpt_read,
+	.write = pc_lpt_write
+};
+
+static irq_cmd_t pc_lpt_cmds_proto[] = {
+	{
+		.cmd = CMD_DECLINE
+	}
+};
+
+/** PC LPT IRQ handler.
+ *
+ * Note that while the standard PC parallel port supports IRQ, it seems
+ * drivers tend to avoid using them (for a reason?) These IRQs tend
+ * to be used by other HW as well (Sound Blaster) so caution is in order.
+ * Also not sure, if/how the IRQ needs to be cleared.
+ *
+ * Currently we don't enable IRQ and don't handle it in any way.
+ */
+static void pc_lpt_irq_handler(ipc_call_t *call, void *arg)
+{
+	pc_lpt_t *lpt = (pc_lpt_t *) arg;
+
+	(void) lpt;
+}
+
+/** Add pc-lpt device. */
+errno_t pc_lpt_add(pc_lpt_t *lpt, pc_lpt_res_t *res)
+{
+	ddf_fun_t *fun = NULL;
+	bool bound = false;
+	irq_cmd_t *pc_lpt_cmds = NULL;
+	uint8_t control;
+	uint8_t r;
+	errno_t rc;
+
+	lpt->irq_handle = CAP_NIL;
+	fibril_mutex_initialize(&lpt->hw_lock);
+
+	pc_lpt_cmds = malloc(sizeof(pc_lpt_cmds_proto));
+	if (pc_lpt_cmds == NULL) {
+		rc = ENOMEM;
+		goto error;
+	}
+
+	lpt->res = *res;
+
+	fun = ddf_fun_create(lpt->dev, fun_exposed, "a");
+	if (fun == NULL) {
+		ddf_msg(LVL_ERROR, "Error creating function 'a'.");
+		rc = ENOMEM;
+		goto error;
+	}
+
+	rc = pio_enable((void *)res->base, sizeof(pc_lpt_regs_t),
+	    (void **) &lpt->regs);
+	if (rc != EOK) {
+		ddf_msg(LVL_ERROR, "Error enabling I/O");
+		goto error;
+	}
+
+	ddf_fun_set_conn_handler(fun, pc_lpt_connection);
+
+	lpt->irq_range[0].base = res->base;
+	lpt->irq_range[0].size = 1;
+
+	memcpy(pc_lpt_cmds, pc_lpt_cmds_proto, sizeof(pc_lpt_cmds_proto));
+	pc_lpt_cmds[0].addr = (void *) res->base;
+
+	lpt->irq_code.rangecount = 1;
+	lpt->irq_code.ranges = lpt->irq_range;
+	lpt->irq_code.cmdcount = sizeof(pc_lpt_cmds_proto) / sizeof(irq_cmd_t);
+	lpt->irq_code.cmds = pc_lpt_cmds;
+
+	rc = async_irq_subscribe(res->irq, pc_lpt_irq_handler, lpt,
+	    &lpt->irq_code, &lpt->irq_handle);
+	if (rc != EOK) {
+		ddf_msg(LVL_ERROR, "Error registering IRQ code.");
+		goto error;
+	}
+
+	control = BIT_V(uint8_t, ctl_select) | BIT_V(uint8_t, ctl_ninit);
+	pio_write_8(&lpt->regs->control, control);
+	r = pio_read_8(&lpt->regs->control);
+	if ((r & 0xf) != control) {
+		/* Device not present */
+		rc = EIO;
+		goto error;
+	}
+
+	control |= BIT_V(uint8_t, ctl_autofd);
+	pio_write_8(&lpt->regs->control, control);
+	r = pio_read_8(&lpt->regs->control);
+	if ((r & 0xf) != control) {
+		/* Device not present */
+		rc = EIO;
+		goto error;
+	}
+
+	control &= ~BIT_V(uint8_t, ctl_autofd);
+	pio_write_8(&lpt->regs->control, control);
+
+	chardev_srvs_init(&lpt->cds);
+	lpt->cds.ops = &pc_lpt_chardev_ops;
+	lpt->cds.sarg = lpt;
+
+	rc = ddf_fun_bind(fun);
+	if (rc != EOK) {
+		ddf_msg(LVL_ERROR, "Error binding function 'a'.");
+		goto error;
+	}
+
+	bound = true;
+
+	rc = ddf_fun_add_to_category(fun, "printer-port");
+	if (rc != EOK) {
+		ddf_msg(LVL_ERROR, "Error adding function 'a' to category "
+		    "'printer-port'.");
+		goto error;
+	}
+
+	return EOK;
+error:
+	if (CAP_HANDLE_VALID(lpt->irq_handle))
+		async_irq_unsubscribe(lpt->irq_handle);
+	if (bound)
+		ddf_fun_unbind(fun);
+	if (fun != NULL)
+		ddf_fun_destroy(fun);
+	free(pc_lpt_cmds);
+
+	return rc;
+}
+
+/** Remove pc-lpt device */
+errno_t pc_lpt_remove(pc_lpt_t *lpt)
+{
+	return ENOTSUP;
+}
+
+/** Pc-lpt device gone */
+errno_t pc_lpt_gone(pc_lpt_t *lpt)
+{
+	return ENOTSUP;
+}
+
+/** Write a single byte to the parallel port.
+ *
+ * @param lpt Parallel port (locked)
+ * @param ch Byte
+ */
+static void pc_lpt_putchar(pc_lpt_t *lpt, uint8_t ch)
+{
+	uint8_t status;
+	uint8_t control;
+
+	assert(fibril_mutex_is_locked(&lpt->hw_lock));
+
+	/* Write data */
+	pio_write_8(&lpt->regs->data, ch);
+
+	/* Wait for S7/nbusy to become 1 */
+	do {
+		status = pio_read_8(&lpt->regs->status);
+		// FIXME Need to time out with an error after a while
+	} while ((status & BIT_V(uint8_t, sts_nbusy)) == 0);
+
+	control = pio_read_8(&lpt->regs->control);
+	pio_write_8(&lpt->regs->control, control | BIT_V(uint8_t, ctl_strobe));
+	fibril_usleep(5);
+	pio_write_8(&lpt->regs->control, control & ~BIT_V(uint8_t, ctl_strobe));
+}
+
+/** Read from pc-lpt device */
+static errno_t pc_lpt_read(chardev_srv_t *srv, void *buf, size_t size,
+    size_t *nread)
+{
+	pc_lpt_t *lpt = (pc_lpt_t *) srv->srvs->sarg;
+	(void) lpt;
+	return ENOTSUP;
+}
+
+/** Write to pc-lpt device */
+static errno_t pc_lpt_write(chardev_srv_t *srv, const void *data, size_t size,
+    size_t *nwr)
+{
+	pc_lpt_t *lpt = (pc_lpt_t *) srv->srvs->sarg;
+	size_t i;
+	uint8_t *dp = (uint8_t *) data;
+
+	fibril_mutex_lock(&lpt->hw_lock);
+
+	for (i = 0; i < size; i++)
+		pc_lpt_putchar(lpt, dp[i]);
+
+	fibril_mutex_unlock(&lpt->hw_lock);
+
+	*nwr = size;
+	return EOK;
+}
+
+/** Character device connection handler. */
+static void pc_lpt_connection(ipc_call_t *icall, void *arg)
+{
+	pc_lpt_t *lpt = (pc_lpt_t *) ddf_dev_data_get(
+	    ddf_fun_get_dev((ddf_fun_t *) arg));
+
+	chardev_conn(icall, &lpt->cds);
+}
+
+/** @}
+ */
Index: uspace/drv/char/pc-lpt/pc-lpt.h
===================================================================
--- uspace/drv/char/pc-lpt/pc-lpt.h	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
+++ uspace/drv/char/pc-lpt/pc-lpt.h	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup uspace_drv_pc_lpt
+ * @{
+ */
+/** @file
+ */
+
+#ifndef PC_LPT_H
+#define PC_LPT_H
+
+#include <async.h>
+#include <ddf/driver.h>
+#include <ddi.h>
+#include <fibril_synch.h>
+#include <io/chardev_srv.h>
+#include <stdint.h>
+
+#include "pc-lpt_hw.h"
+
+/** PC parallel port resources */
+typedef struct {
+	uintptr_t base;
+	int irq;
+} pc_lpt_res_t;
+
+/** PC parallel port */
+typedef struct {
+	/** DDF device */
+	ddf_dev_t *dev;
+	/** Character device service structure */
+	chardev_srvs_t cds;
+	/** Hardware resources */
+	pc_lpt_res_t res;
+	/** PIO range */
+	irq_pio_range_t irq_range[1];
+	/** IRQ code */
+	irq_code_t irq_code;
+	/** Hardware access lock */
+	fibril_mutex_t hw_lock;
+	/** Hardware registers */
+	pc_lpt_regs_t *regs;
+	/** IRQ handle */
+	cap_irq_handle_t irq_handle;
+} pc_lpt_t;
+
+extern errno_t pc_lpt_add(pc_lpt_t *, pc_lpt_res_t *);
+extern errno_t pc_lpt_remove(pc_lpt_t *);
+extern errno_t pc_lpt_gone(pc_lpt_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/drv/char/pc-lpt/pc-lpt.ma
===================================================================
--- uspace/drv/char/pc-lpt/pc-lpt.ma	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
+++ uspace/drv/char/pc-lpt/pc-lpt.ma	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
@@ -0,0 +1,1 @@
+10 isa/lpt
Index: uspace/drv/char/pc-lpt/pc-lpt_hw.h
===================================================================
--- uspace/drv/char/pc-lpt/pc-lpt_hw.h	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
+++ uspace/drv/char/pc-lpt/pc-lpt_hw.h	(revision 10b21a1b4acffc43c8b5c6b3509a57de3f6d691e)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup uspace_drv_pc_lpt
+ * @{
+ */
+/** @file
+ */
+
+#ifndef PC_LPT_HW_H
+#define PC_LPT_HW_H
+
+#include <ddi.h>
+
+/** PC parallel port registers */
+typedef struct {
+	/** Data out register */
+	ioport8_t data;
+	/** Status register */
+	ioport8_t status;
+	/** Control register */
+	ioport8_t control;
+} pc_lpt_regs_t;
+
+/** Printer control register bits */
+typedef enum {
+	/** Strobe */
+	ctl_strobe = 0,
+	/** Auto linefeed */
+	ctl_autofd = 1,
+	/** -Init */
+	ctl_ninit = 2,
+	/** Select */
+	ctl_select = 3,
+	/** IRQ Enable */
+	ctl_irq_enable = 4
+} pc_lpt_ctl_bits_t;
+
+/** Printer status register bits */
+typedef enum {
+	/** -Error */
+	sts_nerror = 3,
+	/** Select */
+	sts_select = 4,
+	/** Init */
+	sts_paper_end = 5,
+	/** -Ack */
+	sts_nack = 6,
+	/** -Busy */
+	sts_nbusy = 7
+} pc_lpt_sts_bits_t;
+
+#endif
+
+/** @}
+ */
