Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 2 | /* Copyright 2013-2015 Freescale Semiconductor Inc. |
J. German Rivera | 43e4ae3 | 2015-01-06 13:19:02 -0800 | [diff] [blame] | 3 | */ |
| 4 | #include <fsl-mc/fsl_mc_sys.h> |
| 5 | #include <fsl-mc/fsl_mc_cmd.h> |
| 6 | #include <fsl-mc/fsl_dpmng.h> |
| 7 | #include "fsl_dpmng_cmd.h" |
| 8 | |
Prabhakar Kushwaha | 9564df6 | 2015-07-07 15:40:06 +0530 | [diff] [blame] | 9 | int mc_get_version(struct fsl_mc_io *mc_io, |
| 10 | uint32_t cmd_flags, |
| 11 | struct mc_version *mc_ver_info) |
J. German Rivera | 43e4ae3 | 2015-01-06 13:19:02 -0800 | [diff] [blame] | 12 | { |
| 13 | struct mc_command cmd = { 0 }; |
| 14 | int err; |
| 15 | |
| 16 | /* prepare command */ |
| 17 | cmd.header = mc_encode_cmd_header(DPMNG_CMDID_GET_VERSION, |
Prabhakar Kushwaha | 9564df6 | 2015-07-07 15:40:06 +0530 | [diff] [blame] | 18 | cmd_flags, |
| 19 | 0); |
J. German Rivera | 43e4ae3 | 2015-01-06 13:19:02 -0800 | [diff] [blame] | 20 | |
| 21 | /* send command to mc*/ |
| 22 | err = mc_send_command(mc_io, &cmd); |
| 23 | if (err) |
| 24 | return err; |
| 25 | |
| 26 | /* retrieve response parameters */ |
| 27 | DPMNG_RSP_GET_VERSION(cmd, mc_ver_info); |
| 28 | |
| 29 | return 0; |
| 30 | } |