From patchwork Fri Sep 9 13:53:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Povi=C5=A1er?= X-Patchwork-Id: 12971859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F67DECAAA1 for ; Fri, 9 Sep 2022 13:57:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7C3091695; Fri, 9 Sep 2022 15:56:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7C3091695 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1662731860; bh=JD4zUMnGGwwl8/5VTjKcH/k8sZEy9pMbur8Sb4TqRpg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WLms35Dn7GP3NH49mTB8NUWtYqOwY5Py+9gp6uCnP67ntVhUEJaQO7zBp0LL3wCBH SQI73ivy2kr3L26BI6Z0hhGo9zu2itq2AzB3DfqCeOdbVXZtI8mY0XE/SMh9G4dwqC FiLr5oOIOJ2WoxZEiO4+qE0wxj7cKqa9R1iXLSTM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1AFDFF80579; Fri, 9 Sep 2022 15:54:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 82CBEF80571; Fri, 9 Sep 2022 15:54:56 +0200 (CEST) Received: from hutie.ust.cz (hutie.ust.cz [185.8.165.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 23421F804B4 for ; Fri, 9 Sep 2022 15:54:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 23421F804B4 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=cutebit.org header.i=@cutebit.org header.b="rNVALXYE" From: =?utf-8?q?Martin_Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1662731680; bh=7ptJCN9nATn9uDBcMGbXpo6rfRfMfA+dgnRJT7fm8AA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rNVALXYEVGITpfBIDipXLXlJW8g3bx6rGwNFvMaCmnxz3mP4qrE88O7z0WFlKDfPa 0+VDmBrBRKOurY1q3pOvPrgX6DUVq3n8M5Tl8ydcPny0ZrgggUfB/ewtfdFfDjpiJZ WtPpaEseAWnVTZolM2azQ2Sr5oGmrAuMqm8R1LvE= To: James Schulman , David Rhodes , Lucas Tanure , Richard Fitzgerald , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Martin_Povi=C5=A1er?= Subject: [PATCH 08/10] ASoC: cs42l42: Export regmap elements to core namespace Date: Fri, 9 Sep 2022 15:53:32 +0200 Message-Id: <20220909135334.98220-9-povik+lin@cutebit.org> In-Reply-To: <20220909135334.98220-1-povik+lin@cutebit.org> References: <20220909135334.98220-1-povik+lin@cutebit.org> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Charles Keepax , - , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, ChiYuan Huang , asahi@lists.linux.dev, Lukas Bulwahn , Matt Flax X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Export the regmap callbacks for indicating readable/volatile registers, also the range structure, in the CS42L42 core namespace. This is in advance of reusing these bits in a CS42L83 driver frontend. Signed-off-by: Martin PoviĊĦer --- sound/soc/codecs/cs42l42.c | 9 ++++++--- sound/soc/codecs/cs42l42.h | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index a22d84db356c..f7a4d51538dd 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -171,7 +171,7 @@ static const struct reg_default cs42l42_reg_defaults[] = { { CS42L42_ASP_RX_DAI1_CH2_BIT_LSB, 0x00 }, }; -static bool cs42l42_readable_register(struct device *dev, unsigned int reg) +bool cs42l42_readable_register(struct device *dev, unsigned int reg) { switch (reg) { case CS42L42_PAGE_REGISTER: @@ -330,8 +330,9 @@ static bool cs42l42_readable_register(struct device *dev, unsigned int reg) return false; } } +EXPORT_SYMBOL_NS_GPL(cs42l42_readable_register, SND_SOC_CS42L42_CORE); -static bool cs42l42_volatile_register(struct device *dev, unsigned int reg) +bool cs42l42_volatile_register(struct device *dev, unsigned int reg) { switch (reg) { case CS42L42_DEVID_AB: @@ -362,8 +363,9 @@ static bool cs42l42_volatile_register(struct device *dev, unsigned int reg) return false; } } +EXPORT_SYMBOL_NS_GPL(cs42l42_volatile_register, SND_SOC_CS42L42_CORE); -static const struct regmap_range_cfg cs42l42_page_range = { +const struct regmap_range_cfg cs42l42_page_range = { .name = "Pages", .range_min = 0, .range_max = CS42L42_MAX_REGISTER, @@ -373,6 +375,7 @@ static const struct regmap_range_cfg cs42l42_page_range = { .window_start = 0, .window_len = 256, }; +EXPORT_SYMBOL_NS_GPL(cs42l42_page_range, SND_SOC_CS42L42_CORE); const struct regmap_config cs42l42_regmap = { .reg_bits = 8, diff --git a/sound/soc/codecs/cs42l42.h b/sound/soc/codecs/cs42l42.h index 2a9f178f6190..be6f979c82ec 100644 --- a/sound/soc/codecs/cs42l42.h +++ b/sound/soc/codecs/cs42l42.h @@ -52,10 +52,14 @@ struct cs42l42_private { bool init_done; }; +extern const struct regmap_range_cfg cs42l42_page_range; extern const struct regmap_config cs42l42_regmap; extern const struct snd_soc_component_driver cs42l42_soc_component; 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_suspend(struct device *dev); int cs42l42_resume(struct device *dev); void cs42l42_resume_restore(struct device *dev);