* [PATCH v3] ASoC: cs42l56: Fix new value argument in snd_soc_update_bits calls
@ 2014-05-23 5:05 Axel Lin
2014-05-27 14:31 ` Brian Austin
2014-06-01 10:50 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2014-05-23 5:05 UTC (permalink / raw)
To: Mark Brown; +Cc: Brian Austin, alsa-devel, Liam Girdwood, Paul Handrigan
The new value argument needs proper shift to match the mask bit fields.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
v3: Define CS42L56_MUTE_ALL as 0xff, so all the mask bits will be set.
v2: Address Brian's comment in v1.
sound/soc/codecs/cs42l56.c | 70 ++++++++++++++++++++--------------------------
sound/soc/codecs/cs42l56.h | 10 ++++---
2 files changed, 37 insertions(+), 43 deletions(-)
diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c
index 5bb134b..fdc4bd2 100644
--- a/sound/soc/codecs/cs42l56.c
+++ b/sound/soc/codecs/cs42l56.c
@@ -763,14 +763,14 @@ static int cs42l56_set_sysclk(struct snd_soc_dai *codec_dai,
case CS42L56_MCLK_11P2896MHZ:
case CS42L56_MCLK_12MHZ:
case CS42L56_MCLK_12P288MHZ:
- cs42l56->mclk_div2 = 1;
+ cs42l56->mclk_div2 = CS42L56_MCLK_DIV2;
cs42l56->mclk_prediv = 0;
break;
case CS42L56_MCLK_22P5792MHZ:
case CS42L56_MCLK_24MHZ:
case CS42L56_MCLK_24P576MHZ:
- cs42l56->mclk_div2 = 1;
- cs42l56->mclk_prediv = 1;
+ cs42l56->mclk_div2 = CS42L56_MCLK_DIV2;
+ cs42l56->mclk_prediv = CS42L56_MCLK_PREDIV;
break;
default:
return -EINVAL;
@@ -844,57 +844,49 @@ static int cs42l56_digital_mute(struct snd_soc_dai *dai, int mute)
/* Hit the DSP Mixer first */
snd_soc_update_bits(codec, CS42L56_DSP_MUTE_CTL,
CS42L56_ADCAMIX_MUTE_MASK |
- CS42L56_ADCBMIX_MUTE_MASK |
- CS42L56_PCMAMIX_MUTE_MASK |
- CS42L56_PCMBMIX_MUTE_MASK |
- CS42L56_MSTB_MUTE_MASK |
- CS42L56_MSTA_MUTE_MASK,
- CS42L56_MUTE);
+ CS42L56_ADCBMIX_MUTE_MASK |
+ CS42L56_PCMAMIX_MUTE_MASK |
+ CS42L56_PCMBMIX_MUTE_MASK |
+ CS42L56_MSTB_MUTE_MASK |
+ CS42L56_MSTA_MUTE_MASK,
+ CS42L56_MUTE_ALL);
/* Mute ADC's */
snd_soc_update_bits(codec, CS42L56_MISC_ADC_CTL,
- CS42L56_ADCA_MUTE_MASK |
- CS42L56_ADCB_MUTE_MASK,
- CS42L56_MUTE);
+ CS42L56_ADCA_MUTE_MASK |
+ CS42L56_ADCB_MUTE_MASK,
+ CS42L56_MUTE_ALL);
/* HP And LO */
snd_soc_update_bits(codec, CS42L56_HPA_VOLUME,
- CS42L56_HP_MUTE_MASK,
- CS42L56_MUTE);
+ CS42L56_HP_MUTE_MASK, CS42L56_MUTE_ALL);
snd_soc_update_bits(codec, CS42L56_HPB_VOLUME,
- CS42L56_HP_MUTE_MASK,
- CS42L56_MUTE);
+ CS42L56_HP_MUTE_MASK, CS42L56_MUTE_ALL);
snd_soc_update_bits(codec, CS42L56_LOA_VOLUME,
- CS42L56_LO_MUTE_MASK,
- CS42L56_MUTE);
+ CS42L56_LO_MUTE_MASK, CS42L56_MUTE_ALL);
snd_soc_update_bits(codec, CS42L56_LOB_VOLUME,
- CS42L56_LO_MUTE_MASK,
- CS42L56_MUTE);
-
-
+ CS42L56_LO_MUTE_MASK, CS42L56_MUTE_ALL);
} else {
snd_soc_update_bits(codec, CS42L56_DSP_MUTE_CTL,
CS42L56_ADCAMIX_MUTE_MASK |
- CS42L56_ADCBMIX_MUTE_MASK |
- CS42L56_PCMAMIX_MUTE_MASK |
- CS42L56_PCMBMIX_MUTE_MASK |
- CS42L56_MSTB_MUTE_MASK |
- CS42L56_MSTA_MUTE_MASK,
- CS42L56_UNMUTE);
+ CS42L56_ADCBMIX_MUTE_MASK |
+ CS42L56_PCMAMIX_MUTE_MASK |
+ CS42L56_PCMBMIX_MUTE_MASK |
+ CS42L56_MSTB_MUTE_MASK |
+ CS42L56_MSTA_MUTE_MASK,
+ CS42L56_UNMUTE);
+
snd_soc_update_bits(codec, CS42L56_MISC_ADC_CTL,
- CS42L56_ADCA_MUTE_MASK |
- CS42L56_ADCB_MUTE_MASK,
- CS42L56_UNMUTE);
+ CS42L56_ADCA_MUTE_MASK |
+ CS42L56_ADCB_MUTE_MASK,
+ CS42L56_UNMUTE);
+
snd_soc_update_bits(codec, CS42L56_HPA_VOLUME,
- CS42L56_HP_MUTE_MASK,
- CS42L56_UNMUTE);
+ CS42L56_HP_MUTE_MASK, CS42L56_UNMUTE);
snd_soc_update_bits(codec, CS42L56_HPB_VOLUME,
- CS42L56_HP_MUTE_MASK,
- CS42L56_UNMUTE);
+ CS42L56_HP_MUTE_MASK, CS42L56_UNMUTE);
snd_soc_update_bits(codec, CS42L56_LOA_VOLUME,
- CS42L56_LO_MUTE_MASK,
- CS42L56_UNMUTE);
+ CS42L56_LO_MUTE_MASK, CS42L56_UNMUTE);
snd_soc_update_bits(codec, CS42L56_LOB_VOLUME,
- CS42L56_LO_MUTE_MASK,
- CS42L56_UNMUTE);
+ CS42L56_LO_MUTE_MASK, CS42L56_UNMUTE);
}
return 0;
}
diff --git a/sound/soc/codecs/cs42l56.h b/sound/soc/codecs/cs42l56.h
index ad2b50a..5025ec9 100644
--- a/sound/soc/codecs/cs42l56.h
+++ b/sound/soc/codecs/cs42l56.h
@@ -80,19 +80,21 @@
#define CS42L56_PDN_HPB_MASK 0xc0
/* serial port and clk masks */
-#define CS42L56_MASTER_MODE 1
+#define CS42L56_MASTER_MODE 0x40
#define CS42L56_SLAVE_MODE 0
#define CS42L56_MS_MODE_MASK 0x40
-#define CS42L56_SCLK_INV 1
+#define CS42L56_SCLK_INV 0x20
#define CS42L56_SCLK_INV_MASK 0x20
#define CS42L56_SCLK_MCLK_MASK 0x18
+#define CS42L56_MCLK_PREDIV 0x04
#define CS42L56_MCLK_PREDIV_MASK 0x04
+#define CS42L56_MCLK_DIV2 0x02
#define CS42L56_MCLK_DIV2_MASK 0x02
#define CS42L56_MCLK_DIS_MASK 0x01
#define CS42L56_CLK_AUTO_MASK 0x20
#define CS42L56_CLK_RATIO_MASK 0x1f
#define CS42L56_DIG_FMT_I2S 0
-#define CS42L56_DIG_FMT_LEFT_J 1
+#define CS42L56_DIG_FMT_LEFT_J 0x08
#define CS42L56_DIG_FMT_MASK 0x08
/* Class H and misc ctl masks */
@@ -116,7 +118,7 @@
#define CS42L56_DEEMPH_MASK 0x40
#define CS42L56_PLYBCK_GANG_MASK 0x10
#define CS42L56_PCM_INV_MASK 0x0c
-#define CS42L56_MUTE 1
+#define CS42L56_MUTE_ALL 0xff
#define CS42L56_UNMUTE 0
#define CS42L56_ADCAMIX_MUTE_MASK 0x40
#define CS42L56_ADCBMIX_MUTE_MASK 0x80
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] ASoC: cs42l56: Fix new value argument in snd_soc_update_bits calls
2014-05-23 5:05 [PATCH v3] ASoC: cs42l56: Fix new value argument in snd_soc_update_bits calls Axel Lin
@ 2014-05-27 14:31 ` Brian Austin
2014-06-01 10:50 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Brian Austin @ 2014-05-27 14:31 UTC (permalink / raw)
To: Axel Lin
Cc: alsa-devel, Brian Austin, Mark Brown, Liam Girdwood,
Paul Handrigan
On Fri, 23 May 2014, Axel Lin wrote:
> The new value argument needs proper shift to match the mask bit fields.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> v3: Define CS42L56_MUTE_ALL as 0xff, so all the mask bits will be set.
> v2: Address Brian's comment in v1.
Looks good Axel,
Thanks
Tested-by: Brian Austin <brian.austin@cirrus.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] ASoC: cs42l56: Fix new value argument in snd_soc_update_bits calls
2014-05-23 5:05 [PATCH v3] ASoC: cs42l56: Fix new value argument in snd_soc_update_bits calls Axel Lin
2014-05-27 14:31 ` Brian Austin
@ 2014-06-01 10:50 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-06-01 10:50 UTC (permalink / raw)
To: Axel Lin; +Cc: Brian Austin, alsa-devel, Liam Girdwood, Paul Handrigan
[-- Attachment #1.1: Type: text/plain, Size: 150 bytes --]
On Fri, May 23, 2014 at 01:05:31PM +0800, Axel Lin wrote:
> The new value argument needs proper shift to match the mask bit fields.
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-01 10:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-23 5:05 [PATCH v3] ASoC: cs42l56: Fix new value argument in snd_soc_update_bits calls Axel Lin
2014-05-27 14:31 ` Brian Austin
2014-06-01 10:50 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox