blob: 01ee1126a97e4308f30267af9936d2c710ed42de [file] [log] [blame]
Prabhakar Kushwahaa2a55e52015-03-19 09:20:45 -07001/* Copyright 2013-2015 Freescale Semiconductor Inc.
J. German Rivera7b3bd9a2015-01-06 13:19:02 -08002 *
3 * SPDX-License-Identifier: GPL-2.0+
4 */
5#include <fsl-mc/fsl_mc_sys.h>
6#include <fsl-mc/fsl_mc_cmd.h>
7#include <fsl-mc/fsl_dpmng.h>
8#include "fsl_dpmng_cmd.h"
9
10int mc_get_version(struct fsl_mc_io *mc_io, struct mc_version *mc_ver_info)
11{
12 struct mc_command cmd = { 0 };
13 int err;
14
15 /* prepare command */
16 cmd.header = mc_encode_cmd_header(DPMNG_CMDID_GET_VERSION,
17 MC_CMD_PRI_LOW, 0);
18
19 /* send command to mc*/
20 err = mc_send_command(mc_io, &cmd);
21 if (err)
22 return err;
23
24 /* retrieve response parameters */
25 DPMNG_RSP_GET_VERSION(cmd, mc_ver_info);
26
27 return 0;
28}