Loading asoc/msm-dai-q6-v2.c +37 −0 Original line number Diff line number Diff line Loading @@ -2419,6 +2419,36 @@ static int msm_dai_q6_afe_input_bit_format_put( return 0; } static int msm_dai_q6_afe_scrambler_mode_get( struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data; if (!dai_data) { pr_err("%s: Invalid dai data\n", __func__); return -EINVAL; } ucontrol->value.integer.value[0] = dai_data->enc_config.scrambler_mode; return 0; } static int msm_dai_q6_afe_scrambler_mode_put( struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data; if (!dai_data) { pr_err("%s: Invalid dai data\n", __func__); return -EINVAL; } dai_data->enc_config.scrambler_mode = ucontrol->value.integer.value[0]; pr_debug("%s: afe scrambler mode : %d\n", __func__, dai_data->enc_config.scrambler_mode); return 0; } static const struct snd_kcontrol_new afe_enc_config_controls[] = { { Loading @@ -2436,6 +2466,10 @@ static const struct snd_kcontrol_new afe_enc_config_controls[] = { SOC_ENUM_EXT("AFE Input Bit Format", afe_input_bit_format_enum[0], msm_dai_q6_afe_input_bit_format_get, msm_dai_q6_afe_input_bit_format_put), SOC_SINGLE_EXT("AFE Scrambler Mode", 0, 0, 1, 0, msm_dai_q6_afe_scrambler_mode_get, msm_dai_q6_afe_scrambler_mode_put), }; static int msm_dai_q6_slim_rx_drift_info(struct snd_kcontrol *kcontrol, Loading Loading @@ -2598,6 +2632,9 @@ static int msm_dai_q6_dai_probe(struct snd_soc_dai *dai) rc = snd_ctl_add(dai->component->card->snd_card, snd_ctl_new1(&afe_enc_config_controls[2], dai_data)); rc = snd_ctl_add(dai->component->card->snd_card, snd_ctl_new1(&afe_enc_config_controls[3], dai_data)); rc = snd_ctl_add(dai->component->card->snd_card, snd_ctl_new1(&avd_drift_config_controls[2], dai)); Loading dsp/q6afe.c +23 −5 Original line number Diff line number Diff line Loading @@ -2961,7 +2961,8 @@ int afe_port_send_usb_dev_param(u16 port_id, union afe_port_config *afe_config) static int q6afe_send_enc_config(u16 port_id, union afe_enc_config_data *cfg, u32 format, union afe_port_config afe_config, u16 afe_in_channels, u16 afe_in_bit_width) u16 afe_in_channels, u16 afe_in_bit_width, u32 scrambler_mode) { struct afe_audioif_config_command config; int index; Loading Loading @@ -3058,6 +3059,20 @@ static int q6afe_send_enc_config(u16 port_id, goto exit; } config.param.payload_size = payload_size + sizeof(config.port.enc_set_scrambler_param); pr_debug("%s:sending AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING mode= %d to DSP payload = %d\n", __func__, scrambler_mode, config.param.payload_size); config.pdata.param_id = AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING; config.pdata.param_size = sizeof(config.port.enc_set_scrambler_param); config.port.enc_set_scrambler_param.enable_scrambler = scrambler_mode; ret = afe_apr_send_pkt(&config, &this_afe.wait[index]); if (ret) { pr_err("%s: AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING for port 0x%x failed %d\n", __func__, port_id, ret); goto exit; } config.param.payload_size = payload_size + sizeof(config.port.media_type); config.pdata.param_size = sizeof(config.port.media_type); Loading Loading @@ -3094,7 +3109,8 @@ static int q6afe_send_enc_config(u16 port_id, static int __afe_port_start(u16 port_id, union afe_port_config *afe_config, u32 rate, u16 afe_in_channels, u16 afe_in_bit_width, union afe_enc_config_data *cfg, u32 enc_format) union afe_enc_config_data *cfg, u32 enc_format, u32 scrambler_mode) { struct afe_audioif_config_command config; int ret = 0; Loading Loading @@ -3357,7 +3373,8 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config, __func__, enc_format); ret = q6afe_send_enc_config(port_id, cfg, enc_format, *afe_config, afe_in_channels, afe_in_bit_width); afe_in_bit_width, scrambler_mode); if (ret) { pr_err("%s: AFE encoder config for port 0x%x failed %d\n", __func__, port_id, ret); Loading Loading @@ -3410,7 +3427,7 @@ int afe_port_start(u16 port_id, union afe_port_config *afe_config, u32 rate) { return __afe_port_start(port_id, afe_config, rate, 0, 0, NULL, ASM_MEDIA_FMT_NONE); 0, 0, NULL, ASM_MEDIA_FMT_NONE, 0); } EXPORT_SYMBOL(afe_port_start); Loading @@ -3433,7 +3450,8 @@ int afe_port_start_v2(u16 port_id, union afe_port_config *afe_config, { return __afe_port_start(port_id, afe_config, rate, afe_in_channels, afe_in_bit_width, &enc_cfg->data, enc_cfg->format); &enc_cfg->data, enc_cfg->format, enc_cfg->scrambler_mode); } EXPORT_SYMBOL(afe_port_start_v2); Loading include/dsp/apr_audio-v2.h +20 −0 Original line number Diff line number Diff line Loading @@ -3118,6 +3118,12 @@ struct afe_param_id_aptx_sync_mode { */ #define AFE_ENCODER_PARAM_ID_ENC_FMT_ID 0x0001322B /* * Encoder scrambler parameter for the #AVS_MODULE_ID_ENCODER module. * This parameter cannot be set runtime. */ #define AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING 0x0001323C /* * Data format to send compressed data * is transmitted/received over Slimbus lines. Loading Loading @@ -3451,6 +3457,7 @@ union afe_enc_config_data { struct afe_enc_config { u32 format; u32 scrambler_mode; union afe_enc_config_data data; }; Loading @@ -3474,6 +3481,18 @@ struct avs_enc_packetizer_id_param_t { uint32_t enc_packetizer_id; }; /* * Payload of the AVS_ENCODER_PARAM_ID_ENABLE_SCRAMBLING parameter. */ struct avs_enc_set_scrambler_param_t { /* * Supported values: * 1 : enable scrambler * 0 : disable scrambler */ uint32_t enable_scrambler; }; union afe_port_config { struct afe_param_id_pcm_cfg pcm; struct afe_param_id_i2s_cfg i2s; Loading @@ -3492,6 +3511,7 @@ union afe_port_config { struct afe_port_media_type_t media_type; struct afe_enc_cfg_blk_param_t enc_blk_param; struct avs_enc_packetizer_id_param_t enc_pkt_id_param; struct avs_enc_set_scrambler_param_t enc_set_scrambler_param; } __packed; struct afe_audioif_config_command_no_payload { Loading Loading
asoc/msm-dai-q6-v2.c +37 −0 Original line number Diff line number Diff line Loading @@ -2419,6 +2419,36 @@ static int msm_dai_q6_afe_input_bit_format_put( return 0; } static int msm_dai_q6_afe_scrambler_mode_get( struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data; if (!dai_data) { pr_err("%s: Invalid dai data\n", __func__); return -EINVAL; } ucontrol->value.integer.value[0] = dai_data->enc_config.scrambler_mode; return 0; } static int msm_dai_q6_afe_scrambler_mode_put( struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct msm_dai_q6_dai_data *dai_data = kcontrol->private_data; if (!dai_data) { pr_err("%s: Invalid dai data\n", __func__); return -EINVAL; } dai_data->enc_config.scrambler_mode = ucontrol->value.integer.value[0]; pr_debug("%s: afe scrambler mode : %d\n", __func__, dai_data->enc_config.scrambler_mode); return 0; } static const struct snd_kcontrol_new afe_enc_config_controls[] = { { Loading @@ -2436,6 +2466,10 @@ static const struct snd_kcontrol_new afe_enc_config_controls[] = { SOC_ENUM_EXT("AFE Input Bit Format", afe_input_bit_format_enum[0], msm_dai_q6_afe_input_bit_format_get, msm_dai_q6_afe_input_bit_format_put), SOC_SINGLE_EXT("AFE Scrambler Mode", 0, 0, 1, 0, msm_dai_q6_afe_scrambler_mode_get, msm_dai_q6_afe_scrambler_mode_put), }; static int msm_dai_q6_slim_rx_drift_info(struct snd_kcontrol *kcontrol, Loading Loading @@ -2598,6 +2632,9 @@ static int msm_dai_q6_dai_probe(struct snd_soc_dai *dai) rc = snd_ctl_add(dai->component->card->snd_card, snd_ctl_new1(&afe_enc_config_controls[2], dai_data)); rc = snd_ctl_add(dai->component->card->snd_card, snd_ctl_new1(&afe_enc_config_controls[3], dai_data)); rc = snd_ctl_add(dai->component->card->snd_card, snd_ctl_new1(&avd_drift_config_controls[2], dai)); Loading
dsp/q6afe.c +23 −5 Original line number Diff line number Diff line Loading @@ -2961,7 +2961,8 @@ int afe_port_send_usb_dev_param(u16 port_id, union afe_port_config *afe_config) static int q6afe_send_enc_config(u16 port_id, union afe_enc_config_data *cfg, u32 format, union afe_port_config afe_config, u16 afe_in_channels, u16 afe_in_bit_width) u16 afe_in_channels, u16 afe_in_bit_width, u32 scrambler_mode) { struct afe_audioif_config_command config; int index; Loading Loading @@ -3058,6 +3059,20 @@ static int q6afe_send_enc_config(u16 port_id, goto exit; } config.param.payload_size = payload_size + sizeof(config.port.enc_set_scrambler_param); pr_debug("%s:sending AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING mode= %d to DSP payload = %d\n", __func__, scrambler_mode, config.param.payload_size); config.pdata.param_id = AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING; config.pdata.param_size = sizeof(config.port.enc_set_scrambler_param); config.port.enc_set_scrambler_param.enable_scrambler = scrambler_mode; ret = afe_apr_send_pkt(&config, &this_afe.wait[index]); if (ret) { pr_err("%s: AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING for port 0x%x failed %d\n", __func__, port_id, ret); goto exit; } config.param.payload_size = payload_size + sizeof(config.port.media_type); config.pdata.param_size = sizeof(config.port.media_type); Loading Loading @@ -3094,7 +3109,8 @@ static int q6afe_send_enc_config(u16 port_id, static int __afe_port_start(u16 port_id, union afe_port_config *afe_config, u32 rate, u16 afe_in_channels, u16 afe_in_bit_width, union afe_enc_config_data *cfg, u32 enc_format) union afe_enc_config_data *cfg, u32 enc_format, u32 scrambler_mode) { struct afe_audioif_config_command config; int ret = 0; Loading Loading @@ -3357,7 +3373,8 @@ static int __afe_port_start(u16 port_id, union afe_port_config *afe_config, __func__, enc_format); ret = q6afe_send_enc_config(port_id, cfg, enc_format, *afe_config, afe_in_channels, afe_in_bit_width); afe_in_bit_width, scrambler_mode); if (ret) { pr_err("%s: AFE encoder config for port 0x%x failed %d\n", __func__, port_id, ret); Loading Loading @@ -3410,7 +3427,7 @@ int afe_port_start(u16 port_id, union afe_port_config *afe_config, u32 rate) { return __afe_port_start(port_id, afe_config, rate, 0, 0, NULL, ASM_MEDIA_FMT_NONE); 0, 0, NULL, ASM_MEDIA_FMT_NONE, 0); } EXPORT_SYMBOL(afe_port_start); Loading @@ -3433,7 +3450,8 @@ int afe_port_start_v2(u16 port_id, union afe_port_config *afe_config, { return __afe_port_start(port_id, afe_config, rate, afe_in_channels, afe_in_bit_width, &enc_cfg->data, enc_cfg->format); &enc_cfg->data, enc_cfg->format, enc_cfg->scrambler_mode); } EXPORT_SYMBOL(afe_port_start_v2); Loading
include/dsp/apr_audio-v2.h +20 −0 Original line number Diff line number Diff line Loading @@ -3118,6 +3118,12 @@ struct afe_param_id_aptx_sync_mode { */ #define AFE_ENCODER_PARAM_ID_ENC_FMT_ID 0x0001322B /* * Encoder scrambler parameter for the #AVS_MODULE_ID_ENCODER module. * This parameter cannot be set runtime. */ #define AFE_ENCODER_PARAM_ID_ENABLE_SCRAMBLING 0x0001323C /* * Data format to send compressed data * is transmitted/received over Slimbus lines. Loading Loading @@ -3451,6 +3457,7 @@ union afe_enc_config_data { struct afe_enc_config { u32 format; u32 scrambler_mode; union afe_enc_config_data data; }; Loading @@ -3474,6 +3481,18 @@ struct avs_enc_packetizer_id_param_t { uint32_t enc_packetizer_id; }; /* * Payload of the AVS_ENCODER_PARAM_ID_ENABLE_SCRAMBLING parameter. */ struct avs_enc_set_scrambler_param_t { /* * Supported values: * 1 : enable scrambler * 0 : disable scrambler */ uint32_t enable_scrambler; }; union afe_port_config { struct afe_param_id_pcm_cfg pcm; struct afe_param_id_i2s_cfg i2s; Loading @@ -3492,6 +3511,7 @@ union afe_port_config { struct afe_port_media_type_t media_type; struct afe_enc_cfg_blk_param_t enc_blk_param; struct avs_enc_packetizer_id_param_t enc_pkt_id_param; struct avs_enc_set_scrambler_param_t enc_set_scrambler_param; } __packed; struct afe_audioif_config_command_no_payload { Loading