Merge remote-tracking branch 'asoc/topic/core' into asoc-next
This commit is contained in:
commit
2914b7004b
1 changed files with 23 additions and 21 deletions
|
@ -92,30 +92,21 @@ static int format_register_str(struct snd_soc_codec *codec,
|
||||||
int wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
|
int wordsize = min_bytes_needed(codec->driver->reg_cache_size) * 2;
|
||||||
int regsize = codec->driver->reg_word_size * 2;
|
int regsize = codec->driver->reg_word_size * 2;
|
||||||
int ret;
|
int ret;
|
||||||
char tmpbuf[len + 1];
|
|
||||||
char regbuf[regsize + 1];
|
|
||||||
|
|
||||||
/* since tmpbuf is allocated on the stack, warn the callers if they
|
|
||||||
* try to abuse this function */
|
|
||||||
WARN_ON(len > 63);
|
|
||||||
|
|
||||||
/* +2 for ': ' and + 1 for '\n' */
|
/* +2 for ': ' and + 1 for '\n' */
|
||||||
if (wordsize + regsize + 2 + 1 != len)
|
if (wordsize + regsize + 2 + 1 != len)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
sprintf(buf, "%.*x: ", wordsize, reg);
|
||||||
|
buf += wordsize + 2;
|
||||||
|
|
||||||
ret = snd_soc_read(codec, reg);
|
ret = snd_soc_read(codec, reg);
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
memset(regbuf, 'X', regsize);
|
memset(buf, 'X', regsize);
|
||||||
regbuf[regsize] = '\0';
|
else
|
||||||
} else {
|
sprintf(buf, "%.*x", regsize, ret);
|
||||||
snprintf(regbuf, regsize + 1, "%.*x", regsize, ret);
|
buf[regsize] = '\n';
|
||||||
}
|
/* no NUL-termination needed */
|
||||||
|
|
||||||
/* prepare the buffer */
|
|
||||||
snprintf(tmpbuf, len + 1, "%.*x: %s\n", wordsize, reg, regbuf);
|
|
||||||
/* copy it back to the caller without the '\0' */
|
|
||||||
memcpy(buf, tmpbuf, len);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -904,12 +895,17 @@ static struct snd_soc_dai *snd_soc_find_dai(
|
||||||
{
|
{
|
||||||
struct snd_soc_component *component;
|
struct snd_soc_component *component;
|
||||||
struct snd_soc_dai *dai;
|
struct snd_soc_dai *dai;
|
||||||
|
struct device_node *component_of_node;
|
||||||
|
|
||||||
lockdep_assert_held(&client_mutex);
|
lockdep_assert_held(&client_mutex);
|
||||||
|
|
||||||
/* Find CPU DAI from registered DAIs*/
|
/* Find CPU DAI from registered DAIs*/
|
||||||
list_for_each_entry(component, &component_list, list) {
|
list_for_each_entry(component, &component_list, list) {
|
||||||
if (dlc->of_node && component->dev->of_node != dlc->of_node)
|
component_of_node = component->dev->of_node;
|
||||||
|
if (!component_of_node && component->dev->parent)
|
||||||
|
component_of_node = component->dev->parent->of_node;
|
||||||
|
|
||||||
|
if (dlc->of_node && component_of_node != dlc->of_node)
|
||||||
continue;
|
continue;
|
||||||
if (dlc->name && strcmp(component->name, dlc->name))
|
if (dlc->name && strcmp(component->name, dlc->name))
|
||||||
continue;
|
continue;
|
||||||
|
@ -2599,7 +2595,8 @@ static int snd_soc_register_dais(struct snd_soc_component *component,
|
||||||
* the same naming style even though those DAIs are not
|
* the same naming style even though those DAIs are not
|
||||||
* component-less anymore.
|
* component-less anymore.
|
||||||
*/
|
*/
|
||||||
if (count == 1 && legacy_dai_naming) {
|
if (count == 1 && legacy_dai_naming &&
|
||||||
|
(dai_drv[i].id == 0 || dai_drv[i].name == NULL)) {
|
||||||
dai->name = fmt_single_name(dev, &dai->id);
|
dai->name = fmt_single_name(dev, &dai->id);
|
||||||
} else {
|
} else {
|
||||||
dai->name = fmt_multiple_name(dev, &dai_drv[i]);
|
dai->name = fmt_multiple_name(dev, &dai_drv[i]);
|
||||||
|
@ -3488,11 +3485,16 @@ static int snd_soc_get_dai_name(struct of_phandle_args *args,
|
||||||
const char **dai_name)
|
const char **dai_name)
|
||||||
{
|
{
|
||||||
struct snd_soc_component *pos;
|
struct snd_soc_component *pos;
|
||||||
|
struct device_node *component_of_node;
|
||||||
int ret = -EPROBE_DEFER;
|
int ret = -EPROBE_DEFER;
|
||||||
|
|
||||||
mutex_lock(&client_mutex);
|
mutex_lock(&client_mutex);
|
||||||
list_for_each_entry(pos, &component_list, list) {
|
list_for_each_entry(pos, &component_list, list) {
|
||||||
if (pos->dev->of_node != args->np)
|
component_of_node = pos->dev->of_node;
|
||||||
|
if (!component_of_node && pos->dev->parent)
|
||||||
|
component_of_node = pos->dev->parent->of_node;
|
||||||
|
|
||||||
|
if (component_of_node != args->np)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (pos->driver->of_xlate_dai_name) {
|
if (pos->driver->of_xlate_dai_name) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue