summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-07-19 08:34:33 +0200
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-07-18 20:20:04 +0800
commitd5b96bdca994ab00de350fe698a7daa09292ab29 (patch)
tree37f75b483d202827e4036578fbb75918a9f86348 /include
parent56fe623bfeb0dade618f9f93a4b9c125694e4c81 (diff)
downloadbarebox-d5b96bdca994ab00de350fe698a7daa09292ab29.tar.gz
barebox-d5b96bdca994ab00de350fe698a7daa09292ab29.tar.xz
device: Add a dev_request_mem_region function
We might want to add real resource tracking later. Also The first resource may not be a IORESOURCE_MEM at all. For these reasons introduce a wrapper function for driver so that they do not have to fiddle with resources directly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'include')
-rw-r--r--include/driver.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/driver.h b/include/driver.h
index ed3df16f7c..0fc254dbbc 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -188,6 +188,20 @@ static inline const char *dev_name(const struct device_d *dev)
return dev_id(dev);
}
+/*
+ * get register base 'num' for a device
+ */
+void __iomem *dev_get_mem_region(struct device_d *dev, int num);
+
+/*
+ * exlusively request register base 'num' for a device
+ */
+static inline void __iomem *dev_request_mem_region(struct device_d *dev, int num)
+{
+ /* no resource tracking yet */
+ return dev_get_mem_region(dev, num);
+}
+
/* linear list over all available devices
*/
extern struct list_head device_list;