Commit 09305da9 authored by Shreyas NC's avatar Shreyas NC Committed by Mark Brown

ASoC: Intel: Skylake: Use UUID in binary format

To avoid complex string manipulations with UUID in canonical
form, use UUID in binary format.
Signed-off-by: default avatarShreyas NC <shreyas.nc@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 92eb4f62
...@@ -118,7 +118,7 @@ struct skl_dsp_fw_ops { ...@@ -118,7 +118,7 @@ struct skl_dsp_fw_ops {
int (*set_state_D0)(struct sst_dsp *ctx); int (*set_state_D0)(struct sst_dsp *ctx);
int (*set_state_D3)(struct sst_dsp *ctx); int (*set_state_D3)(struct sst_dsp *ctx);
unsigned int (*get_fw_errcode)(struct sst_dsp *ctx); unsigned int (*get_fw_errcode)(struct sst_dsp *ctx);
int (*load_mod)(struct sst_dsp *ctx, u16 mod_id, char *mod_name); int (*load_mod)(struct sst_dsp *ctx, u16 mod_id, u8 *mod_name);
int (*unload_mod)(struct sst_dsp *ctx, u16 mod_id); int (*unload_mod)(struct sst_dsp *ctx, u16 mod_id);
}; };
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/uuid.h>
#include "../common/sst-dsp.h" #include "../common/sst-dsp.h"
#include "../common/sst-dsp-priv.h" #include "../common/sst-dsp-priv.h"
#include "../common/sst-ipc.h" #include "../common/sst-ipc.h"
...@@ -304,14 +305,16 @@ static int skl_transfer_module(struct sst_dsp *ctx, ...@@ -304,14 +305,16 @@ static int skl_transfer_module(struct sst_dsp *ctx,
return ret; return ret;
} }
static int skl_load_module(struct sst_dsp *ctx, u16 mod_id, char *guid) static int skl_load_module(struct sst_dsp *ctx, u16 mod_id, u8 *guid)
{ {
struct skl_module_table *module_entry = NULL; struct skl_module_table *module_entry = NULL;
int ret = 0; int ret = 0;
char mod_name[64]; /* guid str = 32 chars + 4 hyphens */ char mod_name[64]; /* guid str = 32 chars + 4 hyphens */
uuid_le *uuid_mod;
snprintf(mod_name, sizeof(mod_name), "%s%s%s", uuid_mod = (uuid_le *)guid;
"intel/dsp_fw_", guid, ".bin"); snprintf(mod_name, sizeof(mod_name), "%s%pUL%s",
"intel/dsp_fw_", uuid_mod, ".bin");
module_entry = skl_module_get_from_id(ctx, mod_id); module_entry = skl_module_get_from_id(ctx, mod_id);
if (module_entry == NULL) { if (module_entry == NULL) {
......
...@@ -1550,6 +1550,8 @@ static int skl_tplg_widget_load(struct snd_soc_component *cmpnt, ...@@ -1550,6 +1550,8 @@ static int skl_tplg_widget_load(struct snd_soc_component *cmpnt,
return -ENOMEM; return -ENOMEM;
w->priv = mconfig; w->priv = mconfig;
memcpy(&mconfig->guid, &dfw_config->uuid, 16);
mconfig->id.module_id = dfw_config->module_id; mconfig->id.module_id = dfw_config->module_id;
mconfig->id.instance_id = dfw_config->instance_id; mconfig->id.instance_id = dfw_config->instance_id;
mconfig->mcps = dfw_config->max_mcps; mconfig->mcps = dfw_config->max_mcps;
...@@ -1579,10 +1581,6 @@ static int skl_tplg_widget_load(struct snd_soc_component *cmpnt, ...@@ -1579,10 +1581,6 @@ static int skl_tplg_widget_load(struct snd_soc_component *cmpnt,
mconfig->time_slot = dfw_config->time_slot; mconfig->time_slot = dfw_config->time_slot;
mconfig->formats_config.caps_size = dfw_config->caps.caps_size; mconfig->formats_config.caps_size = dfw_config->caps.caps_size;
if (dfw_config->is_loadable)
memcpy(mconfig->guid, dfw_config->uuid,
ARRAY_SIZE(dfw_config->uuid));
mconfig->m_in_pin = devm_kzalloc(bus->dev, (mconfig->max_in_queue) * mconfig->m_in_pin = devm_kzalloc(bus->dev, (mconfig->max_in_queue) *
sizeof(*mconfig->m_in_pin), sizeof(*mconfig->m_in_pin),
GFP_KERNEL); GFP_KERNEL);
......
...@@ -281,7 +281,7 @@ enum skl_module_state { ...@@ -281,7 +281,7 @@ enum skl_module_state {
}; };
struct skl_module_cfg { struct skl_module_cfg {
char guid[SKL_UUID_STR_SZ]; u8 guid[16];
struct skl_module_inst_id id; struct skl_module_inst_id id;
u8 domain; u8 domain;
bool homogenous_inputs; bool homogenous_inputs;
......
...@@ -181,7 +181,7 @@ struct skl_dfw_pipe { ...@@ -181,7 +181,7 @@ struct skl_dfw_pipe {
} __packed; } __packed;
struct skl_dfw_module { struct skl_dfw_module {
char uuid[SKL_UUID_STR_SZ]; u8 uuid[16];
u16 module_id; u16 module_id;
u16 instance_id; u16 instance_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment