diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2015-06-04 09:04:17 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-06-04 12:50:02 -0400 |
commit | 7de544fd3275a136b311bfce9fe4406a1518d488 (patch) | |
tree | fb5022992d5e06fed3cffac6066440d66e6a2c3f | |
parent | 89683fdefdd74828145b9d18333761cc975143f8 (diff) |
ASoC: tas2552: Correct CFG1 register bit definitions
Remove the _MASK postfix of the bit definitions, collect the CFG1 bit
definition in one place and correct the bit shifts at the same time.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/tas2552.c | 14 | ||||
-rw-r--r-- | sound/soc/codecs/tas2552.h | 17 |
2 files changed, 15 insertions, 16 deletions
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index 07a0ec03905d..681b868a9e8c 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c | |||
@@ -126,10 +126,10 @@ static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown) | |||
126 | if (sw_shutdown) | 126 | if (sw_shutdown) |
127 | cfg1_reg = 0; | 127 | cfg1_reg = 0; |
128 | else | 128 | else |
129 | cfg1_reg = TAS2552_SWS_MASK; | 129 | cfg1_reg = TAS2552_SWS; |
130 | 130 | ||
131 | snd_soc_update_bits(tas_data->codec, TAS2552_CFG_1, | 131 | snd_soc_update_bits(tas_data->codec, TAS2552_CFG_1, TAS2552_SWS, |
132 | TAS2552_SWS_MASK, cfg1_reg); | 132 | cfg1_reg); |
133 | } | 133 | } |
134 | #endif | 134 | #endif |
135 | 135 | ||
@@ -258,11 +258,11 @@ static int tas2552_mute(struct snd_soc_dai *dai, int mute) | |||
258 | struct snd_soc_codec *codec = dai->codec; | 258 | struct snd_soc_codec *codec = dai->codec; |
259 | 259 | ||
260 | if (mute) | 260 | if (mute) |
261 | cfg1_reg = TAS2552_MUTE_MASK; | 261 | cfg1_reg = TAS2552_MUTE; |
262 | else | 262 | else |
263 | cfg1_reg = ~TAS2552_MUTE_MASK; | 263 | cfg1_reg = ~TAS2552_MUTE; |
264 | 264 | ||
265 | snd_soc_update_bits(codec, TAS2552_CFG_1, TAS2552_MUTE_MASK, cfg1_reg); | 265 | snd_soc_update_bits(codec, TAS2552_CFG_1, TAS2552_MUTE, cfg1_reg); |
266 | 266 | ||
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
@@ -370,7 +370,7 @@ static int tas2552_codec_probe(struct snd_soc_codec *codec) | |||
370 | goto probe_fail; | 370 | goto probe_fail; |
371 | } | 371 | } |
372 | 372 | ||
373 | snd_soc_write(codec, TAS2552_CFG_1, TAS2552_MUTE_MASK | | 373 | snd_soc_write(codec, TAS2552_CFG_1, TAS2552_MUTE | |
374 | TAS2552_PLL_SRC_BCLK); | 374 | TAS2552_PLL_SRC_BCLK); |
375 | snd_soc_write(codec, TAS2552_CFG_3, TAS2552_I2S_OUT_SEL | | 375 | snd_soc_write(codec, TAS2552_CFG_3, TAS2552_I2S_OUT_SEL | |
376 | TAS2552_DIN_SRC_SEL_AVG_L_R | TAS2552_88_96KHZ); | 376 | TAS2552_DIN_SRC_SEL_AVG_L_R | TAS2552_88_96KHZ); |
diff --git a/sound/soc/codecs/tas2552.h b/sound/soc/codecs/tas2552.h index 938d90f1cab9..0725befb4c41 100644 --- a/sound/soc/codecs/tas2552.h +++ b/sound/soc/codecs/tas2552.h | |||
@@ -45,10 +45,14 @@ | |||
45 | #define TAS2552_MAX_REG 0x20 | 45 | #define TAS2552_MAX_REG 0x20 |
46 | 46 | ||
47 | /* CFG1 Register Masks */ | 47 | /* CFG1 Register Masks */ |
48 | #define TAS2552_MUTE_MASK (1 << 2) | 48 | #define TAS2552_DEV_RESET (1 << 0) |
49 | #define TAS2552_SWS_MASK (1 << 1) | 49 | #define TAS2552_SWS (1 << 1) |
50 | #define TAS2552_WCLK_MASK 0x07 | 50 | #define TAS2552_MUTE (1 << 2) |
51 | #define TAS2552_CLASSD_EN_MASK (1 << 7) | 51 | #define TAS2552_PLL_SRC_MCLK (0x0 << 4) |
52 | #define TAS2552_PLL_SRC_BCLK (0x1 << 4) | ||
53 | #define TAS2552_PLL_SRC_IVCLKIN (0x2 << 4) | ||
54 | #define TAS2552_PLL_SRC_1_8_FIXED (0x3 << 4) | ||
55 | #define TAS2552_PLL_SRC_MASK TAS2552_PLL_SRC_1_8_FIXED | ||
52 | 56 | ||
53 | /* CFG2 Register Masks */ | 57 | /* CFG2 Register Masks */ |
54 | #define TAS2552_CLASSD_EN (1 << 7) | 58 | #define TAS2552_CLASSD_EN (1 << 7) |
@@ -68,11 +72,6 @@ | |||
68 | #define TAS2552_DAIFMT_RIGHT_J (1 << 4) | 72 | #define TAS2552_DAIFMT_RIGHT_J (1 << 4) |
69 | #define TAS2552_DAIFMT_LEFT_J (0x11 << 3) | 73 | #define TAS2552_DAIFMT_LEFT_J (0x11 << 3) |
70 | 74 | ||
71 | #define TAS2552_PLL_SRC_MCLK 0x00 | ||
72 | #define TAS2552_PLL_SRC_BCLK (1 << 3) | ||
73 | #define TAS2552_PLL_SRC_IVCLKIN (1 << 4) | ||
74 | #define TAS2552_PLL_SRC_1_8_FIXED (0x11 << 3) | ||
75 | |||
76 | #define TAS2552_DIN_SRC_SEL_MUTED 0x00 | 75 | #define TAS2552_DIN_SRC_SEL_MUTED 0x00 |
77 | #define TAS2552_DIN_SRC_SEL_LEFT (1 << 4) | 76 | #define TAS2552_DIN_SRC_SEL_LEFT (1 << 4) |
78 | #define TAS2552_DIN_SRC_SEL_RIGHT (1 << 5) | 77 | #define TAS2552_DIN_SRC_SEL_RIGHT (1 << 5) |