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

Commit c596fc8b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Add support for 44.1/48/88.1/96KHz for Tx channel"

parents b089597b c685521b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -131,6 +131,14 @@ int btfm_slim_enable_ch(struct btfmslim *btfmslim, struct btfmslim_ch *ch,
	prop.dataf = ((rates == 48000) || (rates == 44100) ||
		(rates == 88200) || (rates == 96000)) ?
			SLIM_CH_DATAF_NOT_DEFINED : SLIM_CH_DATAF_LPCM_AUDIO;

	/* for feedback channel, PCM bit should not be set */
	if (btfm_feedback_ch_setting) {
		BTFMSLIM_DBG("port open for feedback ch, not setting PCM bit");
		prop.dataf = SLIM_CH_DATAF_NOT_DEFINED;
		/* reset so that next port open sets the data format properly */
		btfm_feedback_ch_setting = 0;
	}
	prop.auxf = SLIM_CH_AUXF_NOT_APPLICABLE;
	prop.ratem = ((rates == 44100) || (rates == 88200)) ?
		(rates/11025) : (rates/4000);
+2 −0
Original line number Diff line number Diff line
@@ -72,6 +72,8 @@ struct btfmslim {
		uint8_t rxport, uint8_t enable);
};

extern int btfm_feedback_ch_setting;

/**
 * btfm_slim_hw_init: Initialize slimbus slave device
 * Returns:
+23 −5
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include <btfm_slim.h>

static int bt_soc_enable_status;

int btfm_feedback_ch_setting;

static int btfm_slim_codec_write(struct snd_soc_component *codec,
			unsigned int reg, unsigned int value)
@@ -48,11 +48,27 @@ static int bt_soc_status_put(struct snd_kcontrol *kcontrol,
	return 1;
}

static int btfm_get_feedback_ch_setting(struct snd_kcontrol *kcontrol,
					struct snd_ctl_elem_value *ucontrol)
{
	ucontrol->value.integer.value[0] = btfm_feedback_ch_setting;
	return 1;
}

static int btfm_put_feedback_ch_setting(struct snd_kcontrol *kcontrol,
					struct snd_ctl_elem_value *ucontrol)
{
	btfm_feedback_ch_setting = ucontrol->value.integer.value[0];
	return 1;
}

static const struct snd_kcontrol_new status_controls[] = {
	SOC_SINGLE_EXT("BT SOC status", 0, 0, 1, 0,
			bt_soc_status_get,
			bt_soc_status_put)

			bt_soc_status_put),
	SOC_SINGLE_EXT("BT set feedback channel", 0, 0, 1, 0,
	btfm_get_feedback_ch_setting,
	btfm_put_feedback_ch_setting)
};


@@ -366,9 +382,11 @@ static struct snd_soc_dai_driver btfmslim_dai[] = {
		.capture = {
			.stream_name = "SCO TX Capture",
			/* 8 KHz or 16 KHz */
			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
			.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000
				| SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000
				| SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000,
			.formats = SNDRV_PCM_FMTBIT_S16_LE, /* 16 bits */
			.rate_max = 16000,
			.rate_max = 96000,
			.rate_min = 8000,
			.channels_min = 1,
			.channels_max = 1,