Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3084506ybt; Mon, 29 Jun 2020 14:57:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymuPMMJ/VI/GII5ulYqO+C01SsPhxYpUFdqK26iCFaafChZxxk8lZxhkOYJ4tb+MeAQs13 X-Received: by 2002:a17:906:e294:: with SMTP id gg20mr15075549ejb.521.1593467871030; Mon, 29 Jun 2020 14:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593467871; cv=none; d=google.com; s=arc-20160816; b=hkgaAaBY13w5xjxwIfElJgiMwddUEg4c6josi4YCdQZIyX1uYC4Jv+PiwMEjWipgLC Xu6PQIsBGXuURepdcdOm7IhOWlYE+QPdufLg4m2ocrUBbafVFvoIAxDCzCZddZiuhbQk eNA82bO9w1K9P/vs9tPyw7i0INgDvnsOwFIU/jpn3sWNs6QrWvufZp4R1hTdq1+ik31t qss5plWelQ1bU0ggVkgCU/boay6tAPJrYG4LcdtrBhUqnBm72+QnZdjpjl/VNprtRPv1 DfGvnWLPXJtvHwB/1sx4tDQkLAsd0IFLkvJd9rT8sqrgPHtIW+9PRPNQ/vbFgNS1UX3T XgSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hvbNxNxzs0C4s//erVM6Eiq2mDJq0i87i43TyU+5E8E=; b=qDq91KlkAAFPguVvfr23uZkJuKfhLVWWLdZUx9xV9wNqiv9FjlT1d6SPWlNXlNt3Ur ewFfTf2AalCLNMsWAc7kdn9jg2IctXrSbiZhW3MfKd02xkt8hiu7lHM2mlZg7+4k6bDv Ou+kaka8Dlzfi42qNqSv+DRiPMvE9sL9flC55hJr0EesT+19bnU5oX9t4c4chXZhey8+ xET0Er7PQu6p6qf5AtgOMp0DWIIdkdRI7rds67ylhidyKK8eCKnoOeGvMxGWenIx2QA3 9huZGx8J2pQ07VBGLS+i2sr3HbGx8ziiFH2rxO6Iqwr6/y15iE6se20lC2kiuylY/hez v4+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=X9SaKm+6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk22si480283edb.289.2020.06.29.14.57.28; Mon, 29 Jun 2020 14:57:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=X9SaKm+6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404661AbgF2Vx4 (ORCPT + 99 others); Mon, 29 Jun 2020 17:53:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:56780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbgF2Sfd (ORCPT ); Mon, 29 Jun 2020 14:35:33 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0FCCA246B2; Mon, 29 Jun 2020 15:20:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593444005; bh=Zr5itSru/+GHNNd9LHWvlnW58UoEc4Xy72bax738w/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X9SaKm+6al8zv4LRYqgk1LjZR1vruydOy4YEs1ZSxwYaD4omsIcyeEoyEP1QCEmgf 3cQxV0o44/TL7h6kawawNfXC5brCMGRbYeTbI2sxNIvOmrSI0Omm9jL3/sAwAJOQGu /anj0HkaHk3UhEJzbmLb9a6ZO8CH84TvS//0FIKw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Srinivas Kandagatla , John Stultz , Vinod Koul , Mark Brown , Sasha Levin Subject: [PATCH 5.7 111/265] ASoc: q6afe: add support to get port direction Date: Mon, 29 Jun 2020 11:15:44 -0400 Message-Id: <20200629151818.2493727-112-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629151818.2493727-1-sashal@kernel.org> References: <20200629151818.2493727-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.7.7-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.7.7-rc1 X-KernelTest-Deadline: 2020-07-01T15:14+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Kandagatla [ Upstream commit 4a95737440d426e93441d49d11abf4c6526d4666 ] This patch adds support to q6afe_is_rx_port() to get direction of DSP BE dai port, this is useful for setting dailink directions correctly. Fixes: c25e295cd77b (ASoC: qcom: Add support to parse common audio device nodes) Reported-by: John Stultz Signed-off-by: Srinivas Kandagatla Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20200612123711.29130-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/qcom/qdsp6/q6afe.c | 8 ++++++++ sound/soc/qcom/qdsp6/q6afe.h | 1 + 2 files changed, 9 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c index e0945f7a58c81..0ce4eb60f9848 100644 --- a/sound/soc/qcom/qdsp6/q6afe.c +++ b/sound/soc/qcom/qdsp6/q6afe.c @@ -800,6 +800,14 @@ int q6afe_get_port_id(int index) } EXPORT_SYMBOL_GPL(q6afe_get_port_id); +int q6afe_is_rx_port(int index) +{ + if (index < 0 || index >= AFE_PORT_MAX) + return -EINVAL; + + return port_maps[index].is_rx; +} +EXPORT_SYMBOL_GPL(q6afe_is_rx_port); static int afe_apr_send_pkt(struct q6afe *afe, struct apr_pkt *pkt, struct q6afe_port *port) { diff --git a/sound/soc/qcom/qdsp6/q6afe.h b/sound/soc/qcom/qdsp6/q6afe.h index c7ed5422baffd..1a0f80a14afea 100644 --- a/sound/soc/qcom/qdsp6/q6afe.h +++ b/sound/soc/qcom/qdsp6/q6afe.h @@ -198,6 +198,7 @@ int q6afe_port_start(struct q6afe_port *port); int q6afe_port_stop(struct q6afe_port *port); void q6afe_port_put(struct q6afe_port *port); int q6afe_get_port_id(int index); +int q6afe_is_rx_port(int index); void q6afe_hdmi_port_prepare(struct q6afe_port *port, struct q6afe_hdmi_cfg *cfg); void q6afe_slim_port_prepare(struct q6afe_port *port, -- 2.25.1