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

Commit e67186c6 authored by Shreyas Nagasandra Chandrasekhar's avatar Shreyas Nagasandra Chandrasekhar
Browse files

ASoC: Change to correctly set the BTSCO Sample Rate



 This mixer control would always set the default value of
 BT SCO Sample ate as there is no matching case.
 The change ensures appropriate enum texts are used instead
 and the cases are appropriately modified to ensure a match.

Change-Id: I097b20a4983e7c4eae29e97803e36fcfc14fb8b2
Signed-off-by: default avatarShreyas Nagasandra Chandrasekhar <snagas@codeaurora.org>
parent 594dfaac
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -403,7 +403,8 @@ static const struct soc_enum msm_enum[] = {
	SOC_ENUM_SINGLE_EXT(4, slim0_tx_ch_text),
};

static const char *const btsco_rate_text[] = {"8000", "16000"};
static const char *const btsco_rate_text[] = {"BTSCO_RATE_8KHZ",
	"BTSCO_RATE_16KHZ"};
static const struct soc_enum msm_btsco_enum[] = {
	SOC_ENUM_SINGLE_EXT(2, btsco_rate_text),
};
@@ -509,10 +510,10 @@ static int msm_btsco_rate_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	switch (ucontrol->value.integer.value[0]) {
	case 8000:
	case 0:
		msm_btsco_rate = BTSCO_RATE_8KHZ;
		break;
	case 16000:
	case 1:
		msm_btsco_rate = BTSCO_RATE_16KHZ;
		break;
	default:
+4 −3
Original line number Diff line number Diff line
@@ -725,7 +725,8 @@ static const char *const proxy_rx_ch_text[] = {"One", "Two", "Three", "Four",

static char const *hdmi_rx_sample_rate_text[] = {"KHZ_48", "KHZ_96",
					"KHZ_192"};
static const char *const btsco_rate_text[] = {"8000", "16000"};
static const char *const btsco_rate_text[] = {"BTSCO_RATE_8KHZ",
	"BTSCO_RATE_16KHZ"};
static const struct soc_enum msm_btsco_enum[] = {
	SOC_ENUM_SINGLE_EXT(2, btsco_rate_text),
};
@@ -867,10 +868,10 @@ static int msm_btsco_rate_put(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	switch (ucontrol->value.integer.value[0]) {
	case 8000:
	case 0:
		msm_btsco_rate = BTSCO_RATE_8KHZ;
		break;
	case 16000:
	case 1:
		msm_btsco_rate = BTSCO_RATE_16KHZ;
		break;
	default:
+4 −3
Original line number Diff line number Diff line
@@ -311,7 +311,8 @@ static int msm_tx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
}


static const char *const btsco_rate_text[] = {"8000", "16000"};
static const char *const btsco_rate_text[] = {"BTSCO_RATE_8KHZ",
	"BTSCO_RATE_16KHZ"};
static const struct soc_enum msm_btsco_enum[] = {
	SOC_ENUM_SINGLE_EXT(2, btsco_rate_text),
};
@@ -331,10 +332,10 @@ static int msm_btsco_rate_put(struct snd_kcontrol *kcontrol,
			      struct snd_ctl_elem_value *ucontrol)
{
	switch (ucontrol->value.integer.value[0]) {
	case 8000:
	case 0:
		msm_btsco_rate = BTSCO_RATE_8KHZ;
		break;
	case 16000:
	case 1:
		msm_btsco_rate = BTSCO_RATE_16KHZ;
		break;
	default: