Unverified Commit f42924b4 authored by Daniel Mack's avatar Daniel Mack Committed by Mark Brown
Browse files

ASoC: max98396: Implement DSP speaker monitor



Allow the selection of the TDM slot that is used to send back speaker
monitor data. The DT property adi,spkfb-slot-no can be used to configure
this setting which defaults to 2.

Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
Link: https://lore.kernel.org/r/20220624104712.1934484-8-daniel@zonque.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c529fd62
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1377,6 +1377,9 @@ static int max98396_probe(struct snd_soc_component *component)
	regmap_write(max98396->regmap,
		     MAX98396_R2045_PCM_TX_CTRL_2,
		     max98396->i_slot);
	regmap_write(max98396->regmap,
		     MAX98396_R204A_PCM_TX_CTRL_7,
		     max98396->spkfb_slot);

	if (max98396->v_slot < 8)
		if (max98396->device_id == CODEC_TYPE_MAX98396)
@@ -1552,6 +1555,11 @@ static void max98396_read_device_property(struct device *dev,
	else
		max98396->i_slot = 1;

	if (!device_property_read_u32(dev, "adi,spkfb-slot-no", &value))
		max98396->spkfb_slot = value & 0xF;
	else
		max98396->spkfb_slot = 2;

	if (!device_property_read_u32(dev, "adi,bypass-slot-no", &value))
		max98396->bypass_slot = value & 0xF;
	else
+1 −0
Original line number Diff line number Diff line
@@ -303,6 +303,7 @@ struct max98396_priv {
	struct regulator *pvdd, *vbat;
	unsigned int v_slot;
	unsigned int i_slot;
	unsigned int spkfb_slot;
	unsigned int bypass_slot;
	bool interleave_mode;
	unsigned int ch_size;