]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.2-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Sep 2015 18:33:36 +0000 (11:33 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Sep 2015 18:33:36 +0000 (11:33 -0700)
added patches:
asoc-adav80x-remove-.read_flag_mask-setting-from-adav80x_regmap_config.patch
asoc-arizona-fix-gain-settings-of-fll-in-free-run-mode.patch
asoc-arizona-poll-for-fll-clock-ok-rather-than-use-interrupts.patch

queue-4.2/asoc-adav80x-remove-.read_flag_mask-setting-from-adav80x_regmap_config.patch [new file with mode: 0644]
queue-4.2/asoc-arizona-fix-gain-settings-of-fll-in-free-run-mode.patch [new file with mode: 0644]
queue-4.2/asoc-arizona-poll-for-fll-clock-ok-rather-than-use-interrupts.patch [new file with mode: 0644]
queue-4.2/series

diff --git a/queue-4.2/asoc-adav80x-remove-.read_flag_mask-setting-from-adav80x_regmap_config.patch b/queue-4.2/asoc-adav80x-remove-.read_flag_mask-setting-from-adav80x_regmap_config.patch
new file mode 100644 (file)
index 0000000..333f025
--- /dev/null
@@ -0,0 +1,31 @@
+From 9d8352864907f0ad76124c5b28f65b5a382d7d7c Mon Sep 17 00:00:00 2001
+From: Axel Lin <axel.lin@ingics.com>
+Date: Fri, 14 Aug 2015 17:54:07 +0800
+Subject: ASoC: adav80x: Remove .read_flag_mask setting from adav80x_regmap_config
+
+From: Axel Lin <axel.lin@ingics.com>
+
+commit 9d8352864907f0ad76124c5b28f65b5a382d7d7c upstream.
+
+Don't set .read_flag_mask for adav803, it's for adav801 only.
+
+Fixes: 0c2d69645628 ("ASoC: adav80x: Split SPI and I2C code into different modules")
+Signed-off-by: Axel Lin <axel.lin@ingics.com>
+Acked-by: Lars-Peter Clausen <lars@metafoo.de>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/adav80x.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/sound/soc/codecs/adav80x.c
++++ b/sound/soc/codecs/adav80x.c
+@@ -865,7 +865,6 @@ const struct regmap_config adav80x_regma
+       .val_bits = 8,
+       .pad_bits = 1,
+       .reg_bits = 7,
+-      .read_flag_mask = 0x01,
+       .max_register = ADAV80X_PLL_OUTE,
diff --git a/queue-4.2/asoc-arizona-fix-gain-settings-of-fll-in-free-run-mode.patch b/queue-4.2/asoc-arizona-fix-gain-settings-of-fll-in-free-run-mode.patch
new file mode 100644 (file)
index 0000000..03c32ff
--- /dev/null
@@ -0,0 +1,33 @@
+From 1cf5a330c05ae37a0a98ac7c9800a6f50d5579ec Mon Sep 17 00:00:00 2001
+From: Nikesh Oswal <Nikesh.Oswal@wolfsonmicro.com>
+Date: Wed, 19 Aug 2015 16:02:24 +0100
+Subject: ASoC: arizona: Fix gain settings of FLL in free-run mode
+
+From: Nikesh Oswal <Nikesh.Oswal@wolfsonmicro.com>
+
+commit 1cf5a330c05ae37a0a98ac7c9800a6f50d5579ec upstream.
+
+The wrong register was used to set the gain of ref loop, when changing
+the FLL output on an active FLL. This patch corrects the offset of the
+gain register.
+
+Signed-off-by: Nikesh Oswal <Nikesh.Oswal@wolfsonmicro.com>
+Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/arizona.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/codecs/arizona.c
++++ b/sound/soc/codecs/arizona.c
+@@ -2058,7 +2058,7 @@ static int arizona_enable_fll(struct ari
+       if (already_enabled) {
+               /* Facilitate smooth refclk across the transition */
+-              regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x7,
++              regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x9,
+                                        ARIZONA_FLL1_GAIN_MASK, 0);
+               regmap_update_bits_async(fll->arizona->regmap, fll->base + 1,
+                                        ARIZONA_FLL1_FREERUN,
diff --git a/queue-4.2/asoc-arizona-poll-for-fll-clock-ok-rather-than-use-interrupts.patch b/queue-4.2/asoc-arizona-poll-for-fll-clock-ok-rather-than-use-interrupts.patch
new file mode 100644 (file)
index 0000000..4ab3069
--- /dev/null
@@ -0,0 +1,141 @@
+From 0e7659712836ca59b4735bc5cc94de38698a5e01 Mon Sep 17 00:00:00 2001
+From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Date: Tue, 25 Aug 2015 12:43:48 +0100
+Subject: ASoC: arizona: Poll for FLL clock OK rather than use interrupts
+
+From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+
+commit 0e7659712836ca59b4735bc5cc94de38698a5e01 upstream.
+
+The extcon driver takes the DAPM mutex from within the interrupt thread
+in several places, which makes it possible to get into a situation where
+the interrupt thread is blocked waiting on the DAPM mutex whilst a DAPM
+sequence is running which is attempting to configure the FLL. In this
+case the FLL completion can't be completed as as the IRQ handler is
+ONE_SHOT, which cause the FLL lock to use the full time out (250mS) and
+report that the process timed out.
+
+It is not really practical to make the extcon driver not take the DAPM
+mutex from within the interrupt thread, at least not without extensive
+modification. So this patch fixes the issue by switching the wait for
+the FLL lock to polling. A few fast polls are done first as the FLL
+should lock quickly for a good quality reference clock, (indeed it hits
+on the first poll on my system) and it will poll every 20mS after that
+until it times out.
+
+Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/arizona.c |   47 ++++++++++++++++++---------------------------
+ sound/soc/codecs/arizona.h |    1 
+ 2 files changed, 19 insertions(+), 29 deletions(-)
+
+--- a/sound/soc/codecs/arizona.c
++++ b/sound/soc/codecs/arizona.c
+@@ -1756,17 +1756,6 @@ int arizona_init_dai(struct arizona_priv
+ }
+ EXPORT_SYMBOL_GPL(arizona_init_dai);
+-static irqreturn_t arizona_fll_clock_ok(int irq, void *data)
+-{
+-      struct arizona_fll *fll = data;
+-
+-      arizona_fll_dbg(fll, "clock OK\n");
+-
+-      complete(&fll->ok);
+-
+-      return IRQ_HANDLED;
+-}
+-
+ static struct {
+       unsigned int min;
+       unsigned int max;
+@@ -2048,10 +2037,11 @@ static int arizona_is_enabled_fll(struct
+ static int arizona_enable_fll(struct arizona_fll *fll)
+ {
+       struct arizona *arizona = fll->arizona;
+-      unsigned long time_left;
+       bool use_sync = false;
+       int already_enabled = arizona_is_enabled_fll(fll);
+       struct arizona_fll_cfg cfg;
++      int i;
++      unsigned int val;
+       if (already_enabled < 0)
+               return already_enabled;
+@@ -2110,9 +2100,6 @@ static int arizona_enable_fll(struct ari
+       if (!already_enabled)
+               pm_runtime_get(arizona->dev);
+-      /* Clear any pending completions */
+-      try_wait_for_completion(&fll->ok);
+-
+       regmap_update_bits_async(arizona->regmap, fll->base + 1,
+                                ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA);
+       if (use_sync)
+@@ -2124,10 +2111,24 @@ static int arizona_enable_fll(struct ari
+               regmap_update_bits_async(arizona->regmap, fll->base + 1,
+                                        ARIZONA_FLL1_FREERUN, 0);
+-      time_left = wait_for_completion_timeout(&fll->ok,
+-                                        msecs_to_jiffies(250));
+-      if (time_left == 0)
++      arizona_fll_dbg(fll, "Waiting for FLL lock...\n");
++      val = 0;
++      for (i = 0; i < 15; i++) {
++              if (i < 5)
++                      usleep_range(200, 400);
++              else
++                      msleep(20);
++
++              regmap_read(arizona->regmap,
++                          ARIZONA_INTERRUPT_RAW_STATUS_5,
++                          &val);
++              if (val & (ARIZONA_FLL1_CLOCK_OK_STS << (fll->id - 1)))
++                      break;
++      }
++      if (i == 15)
+               arizona_fll_warn(fll, "Timed out waiting for lock\n");
++      else
++              arizona_fll_dbg(fll, "FLL locked (%d polls)\n", i);
+       return 0;
+ }
+@@ -2212,11 +2213,8 @@ EXPORT_SYMBOL_GPL(arizona_set_fll);
+ int arizona_init_fll(struct arizona *arizona, int id, int base, int lock_irq,
+                    int ok_irq, struct arizona_fll *fll)
+ {
+-      int ret;
+       unsigned int val;
+-      init_completion(&fll->ok);
+-
+       fll->id = id;
+       fll->base = base;
+       fll->arizona = arizona;
+@@ -2238,13 +2236,6 @@ int arizona_init_fll(struct arizona *ari
+       snprintf(fll->clock_ok_name, sizeof(fll->clock_ok_name),
+                "FLL%d clock OK", id);
+-      ret = arizona_request_irq(arizona, ok_irq, fll->clock_ok_name,
+-                                arizona_fll_clock_ok, fll);
+-      if (ret != 0) {
+-              dev_err(arizona->dev, "Failed to get FLL%d clock OK IRQ: %d\n",
+-                      id, ret);
+-      }
+-
+       regmap_update_bits(arizona->regmap, fll->base + 1,
+                          ARIZONA_FLL1_FREERUN, 0);
+--- a/sound/soc/codecs/arizona.h
++++ b/sound/soc/codecs/arizona.h
+@@ -242,7 +242,6 @@ struct arizona_fll {
+       int id;
+       unsigned int base;
+       unsigned int vco_mult;
+-      struct completion ok;
+       unsigned int fout;
+       int sync_src;
index ec44de2a16082f44a7953c36407d7c25fd2623dc..ff845fcd7453f858bcf6dbe386c020602f5545e0 100644 (file)
@@ -74,3 +74,6 @@ tty-serial-men_z135_uart.c-fix-race-between-irq-and-set_termios.patch
 asoc-rt5640-fix-line-out-no-sound-issue.patch
 asoc-rt5645-add-struct-dmi_system_id-google-celes-for-chrome-platform.patch
 asoc-samsung-remove-redundant-arndale_audio_remove.patch
+asoc-adav80x-remove-.read_flag_mask-setting-from-adav80x_regmap_config.patch
+asoc-arizona-fix-gain-settings-of-fll-in-free-run-mode.patch
+asoc-arizona-poll-for-fll-clock-ok-rather-than-use-interrupts.patch