From patchwork Thu Sep 15 09:44:41 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: 606684 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5A3AC6FA8B for ; Thu, 15 Sep 2022 09:46:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230006AbiIOJqM (ORCPT ); Thu, 15 Sep 2022 05:46:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230001AbiIOJpn (ORCPT ); Thu, 15 Sep 2022 05:45:43 -0400 Received: from hutie.ust.cz (hutie.ust.cz [185.8.165.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA7AF99B59; Thu, 15 Sep 2022 02:45:40 -0700 (PDT) From: =?utf-8?q?Martin_Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1663235136; bh=5iADcUyCkoKBLtPlXxKURQhY4TmQ9CXYiJ51cQuH6qI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ILCBgd+d2F1xL5yu8ExrZbyMrdANyfkHWDDq1OYbz9YKhvikJan6iTzh+1Qji5Z7x jEnAyyGRvAKxwoE+PdMbGByP02azv2pzva2VVwhm2zJmP8JGQ4cO4e9GPnxhxWNgKh 84TYPjlcgAAsejYG1goLel0jkxdD0OrBBH36NYBk= To: James Schulman , David Rhodes , Lucas Tanure , Richard Fitzgerald , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , =?utf-8?q?Martin_P?= =?utf-8?q?ovi=C5=A1er?= Cc: Charles Keepax , ChiYuan Huang , Matt Flax , Lukas Bulwahn , Pierre-Louis Bossart , - , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev Subject: [PATCH v2 08/11] ASoC: cs42l42: Export regmap elements to core namespace Date: Thu, 15 Sep 2022 11:44:41 +0200 Message-Id: <20220915094444.11434-9-povik+lin@cutebit.org> In-Reply-To: <20220915094444.11434-1-povik+lin@cutebit.org> References: <20220915094444.11434-1-povik+lin@cutebit.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Export the regmap callbacks for indicating readable/volatile registers, also the range structure, to 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 3ace16259d1a..7b9237f0ce78 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);