summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaxminath Kasam <lkasam@codeaurora.org>2017-02-01 10:37:19 +0530
committerLaxminath Kasam <lkasam@codeaurora.org>2017-02-01 15:12:31 +0530
commitb3f17f8fe8f3624fa774d4dc15e10dff88c7d190 (patch)
treea3fb07dd85cce10bf41d1777f3b322c06a02d1b9
parent42e1251b38729f7d0ec276e8a195db1d3ed22d41 (diff)
ASoC: wsa881x: Add cache-always mode for sdm660
As WSA881x registers fails to read sometimes on sdm660 internal codec, use cache-always mode to avoid speaker mute. CRs-Fixed: 1117406 Change-Id: I9742af37c3e64efb46fc9b3cef616f685b7f01a8 Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
-rw-r--r--Documentation/devicetree/bindings/sound/wcd_codec.txt9
-rw-r--r--sound/soc/codecs/wsa881x-regmap.c5
-rw-r--r--sound/soc/codecs/wsa881x.c6
-rw-r--r--sound/soc/codecs/wsa881x.h3
4 files changed, 19 insertions, 4 deletions
diff --git a/Documentation/devicetree/bindings/sound/wcd_codec.txt b/Documentation/devicetree/bindings/sound/wcd_codec.txt
index fb2b3654dcc7..b7a81efb768c 100644
--- a/Documentation/devicetree/bindings/sound/wcd_codec.txt
+++ b/Documentation/devicetree/bindings/sound/wcd_codec.txt
@@ -1,4 +1,6 @@
-WCD audio CODEC
+* Qualcomm Technologies WCD Audio Codec
+
+This node models the Qualcomm Technologies Audio HW WCD Codecs
Required properties:
@@ -512,6 +514,10 @@ Required properties:
which is also existing driver WSA881x that represents
soundwire slave devices.
+Optional Properties:
+ - qcom,cache-always : Boolean. This property is used in WSA slave
+ device to use cacheable for all registers.
+
Example:
msm_sdw_codec: qcom,msm-sdw-codec@152c1000 {
@@ -529,6 +535,7 @@ msm_sdw_codec: qcom,msm-sdw-codec@152c1000 {
compatible = "qcom,wsa881x";
reg = <0x00 0x20170212>;
qcom,spkr-sd-n-gpio = <&tlmm 80 0>;
+ qcom,cache-always;
};
};
};
diff --git a/sound/soc/codecs/wsa881x-regmap.c b/sound/soc/codecs/wsa881x-regmap.c
index 63bbbfa6beab..faa44301286c 100644
--- a/sound/soc/codecs/wsa881x-regmap.c
+++ b/sound/soc/codecs/wsa881x-regmap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -216,6 +216,9 @@ static bool wsa881x_readable_register(struct device *dev, unsigned int reg)
static bool wsa881x_volatile_register(struct device *dev, unsigned int reg)
{
+ if (cache_always)
+ return false;
+
switch (reg) {
case WSA881X_CHIP_ID0:
case WSA881X_CHIP_ID1:
diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
index d7f4044b71ee..171735c8efd4 100644
--- a/sound/soc/codecs/wsa881x.c
+++ b/sound/soc/codecs/wsa881x.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -78,6 +78,7 @@ enum {
WSA881X_DEV_UP,
};
+bool cache_always;
/*
* Private data Structure for wsa881x. All parameters related to
* WSA881X codec needs to be defined here.
@@ -1227,6 +1228,9 @@ static int wsa881x_swr_probe(struct swr_device *pdev)
if (ret)
goto err;
}
+
+ cache_always = of_property_read_bool(pdev->dev.of_node,
+ "qcom,cache-always");
wsa881x_gpio_ctrl(wsa881x, true);
wsa881x->state = WSA881X_DEV_UP;
diff --git a/sound/soc/codecs/wsa881x.h b/sound/soc/codecs/wsa881x.h
index be234ac0cd07..178237555c54 100644
--- a/sound/soc/codecs/wsa881x.h
+++ b/sound/soc/codecs/wsa881x.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -20,6 +20,7 @@
#define WSA881X_MAX_SWR_PORTS 4
+extern bool cache_always;
extern int wsa881x_set_channel_map(struct snd_soc_codec *codec, u8 *port,
u8 num_port, unsigned int *ch_mask,
unsigned int *ch_rate);