From patchwork Wed Jan 18 16:04:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Binding X-Patchwork-Id: 45365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2424109wrn; Wed, 18 Jan 2023 08:14:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXvgmEuc+XwpAWSm4Perrlbg2MD13z2AkXiHHJTR1mqtFBY/EJXNe+N8ZRO+vWOTTrnJZB+l X-Received: by 2002:a17:906:eb13:b0:869:236c:ac43 with SMTP id mb19-20020a170906eb1300b00869236cac43mr7671218ejb.32.1674058440183; Wed, 18 Jan 2023 08:14:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674058440; cv=none; d=google.com; s=arc-20160816; b=N9kBQtnCU8ij0xpJMLa+CKr2TKud4bLwoloODpvDf6BgOSxQ4/OQq2tY/2vHt6Ap8r W1v7iaohlIuvHtLre1fP/yuzdocGncEfxspHhfnkfmcGCZerrm+TaHYBAFvAkiGT9ZBP YeDkEQ+yCXH6hggO3buNgQfnaVDRG4+NQTtTPY/5FK7pl27mL+00X26w1ccQToglRo7t hiC6XgcXmlzXYgTWsyVx7qg1QEpSQCEP6HfSvPZo4opXPrxAjFFdlCHBptBrn9DXfnu9 yy63fJ1GFLnOJBXlFl9xlxLaK8m6bPgXXqd7b0Q04QXc4Vunbc0NPi5eaGKzvSSlU/bg /jgA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VkEQ/+6tCb28lQhqZZB7/1qdgbcRJIIlgjD9dLONQZg=; b=iIXs9snUXGOvgD71y5FxpgYnQRR0+V/hw/1ukhLr51wTAw92b2Ql2tB4R3FL4O3CG+ ruj/z8bTcLxufHp29ULhxmLcCgVTS6lvkHEzmp0v19oQ7SeJz6FqsqSxwtJLcgGJ+7pU FvjRsi6w/6QCtJ5laZ0hVj/+1u3kHy8cEGVT60zSXzKrTx9ujOA9u1hkDRCZ8jE9FYk/ 3a/WGbToHFzIaFu3dG9RYrx8651vd6EX1bY3SHj7lSR3RuJLdivEZ5Q31eshjRBRZB0G yhJglWYNLN4782cB/ii4BpKLw5cVBSVAyd82wy1jxI7rsr47ojB/hWNTHzxNyb1PMmR0 6N4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=CfLnuovq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb12-20020a1709071c8c00b008706dceb60fsi11923249ejc.106.2023.01.18.08.13.36; Wed, 18 Jan 2023 08:14:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=CfLnuovq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229572AbjARQLI (ORCPT + 99 others); Wed, 18 Jan 2023 11:11:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229829AbjARQJW (ORCPT ); Wed, 18 Jan 2023 11:09:22 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75981474E5 for ; Wed, 18 Jan 2023 08:05:19 -0800 (PST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30IEDgr9022836; Wed, 18 Jan 2023 10:05:06 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=VkEQ/+6tCb28lQhqZZB7/1qdgbcRJIIlgjD9dLONQZg=; b=CfLnuovqxnPb5kq1igrKUZGiD5POleBH4VAYwmCW7HQWBFwDwFgWbFP7dykE4IkCaDZF +CBEPbLpzCtZwZCDKJLfSByVZSBXk0nZwgugkp1Qy86Ja21Rm+DtsG+7rt0JQA9tKF5v lmmx9Bk023eYIZymYn2rTjw648hPCYXzDRo1wdr4Kt85XDaj8io5w2bkMZzHMoyJ7kAh JqHUmflnqwTmOTI/h4VcGUH3bslfJv5wAi+cn2ezi0jr+O8Wt4kd2y+Apyf6AYyC8r0b sDQ1LeS6sKobQ0n2zDNYPWwQs42XJuH+XZFtrDhUMQFO4Kpr32aOlXJuBiqyT2UhdQe5 cw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3n3spx6vk9-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Jan 2023 10:05:06 -0600 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.21; Wed, 18 Jan 2023 10:04:57 -0600 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.7 via Frontend Transport; Wed, 18 Jan 2023 10:04:57 -0600 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.202.160]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 934D811CC; Wed, 18 Jan 2023 16:04:57 +0000 (UTC) From: Stefan Binding To: Mark Brown , Pierre-Louis Bossart CC: , , , Richard Fitzgerald , Stefan Binding Subject: [PATCH v2 5/8] ASoC: cs42l42: Export some functions for Soundwire Date: Wed, 18 Jan 2023 16:04:49 +0000 Message-ID: <20230118160452.2385494-6-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230118160452.2385494-1-sbinding@opensource.cirrus.com> References: <20230118160452.2385494-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: e0TwxmiCoLTa6zUv4AqYAIA2xNmwJPWj X-Proofpoint-ORIG-GUID: e0TwxmiCoLTa6zUv4AqYAIA2xNmwJPWj X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755377502559039201?= X-GMAIL-MSGID: =?utf-8?q?1755377502559039201?= From: Richard Fitzgerald Export functions that will be needed by a Soundwire module. Signed-off-by: Richard Fitzgerald Signed-off-by: Stefan Binding --- sound/soc/codecs/cs42l42.c | 14 +++++++++----- sound/soc/codecs/cs42l42.h | 5 +++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index d81c6eb1c1e59..cefefd7061689 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -653,8 +653,8 @@ static const struct cs42l42_pll_params pll_ratio_table[] = { { 24576000, 1, 0x03, 0x40, 0x000000, 0x03, 0x10, 12288000, 128, 1} }; -static int cs42l42_pll_config(struct snd_soc_component *component, unsigned int clk, - unsigned int sample_rate) +int cs42l42_pll_config(struct snd_soc_component *component, unsigned int clk, + unsigned int sample_rate) { struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component); int i; @@ -740,8 +740,9 @@ static int cs42l42_pll_config(struct snd_soc_component *component, unsigned int return -EINVAL; } +EXPORT_SYMBOL_NS_GPL(cs42l42_pll_config, SND_SOC_CS42L42_CORE); -static void cs42l42_src_config(struct snd_soc_component *component, unsigned int sample_rate) +void cs42l42_src_config(struct snd_soc_component *component, unsigned int sample_rate) { struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component); unsigned int fs; @@ -773,6 +774,7 @@ static void cs42l42_src_config(struct snd_soc_component *component, unsigned int CS42L42_CLK_OASRC_SEL_MASK, fs << CS42L42_CLK_OASRC_SEL_SHIFT); } +EXPORT_SYMBOL_NS_GPL(cs42l42_src_config, SND_SOC_CS42L42_CORE); static int cs42l42_asp_config(struct snd_soc_component *component, unsigned int sclk, unsigned int sample_rate) @@ -1013,7 +1015,7 @@ static int cs42l42_set_bclk_ratio(struct snd_soc_dai *dai, return 0; } -static int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream) +int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream) { struct snd_soc_component *component = dai->component; struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component); @@ -1106,6 +1108,7 @@ static int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream) return 0; } +EXPORT_SYMBOL_NS_GPL(cs42l42_mute_stream, SND_SOC_CS42L42_CORE); #define CS42L42_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\ SNDRV_PCM_FMTBIT_S24_LE |\ @@ -1648,7 +1651,7 @@ static const struct cs42l42_irq_params irq_params_table[] = { CS42L42_TSRS_PLUG_VAL_MASK} }; -static irqreturn_t cs42l42_irq_thread(int irq, void *data) +irqreturn_t cs42l42_irq_thread(int irq, void *data) { struct cs42l42_private *cs42l42 = (struct cs42l42_private *)data; unsigned int stickies[12]; @@ -1765,6 +1768,7 @@ static irqreturn_t cs42l42_irq_thread(int irq, void *data) return IRQ_HANDLED; } +EXPORT_SYMBOL_NS_GPL(cs42l42_irq_thread, SND_SOC_CS42L42_CORE); static void cs42l42_set_interrupt_masks(struct cs42l42_private *cs42l42) { diff --git a/sound/soc/codecs/cs42l42.h b/sound/soc/codecs/cs42l42.h index 17aab06adc8e6..ef8219f489100 100644 --- a/sound/soc/codecs/cs42l42.h +++ b/sound/soc/codecs/cs42l42.h @@ -61,6 +61,11 @@ extern struct snd_soc_dai_driver cs42l42_dai; bool cs42l42_readable_register(struct device *dev, unsigned int reg); bool cs42l42_volatile_register(struct device *dev, unsigned int reg); +int cs42l42_pll_config(struct snd_soc_component *component, + unsigned int clk, unsigned int sample_rate); +void cs42l42_src_config(struct snd_soc_component *component, unsigned int sample_rate); +int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream); +irqreturn_t cs42l42_irq_thread(int irq, void *data); int cs42l42_suspend(struct device *dev); int cs42l42_resume(struct device *dev); void cs42l42_resume_restore(struct device *dev);