Merge tag 'asoc-v4.16-5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Feb 2018 20:11:09 +0000 (12:11 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Feb 2018 20:11:09 +0000 (12:11 -0800)
Pull more ASoC updates from Mark Brown:
 "With the merge window having been delayed for another week here's
  another batch of updates that came in during that week.

  There's a few important fixes in here, mainly a fix for I/O on a
  number of devices caused by some of the component rework and a fix for
  a potential issue if more than one component in a link provides
  compressed operations. The I/O fixes are particularly important as the
  problem causes a power regression on a number of OMAP platforms"

* tag 'asoc-v4.16-5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound: (22 commits)
  ASoC: stm32: add of dependency for stm32 drivers
  ASoC: mt8173-rt5650: fix child-node lookup
  ASoC: dapm: fix debugfs read using path->connected
  ASoC: compress: Fixup error messages
  ASoC: compress: Remove some extraneous blank lines
  ASoC: compress: Correct handling of copy callback
  ASoC: Intel: kbl: Enable mclk and ssp sclk early
  ASoC: Intel: Skylake: Add extended I2S config blob support in Clock driver
  ASoC: Intel: Skylake: Add ssp clock driver
  ASoC: Fix twl4030 and 6040 regression by adding back read and write
  ASoC: sun8i-codec: Add ADC support for a33
  ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink
  ASoC: soc-pcm: rename .pmdown_time to .use_pmdown_time for Component
  ASoC: ak4613: call dummy write for PW_MGMT1/3 when Playback
  ASoC: soc-pcm: don't call flush_delayed_work() many times in soc_pcm_private_free()
  ASoC: soc-core: snd_soc_rtdcom_lookup() cares component driver name
  ASoC: sam9x5_wm8731: Drop 'ASoC' prefix from error messages
  ASoC: sam9g20_wm8731: use dev_*() logging functions
  ASoC: max98373 Changed SPDX header in C++ comments style
  ASoC: dmic: Fix check of return value from read of 'num-channels'
  ...

1  2 
sound/soc/soc-core.c
sound/soc/soc-dapm.c

diff --combined sound/soc/soc-core.c
index 88efc84f3e7b4aa0d3a68e5d2d409aaca6358c45,65537074c05355ed5078b8da48cbe659506ddd27..96c44f6576c95f4dfae19547414040e2d2153235
@@@ -173,7 -173,7 +173,7 @@@ static ssize_t codec_reg_show(struct de
        return soc_codec_reg_show(rtd->codec, buf, PAGE_SIZE, 0);
  }
  
 -static DEVICE_ATTR(codec_reg, 0444, codec_reg_show, NULL);
 +static DEVICE_ATTR_RO(codec_reg);
  
  static ssize_t pmdown_time_show(struct device *dev,
                                struct device_attribute *attr, char *buf)
