sof-ctl: add header_init() for abi header initialization

This will be needed for raw data(without abi header) input file.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This commit is contained in:
Keyon Jie 2019-06-27 17:03:36 +08:00 committed by Liam Girdwood
parent 89b4df8c6c
commit 0c2f1a6cdc
1 changed files with 10 additions and 0 deletions

View File

@ -66,6 +66,16 @@ static void usage(char *name)
fprintf(stdout, " -b set/get control in binary mode(e.g. for set, use binary input file, for get, dump out in hex format)\n"); fprintf(stdout, " -b set/get control in binary mode(e.g. for set, use binary input file, for get, dump out in hex format)\n");
} }
static void header_init(struct ctl_data *ctl_data)
{
struct sof_abi_hdr *hdr =
(struct sof_abi_hdr *)&ctl_data->buffer[2];
hdr->magic = SOF_ABI_MAGIC;
hdr->type = 0;
hdr->abi = SOF_ABI_VERSION;
}
static int read_setup(struct ctl_data *ctl_data) static int read_setup(struct ctl_data *ctl_data)
{ {
FILE *fh; FILE *fh;