public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Shawn Guo <shawn.guo@linaro.org>,
	Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
	Mark Brown <broonie@linaro.org>
Subject: [PATCH 3.10 080/103] ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile
Date: Wed,  4 Jun 2014 16:25:43 -0700	[thread overview]
Message-ID: <20140604232549.423209759@linuxfoundation.org> (raw)
In-Reply-To: <20140604232546.704156131@linuxfoundation.org>

3.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

commit 44330ab516c15dda8a1e660eeaf0003f84e43e3f upstream.

The register CLASS_D_CONTROL_1 is marked as volatile because it contains
a bit, DAC_MUTE, which is also mirrored in the ADC_DAC_CONTROL_1
register. This causes problems for the "Speaker Switch" control, which
will report an error if the CODEC is suspended because it relies on a
volatile register.

To resolve this issue mark CLASS_D_CONTROL_1 as non-volatile and
manually keep the register cache in sync by updating both bits when
changing the mute status.

Reported-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/soc/codecs/wm8962.c |   15 ++++++++++++---
 sound/soc/codecs/wm8962.h |    4 ++++
 2 files changed, 16 insertions(+), 3 deletions(-)

--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -153,6 +153,7 @@ static struct reg_default wm8962_reg[] =
 	{ 40, 0x0000 },   /* R40    - SPKOUTL volume */
 	{ 41, 0x0000 },   /* R41    - SPKOUTR volume */
 
+	{ 49, 0x0010 },   /* R49    - Class D Control 1 */
 	{ 51, 0x0003 },   /* R51    - Class D Control 2 */
 
 	{ 56, 0x0506 },   /* R56    - Clocking 4 */
