channel += tplg->channel_idx;
snd_config_get_id(cfg, &id);
- tplg_dbg("\tChannel %s at index %d\n", id, tplg->channel_idx);
+ tplg_dbg("\tChannel %s at index %d", id, tplg->channel_idx);
channel_id = lookup_channel(id);
if (channel_id < 0) {
channel->id = channel_id;
channel->size = sizeof(*channel);
- tplg_dbg("\tChan %s = %d\n", id, channel->id);
+ tplg_dbg("\tChan %s = %d", id, channel->id);
snd_config_for_each(i, next, cfg) {
else if (strcmp(id, "shift") == 0)
channel->shift = value;
- tplg_dbg("\t\t%s = %d\n", id, value);
+ tplg_dbg("\t\t%s = %d", id, value);
}
tplg->channel_idx++;
const char *value = NULL;
unsigned int j;
- tplg_dbg(" Access:\n");
+ tplg_dbg(" Access:");
snd_config_for_each(i, next, cfg) {
n = snd_config_iterator_entry(i);
for (j = 0; j < ARRAY_SIZE(ctl_access); j++) {
if (strcmp(value, ctl_access[j].name) == 0) {
hdr->access |= ctl_access[j].value;
- tplg_dbg("\t%s\n", value);
+ tplg_dbg("\t%s", value);
break;
}
}
struct snd_soc_tplg_mixer_control *mixer_ctrl = elem->mixer_ctrl;
struct snd_soc_tplg_ctl_tlv *tlv = ref->tlv;
- tplg_dbg("TLV '%s' used by '%s\n", ref->id, elem->id);
+ tplg_dbg("TLV '%s' used by '%s", ref->id, elem->id);
/* TLV has a fixed size */
mixer_ctrl->hdr.tlv = *tlv;
const char *id = NULL;
int val;
- tplg_dbg(" scale: %s\n", elem->id);
+ tplg_dbg(" scale: %s", elem->id);
tplg_tlv->size = sizeof(struct snd_soc_tplg_ctl_tlv);
tplg_tlv->type = SNDRV_CTL_TLVT_DB_SCALE;
if (tplg_get_integer(n, &val, 0))
continue;
- tplg_dbg("\t%s = %i\n", id, val);
+ tplg_dbg("\t%s = %i", id, val);
/* get TLV data */
if (strcmp(id, "min") == 0)
snd_strlcpy(be->hdr.name, elem->id, SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
be->hdr.type = SND_SOC_TPLG_TYPE_BYTES;
- tplg_dbg(" Control Bytes: %s\n", elem->id);
+ tplg_dbg(" Control Bytes: %s", elem->id);
snd_config_for_each(i, next, cfg) {
n = snd_config_iterator_entry(i);
return -EINVAL;
be->base = ival;
- tplg_dbg("\t%s: %d\n", id, be->base);
+ tplg_dbg("\t%s: %d", id, be->base);
continue;
}
return -EINVAL;
be->num_regs = ival;
- tplg_dbg("\t%s: %d\n", id, be->num_regs);
+ tplg_dbg("\t%s: %d", id, be->num_regs);
continue;
}
return -EINVAL;
be->max = ival;
- tplg_dbg("\t%s: %d\n", id, be->max);
+ tplg_dbg("\t%s: %d", id, be->max);
continue;
}
return -EINVAL;
be->mask = ival;
- tplg_dbg("\t%s: %d\n", id, be->mask);
+ tplg_dbg("\t%s: %d", id, be->mask);
continue;
}
return err;
tlv_set = true;
- tplg_dbg("\t%s: %s\n", id, val);
+ tplg_dbg("\t%s: %s", id, val);
continue;
}
ec->channel[j].reg = -1;
}
- tplg_dbg(" Control Enum: %s\n", elem->id);
+ tplg_dbg(" Control Enum: %s", elem->id);
snd_config_for_each(i, next, cfg) {
return -EINVAL;
tplg_ref_add(elem, SND_TPLG_TYPE_TEXT, val);
- tplg_dbg("\t%s: %s\n", id, val);
+ tplg_dbg("\t%s: %s", id, val);
continue;
}
for (j = 0; j < SND_SOC_TPLG_MAX_CHAN; j++)
mc->channel[j].reg = -1;
- tplg_dbg(" Control Mixer: %s\n", elem->id);
+ tplg_dbg(" Control Mixer: %s", elem->id);
/* giterate trough each mixer elment */
snd_config_for_each(i, next, cfg) {
return -EINVAL;
mc->max = ival;
- tplg_dbg("\t%s: %d\n", id, mc->max);
+ tplg_dbg("\t%s: %d", id, mc->max);
continue;
}
return -EINVAL;
mc->invert = ival;
- tplg_dbg("\t%s: %d\n", id, mc->invert);
+ tplg_dbg("\t%s: %d", id, mc->invert);
continue;
}
return err;
tlv_set = true;
- tplg_dbg("\t%s: %s\n", id, val);
+ tplg_dbg("\t%s: %s", id, val);
continue;
}
struct tplg_elem *elem;
int ret, i, num_channels;
- tplg_dbg(" Control Mixer: %s\n", mixer->hdr.name);
+ tplg_dbg(" Control Mixer: %s", mixer->hdr.name);
if (mixer->hdr.type != SND_SOC_TPLG_TYPE_MIXER) {
SNDERR("invalid mixer type %d", mixer->hdr.type);
struct tplg_elem *elem;
int ret, i, num_items, num_channels;
- tplg_dbg(" Control Enum: %s\n", enum_ctl->hdr.name);
+ tplg_dbg(" Control Enum: %s", enum_ctl->hdr.name);
if (enum_ctl->hdr.type != SND_SOC_TPLG_TYPE_ENUM) {
SNDERR("invalid enum type %d", enum_ctl->hdr.type);
struct tplg_elem *elem;
int ret;
- tplg_dbg(" Control Bytes: %s\n", bytes_ctl->hdr.name);
+ tplg_dbg(" Control Bytes: %s", bytes_ctl->hdr.name);
if (bytes_ctl->hdr.type != SND_SOC_TPLG_TYPE_BYTES) {
SNDERR("invalid bytes type %d", bytes_ctl->hdr.type);
{
struct snd_soc_tplg_dapm_widget *widget = elem->widget;
- tplg_dbg("Control '%s' used by '%s'\n", ref->id, elem->id);
- tplg_dbg("\tparent size: %d + %d -> %d, priv size -> %d\n",
+ tplg_dbg("Control '%s' used by '%s'", ref->id, elem->id);
+ tplg_dbg("\tparent size: %d + %d -> %d, priv size -> %d",
elem->size, ref->size, elem->size + ref->size,
widget->priv.size);
}
route = elem->route;
- tplg_dbg("\nCheck route: sink '%s', control '%s', source '%s'\n",
- route->sink, route->control, route->source);
+ tplg_dbg("Check route: sink '%s', control '%s', source '%s'",
+ route->sink, route->control, route->source);
/* validate sink */
if (strlen(route->sink) <= 0) {
if (err < 0)
return err;
- tplg_dbg("route: sink '%s', control '%s', source '%s'\n",
+ tplg_dbg("route: sink '%s', control '%s', source '%s'",
line->sink, line->control, line->source);
}
if (!elem)
return -ENOMEM;
- tplg_dbg(" Widget: %s\n", elem->id);
+ tplg_dbg(" Widget: %s", elem->id);
widget = elem->widget;
snd_strlcpy(widget->name, elem->id, SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
}
widget->id = widget_type;
- tplg_dbg("\t%s: %s\n", id, val);
+ tplg_dbg("\t%s: %s", id, val);
continue;
}
snd_strlcpy(widget->sname, val,
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
- tplg_dbg("\t%s: %s\n", id, val);
+ tplg_dbg("\t%s: %s", id, val);
continue;
}
widget->reg = ival ? -1 : 0;
- tplg_dbg("\t%s: %s\n", id, val);
+ tplg_dbg("\t%s: %s", id, val);
continue;
}
return -EINVAL;
widget->shift = ival;
- tplg_dbg("\t%s: %d\n", id, widget->shift);
+ tplg_dbg("\t%s: %d", id, widget->shift);
continue;
}
return -EINVAL;
widget->reg = ival;
- tplg_dbg("\t%s: %d\n", id, widget->reg);
+ tplg_dbg("\t%s: %d", id, widget->reg);
continue;
}
return -EINVAL;
widget->invert = ival;
- tplg_dbg("\t%s: %d\n", id, widget->invert);
+ tplg_dbg("\t%s: %d", id, widget->invert);
continue;
}
return -EINVAL;
widget->subseq = ival;
- tplg_dbg("\t%s: %d\n", id, widget->subseq);
+ tplg_dbg("\t%s: %d", id, widget->subseq);
continue;
}
return -EINVAL;
widget->event_type = ival;
- tplg_dbg("\t%s: %d\n", id, widget->event_type);
+ tplg_dbg("\t%s: %d", id, widget->event_type);
continue;
}
return -EINVAL;
widget->event_flags = ival;
- tplg_dbg("\t%s: %d\n", id, widget->event_flags);
+ tplg_dbg("\t%s: %d", id, widget->event_flags);
continue;
}
struct tplg_elem *elem;
int i, ret = 0;
- tplg_dbg("Widget: %s\n", wt->name);
+ tplg_dbg("Widget: %s", wt->name);
elem = tplg_elem_new_common(tplg, NULL, wt->name,
SND_TPLG_TYPE_DAPM_WIDGET);
if (snd_config_get_string(cfg, &val) < 0)
return -EINVAL;
- tplg_dbg("\tref data: %s\n", val);
+ tplg_dbg("\tref data: %s", val);
err = tplg_ref_add(elem, type, val);
if (err < 0)
return err;
if (snd_config_get_string(n, &val) < 0)
continue;
- tplg_dbg("\tref data: %s\n", val);
+ tplg_dbg("\tref data: %s", val);
err = tplg_ref_add(elem, type, val);
if (err < 0)
return err;
size_t size, bytes_read;
int ret = 0;
- tplg_dbg("data DataFile: %s\n", elem->id);
+ tplg_dbg("data DataFile: %s", elem->id);
if (snd_config_get_string(cfg, &value) < 0)
return -EINVAL;
#ifdef TPLG_DEBUG
struct snd_soc_tplg_private *priv = elem->data;
unsigned char *p = (unsigned char *)priv->data;
+ char buf[128], buf2[8];
unsigned int i;
- tplg_dbg(" elem size = %d, priv data size = %d\n",
+ tplg_dbg(" elem size = %d, priv data size = %d",
elem->size, priv->size);
+ buf[0] = '\0';
for (i = 0; i < priv->size; i++) {
- if (i > 0 && (i % 16) == 0)
- tplg_dbg("\n");
+ if (i > 0 && (i % 16) == 0) {
+ tplg_dbg("%s", buf);
+ buf[0] = '\0';
+ }
- tplg_dbg(" %02x:", *p++);
+ snprintf(buf2, sizeof(buf2), " %02x", *p++);
+ strcat(buf, buf2);
}
- tplg_dbg("\n\n");
+ if (buf[0])
+ tplg_dbg("%s", buf);
#endif
}
int size, esize, off, num;
int ret;
- tplg_dbg(" data: %s\n", elem->id);
+ tplg_dbg(" data: %s", elem->id);
if (snd_config_get_string(cfg, &value) < 0)
return -EINVAL;
if (ref->type != SND_TPLG_TYPE_TUPLE)
continue;
- tplg_dbg("tuples '%s' used by data '%s'\n", ref->id, elem->id);
+ tplg_dbg("tuples '%s' used by data '%s'", ref->id, elem->id);
if (!ref->elem)
ref->elem = tplg_elem_lookup(&tplg->tuple_list,
if (!num_tuples)
return 0;
- tplg_dbg("\t %d %s tuples:\n", num_tuples, id);
+ tplg_dbg("\t %d %s tuples:", num_tuples, id);
set = calloc(1, sizeof(*set) + num_tuples * sizeof(struct tplg_tuple));
if (!set)
return -ENOMEM;
continue;
snd_strlcpy(tuple->string, value,
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
- tplg_dbg("\t\t%s = %s\n", tuple->token, tuple->string);
+ tplg_dbg("\t\t%s = %s", tuple->token, tuple->string);
break;
case SND_SOC_TPLG_TUPLE_TYPE_BOOL:
if (ival < 0)
continue;
tuple->value = ival;
- tplg_dbg("\t\t%s = %d\n", tuple->token, tuple->value);
+ tplg_dbg("\t\t%s = %d", tuple->token, tuple->value);
break;
case SND_SOC_TPLG_TUPLE_TYPE_BYTE:
}
tuple->value = tuple_val;
- tplg_dbg("\t\t%s = 0x%x\n", tuple->token, tuple->value);
+ tplg_dbg("\t\t%s = 0x%x", tuple->token, tuple->value);
break;
default:
if (!num_tokens)
return 0;
- tplg_dbg(" Vendor tokens: %s, %d tokens\n", elem->id, num_tokens);
+ tplg_dbg(" Vendor tokens: %s, %d tokens", elem->id, num_tokens);
tokens = calloc(1, sizeof(*tokens)
+ num_tokens * sizeof(struct tplg_token));
snd_strlcpy(tokens->token[tokens->num_tokens].id, id,
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
tokens->token[tokens->num_tokens].value = value;
- tplg_dbg("\t\t %s : %d\n", tokens->token[tokens->num_tokens].id,
+ tplg_dbg("\t\t %s : %d", tokens->token[tokens->num_tokens].id,
tokens->token[tokens->num_tokens].value);
tokens->num_tokens++;
}
if (!elem)
return -ENOMEM;
- tplg_dbg(" Vendor Tuples: %s\n", elem->id);
+ tplg_dbg(" Vendor Tuples: %s", elem->id);
tuples = calloc(1, sizeof(*tuples));
if (!tuples)
if (snd_config_get_string(n, &value) < 0)
return -EINVAL;
tplg_ref_add(elem, SND_TPLG_TYPE_TOKEN, value);
- tplg_dbg("\t refer to vendor tokens: %s\n", value);
+ tplg_dbg("\t refer to vendor tokens: %s", value);
}
if (strcmp(id, "tuples") == 0) {
manifest = elem->manifest;
manifest->size = elem->size;
- tplg_dbg(" Manifest: %s\n", elem->id);
+ tplg_dbg(" Manifest: %s", elem->id);
snd_config_for_each(i, next, cfg) {
n = snd_config_iterator_entry(i);
return -EINVAL;
elem->vendor_type = ival;
- tplg_dbg("\t%s: %d\n", id, elem->index);
+ tplg_dbg("\t%s: %d", id, elem->index);
continue;
}
}
return -EINVAL;
}
- tplg_dbg("Data '%s' used by '%s'\n", ref->id, elem->id);
+ tplg_dbg("Data '%s' used by '%s'", ref->id, elem->id);
/* overlook empty private data */
if (!ref_elem->data || !ref_elem->data->size) {
ref->elem = ref_elem;
const char *id, *value;
int ival;
- tplg_dbg("\tOps\n");
+ tplg_dbg("\tOps");
hdr->size = sizeof(*hdr);
snd_config_for_each(i, next, cfg) {
else if (strcmp(id, "get") == 0)
hdr->ops.get = ival;
- tplg_dbg("\t\t%s = %d\n", id, ival);
+ tplg_dbg("\t\t%s = %d", id, ival);
}
return 0;
const char *id, *value;
int ival;
- tplg_dbg("\tExt Ops\n");
+ tplg_dbg("\tExt Ops");
snd_config_for_each(i, next, cfg) {
else if (strcmp(id, "get") == 0)
be->ext_ops.get = ival;
- tplg_dbg("\t\t%s = %s\n", id, value);
+ tplg_dbg("\t\t%s = %s", id, value);
}
return 0;
{
struct snd_soc_tplg_stream_caps *ref_caps = ref_elem->stream_caps;
- tplg_dbg("Copy pcm caps (%ld bytes) from '%s' to '%s' \n",
+ tplg_dbg("Copy pcm caps (%ld bytes) from '%s' to '%s'",
sizeof(*caps), ref_elem->id, id);
*caps = *ref_caps;
{
const char *id;
if (snd_config_get_id(n, &id) >= 0)
- tplg_dbg("\t\t%s: %d\n", id, *dst);
+ tplg_dbg("\t\t%s: %d", id, *dst);
}
#endif
return 0;
sc->size = elem->size;
snd_strlcpy(sc->name, elem->id, SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
- tplg_dbg(" PCM Capabilities: %s\n", elem->id);
+ tplg_dbg(" PCM Capabilities: %s", elem->id);
snd_config_for_each(i, next, cfg) {
n = snd_config_iterator_entry(i);
if (err < 0)
return err;
- tplg_dbg("\t\t%s: %s\n", id, val);
+ tplg_dbg("\t\t%s: %s", id, val);
continue;
}
if (err < 0)
return err;
- tplg_dbg("\t\t%s: %s\n", id, val);
+ tplg_dbg("\t\t%s: %s", id, val);
continue;
}
snd_config_get_id(cfg, &id);
- tplg_dbg("\t%s:\n", id);
+ tplg_dbg("\t%s:", id);
switch (elem->type) {
case SND_TPLG_TYPE_PCM:
snd_strlcpy(caps[stream].name, value,
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
- tplg_dbg("\t\t%s\n\t\t\t%s\n", id, value);
+ tplg_dbg("\t\t%s\n\t\t\t%s", id, value);
continue;
}
}
const char *id;
snd_config_get_id(cfg, &id);
- tplg_dbg("\t\tFE DAI %s:\n", id);
+ tplg_dbg("\t\tFE DAI %s:", id);
snd_strlcpy(pcm->dai_name, id, SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
snd_config_for_each(i, next, cfg) {
return -EINVAL;
}
- tplg_dbg("\t\t\tindex: %d\n", pcm->dai_id);
+ tplg_dbg("\t\t\tindex: %d", pcm->dai_id);
}
}
pcm->size = elem->size;
snd_strlcpy(pcm->pcm_name, elem->id, SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
- tplg_dbg(" PCM: %s\n", elem->id);
+ tplg_dbg(" PCM: %s", elem->id);
snd_config_for_each(i, next, cfg) {
pcm->compress = ival;
- tplg_dbg("\t%s: %d\n", id, ival);
+ tplg_dbg("\t%s: %d", id, ival);
continue;
}
snd_strlcpy(dai->dai_name, elem->id,
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
- tplg_dbg(" DAI: %s\n", elem->id);
+ tplg_dbg(" DAI: %s", elem->id);
snd_config_for_each(i, next, cfg) {
link->size = elem->size;
snd_strlcpy(link->name, elem->id, SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
- tplg_dbg(" Link: %s\n", elem->id);
+ tplg_dbg(" Link: %s", elem->id);
snd_config_for_each(i, next, cfg) {
snd_strlcpy(link->stream_name, val,
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
- tplg_dbg("\t%s: %s\n", id, val);
+ tplg_dbg("\t%s: %s", id, val);
continue;
}
link = elem->link;
link->size = elem->size;
- tplg_dbg(" CC: %s\n", elem->id);
+ tplg_dbg(" CC: %s", elem->id);
snd_config_for_each(i, next, cfg) {
hw_cfg = elem->hw_cfg;
hw_cfg->size = elem->size;
- tplg_dbg(" Link HW config: %s\n", elem->id);
+ tplg_dbg(" Link HW config: %s", elem->id);
snd_config_for_each(i, next, cfg) {
struct tplg_elem *elem;
int ret, i;
- tplg_dbg("PCM: %s, DAI %s\n", pcm_tpl->pcm_name, pcm_tpl->dai_name);
+ tplg_dbg("PCM: %s, DAI %s", pcm_tpl->pcm_name, pcm_tpl->dai_name);
if (pcm_tpl->num_streams > SND_SOC_TPLG_STREAM_CONFIG_MAX)
return -EINVAL;
struct tplg_elem *elem;
int ret, i;
- tplg_dbg("DAI %s\n", dai_tpl->dai_name);
+ tplg_dbg("DAI %s", dai_tpl->dai_name);
elem = tplg_elem_new_common(tplg, NULL, dai_tpl->dai_name,
SND_TPLG_TYPE_DAI);
const char *value = NULL;
int j = 0;
- tplg_dbg(" Text Values: %s\n", elem->id);
+ tplg_dbg(" Text Values: %s", elem->id);
snd_config_for_each(i, next, cfg) {
n = snd_config_iterator_entry(i);
if (j == SND_SOC_TPLG_NUM_TEXTS) {
- tplg_dbg("text string number exceeds %d\n", j);
+ tplg_dbg("text string number exceeds %d", j);
return -ENOMEM;
}
snd_strlcpy(&texts->items[j][0], value,
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
- tplg_dbg("\t%s\n", &texts->items[j][0]);
+ tplg_dbg("\t%s", &texts->items[j][0]);
j++;
}