@@@ -349,84 -349,120 +349,84 @@@ static void soc_init_codec_debugfs(stru
                        "ASoC: Failed to create codec register debugfs file\n");
  }
  
 -static ssize_t codec_list_read_file(struct file *file, char __user *user_buf,
 -                                  size_t count, loff_t *ppos)
 +static int codec_list_seq_show(struct seq_file *m, void *v)
  {
 -      char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
 -      ssize_t len, ret = 0;
        struct snd_soc_codec *codec;
  
 -      if (!buf)
 -              return -ENOMEM;
 -
        mutex_lock(&client_mutex);
  
 -      list_for_each_entry(codec, &codec_list, list) {
 -              len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
 -                             codec->component.name);
 -              if (len >= 0)
 -                      ret += len;
 -              if (ret > PAGE_SIZE) {
 -                      ret = PAGE_SIZE;
 -                      break;
 -              }
 -      }
 +      list_for_each_entry(codec, &codec_list, list)
 +              seq_printf(m, "%s\n", codec->component.name);
  
        mutex_unlock(&client_mutex);
  
 -      if (ret >= 0)
 -              ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
 -
 -      kfree(buf);
 +      return 0;
 +}
  
 -      return ret;
 +static int codec_list_seq_open(struct inode *inode, struct file *file)
 +{
 +      return single_open(file, codec_list_seq_show, NULL);
  }
  
  static const struct file_operations codec_list_fops = {
 -      .read = codec_list_read_file,
 -      .llseek = default_llseek,/* read accesses f_pos */
 +      .open = codec_list_seq_open,
 +      .read = seq_read,
 +      .llseek = seq_lseek,
 +      .release = single_release,
  };
  
 -static ssize_t dai_list_read_file(struct file *file, char __user *user_buf,
 -                                size_t count, loff_t *ppos)
 +static int dai_list_seq_show(struct seq_file *m, void *v)
  {
 -      char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
 -      ssize_t len, ret = 0;
        struct snd_soc_component *component;
        struct snd_soc_dai *dai;
  
 -      if (!buf)
 -              return -ENOMEM;
 -
        mutex_lock(&client_mutex);
  
 -      list_for_each_entry(component, &component_list, list) {
 -              list_for_each_entry(dai, &component->dai_list, list) {
 -                      len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
 -                              dai->name);
 -                      if (len >= 0)
 -                              ret += len;
 -                      if (ret > PAGE_SIZE) {
 -                              ret = PAGE_SIZE;
 -                              break;
 -                      }
 -              }
 -      }
 +      list_for_each_entry(component, &component_list, list)
 +              list_for_each_entry(dai, &component->dai_list, list)
 +                      seq_printf(m, "%s\n", dai->name);
  
        mutex_unlock(&client_mutex);
  
 -      ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
 -
 -      kfree(buf);
 +      return 0;
 +}
  
 -      return ret;
 +static int dai_list_seq_open(struct inode *inode, struct file *file)
 +{
 +      return single_open(file, dai_list_seq_show, NULL);
  }
  
  static const struct file_operations dai_list_fops = {
 -      .read = dai_list_read_file,
 -      .llseek = default_llseek,/* read accesses f_pos */
 +      .open = dai_list_seq_open,
 +      .read = seq_read,
 +      .llseek = seq_lseek,
 +      .release = single_release,
  };
  
 -static ssize_t platform_list_read_file(struct file *file,
 -                                     char __user *user_buf,
 -                                     size_t count, loff_t *ppos)
 +static int platform_list_seq_show(struct seq_file *m, void *v)
  {
 -      char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
 -      ssize_t len, ret = 0;
        struct snd_soc_platform *platform;
  
 -      if (!buf)
 -              return -ENOMEM;
 -
        mutex_lock(&client_mutex);
  
 -      list_for_each_entry(platform, &platform_list, list) {
 -              len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
 -                             platform->component.name);
 -              if (len >= 0)
 -                      ret += len;
 -              if (ret > PAGE_SIZE) {
 -                      ret = PAGE_SIZE;
 -                      break;
 -              }
 -      }
 +      list_for_each_entry(platform, &platform_list, list)
 +              seq_printf(m, "%s\n", platform->component.name);
  
        mutex_unlock(&client_mutex);
  
 -      ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
 -
 -      kfree(buf);
 +      return 0;
 +}
  
 -      return ret;
 +static int platform_list_seq_open(struct inode *inode, struct file *file)
 +{
 +      return single_open(file, platform_list_seq_show, NULL);
  }
  
  static const struct file_operations platform_list_fops = {
 -      .read = platform_list_read_file,
 -      .llseek = default_llseek,/* read accesses f_pos */
 +      .open = platform_list_seq_open,
 +      .read = seq_read,
 +      .llseek = seq_lseek,
 +      .release = single_release,
  };
  
  static void soc_init_card_debugfs(struct snd_soc_card *card)
@@@ -455,6 -491,7 +455,6 @@@ static void soc_cleanup_card_debugfs(st
        debugfs_remove_recursive(card->debugfs_card_root);
  }
  
 -
  static void snd_soc_debugfs_init(void)
  {
        snd_soc_debugfs_root = debugfs_create_dir("asoc", NULL);
@@@ -553,9 -590,17 +553,17 @@@ struct snd_soc_component *snd_soc_rtdco
  {
        struct snd_soc_rtdcom_list *rtdcom;
  
+       if (!driver_name)
+               return NULL;
        for_each_rtdcom(rtd, rtdcom) {
-               if ((rtdcom->component->driver->name == driver_name) ||
-                   strcmp(rtdcom->component->driver->name, driver_name) == 0)
+               const char *component_name = rtdcom->component->driver->name;
+               if (!component_name)
+                       continue;
+               if ((component_name == driver_name) ||
+                   strcmp(component_name, driver_name) == 0)
                        return rtdcom->component;
        }
  
diff --combined sound/soc/soc-dapm.c
index d1977ced895ff0217a33fd23eef7e0107d2f311c,ee6d9d9a3c5eb9260dfcdf4f94de3f587c409751..92894d9cac19d54d835b6611c013b0ea527403a8
@@@ -2026,7 -2026,7 +2026,7 @@@ static ssize_t dapm_widget_power_read_f
        snd_soc_dapm_for_each_direction(dir) {
                rdir = SND_SOC_DAPM_DIR_REVERSE(dir);
                snd_soc_dapm_widget_for_each_path(w, dir, p) {
-                       if (p->connected && !p->connected(w, p->node[rdir]))
+                       if (p->connected && !p->connected(p->source, p->sink))
                                continue;
  
                        if (!p->connect)
@@@ -2364,7 -2364,7 +2364,7 @@@ static ssize_t dapm_widget_show(struct 
        return count;
  }
  
 -static DEVICE_ATTR(dapm_widget, 0444, dapm_widget_show, NULL);
 +static DEVICE_ATTR_RO(dapm_widget);
  
  struct attribute *soc_dapm_dev_attrs[] = {
        &dev_attr_dapm_widget.attr,