Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93194f83 authored by Satish Kodishala's avatar Satish Kodishala Committed by Gerrit - the friendly Code Review server
Browse files

btfm: Don't program multi channel registers in wcn3990 for SCO



For SCO use cases, we should not program multi chanel
registers. Programming this leading to silence randomly
in SCO Rx/Tx.

CRs-Fixed: 2048423
Change-Id: I5e41591fb81b5bd3cf9358819c0a62a5cfe60e13
Signed-off-by: default avatarSatish Kodishala <skodisha@codeaurora.org>
parent 03a5d4f9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ struct btfmslim {

	uint32_t num_rx_port;
	uint32_t num_tx_port;
	uint32_t sample_rate;

	struct btfmslim_ch *rx_chs;
	struct btfmslim_ch *tx_chs;
+3 −0
Original line number Diff line number Diff line
@@ -134,6 +134,9 @@ static int btfm_slim_dai_prepare(struct snd_pcm_substream *substream,
	BTFMSLIM_DBG("dai->name: %s, dai->id: %d, dai->rate: %d", dai->name,
		dai->id, dai->rate);

	/* save sample rate */
	btfmslim->sample_rate = dai->rate;

	switch (dai->id) {
	case BTFM_FM_SLIM_TX:
		grp = true; nchan = 2;
+3 −15
Original line number Diff line number Diff line
@@ -88,12 +88,12 @@ int btfm_slim_chrk_enable_port(struct btfmslim *btfmslim, uint8_t port_num,

	BTFMSLIM_DBG("port(%d) enable(%d)", port_num, enable);
	if (rxport) {
		if (enable) {
			/* For SCO Rx, A2DP Rx */
		if (enable && btfmslim->sample_rate == 48000) {
			/* For A2DP Rx */
			reg_val = 0x1;
			port_bit = port_num - 0x10;
			reg = CHRK_SB_PGD_RX_PORTn_MULTI_CHNL_0(port_bit);
			BTFMSLIM_DBG("writing reg_val (%d) to reg(%x)",
			BTFMSLIM_DBG("writing reg_val (%d) to reg(%x) for A2DP",
					reg_val, reg);
			ret = btfm_slim_write(btfmslim, reg, 1, &reg_val, IFD);
			if (ret) {
@@ -120,18 +120,6 @@ int btfm_slim_chrk_enable_port(struct btfmslim *btfmslim, uint8_t port_num,
			BTFMSLIM_ERR("failed to write (%d) reg 0x%x", ret, reg);
			goto error;
		}
	} else if (port_num == CHRK_SB_PGD_PORT_TX_SCO) {
		/* SCO Tx */
		reg_val = 0x1 << CHRK_SB_PGD_PORT_TX_SCO;
		reg = CHRK_SB_PGD_TX_PORTn_MULTI_CHNL_0(port_num);
		BTFMSLIM_DBG("writing reg_val (%d) to reg(%x)",
				reg_val, reg);
		ret = btfm_slim_write(btfmslim, reg, 1, &reg_val, IFD);
		if (ret) {
			BTFMSLIM_ERR("failed to write (%d) reg 0x%x",
					ret, reg);
			goto error;
		}
	}

	/* Enable Tx port hw auto recovery for underrun or overrun error */