Index: uspace/drv/time/cmos-rtc/cmos-rtc.c
===================================================================
--- uspace/drv/time/cmos-rtc/cmos-rtc.c	(revision 557b7b3076331d719e1781cc0f4d4dad0d578afc)
+++ uspace/drv/time/cmos-rtc/cmos-rtc.c	(revision 0883de88d3c2a6ddbe6f8b984a59a88b5b70af60)
@@ -48,4 +48,6 @@
 #define NAME "cmos-rtc"
 
+#define REG_COUNT 2
+
 typedef struct rtc {
 	/** DDF device node */
@@ -57,4 +59,6 @@
 	/** The base I/O address of the device registers */
 	uint32_t io_addr;
+	/** The I/O port used to access the CMOS registers */
+	ioport8_t *port;
 } rtc_t;
 
@@ -71,4 +75,7 @@
 static int
 rtc_dev_initialize(rtc_t *rtc);
+
+static bool
+rtc_pio_enable(rtc_t *rtc);
 
 
@@ -104,4 +111,24 @@
 	rtc_dev_ops.interfaces[CLOCK_DEV_IFACE] = &rtc_clock_dev_ops;
 	rtc_dev_ops.default_handler = NULL; /* XXX */
+}
+
+/** Enable the I/O ports of the device
+ *
+ * @param rtc  The real time clock device
+ *
+ * @return  true in case of success, false otherwise
+ */
+static bool
+rtc_pio_enable(rtc_t *rtc)
+{
+	if (pio_enable((void *)(uintptr_t) rtc->io_addr, REG_COUNT,
+	    (void **) &rtc->port)) {
+
+		ddf_msg(LVL_ERROR, "Cannot map the port %#" PRIx32
+		    " for device %s", rtc->io_addr, rtc->dev->name);
+		return false;
+	}
+
+	return true;
 }
 
@@ -203,4 +230,5 @@
 {
 	rtc_t *rtc;
+	ddf_fun_t *fun;
 	int rc;
 
@@ -219,4 +247,28 @@
 		return rc;
 
+	/* XXX Need cleanup */
+	if (!rtc_pio_enable(rtc))
+		return EADDRNOTAVAIL;
+
+	fun = ddf_fun_create(dev, fun_exposed, "a");
+	if (!fun) {
+		ddf_msg(LVL_ERROR, "Failed creating function");
+		return ENOENT;
+	}
+
+	fun->ops = &rtc_dev_ops;
+	rc = ddf_fun_bind(fun);
+	if (rc != EOK) {
+		ddf_msg(LVL_ERROR, "Failed binding function");
+		return rc;
+	}
+
+	rtc->fun = fun;
+
+	ddf_fun_add_to_category(fun, "clock");
+
+	ddf_msg(LVL_NOTE, "Device %s successfully initialized",
+	    dev->name);
+
 	return rc;
 }
