Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp748716pxy; Sun, 1 Aug 2021 00:55:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUbKLcE3aovqDFjuYXKqAKNMFRrCX/sbG6EA4evtHs3MH+O9IOmQM5cTLA//5vI5IOw9AV X-Received: by 2002:a5d:925a:: with SMTP id e26mr1247052iol.195.1627804526880; Sun, 01 Aug 2021 00:55:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627804526; cv=none; d=google.com; s=arc-20160816; b=LH/mJuQQ+anyAsybMo1Ft8YeWmOCHWdC7FDxWze6j97e5xdilbqSD/cKXgvr5mi4ZG IVmOVeRFqcJGDqi86RpWkZXlSHZQzmdqYM/gxLwZjZ0nZpNnEDxff3Ctj2kbrJjdN5+y 5nO4lVHpo418Q1CmL5HijcFijX7FcTARn5b/RCt602JzTbmLX30Sz/n/0s7P/qlcuTNE M9suN/qLoYYAorkHE/mS810CLAMbo1ZtckOiuIg6DHg0ujVLmC0mnA+dtf/OpbL8FAB4 YAl6t09z+0E9nRy4LOfV619hd1wSV5l3GnY34vflBWHkVqh863rYqglDDqZMlDd0dB8p aV2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9M47fnbqFjjT0wUykNJJyk2P3Uigpsq8dlBLr4EYpEY=; b=Zhn2Twf1PvJsdEeOI11njk9KM1SRtxMcGE29BQshknYbxZfXu25QcXnRkVakr4SKa+ QYbzRE9LVLeNKOylznzvYcpY3e/H8CM8WKVQ1AgScndjLK8gMumb6ssR9Ez4KEfZvRKC /U5na4vzlD3PODvBicJiEaukmnofl+EsU2xREUtZ2VPteeazUE66aAMU9jra8ovuSf+O ZOU0ElhN6DKSFOe0O2Du2nDVbwoDs5iPBHuQXXH2d428Lq1ZKBzyPY0e0Xu3V10g0fcG 1iarPDgjEhpn95v9dvdTPs3l6zMYQToSQpyM7wLhUU/zpM/FoFOnrfATgxzdPRHZKSNh D+jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailoo.org header.s=mailo header.b=eBUwieR1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mailoo.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si8517936jak.113.2021.08.01.00.55.15; Sun, 01 Aug 2021 00:55:26 -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=fail header.i=@mailoo.org header.s=mailo header.b=eBUwieR1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mailoo.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbhHAHxH (ORCPT + 99 others); Sun, 1 Aug 2021 03:53:07 -0400 Received: from msg-1.mailo.com ([213.182.54.11]:41628 "EHLO msg-1.mailo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbhHAHxG (ORCPT ); Sun, 1 Aug 2021 03:53:06 -0400 X-Greylist: delayed 1323 seconds by postgrey-1.27 at vger.kernel.org; Sun, 01 Aug 2021 03:53:06 EDT DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailoo.org; s=mailo; t=1627803011; bh=4G10nVQJkrQltnOTrznYvxzJZvczMCBK7/8KU1oeR88=; h=X-EA-Auth:From:To:Cc:Subject:Date:Message-Id:X-Mailer: MIME-Version:Content-Transfer-Encoding; b=eBUwieR1Jcmb5GNy2OCAfoRL07rmcEzJrloVfNwd8Su77lb82ETEQucE5RnzTB/RO xfWu7A2kYnBkPnUey4Wyw6p5A0BR/trF0X9hCEG10evkCJCeO9swPawWdHctTWwbqI QQ8S+PRfLmSnLCmxz2sN7kkdyAljdDeMoghPDWNo= Received: by b-6.in.mailobj.net [192.168.90.16] with ESMTP via proxy.mailoo.org [213.182.55.207] Sun, 1 Aug 2021 09:30:11 +0200 (CEST) X-EA-Auth: ZR/HJzMxTWSmhw2LBY8jJO+wEhwbhSwSmMdyX7IU/oyZLhWZY6TfL/dPrWEE0YA7ybC/EhpxzXNGH1WMdyWhfMlCG/30t8t9bMiEKc0TZ5A= From: Vincent Knecht To: tiwai@suse.com, perex@perex.cz Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, broonie@kernel.org, lgirdwood@gmail.com, bgoswami@codeaurora.org, srinivas.kandagatla@linaro.org, stephan@gerhold.net, Vincent Knecht Subject: [PATCH] ASoC: qcom: apq8016_sbc: Add SEC_MI2S support Date: Sun, 1 Aug 2021 09:29:51 +0200 Message-Id: <20210801072951.1403241-1-vincent.knecht@mailoo.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds external codec support on secondary mi2s. It is used for headphones on some devices, eg. alcatel-idol347. Signed-off-by: Vincent Knecht --- sound/soc/qcom/apq8016_sbc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c index 08a05f0ecad7..53460272eb1e 100644 --- a/sound/soc/qcom/apq8016_sbc.c +++ b/sound/soc/qcom/apq8016_sbc.c @@ -30,6 +30,11 @@ struct apq8016_sbc_data { #define MIC_CTRL_QUA_WS_SLAVE_SEL_10 BIT(17) #define MIC_CTRL_TLMM_SCLK_EN BIT(1) #define SPKR_CTL_PRI_WS_SLAVE_SEL_11 (BIT(17) | BIT(16)) +#define SPKR_CTL_TLMM_MCLK_EN BIT(1) +#define SPKR_CTL_TLMM_SCLK_EN BIT(2) +#define SPKR_CTL_TLMM_DATA1_EN BIT(3) +#define SPKR_CTL_TLMM_WS_OUT_SEL BIT(6) +#define SPKR_CTL_TLMM_WS_EN_SEL BIT(18) #define DEFAULT_MCLK_RATE 9600000 static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime *rtd) @@ -53,6 +58,13 @@ static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime *rtd) MIC_CTRL_TLMM_SCLK_EN, pdata->mic_iomux); break; + case MI2S_SECONDARY: + /* Configure the Sec MI2S to TLMM */ + writel(readl(pdata->spkr_iomux) | SPKR_CTL_TLMM_MCLK_EN | + SPKR_CTL_TLMM_SCLK_EN | SPKR_CTL_TLMM_DATA1_EN | + SPKR_CTL_TLMM_WS_OUT_SEL | SPKR_CTL_TLMM_WS_EN_SEL, + pdata->spkr_iomux); + break; case MI2S_TERTIARY: writel(readl(pdata->mic_iomux) | MIC_CTRL_TER_WS_SLAVE_SEL | MIC_CTRL_TLMM_SCLK_EN, -- 2.31.1