Skip to content

Commit cd3beeb

Browse files
committed
ASoC: cs35l56: Updates for B0 silicon
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: These patches make some small changes to align with the B0 silicon revision.
2 parents 60ba2fd + d29a966 commit cd3beeb

3 files changed

Lines changed: 8 additions & 66 deletions

File tree

include/sound/cs35l56.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
#define CS35L56_SWIRE_DP3_CH2_INPUT 0x0004C74
4444
#define CS35L56_SWIRE_DP3_CH3_INPUT 0x0004C78
4545
#define CS35L56_SWIRE_DP3_CH4_INPUT 0x0004C7C
46-
#define CS35L56_SWIRE_DP3_CH5_INPUT 0x0004C80
47-
#define CS35L56_SWIRE_DP3_CH6_INPUT 0x0004C84
4846
#define CS35L56_IRQ1_CFG 0x000E000
4947
#define CS35L56_IRQ1_STATUS 0x000E004
5048
#define CS35L56_IRQ1_EINT_1 0x000E010
@@ -181,12 +179,11 @@
181179
#define CS35L56_INPUT_SRC_DSP1TX8 0x39
182180
#define CS35L56_INPUT_SRC_TEMPMON 0x3A
183181
#define CS35L56_INPUT_SRC_INTERPOLATOR 0x40
184-
#define CS35L56_INPUT_SRC_SWIRE_RX1 0x44
185-
#define CS35L56_INPUT_SRC_SWIRE_RX2 0x45
186-
#define CS35L56_INPUT_SRC_SWIRE_RX3 0x46
182+
#define CS35L56_INPUT_SRC_SWIRE_DP1_CHANNEL1 0x44
183+
#define CS35L56_INPUT_SRC_SWIRE_DP1_CHANNEL2 0x45
187184
#define CS35L56_INPUT_MASK 0x7F
188185

189-
#define CS35L56_NUM_INPUT_SRC 22
186+
#define CS35L56_NUM_INPUT_SRC 21
190187

191188
/* ASP formats */
192189
#define CS35L56_ASP_FMT_DSP_A 0
@@ -262,7 +259,6 @@ extern const struct cs_dsp_region cs35l56_dsp1_regions[CS35L56_NUM_DSP_REGIONS];
262259
extern const char * const cs35l56_tx_input_texts[CS35L56_NUM_INPUT_SRC];
263260
extern const unsigned int cs35l56_tx_input_values[CS35L56_NUM_INPUT_SRC];
264261

265-
void cs35l56_patch(struct device *dev, struct regmap *regmap, u8 revid);
266262
void cs35l56_reread_firmware_registers(struct device *dev, struct regmap *regmap);
267263
int cs35l56_get_bclk_freq_id(unsigned int freq);
268264
void cs35l56_fill_supply_names(struct regulator_bulk_data *data);

