Index: uspace/drv/time/rtc.c
===================================================================
--- uspace/drv/time/rtc.c	(revision 0b8a3e71b801831700b7f6d1c48c084755775ddd)
+++ uspace/drv/time/rtc.c	(revision b3db669a7999a4c7352c724f8986ac18c85ea5d6)
@@ -43,36 +43,8 @@
 #include <ops/clock.h>
 #include <fibril_synch.h>
+#include <device/hw_res.h>
+#include <devman.h>
 
 #define NAME "RTC"
-
-static int
-rtc_time_get(ddf_fun_t *fun, time_t *t);
-
-static int
-rtc_time_set(ddf_fun_t *fun, time_t t);
-
-static int
-rtc_dev_add(ddf_dev_t *dev);
-
-
-static ddf_dev_ops_t rtc_dev_ops;
-
-/** The RTC device driver's standard operations */
-static driver_ops_t rtc_ops = {
-	.dev_add = rtc_dev_add,
-	.dev_remove = NULL,
-};
-
-/** The RTC device driver structure */
-static driver_t rtc_driver = {
-	.name = NAME,
-	.driver_ops = &rtc_ops,
-};
-
-/** Clock interface */
-static clock_dev_ops_t rtc_clock_dev_ops = {
-	.time_get = rtc_time_get,
-	.time_set = rtc_time_set,
-};
 
 typedef struct rtc {
@@ -86,4 +58,37 @@
 
 
+static int
+rtc_time_get(ddf_fun_t *fun, time_t *t);
+
+static int
+rtc_time_set(ddf_fun_t *fun, time_t t);
+
+static int
+rtc_dev_add(ddf_dev_t *dev);
+
+static int
+rtc_dev_initialize(rtc_t *rtc);
+
+
+static ddf_dev_ops_t rtc_dev_ops;
+
+/** The RTC device driver's standard operations */
+static driver_ops_t rtc_ops = {
+	.dev_add = rtc_dev_add,
+	.dev_remove = NULL,
+};
+
+/** The RTC device driver structure */
+static driver_t rtc_driver = {
+	.name = NAME,
+	.driver_ops = &rtc_ops,
+};
+
+/** Clock interface */
+static clock_dev_ops_t rtc_clock_dev_ops = {
+	.time_get = rtc_time_get,
+	.time_set = rtc_time_set,
+};
+
 /** Initialize the RTC driver */
 static void
@@ -99,4 +104,41 @@
 }
 
+/** Initialize the RTC device
+ *
+ * @param rtc  Pointer to the RTC device
+ *
+ * @return  EOK on success or a negative error code
+ */ 
+static int
+rtc_dev_initialize(rtc_t *rtc)
+{
+	int rc;
+
+	ddf_msg(LVL_DEBUG, "rtc_dev_initialize %s", rtc->dev->name);
+
+	hw_resource_list_t hw_resources;
+	memset(&hw_resources, 0, sizeof(hw_resource_list_t));
+
+	/* Connect to the parent's driver */
+
+	rtc->dev->parent_sess = devman_parent_device_connect(EXCHANGE_SERIALIZE,
+	    rtc->dev->handle, IPC_FLAG_BLOCKING);
+	if (!rtc->dev->parent_sess) {
+		ddf_msg(LVL_ERROR, "Failed to connect to parent driver\
+		    of device %s.", rtc->dev->name);
+		return ENOENT;
+	}
+
+	/* Get the HW resources */
+	rc = hw_res_get_resource_list(rtc->dev->parent_sess, &hw_resources);
+	if (rc != EOK) {
+		ddf_msg(LVL_ERROR, "Failed to get HW resources\
+		    for device %s", rtc->dev->name);
+		return rc;
+	}
+
+	return EOK;
+}
+
 /** Read the current time from the CMOS
  *
@@ -135,4 +177,5 @@
 {
 	rtc_t *rtc;
+	int rc;
 
 	ddf_msg(LVL_DEBUG, "rtc_dev_add %s (handle = %d)",
@@ -146,5 +189,9 @@
 	fibril_mutex_initialize(&rtc->mutex);
 
-	return EOK;
+	rc = rtc_dev_initialize(rtc);
+	if (rc != EOK)
+		return rc;
+
+	return rc;
 }
 
