summaryrefslogtreecommitdiff
path: root/drivers/soc/fsl/dpio/dpio.c
diff options
context:
space:
mode:
authorRoy Pledge <roy.pledge@nxp.com>2018-12-10 19:50:17 +0300
committerLi Yang <leoyang.li@nxp.com>2019-01-12 00:06:54 +0300
commit11c8bac9b3877fb8d8b4674f4744c1b5937956ba (patch)
tree356decf725fffb72f8f58a8de624b49a55254ac7 /drivers/soc/fsl/dpio/dpio.c
parent991e873223e9bcfaf10a0074eec1507c1ddfb6ab (diff)
downloadlinux-11c8bac9b3877fb8d8b4674f4744c1b5937956ba.tar.xz
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);
+}