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

Commit 3d1c503e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "bt: Don't set multichannel bit for 44.1/88.2 A2DP Rx"

parents 38951757 530e0b61
Loading
Loading
Loading
Loading
+25 −7
Original line number Diff line number Diff line
@@ -130,7 +130,8 @@ int btfm_slim_enable_ch(struct btfmslim *btfmslim, struct btfmslim_ch *ch,
	BTFMSLIM_DBG("port: %d ch: %d", ch->port, ch->ch);

	/* Define the channel with below parameters */
	prop.prot =  SLIM_AUTO_ISO;
	prop.prot =  ((rates == 44100) || (rates == 88200)) ?
			SLIM_PUSH : SLIM_AUTO_ISO;
	prop.baser = ((rates == 44100) || (rates == 88200)) ?
			SLIM_RATE_11025HZ : SLIM_RATE_4000HZ;
	prop.dataf = ((rates == 48000) || (rates == 44100) ||
@@ -228,19 +229,36 @@ int btfm_slim_disable_ch(struct btfmslim *btfmslim, struct btfmslim_ch *ch,

	BTFMSLIM_INFO("port:%d, grp: %d, ch->grph:0x%x, ch->ch_hdl:0x%x ",
		ch->port, grp, ch->grph, ch->ch_hdl);

	/* For 44.1/88.2 Khz A2DP Rx, disconnect the port first */
	if (rxport &&
		(btfmslim->sample_rate == 44100 ||
		 btfmslim->sample_rate == 88200)) {
		BTFMSLIM_DBG("disconnecting the ports, removing the channel");
		ret = slim_disconnect_ports(btfmslim->slim_pgd,
				&ch->port_hdl, 1);
		if (ret < 0) {
			BTFMSLIM_ERR("slim_disconnect_ports failed ret[%d]",
				ret);
		}
	}

	/* Remove the channel immediately*/
	ret = slim_control_ch(btfmslim->slim_pgd, (grp ? ch->grph : ch->ch_hdl),
			SLIM_CH_REMOVE, true);
	if (ret < 0) {
		BTFMSLIM_ERR("slim_control_ch failed ret[%d]", ret);
		if (btfmslim->sample_rate != 44100 &&
			btfmslim->sample_rate != 88200) {
			ret = slim_disconnect_ports(btfmslim->slim_pgd,
				&ch->port_hdl, 1);
			if (ret < 0) {
			BTFMSLIM_ERR("slim_disconnect_ports failed ret[%d]",
				BTFMSLIM_ERR("disconnect_ports failed ret[%d]",
					 ret);
				goto error;
			}
		}
	}

	/* Disable port through registration setting */
	for (i = 0; i < nchan; i++, ch++) {
+6 −2
Original line number Diff line number Diff line
@@ -88,8 +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 */
		BTFMSLIM_DBG("sample rate is %d", btfmslim->sample_rate);
		if (enable &&
			btfmslim->sample_rate != 44100 &&
			btfmslim->sample_rate != 88200) {
			BTFMSLIM_DBG("setting multichannel bit");
			/* For SCO Rx, A2DP Rx other than 44.1 and 88.2Khz */
			if (port_num < 24) {
				rxport_num = port_num - 16;
				reg_val = 0x01 << rxport_num;