Prabhakar Kushwaha | a2a55e5 | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 1 | /* Copyright 2013-2015 Freescale Semiconductor Inc. |
J. German Rivera | 7b3bd9a | 2015-01-06 13:19:02 -0800 | [diff] [blame] | 2 | * |
| 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 | |
Prabhakar Kushwaha | 87457d1 | 2015-07-07 15:40:06 +0530 | [diff] [blame] | 10 | int mc_get_version(struct fsl_mc_io *mc_io, |
| 11 | uint32_t cmd_flags, |
| 12 | struct mc_version *mc_ver_info) |
J. German Rivera | 7b3bd9a | 2015-01-06 13:19:02 -0800 | [diff] [blame] | 13 | { |
| 14 | struct mc_command cmd = { 0 }; |
| 15 | int err; |
| 16 | |
| 17 | /* prepare command */ |
| 18 | cmd.header = mc_encode_cmd_header(DPMNG_CMDID_GET_VERSION, |
Prabhakar Kushwaha | 87457d1 | 2015-07-07 15:40:06 +0530 | [diff] [blame] | 19 | cmd_flags, |
| 20 | 0); |
J. German Rivera | 7b3bd9a | 2015-01-06 13:19:02 -0800 | [diff] [blame] | 21 | |
| 22 | /* send command to mc*/ |
| 23 | err = mc_send_command(mc_io, &cmd); |
| 24 | if (err) |
| 25 | return err; |
| 26 | |
| 27 | /* retrieve response parameters */ |
| 28 | DPMNG_RSP_GET_VERSION(cmd, mc_ver_info); |
| 29 | |
| 30 | return 0; |
| 31 | } |