summaryrefslogtreecommitdiffstats
path: root/drivers/rapidio/rio.c
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2016-03-22 22:26:38 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-22 23:36:02 +0100
commit5024622f583eb242ed8040d0b9d1e0d2458d1db8 (patch)
treedcfb1c09c13adaa0dc188667fa6169791e3ab72c /drivers/rapidio/rio.c
parentrapidio: add lock protection for doorbell list (diff)
downloadlinux-5024622f583eb242ed8040d0b9d1e0d2458d1db8.tar.xz
linux-5024622f583eb242ed8040d0b9d1e0d2458d1db8.zip
rapidio: move rio_local_set_device_id function to the common core
Make function rio_local_set_device_id() common for all components of RapidIO subsystem. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: Aurelien Jacquiot <a-jacquiot@ti.com> Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rapidio/rio.c')
-rw-r--r--drivers/rapidio/rio.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index e42f97e9e62a..095801c4d239 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -138,6 +138,20 @@ void rio_free_net(struct rio_net *net)
EXPORT_SYMBOL_GPL(rio_free_net);
/**
+ * rio_local_set_device_id - Set the base/extended device id for a port
+ * @port: RIO master port
+ * @did: Device ID value to be written
+ *
+ * Writes the base/extended device id from a device.
+ */
+void rio_local_set_device_id(struct rio_mport *port, u16 did)
+{
+ rio_local_write_config_32(port, RIO_DID_CSR,
+ RIO_SET_DID(port->sys_size, did));
+}
+EXPORT_SYMBOL_GPL(rio_local_set_device_id);
+
+/**
* rio_add_device- Adds a RIO device to the device model
* @rdev: RIO device
*