sound/soc/codecs/cs35l56-shared.c

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ static const struct reg_default cs35l56_reg_defaults[] = {
2828
{ CS35L56_SWIRE_DP3_CH2_INPUT, 0x00000019 },
2929
{ CS35L56_SWIRE_DP3_CH3_INPUT, 0x00000029 },
3030
{ CS35L56_SWIRE_DP3_CH4_INPUT, 0x00000028 },
31-
{ CS35L56_SWIRE_DP3_CH5_INPUT, 0x00000018 },
32-
{ CS35L56_SWIRE_DP3_CH6_INPUT, 0x00000018 },
3331
{ CS35L56_IRQ1_CFG, 0x00000000 },
3432
{ CS35L56_IRQ1_MASK_1, 0x83ffffff },
3533
{ CS35L56_IRQ1_MASK_2, 0xffff7fff },
@@ -42,29 +40,6 @@ static const struct reg_default cs35l56_reg_defaults[] = {
4240
/* CS35L56_MAIN_POSTURE_NUMBER - soft register, no default */
4341
};
4442

45-
/*
46-
* The Ax devices have different default register values to that of B0,
47-
* establish a common set of register defaults.
48-
*/
49-
static const struct reg_sequence cs35l56_reva_patch[] = {
50-
{ CS35L56_SWIRE_DP3_CH5_INPUT, 0x00000018 },
51-
{ CS35L56_SWIRE_DP3_CH6_INPUT, 0x00000018 },
52-
};
53-
54-
void cs35l56_patch(struct device *dev, struct regmap *regmap, u8 revid)
55-
{
56-
int ret;
57-
58-
if (revid >= CS35L56_REVID_B0)
59-
return;
60-
61-
ret = regmap_register_patch(regmap, cs35l56_reva_patch,
62-
ARRAY_SIZE(cs35l56_reva_patch));
63-
if (ret)
64-
dev_err(dev, "Failed to apply patch: %d\n", ret);
65-
}
66-
EXPORT_SYMBOL_NS_GPL(cs35l56_patch, SND_SOC_CS35L56_SHARED);
67-
6843
static bool cs35l56_is_dsp_memory(unsigned int reg)
6944
{
7045
switch (reg) {
@@ -114,8 +89,6 @@ static bool cs35l56_readable_reg(struct device *dev, unsigned int reg)
11489
case CS35L56_SWIRE_DP3_CH2_INPUT:
11590
case CS35L56_SWIRE_DP3_CH3_INPUT:
11691
case CS35L56_SWIRE_DP3_CH4_INPUT:
117-
case CS35L56_SWIRE_DP3_CH5_INPUT:
118-
case CS35L56_SWIRE_DP3_CH6_INPUT:
11992
case CS35L56_IRQ1_CFG:
12093
case CS35L56_IRQ1_STATUS:
12194
case CS35L56_IRQ1_EINT_1 ... CS35L56_IRQ1_EINT_8:
@@ -305,7 +278,7 @@ const char * const cs35l56_tx_input_texts[] = {
305278
"None", "ASP1RX1", "ASP1RX2", "VMON", "IMON", "ERRVOL", "CLASSH",
306279
"VDDBMON", "VBSTMON", "DSP1TX1", "DSP1TX2", "DSP1TX3", "DSP1TX4",
307280
"DSP1TX5", "DSP1TX6", "DSP1TX7", "DSP1TX8", "TEMPMON",
308-
"INTERPOLATOR", "SDW1RX1", "SDW1RX2", "SDW2RX1",
281+
"INTERPOLATOR", "SDW1RX1", "SDW1RX2",
309282
};
310283
EXPORT_SYMBOL_NS_GPL(cs35l56_tx_input_texts, SND_SOC_CS35L56_SHARED);
311284

@@ -329,9 +302,8 @@ const unsigned int cs35l56_tx_input_values[] = {
329302
CS35L56_INPUT_SRC_DSP1TX8,
330303
CS35L56_INPUT_SRC_TEMPMON,
331304
CS35L56_INPUT_SRC_INTERPOLATOR,
332-
CS35L56_INPUT_SRC_SWIRE_RX1,
333-
CS35L56_INPUT_SRC_SWIRE_RX2,
334-
CS35L56_INPUT_SRC_SWIRE_RX3,
305+
CS35L56_INPUT_SRC_SWIRE_DP1_CHANNEL1,
306+
CS35L56_INPUT_SRC_SWIRE_DP1_CHANNEL2,
335307
};
336308
EXPORT_SYMBOL_NS_GPL(cs35l56_tx_input_values, SND_SOC_CS35L56_SHARED);
337309

sound/soc/codecs/cs35l56.c

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -166,24 +166,6 @@ static SOC_VALUE_ENUM_SINGLE_DECL(cs35l56_sdw1tx4_enum,
166166
static const struct snd_kcontrol_new sdw1_tx4_mux =
167167
SOC_DAPM_ENUM("SDW1TX4 SRC", cs35l56_sdw1tx4_enum);
168168

169-
static SOC_VALUE_ENUM_SINGLE_DECL(cs35l56_sdw1tx5_enum,
170-
CS35L56_SWIRE_DP3_CH5_INPUT,
171-
0, CS35L56_SWIRETXn_SRC_MASK,
172-
cs35l56_tx_input_texts,
173-
cs35l56_tx_input_values);
174-
175-
static const struct snd_kcontrol_new sdw1_tx5_mux =
176-
SOC_DAPM_ENUM("SDW1TX5 SRC", cs35l56_sdw1tx5_enum);
177-
178-
static SOC_VALUE_ENUM_SINGLE_DECL(cs35l56_sdw1tx6_enum,
179-
CS35L56_SWIRE_DP3_CH6_INPUT,
180-
0, CS35L56_SWIRETXn_SRC_MASK,
181-
cs35l56_tx_input_texts,
182-
cs35l56_tx_input_values);
183-
184-
static const struct snd_kcontrol_new sdw1_tx6_mux =
185-
SOC_DAPM_ENUM("SDW1TX6 SRC", cs35l56_sdw1tx6_enum);
186-
187169
static int cs35l56_play_event(struct snd_soc_dapm_widget *w,
188170
struct snd_kcontrol *kcontrol, int event)
189171
{
@@ -251,8 +233,6 @@ static const struct snd_soc_dapm_widget cs35l56_dapm_widgets[] = {
251233
SND_SOC_DAPM_MUX("SDW1 TX2 Source", SND_SOC_NOPM, 0, 0, &sdw1_tx2_mux),
252234
SND_SOC_DAPM_MUX("SDW1 TX3 Source", SND_SOC_NOPM, 0, 0, &sdw1_tx3_mux),
253235
SND_SOC_DAPM_MUX("SDW1 TX4 Source", SND_SOC_NOPM, 0, 0, &sdw1_tx4_mux),
254-
SND_SOC_DAPM_MUX("SDW1 TX5 Source", SND_SOC_NOPM, 0, 0, &sdw1_tx5_mux),
255-
SND_SOC_DAPM_MUX("SDW1 TX6 Source", SND_SOC_NOPM, 0, 0, &sdw1_tx6_mux),
256236

257237
SND_SOC_DAPM_SIGGEN("VMON ADC"),
258238
SND_SOC_DAPM_SIGGEN("IMON ADC"),
@@ -318,14 +298,10 @@ static const struct snd_soc_dapm_route cs35l56_audio_map[] = {
318298
CS35L56_SRC_ROUTE("SDW1 TX2")
319299
CS35L56_SRC_ROUTE("SDW1 TX3")
320300
CS35L56_SRC_ROUTE("SDW1 TX4")
321-
CS35L56_SRC_ROUTE("SDW1 TX5")
322-
CS35L56_SRC_ROUTE("SDW1 TX6")
323301
{ "SDW1 Capture", NULL, "SDW1 TX1 Source" },
324302
{ "SDW1 Capture", NULL, "SDW1 TX2 Source" },
325303
{ "SDW1 Capture", NULL, "SDW1 TX3 Source" },
326304
{ "SDW1 Capture", NULL, "SDW1 TX4 Source" },
327-
{ "SDW1 Capture", NULL, "SDW1 TX5 Source" },
328-
{ "SDW1 Capture", NULL, "SDW1 TX6 Source" },
329305
};
330306

331307
static int cs35l56_dsp_event(struct snd_soc_dapm_widget *w,
@@ -779,7 +755,7 @@ static struct snd_soc_dai_driver cs35l56_dai[] = {
779755
.capture = {
780756
.stream_name = "SDW1 Capture",
781757
.channels_min = 1,
782-
.channels_max = 6,
758+
.channels_max = 4,
783759
.rates = CS35L56_RATES,
784760
.formats = CS35L56_TX_FORMATS,
785761
},
@@ -1535,9 +1511,7 @@ int cs35l56_init(struct cs35l56_private *cs35l56)
15351511
dev_info(cs35l56->dev, "Cirrus Logic CS35L56%s Rev %02X OTP%d\n",
15361512
cs35l56->secured ? "s" : "", cs35l56->rev, otpid);
15371513

1538-
cs35l56_patch(cs35l56->dev, cs35l56->regmap, cs35l56->rev);
1539-
1540-
/* Wake source interrupts default to unmasked, so mask them */
1514+
/* Wake source and *_BLOCKED interrupts default to unmasked, so mask them */
15411515
regmap_write(cs35l56->regmap, CS35L56_IRQ1_MASK_20, 0xffffffff);
15421516
regmap_update_bits(cs35l56->regmap, CS35L56_IRQ1_MASK_1,
15431517
CS35L56_AMP_SHORT_ERR_EINT1_MASK,

0 commit comments

Comments
 (0)