summaryrefslogtreecommitdiffstats
path: root/drivers/soc/fsl/dpio/dpio.c
diff options
context:
space:
mode:
authorRoy Pledge2018-12-10 17:50:17 +0100
committerLi Yang2019-01-11 22:06:54 +0100
commit11c8bac9b3877fb8d8b4674f4744c1b5937956ba (patch)
tree356decf725fffb72f8f58a8de624b49a55254ac7 /drivers/soc/fsl/dpio/dpio.c
parentsoc: fsl: dpio: use a cpumask to identify which cpus are unused (diff)
downloadkernel-qcow2-linux-11c8bac9b3877fb8d8b4674f4744c1b5937956ba.tar.gz
kernel-qcow2-linux-11c8bac9b3877fb8d8b4674f4744c1b5937956ba.tar.xz
kernel-qcow2-linux-11c8bac9b3877fb8d8b4674f4744c1b5937956ba.zip
soc: fsl: dpio: perform DPIO Reset on Probe
Invoke a DPIO reset command when a DPIO device is probed. This will ensure the QBMan portal is in the state the driver expects. Signed-off-by: Roy Pledge <roy.pledge@nxp.com> Signed-off-by: Li Yang <leoyang.li@nxp.com>
Diffstat (limited to 'drivers/soc/fsl/dpio/dpio.c')
-rw-r--r--drivers/soc/fsl/dpio/dpio.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/soc/fsl/dpio/dpio.c b/drivers/soc/fsl/dpio/dpio.c
index ff37c80e11a0..521bc6946317 100644
--- a/drivers/soc/fsl/dpio/dpio.c
+++ b/drivers/soc/fsl/dpio/dpio.c
@@ -196,3 +196,26 @@ int dpio_get_api_version(struct fsl_mc_io *mc_io,
return 0;
}
+
+/**
+ * dpio_reset() - Reset the DPIO, returns the object to initial state.
+ * @mc_io: Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @token: Token of DPIO object
+ *
+ * Return: '0' on Success; Error code otherwise.
+ */
+int dpio_reset(struct fsl_mc_io *mc_io,
+ u32 cmd_flags,
+ u16 token)
+{
+ struct fsl_mc_command cmd = { 0 };
+
+ /* prepare command */
+ cmd.header = mc_encode_cmd_header(DPIO_CMDID_RESET,
+ cmd_flags,
+ token);
+
+ /* send command to mc*/
+ return mc_send_command(mc_io, &cmd);
+}