Merge "asoc: add multiple sampling rates support for a2dp"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
05cae9910f
@@ -121,7 +121,9 @@ static char const *slim_sample_rate_text[] = {"KHZ_8", "KHZ_16",
|
|||||||
"KHZ_88P2", "KHZ_96", "KHZ_176P4",
|
"KHZ_88P2", "KHZ_96", "KHZ_176P4",
|
||||||
"KHZ_192", "KHZ_352P8", "KHZ_384"};
|
"KHZ_192", "KHZ_352P8", "KHZ_384"};
|
||||||
static const char *const spk_function_text[] = {"Off", "On"};
|
static const char *const spk_function_text[] = {"Off", "On"};
|
||||||
static char const *bt_sample_rate_text[] = {"KHZ_8", "KHZ_16", "KHZ_48"};
|
static char const *bt_sample_rate_text[] = {"KHZ_8", "KHZ_16",
|
||||||
|
"KHZ_44P1", "KHZ_48",
|
||||||
|
"KHZ_88P2", "KHZ_96"};
|
||||||
|
|
||||||
static SOC_ENUM_SINGLE_EXT_DECL(spk_func_en, spk_function_text);
|
static SOC_ENUM_SINGLE_EXT_DECL(spk_func_en, spk_function_text);
|
||||||
static SOC_ENUM_SINGLE_EXT_DECL(slim_0_rx_chs, slim_rx_ch_text);
|
static SOC_ENUM_SINGLE_EXT_DECL(slim_0_rx_chs, slim_rx_ch_text);
|
||||||
@@ -312,7 +314,16 @@ static int msm_bt_sample_rate_get(struct snd_kcontrol *kcontrol,
|
|||||||
* value.
|
* value.
|
||||||
*/
|
*/
|
||||||
switch (slim_rx_cfg[SLIM_RX_7].sample_rate) {
|
switch (slim_rx_cfg[SLIM_RX_7].sample_rate) {
|
||||||
|
case SAMPLING_RATE_96KHZ:
|
||||||
|
ucontrol->value.integer.value[0] = 5;
|
||||||
|
break;
|
||||||
|
case SAMPLING_RATE_88P2KHZ:
|
||||||
|
ucontrol->value.integer.value[0] = 4;
|
||||||
|
break;
|
||||||
case SAMPLING_RATE_48KHZ:
|
case SAMPLING_RATE_48KHZ:
|
||||||
|
ucontrol->value.integer.value[0] = 3;
|
||||||
|
break;
|
||||||
|
case SAMPLING_RATE_44P1KHZ:
|
||||||
ucontrol->value.integer.value[0] = 2;
|
ucontrol->value.integer.value[0] = 2;
|
||||||
break;
|
break;
|
||||||
case SAMPLING_RATE_16KHZ:
|
case SAMPLING_RATE_16KHZ:
|
||||||
@@ -338,9 +349,21 @@ static int msm_bt_sample_rate_put(struct snd_kcontrol *kcontrol,
|
|||||||
slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_16KHZ;
|
slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_16KHZ;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_44P1KHZ;
|
||||||
|
slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_44P1KHZ;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_48KHZ;
|
slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_48KHZ;
|
||||||
slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_48KHZ;
|
slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_48KHZ;
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_88P2KHZ;
|
||||||
|
slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_88P2KHZ;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_96KHZ;
|
||||||
|
slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_96KHZ;
|
||||||
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_8KHZ;
|
slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_8KHZ;
|
||||||
|
@@ -150,7 +150,9 @@ static const char *const int_mi2s_tx_ch_text[] = {"One", "Two",
|
|||||||
"Three", "Four"};
|
"Three", "Four"};
|
||||||
static char const *bit_format_text[] = {"S16_LE", "S24_LE", "S24_3LE"};
|
static char const *bit_format_text[] = {"S16_LE", "S24_LE", "S24_3LE"};
|
||||||
static const char *const loopback_mclk_text[] = {"DISABLE", "ENABLE"};
|
static const char *const loopback_mclk_text[] = {"DISABLE", "ENABLE"};
|
||||||
static char const *bt_sample_rate_text[] = {"KHZ_8", "KHZ_16", "KHZ_48"};
|
static char const *bt_sample_rate_text[] = {"KHZ_8", "KHZ_16",
|
||||||
|
"KHZ_44P1", "KHZ_48",
|
||||||
|
"KHZ_88P2", "KHZ_96"};
|
||||||
|
|
||||||
static SOC_ENUM_SINGLE_EXT_DECL(int0_mi2s_rx_sample_rate, int_mi2s_rate_text);
|
static SOC_ENUM_SINGLE_EXT_DECL(int0_mi2s_rx_sample_rate, int_mi2s_rate_text);
|
||||||
static SOC_ENUM_SINGLE_EXT_DECL(int0_mi2s_rx_chs, int_mi2s_ch_text);
|
static SOC_ENUM_SINGLE_EXT_DECL(int0_mi2s_rx_chs, int_mi2s_ch_text);
|
||||||
@@ -835,7 +837,16 @@ static int msm_bt_sample_rate_get(struct snd_kcontrol *kcontrol,
|
|||||||
* value.
|
* value.
|
||||||
*/
|
*/
|
||||||
switch (bt_fm_cfg[BT_SLIM7].sample_rate) {
|
switch (bt_fm_cfg[BT_SLIM7].sample_rate) {
|
||||||
|
case SAMPLING_RATE_96KHZ:
|
||||||
|
ucontrol->value.integer.value[0] = 5;
|
||||||
|
break;
|
||||||
|
case SAMPLING_RATE_88P2KHZ:
|
||||||
|
ucontrol->value.integer.value[0] = 4;
|
||||||
|
break;
|
||||||
case SAMPLING_RATE_48KHZ:
|
case SAMPLING_RATE_48KHZ:
|
||||||
|
ucontrol->value.integer.value[0] = 3;
|
||||||
|
break;
|
||||||
|
case SAMPLING_RATE_44P1KHZ:
|
||||||
ucontrol->value.integer.value[0] = 2;
|
ucontrol->value.integer.value[0] = 2;
|
||||||
break;
|
break;
|
||||||
case SAMPLING_RATE_16KHZ:
|
case SAMPLING_RATE_16KHZ:
|
||||||
@@ -860,8 +871,17 @@ static int msm_bt_sample_rate_put(struct snd_kcontrol *kcontrol,
|
|||||||
bt_fm_cfg[BT_SLIM7].sample_rate = SAMPLING_RATE_16KHZ;
|
bt_fm_cfg[BT_SLIM7].sample_rate = SAMPLING_RATE_16KHZ;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
bt_fm_cfg[BT_SLIM7].sample_rate = SAMPLING_RATE_44P1KHZ;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
bt_fm_cfg[BT_SLIM7].sample_rate = SAMPLING_RATE_48KHZ;
|
bt_fm_cfg[BT_SLIM7].sample_rate = SAMPLING_RATE_48KHZ;
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
bt_fm_cfg[BT_SLIM7].sample_rate = SAMPLING_RATE_88P2KHZ;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
bt_fm_cfg[BT_SLIM7].sample_rate = SAMPLING_RATE_96KHZ;
|
||||||
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
bt_fm_cfg[BT_SLIM7].sample_rate = SAMPLING_RATE_8KHZ;
|
bt_fm_cfg[BT_SLIM7].sample_rate = SAMPLING_RATE_8KHZ;
|
||||||
|
Reference in New Issue
Block a user