@@ -794,7 +795,6 @@ static bool wm8962_volatile_register(str
 	case WM8962_ALC2:
 	case WM8962_THERMAL_SHUTDOWN_STATUS:
 	case WM8962_ADDITIONAL_CONTROL_4:
-	case WM8962_CLASS_D_CONTROL_1:
 	case WM8962_DC_SERVO_6:
 	case WM8962_INTERRUPT_STATUS_1:
 	case WM8962_INTERRUPT_STATUS_2:
@@ -2901,13 +2901,22 @@ static int wm8962_set_fll(struct snd_soc
 static int wm8962_mute(struct snd_soc_dai *dai, int mute)
 {
 	struct snd_soc_codec *codec = dai->codec;
-	int val;
+	int val, ret;
 
 	if (mute)
-		val = WM8962_DAC_MUTE;
+		val = WM8962_DAC_MUTE | WM8962_DAC_MUTE_ALT;
 	else
 		val = 0;
 
+	/**
+	 * The DAC mute bit is mirrored in two registers, update both to keep
+	 * the register cache consistent.
+	 */
+	ret = snd_soc_update_bits(codec, WM8962_CLASS_D_CONTROL_1,
+				  WM8962_DAC_MUTE_ALT, val);
+	if (ret < 0)
+		return ret;
+
 	return snd_soc_update_bits(codec, WM8962_ADC_DAC_CONTROL_1,
 				   WM8962_DAC_MUTE, val);
 }
--- a/sound/soc/codecs/wm8962.h
+++ b/sound/soc/codecs/wm8962.h
@@ -1954,6 +1954,10 @@
 #define WM8962_SPKOUTL_ENA_MASK                 0x0040  /* SPKOUTL_ENA */
 #define WM8962_SPKOUTL_ENA_SHIFT                     6  /* SPKOUTL_ENA */
 #define WM8962_SPKOUTL_ENA_WIDTH                     1  /* SPKOUTL_ENA */
+#define WM8962_DAC_MUTE_ALT                     0x0010  /* DAC_MUTE */
+#define WM8962_DAC_MUTE_ALT_MASK                0x0010  /* DAC_MUTE */
+#define WM8962_DAC_MUTE_ALT_SHIFT                    4  /* DAC_MUTE */
+#define WM8962_DAC_MUTE_ALT_WIDTH                    1  /* DAC_MUTE */
 #define WM8962_SPKOUTL_PGA_MUTE                 0x0002  /* SPKOUTL_PGA_MUTE */
 #define WM8962_SPKOUTL_PGA_MUTE_MASK            0x0002  /* SPKOUTL_PGA_MUTE */
 #define WM8962_SPKOUTL_PGA_MUTE_SHIFT                1  /* SPKOUTL_PGA_MUTE */



  parent reply	other threads:[~2014-06-04 23:34 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04 23:24 [PATCH 3.10 000/103] 3.10.42-stable review Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 001/103] futex: Add another early deadlock detection check Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 002/103] futex: Prevent attaching to kernel threads Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 003/103] mips: dts: Fix missing device_type="memory" property in memory nodes Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 004/103] ftrace/module: Hardcode ftrace_module_init() call into load_module() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 008/103] pata_at91: fix ata_host_activate() failure handling Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 010/103] mm: make fixup_user_fault() check the vma access rights too Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 011/103] serial: 8250: Fix thread unsafe __dma_tx_complete function Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 012/103] 8250_core: Fix unwanted TX chars write Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 013/103] gpu: host1x: handle the correct # of syncpt regs Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 014/103] timer: Prevent overflow in apply_slack Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 015/103] ipmi: Fix a race restarting the timer Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 016/103] ipmi: Reset the KCS timeout when starting error recovery Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 017/103] mac80211: fix suspend vs. authentication race Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 018/103] mm, thp: close race between mremap() and split_huge_page() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 019/103] x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 020/103] hwpoison, hugetlb: lock_page/unlock_page does not match for handling a free hugepage Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 021/103] mac80211: fix on-channel remain-on-channel Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 022/103] hwmon: (emc1403) fix inverted store_hyst() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 023/103] hwmon: (emc1403) Support full range of known chip revision numbers Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 024/103] drivercore: deferral race condition fix Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 025/103] hrtimer: Prevent all reprogramming if hang detected Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 026/103] hrtimer: Prevent remote enqueue of leftmost timers Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 027/103] hrtimer: Set expiry time before switch_hrtimer_base() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 028/103] md: avoid possible spinning md thread at shutdown Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 029/103] drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc() Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 032/103] drm/tegra: Remove gratuitous pad field Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 033/103] iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereference Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 034/103] fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6 Greg Kroah-Hartman
