From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: broonie@kernel.org
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
lgirdwood@gmail.com, robh+dt@kernel.org
Subject: [PATCH 3/5] ASoC: cs35l35: Add for configuring drive mode in unused slots
Date: Wed, 8 Mar 2017 16:42:49 +0000 [thread overview]
Message-ID: <1488991371-22513-3-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1488991371-22513-1-git-send-email-ckeepax@opensource.wolfsonmicro.com>
Add support for setting how the I2S pins are driven in unused slots,
currently the chip will just use the default of drive 0, however this
causes issues when multiple devices are attached to the same bus.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
include/sound/cs35l35.h | 2 ++
sound/soc/codecs/cs35l35.c | 7 +++++++
sound/soc/codecs/cs35l35.h | 4 ++++
3 files changed, 13 insertions(+)
diff --git a/include/sound/cs35l35.h b/include/sound/cs35l35.h
index de92e452..983c610 100644
--- a/include/sound/cs35l35.h
+++ b/include/sound/cs35l35.h
@@ -80,6 +80,8 @@ struct cs35l35_platform_data {
bool stereo;
/* serial port drive strength */
int sp_drv_str;
+ /* serial port drive in unused slots */
+ int sp_drv_unused;
/* Boost Power Down with FET */
bool bst_pdn_fet_on;
/* Boost Voltage : used if ClassH Algo Enabled */
diff --git a/sound/soc/codecs/cs35l35.c b/sound/soc/codecs/cs35l35.c
index 48b45dc..5a9fe5a 100644
--- a/sound/soc/codecs/cs35l35.c
+++ b/sound/soc/codecs/cs35l35.c
@@ -789,6 +789,11 @@ static int cs35l35_codec_probe(struct snd_soc_codec *codec)
CS35L35_SP_DRV_MASK,
cs35l35->pdata.sp_drv_str <<
CS35L35_SP_DRV_SHIFT);
+ if (cs35l35->pdata.sp_drv_unused)
+ regmap_update_bits(cs35l35->regmap, CS35L35_SP_FMT_CTL3,
+ CS35L35_SP_I2S_DRV_MASK,
+ cs35l35->pdata.sp_drv_unused <<
+ CS35L35_SP_I2S_DRV_SHIFT);
if (classh->classh_algo_enable) {
if (classh->classh_bst_override)
@@ -1169,6 +1174,8 @@ static int cs35l35_handle_of_data(struct i2c_client *i2c_client,
if (of_property_read_u32(np, "cirrus,sp-drv-strength", &val32) >= 0)
pdata->sp_drv_str = val32;
+ if (of_property_read_u32(np, "cirrus,sp-drv-unused", &val32) >= 0)
+ pdata->sp_drv_unused = val32 | CS35L35_VALID_PDATA;
pdata->stereo = of_property_read_bool(np, "cirrus,stereo-config");
diff --git a/sound/soc/codecs/cs35l35.h b/sound/soc/codecs/cs35l35.h
index e27a7fe..c203081 100644
--- a/sound/soc/codecs/cs35l35.h
+++ b/sound/soc/codecs/cs35l35.h
@@ -190,6 +190,10 @@
#define CS35L35_AMP_GAIN_ZC_MASK 0x10
#define CS35L35_AMP_GAIN_ZC_SHIFT 4
+/* CS35L35_SP_FMT_CTL3 */
+#define CS35L35_SP_I2S_DRV_MASK 0x03
+#define CS35L35_SP_I2S_DRV_SHIFT 0
+
/* Class H Algorithm Control */
#define CS35L35_CH_STEREO_MASK 0x40
#define CS35L35_CH_STEREO_SHIFT 6
--
2.1.4
next prev parent reply other threads:[~2017-03-08 16:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 16:42 [PATCH 1/5] ASoC: cs35l35: Add missing return in probe Charles Keepax
2017-03-08 16:42 ` [PATCH 2/5] ASoC: cs35l35: Add device tree binding for I2S drive configuration Charles Keepax
[not found] ` <1488991371-22513-2-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2017-03-13 16:58 ` Applied "ASoC: cs35l35: Add device tree binding for I2S drive configuration" to the asoc tree Mark Brown
2017-03-08 16:42 ` Charles Keepax [this message]
[not found] ` <1488991371-22513-3-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2017-03-13 16:58 ` Applied "ASoC: cs35l35: Add for configuring drive mode in unused slots" " Mark Brown
2017-03-08 16:42 ` [PATCH 4/5] ASoC: cs35l35: Add local variable for dev in probe Charles Keepax
[not found] ` <1488991371-22513-4-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2017-03-13 16:58 ` Applied "ASoC: cs35l35: Add local variable for dev in probe" to the asoc tree Mark Brown
2017-03-08 16:42 ` [PATCH 5/5] ASoC: cs35l35: Add IRQF_SHARED to IRQ flags Charles Keepax
[not found] ` <1488991371-22513-5-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2017-03-13 16:58 ` Applied "ASoC: cs35l35: Add IRQF_SHARED to IRQ flags" to the asoc tree Mark Brown
2017-03-08 19:55 ` [PATCH 1/5] ASoC: cs35l35: Add missing return in probe Austin, Brian
[not found] ` <1488991371-22513-1-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2017-03-13 16:59 ` Applied "ASoC: cs35l35: Add missing return in probe" to the asoc tree Mark Brown
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=1488991371-22513-3-git-send-email-ckeepax@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=mark.rutland@arm.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).