Commit ab91835e authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Takashi Iwai
Browse files

ASoC: cs35l56: Set fw_regs table after getting REVID



Defer setting the cs35l56_base.fw_regs pointer until after the REVID has
been read in cs35l56_hw_init(). Also make the corresponding change to the
cs35l56_hda drivers to prevent a build break.

This is preparing for firmware registers that change address between
revisions of the same device.

Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 9cf5b8b6
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -337,9 +337,6 @@ extern const struct regmap_config cs35l56_regmap_sdw;
extern const struct regmap_config cs35l63_regmap_i2c;
extern const struct regmap_config cs35l63_regmap_sdw;

extern const struct cs35l56_fw_reg cs35l56_fw_reg;
extern const struct cs35l56_fw_reg cs35l63_fw_reg;

extern const struct cirrus_amp_cal_controls cs35l56_calibration_controls;

extern const char * const cs35l56_tx_input_texts[CS35L56_NUM_INPUT_SRC];
+1 −0
Original line number Diff line number Diff line
@@ -1049,6 +1049,7 @@ int cs35l56_hda_common_probe(struct cs35l56_hda *cs35l56, int hid, int id)
		goto err;
	}

	cs35l56->base.type = hid & 0xff;
	cs35l56->base.cal_index = -1;

	cs35l56_init_cs_dsp(&cs35l56->base, &cs35l56->cs_dsp);
+0 −2
Original line number Diff line number Diff line
@@ -27,8 +27,6 @@ static int cs35l56_hda_i2c_probe(struct i2c_client *clt)
	cs35l56->base.can_hibernate = true;
#endif

	cs35l56->base.fw_reg = &cs35l56_fw_reg;

	cs35l56->base.regmap = devm_regmap_init_i2c(clt, &cs35l56_regmap_i2c);
	if (IS_ERR(cs35l56->base.regmap)) {
		ret = PTR_ERR(cs35l56->base.regmap);
+0 −2
Original line number Diff line number Diff line
@@ -30,8 +30,6 @@ static int cs35l56_hda_spi_probe(struct spi_device *spi)
	cs35l56->base.can_hibernate = true;
#endif

	cs35l56->base.fw_reg = &cs35l56_fw_reg;

	cs35l56->base.regmap = devm_regmap_init_spi(spi, &cs35l56_regmap_spi);
	if (IS_ERR(cs35l56->base.regmap)) {
		ret = PTR_ERR(cs35l56->base.regmap);
+2 −2
Original line number Diff line number Diff line
@@ -35,11 +35,11 @@ static int cs35l56_i2c_probe(struct i2c_client *client)
	switch (id) {
	case 0x3556:
		regmap_config = &cs35l56_regmap_i2c;
		cs35l56->base.fw_reg = &cs35l56_fw_reg;
		cs35l56->base.type = 0x56;
		break;
	case 0x3563:
		regmap_config = &cs35l63_regmap_i2c;
		cs35l56->base.fw_reg = &cs35l63_fw_reg;
		cs35l56->base.type = 0x63;
		break;
	default:
		return -ENODEV;
Loading