2014-06-04 23:24 ` [PATCH 3.10 035/103] usb: gadget: at91-udc: fix irq and iomem resource retrieval Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 038/103] usb: storage: shuttle_usbat: fix discs being detected twice Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 039/103] USB: Nokia 305 should be treated as unusual dev Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 040/103] USB: Nokia 5300 " Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 041/103] rt2x00: fix beaconing on USB Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 042/103] ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 043/103] Bluetooth: Fix triggering BR/EDR L2CAP Connect too early Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 044/103] Bluetooth: Fix redundant encryption request for reauthentication Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 045/103] Bluetooth: Add support for Lite-on [04ca:3007] Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 046/103] posix_acl: handle NULL ACL in posix_acl_equiv_mode Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 047/103] [media] omap3isp: Defer probe when the IOMMU is not available Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 048/103] ARM: dts: i.MX53: Fix ipu register space size Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 049/103] ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 050/103] rtl8192cu: Fix unbalanced irq enable in error path of rtl92cu_hw_init() Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 051/103] drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 053/103] leds: leds-pwm: properly clean up after probe failure Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 054/103] brcmsmac: fix deadlock on missing firmware Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 055/103] Documentation: Update stable address in Chinese and Japanese translations Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 056/103] crypto: crypto_wq - Fix late crypto work queue initialization Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 057/103] clk: vexpress: NULL dereference on error path Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 059/103] i2c: i801: Add Device IDs for Intel Wildcat Point-LP PCH Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 060/103] i2c: i801: enable Intel BayTrail SMBUS Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 061/103] Drivers: hv: vmbus: Negotiate version 3.0 when running on ws2012r2 hosts Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 062/103] trace: module: Maintain a valid user count Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 063/103] Input: atkbd - fix keyboard not working on some LG laptops Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 064/103] Input: elantech - fix touchpad initialization on Gigabyte U2442 Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 065/103] Input: synaptics - add min/max quirk for the ThinkPad W540 Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 066/103] Input: synaptics - T540p - unify with other LEN0034 models Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 067/103] ALSA: hda - Fix onboard audio on Intel H97/Z97 chipsets Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 068/103] NFSd: Move default initialisers from create_client() to alloc_client() Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 069/103] NFSd: call rpc_destroy_wait_queue() from free_client() Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 070/103] NFSD: Call ->set_acl with a NULL ACL structure if no entries Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 071/103] nfsd4: warn on finding lockowner without stateids Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 072/103] nfsd4: remove lockowner when removing lock stateid Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 073/103] workqueue: fix bugs in wq_update_unbound_numa() failure path Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 074/103] workqueue: fix a possible race condition between rescuer and pwq-release Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 075/103] workqueue: make rescuer_thread() empty wq->maydays list before exiting Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 076/103] bus: mvebu-mbus: allow several windows with the same target/attribute Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 077/103] percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree() Greg Kroah-Hartman
2014-06-04 23:25 ` Greg Kroah-Hartman [this message]
2014-06-04 23:25 ` [PATCH 3.10 081/103] metag: fix memory barriers Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 082/103] metag: Reduce maximum stack size to 256MB Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 083/103] x86-64, modify_ldt: Make support for 16-bit segments a runtime option Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 084/103] genirq: Provide irq_force_affinity fallback for non-SMP Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 085/103] PCI: shpchp: Check bridges secondary (not primary) bus speed Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 086/103] Target/iser: Fix wrong connection requests list addition Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 087/103] Target/iser: Fix iscsit_accept_np and rdma_cm racy flow Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 088/103] target: Dont allow setting WC emulation if device doesnt support Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 089/103] powerpc/tm: Fix crash when forking inside a transaction Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 090/103] dm crypt: fix cpu hotplug crash by removing per-cpu structure Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 091/103] libata: clean up ZPODD when a port is detached Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 092/103] ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC 1015PX Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 093/103] i2c: rcar: bail out on zero length transfers Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 094/103] i2c: designware: Mask all interrupts during i2c controller enable Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 095/103] i2c: s3c2410: resume race fix Greg Kroah-Hartman
2014-06-04 23:25 ` [PATCH 3.10 096/103] crypto: caam - add allocation failure handling in SPRINTFCAT macro Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 097/103] crypto: s390 - fix aes,des ctr mode concurrency finding Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 098/103] powerpc: Fix 64 bit builds with binutils 2.24 Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 099/103] libceph: fix corruption when using page_count 0 page in rbd Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 100/103] iommu/amd: Fix interrupt remapping for aliased devices Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 101/103] media: fc2580: fix tuning failure on 32-bit arch Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 102/103] media: V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space Greg Kroah-Hartman
2014-06-04 23:26 ` [PATCH 3.10 103/103] media: V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode Greg Kroah-Hartman
     [not found] ` <20140604232547.006861681@linuxfoundation.org>
2014-06-05 16:05   ` [PATCH 3.10 005/103] irqchip: Gic: Support forced affinity setting Mark Rutland
2014-06-05 18:05     ` Greg Kroah-Hartman
2014-06-05 18:10       ` Mark Rutland
2014-06-23 11:17       ` Mark Brown
2014-06-05 17:15 ` [PATCH 3.10 000/103] 3.10.42-stable review Guenter Roeck
2014-06-05 17:55 ` Shuah Khan
2014-06-05 23:20 ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140604232549.423209759@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=broonie@linaro.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox