|
@@ -409,6 +409,12 @@ static char const *slim_sample_rate_text[] = {"KHZ_8", "KHZ_16",
|
|
|
static char const *bt_sample_rate_text[] = {"KHZ_8", "KHZ_16",
|
|
|
"KHZ_44P1", "KHZ_48",
|
|
|
"KHZ_88P2", "KHZ_96"};
|
|
|
+static char const *bt_sample_rate_rx_text[] = {"KHZ_8", "KHZ_16",
|
|
|
+ "KHZ_44P1", "KHZ_48",
|
|
|
+ "KHZ_88P2", "KHZ_96"};
|
|
|
+static char const *bt_sample_rate_tx_text[] = {"KHZ_8", "KHZ_16",
|
|
|
+ "KHZ_44P1", "KHZ_48",
|
|
|
+ "KHZ_88P2", "KHZ_96"};
|
|
|
static const char *const usb_ch_text[] = {"One", "Two", "Three", "Four",
|
|
|
"Five", "Six", "Seven",
|
|
|
"Eight"};
|
|
@@ -462,6 +468,8 @@ static SOC_ENUM_SINGLE_EXT_DECL(slim_0_tx_sample_rate, slim_sample_rate_text);
|
|
|
static SOC_ENUM_SINGLE_EXT_DECL(slim_5_rx_sample_rate, slim_sample_rate_text);
|
|
|
static SOC_ENUM_SINGLE_EXT_DECL(slim_6_rx_sample_rate, slim_sample_rate_text);
|
|
|
static SOC_ENUM_SINGLE_EXT_DECL(bt_sample_rate, bt_sample_rate_text);
|
|
|
+static SOC_ENUM_SINGLE_EXT_DECL(bt_sample_rate_rx, bt_sample_rate_rx_text);
|
|
|
+static SOC_ENUM_SINGLE_EXT_DECL(bt_sample_rate_tx, bt_sample_rate_tx_text);
|
|
|
static SOC_ENUM_SINGLE_EXT_DECL(usb_rx_sample_rate, usb_sample_rate_text);
|
|
|
static SOC_ENUM_SINGLE_EXT_DECL(usb_tx_sample_rate, usb_sample_rate_text);
|
|
|
static SOC_ENUM_SINGLE_EXT_DECL(ext_disp_rx_sample_rate,
|
|
@@ -1075,6 +1083,130 @@ static int msm_bt_sample_rate_put(struct snd_kcontrol *kcontrol,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static int msm_bt_sample_rate_rx_get(struct snd_kcontrol *kcontrol,
|
|
|
+ struct snd_ctl_elem_value *ucontrol)
|
|
|
+{
|
|
|
+ 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:
|
|
|
+ ucontrol->value.integer.value[0] = 3;
|
|
|
+ break;
|
|
|
+ case SAMPLING_RATE_44P1KHZ:
|
|
|
+ ucontrol->value.integer.value[0] = 2;
|
|
|
+ break;
|
|
|
+ case SAMPLING_RATE_16KHZ:
|
|
|
+ ucontrol->value.integer.value[0] = 1;
|
|
|
+ break;
|
|
|
+ case SAMPLING_RATE_8KHZ:
|
|
|
+ default:
|
|
|
+ ucontrol->value.integer.value[0] = 0;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ pr_debug("%s: sample rate rx = %d", __func__,
|
|
|
+ slim_rx_cfg[SLIM_RX_7].sample_rate);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static int msm_bt_sample_rate_rx_put(struct snd_kcontrol *kcontrol,
|
|
|
+ struct snd_ctl_elem_value *ucontrol)
|
|
|
+{
|
|
|
+ switch (ucontrol->value.integer.value[0]) {
|
|
|
+ case 1:
|
|
|
+ slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_16KHZ;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_44P1KHZ;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_48KHZ;
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_88P2KHZ;
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_96KHZ;
|
|
|
+ break;
|
|
|
+ case 0:
|
|
|
+ default:
|
|
|
+ slim_rx_cfg[SLIM_RX_7].sample_rate = SAMPLING_RATE_8KHZ;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ pr_debug("%s: sample rate: slim7_rx = %d, value = %d\n",
|
|
|
+ __func__,
|
|
|
+ slim_rx_cfg[SLIM_RX_7].sample_rate,
|
|
|
+ ucontrol->value.enumerated.item[0]);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static int msm_bt_sample_rate_tx_get(struct snd_kcontrol *kcontrol,
|
|
|
+ struct snd_ctl_elem_value *ucontrol)
|
|
|
+{
|
|
|
+ switch (slim_tx_cfg[SLIM_TX_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:
|
|
|
+ ucontrol->value.integer.value[0] = 3;
|
|
|
+ break;
|
|
|
+ case SAMPLING_RATE_44P1KHZ:
|
|
|
+ ucontrol->value.integer.value[0] = 2;
|
|
|
+ break;
|
|
|
+ case SAMPLING_RATE_16KHZ:
|
|
|
+ ucontrol->value.integer.value[0] = 1;
|
|
|
+ break;
|
|
|
+ case SAMPLING_RATE_8KHZ:
|
|
|
+ default:
|
|
|
+ ucontrol->value.integer.value[0] = 0;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ pr_debug("%s: sample rate tx = %d", __func__,
|
|
|
+ slim_tx_cfg[SLIM_TX_7].sample_rate);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static int msm_bt_sample_rate_tx_put(struct snd_kcontrol *kcontrol,
|
|
|
+ struct snd_ctl_elem_value *ucontrol)
|
|
|
+{
|
|
|
+ switch (ucontrol->value.integer.value[0]) {
|
|
|
+ case 1:
|
|
|
+ slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_16KHZ;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_44P1KHZ;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_48KHZ;
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_88P2KHZ;
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_96KHZ;
|
|
|
+ break;
|
|
|
+ case 0:
|
|
|
+ default:
|
|
|
+ slim_tx_cfg[SLIM_TX_7].sample_rate = SAMPLING_RATE_8KHZ;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ pr_debug("%s: sample rate: slim7_tx = %d, value = %d\n",
|
|
|
+ __func__,
|
|
|
+ slim_tx_cfg[SLIM_TX_7].sample_rate,
|
|
|
+ ucontrol->value.enumerated.item[0]);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int usb_audio_rx_ch_get(struct snd_kcontrol *kcontrol,
|
|
|
struct snd_ctl_elem_value *ucontrol)
|
|
|
{
|
|
@@ -2737,6 +2869,12 @@ static const struct snd_kcontrol_new msm_snd_controls[] = {
|
|
|
SOC_ENUM_EXT("BT SampleRate", bt_sample_rate,
|
|
|
msm_bt_sample_rate_get,
|
|
|
msm_bt_sample_rate_put),
|
|
|
+ SOC_ENUM_EXT("BT SampleRate RX", bt_sample_rate_rx,
|
|
|
+ msm_bt_sample_rate_rx_get,
|
|
|
+ msm_bt_sample_rate_rx_put),
|
|
|
+ SOC_ENUM_EXT("BT SampleRate TX", bt_sample_rate_tx,
|
|
|
+ msm_bt_sample_rate_tx_get,
|
|
|
+ msm_bt_sample_rate_tx_put),
|
|
|
SOC_ENUM_EXT("USB_AUDIO_RX SampleRate", usb_rx_sample_rate,
|
|
|
usb_audio_rx_sample_rate_get,
|
|
|
usb_audio_rx_sample_rate_put),
|
|
@@ -5502,6 +5640,22 @@ static struct snd_soc_dai_link msm_common_misc_fe_dai_links[] = {
|
|
|
.codec_dai_name = "snd-soc-dummy-dai",
|
|
|
.codec_name = "snd-soc-dummy",
|
|
|
},
|
|
|
+ {
|
|
|
+ .name = "SLIMBUS_7 Hostless",
|
|
|
+ .stream_name = "SLIMBUS_7 Hostless",
|
|
|
+ .cpu_dai_name = "SLIMBUS7_HOSTLESS",
|
|
|
+ .platform_name = "msm-pcm-hostless",
|
|
|
+ .dynamic = 1,
|
|
|
+ .dpcm_capture = 1,
|
|
|
+ .dpcm_playback = 1,
|
|
|
+ .trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
|
|
+ SND_SOC_DPCM_TRIGGER_POST},
|
|
|
+ .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
|
|
|
+ .ignore_suspend = 1,
|
|
|
+ .ignore_pmdown_time = 1,
|
|
|
+ .codec_dai_name = "snd-soc-dummy-dai",
|
|
|
+ .codec_name = "snd-soc-dummy",
|
|
|
+ },
|
|
|
};
|
|
|
|
|
|
static struct snd_soc_dai_link msm_common_be_dai_links[] = {
|