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

Commit 61518cff authored by Sanjana B's avatar Sanjana B
Browse files

asoc:support for DSD on MI2S interface



Add support for DSD in MI2S interface and corresponding api updates
from ADSP.

Change-Id: I494205763fa429f95e43497ed5b8f91332f5a2a3
Signed-off-by: default avatarSanjana B <sanjb@codeaurora.org>
parent 51671618
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 */


@@ -1231,7 +1231,7 @@ static int msm_compr_send_media_format_block(struct snd_compr_stream *cstream,
		dsd_cfg.dsd_data_rate = prtd->sample_rate;
		dsd_cfg.num_version = 0;
		dsd_cfg.is_bitwise_big_endian = 1;
		dsd_cfg.dsd_channel_block_size = 1;
		dsd_cfg.dsd_channel_block_size = 4;
		ret = q6asm_media_format_block_dsd(prtd->audio_client,
						   &dsd_cfg, stream_id);
		if (ret < 0)
+5 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/init.h>
@@ -329,7 +329,8 @@ static const char *const mi2s_format[] = {
	"NA6",
	"NA7",
	"NA8",
	"DSD_DOP_W_MARKER"
	"DSD_DOP_W_MARKER",
	"NATIVE_DSD_DATA"
};

static const char *const mi2s_vi_feed_mono[] = {
@@ -338,7 +339,7 @@ static const char *const mi2s_vi_feed_mono[] = {
};

static const struct soc_enum mi2s_config_enum[] = {
	SOC_ENUM_SINGLE_EXT(10, mi2s_format),
	SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(mi2s_format), mi2s_format),
	SOC_ENUM_SINGLE_EXT(2, mi2s_vi_feed_mono),
};

@@ -5585,6 +5586,7 @@ static int msm_dai_q6_mi2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)

	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
	case SND_SOC_DAIFMT_CBS_CFS:
	case SND_SOC_DAIFMT_CBM_CFS:
		mi2s_dai_data->rx_dai.mi2s_dai_data.port_config.i2s.ws_src = 1;
		mi2s_dai_data->tx_dai.mi2s_dai_data.port_config.i2s.ws_src = 1;
		break;
+5 −5
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 */
#include <linux/init.h>
@@ -1540,7 +1540,7 @@ int msm_pcm_routing_reg_phy_compr_stream(int fe_id, int perf_mode,
				adm_open(port_id, path_type, sample_rate,
					 channels, topology, perf_mode,
					 bit_width, app_type, acdb_dev_id,
					 session_type);
					 session_type, passthr_mode);
			if ((copp_idx < 0) ||
				(copp_idx >= MAX_COPPS_PER_PORT)) {
				pr_err("%s:adm open failed coppid:%d\n",
@@ -1892,7 +1892,7 @@ int msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode,
					    sample_rate, channels, topology,
					    perf_mode, bits_per_sample,
					    app_type, acdb_dev_id,
					    session_type);
					    session_type, passthr_mode);
			if ((copp_idx < 0) ||
				(copp_idx >= MAX_COPPS_PER_PORT)) {
				pr_err("%s: adm open failed copp_idx:%d\n",
@@ -2173,7 +2173,7 @@ static void msm_pcm_routing_process_audio(u16 reg, u16 val, int set)
					    sample_rate, channels, topology,
					    fdai->perf_mode, bits_per_sample,
					    app_type, acdb_dev_id,
					    session_type);
					    session_type, passthr_mode);
			if ((copp_idx < 0) ||
			    (copp_idx >= MAX_COPPS_PER_PORT)) {
				pr_err("%s: adm open failed\n", __func__);
@@ -28852,7 +28852,7 @@ static int msm_pcm_routing_prepare(struct snd_pcm_substream *substream)
					    sample_rate, channels, topology,
					    fdai->perf_mode, bits_per_sample,
					    app_type, acdb_dev_id,
					    session_type);
					    session_type, fdai->passthr_mode);
			if ((copp_idx < 0) ||
				(copp_idx >= MAX_COPPS_PER_PORT)) {
				pr_err("%s: adm open failed\n", __func__);
+5 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 */
#include <linux/module.h>
#include <linux/slab.h>
@@ -2975,7 +2975,7 @@ static int adm_copp_set_ec_ref_mfc_cfg(int port_id, int copp_idx,
 */
int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
	     int perf_mode, uint16_t bit_width, int app_type, int acdb_id,
	     int session_type)
	     int session_type, uint32_t passthr_mode)
{
	struct adm_cmd_device_open_v5	open;
	struct adm_cmd_device_open_v6	open_v6;
@@ -3188,7 +3188,9 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
			}

			open_v8.topology_id = topology;
			open_v8.reserved = 0;
			open_v8.compressed_data_type = 0;
			if (passthr_mode == COMPRESSED_PASSTHROUGH_DSD)
				open_v8.compressed_data_type = 1;

			/* variable endpoint payload */
			ep1_payload.dev_num_channel = channel_mode & 0x00FF;
+5 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 * Author: Brian Swetland <swetland@google.com>
 *
 * This software is licensed under the terms of the GNU General Public
@@ -3096,6 +3096,10 @@ int q6asm_open_read_compressed(struct audio_client *ac, uint32_t format,
		open.mode_flags = 0x1;
		open.frames_per_buf = 1;
		pr_debug("%s: Flag 1 IEC61937 output\n", __func__);
	} else if (format == FORMAT_DSD) {
		open.mode_flags = ASM_DSD_FORMAT_FLAG;
		open.frames_per_buf = 1;
		pr_debug("%s: Flag 2 DSD output\n", __func__);
	} else {
		open.mode_flags = 0;
		open.frames_per_buf = 1;
Loading