Example #1
0
static int msm_dai_q6_hdmi_prepare(struct snd_pcm_substream *substream,
		struct snd_soc_dai *dai)
{
	struct msm_dai_q6_hdmi_dai_data *dai_data = dev_get_drvdata(dai->dev);

#ifdef CONFIG_LGE_COMPRESSED_PATH
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct msm_audio *prtd = runtime->private_data;
#endif
	int rc = 0;

	if (!test_bit(STATUS_PORT_STARTED, dai_data->status_mask)) {
#ifdef CONFIG_LGE_COMPRESSED_PATH
		pr_debug("msm_dai_q6_hdmi_trigger: compressed_open_flag: %d, samplerate: %d\n", compressed_open_flag, dai_data->rate);
		if (compressed_open_flag) {
			if (hdmi_msm_audio_get_sample_rate() != dai_data->rate) {
				switch (dai_data->rate) {
					case  48000:
						hdmi_msm_samplingrate_setting(HDMI_SAMPLE_RATE_48KHZ);
						break;
					case 44100:
						hdmi_msm_samplingrate_setting(HDMI_SAMPLE_RATE_44_1KHZ);
						break;	
					case 32000:
						hdmi_msm_samplingrate_setting(HDMI_SAMPLE_RATE_32KHZ);
						break;
					default:
						hdmi_msm_samplingrate_setting(HDMI_SAMPLE_RATE_48KHZ);
						break;
				}
			}
			//afe_port_start_nowait(dai->id, &dai_data->port_config, dai_data->rate);//afe_open(dai->id, &dai_data->port_config, dai_data->rate);
			rc = afe_port_start(dai->id, &dai_data->port_config, dai_data->rate);//afe_open(dai->id, &dai_data->port_config, dai_data->rate);
			q6asm_session_cmd_connect_afe_port_nowait(prtd->audio_client);
			q6asm_iec_60958_frame_rate_write_nowait(prtd->audio_client, dai_data->rate); //keyman, will be updated
		}
		else {
			hdmi_msm_samplingrate_setting(HDMI_SAMPLE_RATE_48KHZ);
#endif //                          
			rc = afe_port_start(dai->id, &dai_data->port_config,
				    dai_data->rate);
#ifdef CONFIG_LGE_COMPRESSED_PATH
		}
#endif //                          
		if (IS_ERR_VALUE(rc))
			dev_err(dai->dev, "fail to open AFE port %x\n",
				dai->id);
		else
			set_bit(STATUS_PORT_STARTED,
				dai_data->status_mask);
	}

	return rc;
}
static int msm_dai_q6_hdmi_prepare(struct snd_pcm_substream *substream,
		struct snd_soc_dai *dai)
{
	struct msm_dai_q6_hdmi_dai_data *dai_data = dev_get_drvdata(dai->dev);
	int rc = 0;

	if (!test_bit(STATUS_PORT_STARTED, dai_data->status_mask)) {
		rc = afe_port_start(dai->id, &dai_data->port_config,
				    dai_data->rate);
		if (IS_ERR_VALUE(rc))
			dev_err(dai->dev, "fail to open AFE port %x\n",
				dai->id);
		else
			set_bit(STATUS_PORT_STARTED,
				dai_data->status_mask);
	}

	return rc;
}
Example #3
0
static int msm_dai_q6_hdmi_prepare(struct snd_pcm_substream *substream,
                                   struct snd_soc_dai *dai)
{
    struct msm_dai_q6_hdmi_dai_data *dai_data = dev_get_drvdata(dai->dev);
    int rc = 0;
    dai_data->rate = 48000;
    dai_data->port_config.hdmi_multi_ch.channel_allocation = 0;
    dai_data->port_config.hdmi_multi_ch.reserved = 0;
    dai_data->port_config.hdmi_multi_ch.data_type = 0;

    if (!test_bit(STATUS_PORT_STARTED, dai_data->status_mask)) {
        rc = afe_port_start(HDMI_RX, &dai_data->port_config,
                            dai_data->rate);
        if (IS_ERR_VALUE(rc))
            dev_err(dai->dev, "fail to open AFE port %x\n",
                    HDMI_RX);
        else
            set_bit(STATUS_PORT_STARTED,
                    dai_data->status_mask);
    }

    return rc;
}