From patchwork Fri Sep 1 06:37:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9933581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B22806016C for ; Fri, 1 Sep 2017 06:38:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CB3428542 for ; Fri, 1 Sep 2017 06:38:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8ED1328546; Fri, 1 Sep 2017 06:38:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 966CA28542 for ; Fri, 1 Sep 2017 06:38:54 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5BA0A26765C; Fri, 1 Sep 2017 08:38:15 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1D16126765C; Fri, 1 Sep 2017 08:38:14 +0200 (CEST) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id 217BE267693 for ; Fri, 1 Sep 2017 08:37:41 +0200 (CEST) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie1.idc.renesas.com with ESMTP; 01 Sep 2017 15:37:40 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 26DAD6C9C0; Fri, 1 Sep 2017 15:37:40 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.41,456,1498489200"; d="scan'208";a="256614389" Received: from mail-hk2apc01lp0215.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.215]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 01 Sep 2017 15:37:39 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ozwQB9jTK6ONwcJxUlKutLTi2tgfHCoHZdBAamVvlmk=; b=fNY99FkuzqTOn5S2LeXlEsXRZ8ItAaA1SWz+Ee9qSETkko46Cd6b+JEy5C/QYGyPtq2szdfks55dghcTtwrCCCwBIXjsdr65dM8C2wC/h4zHfzbRmm3L69A0Dj++7o+lJLwn6rQGppxu8Ty2aOmk0XzqBmu3fHL82/JGTKJX8xk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.138) by HK2PR0601MB1876.apcprd06.prod.outlook.com (2603:1096:202:a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Fri, 1 Sep 2017 06:37:35 +0000 Message-ID: <87h8wnj5h3.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown In-Reply-To: <87r2vrj5lz.wl%kuninori.morimoto.gx@renesas.com> References: <873787ngjb.wl%kuninori.morimoto.gx@renesas.com> <87r2vrj5lz.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 1 Sep 2017 06:37:35 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: HK2PR02CA0164.apcprd02.prod.outlook.com (2603:1096:201:1f::24) To HK2PR0601MB1876.apcprd06.prod.outlook.com (2603:1096:202:a::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 01876eab-9eb1-4169-3038-08d4f103ef08 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HK2PR0601MB1876; X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1876; 3:MfAyJCMJSYLX4KhDwg4sQKH/0PnZmEI+6iST06rtNfcIwJ3S1QpOLEsJ2/v41ia4Yh40ChJ3JCbzukZjxJtA8eCYaxxoYkk8qzgHCzDfd/I6AJ7mploGEcX97MZZl+TkG0v8G5RUREQ/wbr7c0Qkp12ueMhPk7VMjHw07pieqKC0lRlbJy0/zGrSY/23qyqRDNTgWoCwBEhXaSb+cO/B17VxxeKIDLGWsSK2CQ0QMIjL6L4CCbX4gqeAYxPcTS5v; 25:jGSQrZhil4NXS3Wi8OPsbthsET5lmyvYbe3o7OXvqiiin1cK8EWjmLRKPY73ytm+3iszuI3NTwXb42yjq/bEFt0Mop1/yrYYTdJi33Wcb4uqYoa6TYtuoA0nYLXM2hu3v2pqld+l5fqwM7+oUOXHDzVNvZFU2hOT8Gt0wIwEot/OLuykszTxDofcFZVBOJrkCU5NBX9k1YfYe4rBJRNOWVjGtL4+EXXah14fKrkCDtR95xxvwD6DE6qAaynMvCRyLQTYK/eS8m/ycaFvlIF5zgtld75CvD0BL2I8FUKHadAr2X+94ZizNQyL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+AtfJr0NomNCxgbmXXytA2AprjH1mxwqgep1bdcNdHAT0rcKAxfpHXhGjNWCXuonv2I02g3vU+r8eFiGrW8= X-Exchange-Antispam-Report-Test: UriScan:(131327999870524); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123555025)(20161123562025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HK2PR0601MB1876; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HK2PR0601MB1876; X-Forefront-PRVS: 0417A3FFD2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(7370300001)(6009001)(39860400002)(189002)(199003)(288314003)(42186005)(4326008)(50466002)(53946003)(6916009)(3846002)(2950100002)(6116002)(86362001)(575784001)(105586002)(106356001)(2906002)(68736007)(83506001)(97736004)(4001350100001)(54906002)(36756003)(7736002)(69596002)(101416001)(5660300001)(47776003)(110136004)(66066001)(6486002)(305945005)(7350300001)(53936002)(25786009)(50986999)(189998001)(54356999)(76176999)(8676002)(23726003)(53416004)(478600001)(81166006)(81156014)(33646002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR0601MB1876; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR0601MB1876; 23:zr2S1ivoZIWxhY4MtPywO6ieu1sYhevpgx9gb84?= =?us-asc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Pk+cPmIyIUU7dYU8U=; 7:9T9Ure5/PONRX5Stv9OyJ8FzOMDKeuTAmnnyrG+Jst2MVDajaVg0Hz5x+TGy/YR+9AMKuHbRXl9t5pYhPTosAF9mtVoA8GgXD9tULI1JiyATLeQnyQA/bjr4Bn2PJfKuzTxDEt21Rvvf/cimgIk0jWJQRCM5rgLerJuDckiCQXV/CjVjrrWu5H41oPQk3AAeERqOYUAY5fuJDravBDI7ekz8gbCLMqJZNg8oM5SsVJk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1876; 20:zROQnOGnoYXAi5hFm6LvDP3OzcAaZaiuUzqw0ONYkgHGLpRxsIBAKeqnhNDtKnhSScyr2BV72v6NGQCaADOZHPy/ozAa037whgKKNQnf9sT1RV9u4QgIEhdrBwTQtENSXd1XVdbZDyYttwCKw4gUyiR7IOMhyFwxsI7v/DIrkao= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2017 06:37:35.9819 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR0601MB1876 Cc: Linux-ALSA , Lars-Peter Subject: [alsa-devel] [SAMPLE -/0] ASoC: remove Codec related code X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Now no one is using Codec related code. Let's remove all Signed-off-by: Kuninori Morimoto --- include/sound/soc.h | 259 ----------------------------------------- sound/soc/soc-core.c | 322 ++------------------------------------------------- sound/soc/soc-io.c | 58 ---------- sound/soc/soc-jack.c | 22 ---- sound/soc/soc-pcm.c | 5 - 5 files changed, 11 insertions(+), 655 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 6c10866..4f05b0e 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -402,8 +402,6 @@ enum snd_soc_bias_level { struct snd_soc_dai; struct snd_soc_dai_driver; struct snd_soc_dai_link; -struct snd_soc_codec; -struct snd_soc_codec_driver; struct snd_soc_component; struct snd_soc_component_driver; struct soc_enum; @@ -428,13 +426,6 @@ enum snd_soc_card_subclass { SND_SOC_CARD_CLASS_RUNTIME = 1, }; -int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, - int source, unsigned int freq, int dir); -int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, - unsigned int freq_in, unsigned int freq_out); -int snd_soc_codec_set_jack(struct snd_soc_codec *codec, - struct snd_soc_jack *jack, void *data); - int snd_soc_register_card(struct snd_soc_card *card); int snd_soc_unregister_card(struct snd_soc_card *card); int devm_snd_soc_register_card(struct device *dev, struct snd_soc_card *card); @@ -453,10 +444,6 @@ static inline int snd_soc_resume(struct device *dev) } #endif int snd_soc_poweroff(struct device *dev); -int snd_soc_register_codec(struct device *dev, - const struct snd_soc_codec_driver *codec_drv, - struct snd_soc_dai_driver *dai_drv, int num_dai); -void snd_soc_unregister_codec(struct device *dev); int snd_soc_add_component(struct device *dev, struct snd_soc_component *component, const struct snd_soc_component_driver *component_driver, @@ -557,23 +544,7 @@ static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, } #endif -/* codec register bit access */ -int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg, - unsigned int mask, unsigned int value); -int snd_soc_update_bits_locked(struct snd_soc_codec *codec, - unsigned int reg, unsigned int mask, - unsigned int value); -int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg, - unsigned int mask, unsigned int value); - #ifdef CONFIG_SND_SOC_AC97_BUS -#define snd_soc_alloc_ac97_codec(codec) \ - snd_soc_alloc_ac97_component(&codec->component) -#define snd_soc_new_ac97_codec(codec, id, id_mask) \ - snd_soc_new_ac97_component(&codec->component, id, id_mask) -#define snd_soc_free_ac97_codec(ac97) \ - snd_soc_free_ac97_component(ac97) - struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *component); struct snd_ac97 *snd_soc_new_ac97_component(struct snd_soc_component *component, unsigned int id, unsigned int id_mask); @@ -607,8 +578,6 @@ struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card, const char *name); int snd_soc_add_component_controls(struct snd_soc_component *component, const struct snd_kcontrol_new *controls, unsigned int num_controls); -int snd_soc_add_codec_controls(struct snd_soc_codec *codec, - const struct snd_kcontrol_new *controls, unsigned int num_controls); int snd_soc_add_card_controls(struct snd_soc_card *soc_card, const struct snd_kcontrol_new *controls, int num_controls); int snd_soc_add_dai_controls(struct snd_soc_dai *dai, @@ -838,8 +807,6 @@ struct snd_soc_component { unsigned int active; - unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */ - unsigned int registered_as_component:1; unsigned int suspended:1; /* is in suspend PM state */ struct list_head list; @@ -874,22 +841,6 @@ struct snd_soc_component { /* Don't use these, use snd_soc_component_get_dapm() */ struct snd_soc_dapm_context dapm; - struct snd_soc_codec *codec; - - int (*probe)(struct snd_soc_component *); - void (*remove)(struct snd_soc_component *); - int (*suspend)(struct snd_soc_component *); - int (*resume)(struct snd_soc_component *); - - int (*set_sysclk)(struct snd_soc_component *component, - int clk_id, int source, unsigned int freq, int dir); - int (*set_pll)(struct snd_soc_component *component, int pll_id, - int source, unsigned int freq_in, unsigned int freq_out); - int (*set_jack)(struct snd_soc_component *component, - struct snd_soc_jack *jack, void *data); - int (*set_bias_level)(struct snd_soc_component *component, - enum snd_soc_bias_level level); - /* machine specific init */ int (*init)(struct snd_soc_component *component); }; @@ -906,47 +857,6 @@ struct snd_soc_component* #define for_each_rtdcom_safe(rtd, rtdcom1, rtdcom2) \ list_for_each_entry_safe(rtdcom1, rtdcom2, &(rtd)->component_list, list) -/* SoC Audio Codec device */ -struct snd_soc_codec { - struct device *dev; - const struct snd_soc_codec_driver *driver; - - struct list_head list; - - /* component */ - struct snd_soc_component component; -}; - -/* codec driver */ -struct snd_soc_codec_driver { - - /* driver ops */ - int (*probe)(struct snd_soc_codec *); - int (*remove)(struct snd_soc_codec *); - int (*suspend)(struct snd_soc_codec *); - int (*resume)(struct snd_soc_codec *); - struct snd_soc_component_driver component_driver; - - /* codec wide operations */ - int (*set_sysclk)(struct snd_soc_codec *codec, - int clk_id, int source, unsigned int freq, int dir); - int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source, - unsigned int freq_in, unsigned int freq_out); - int (*set_jack)(struct snd_soc_codec *codec, - struct snd_soc_jack *jack, void *data); - - /* codec bias level */ - int (*set_bias_level)(struct snd_soc_codec *, - enum snd_soc_bias_level level); - bool idle_bias_off; - bool suspend_bias_off; - - void (*seq_notifier)(struct snd_soc_dapm_context *, - enum snd_soc_dapm_type, int); - - bool ignore_pmdown_time; /* Doesn't benefit from pmdown delay */ -}; - struct snd_soc_dai_link_component { const char *name; struct device_node *of_node; @@ -1200,7 +1110,6 @@ struct snd_soc_pcm_runtime { /* runtime devices */ struct snd_pcm *pcm; struct snd_compr *compr; - struct snd_soc_codec *codec; struct snd_soc_dai *codec_dai; struct snd_soc_dai *cpu_dai; @@ -1269,19 +1178,6 @@ struct soc_enum { }; /** - * snd_soc_component_to_codec() - Casts a component to the CODEC it is embedded in - * @component: The component to cast to a CODEC - * - * This function must only be used on components that are known to be CODECs. - * Otherwise the behavior is undefined. - */ -static inline struct snd_soc_codec *snd_soc_component_to_codec( - struct snd_soc_component *component) -{ - return container_of(component, struct snd_soc_codec, component); -} - -/** * snd_soc_dapm_to_component() - Casts a DAPM context to the component it is * embedded in * @dapm: The DAPM context to cast to the component @@ -1297,19 +1193,6 @@ static inline struct snd_soc_component *snd_soc_dapm_to_component( } /** - * snd_soc_dapm_to_codec() - Casts a DAPM context to the CODEC it is embedded in - * @dapm: The DAPM context to cast to the CODEC - * - * This function must only be used on DAPM contexts that are known to be part of - * a CODEC (e.g. in a CODEC driver). Otherwise the behavior is undefined. - */ -static inline struct snd_soc_codec *snd_soc_dapm_to_codec( - struct snd_soc_dapm_context *dapm) -{ - return snd_soc_component_to_codec(snd_soc_dapm_to_component(dapm)); -} - -/** * snd_soc_component_get_dapm() - Returns the DAPM context associated with a * component * @component: The component for which to get the DAPM context @@ -1321,31 +1204,6 @@ static inline struct snd_soc_dapm_context *snd_soc_component_get_dapm( } /** - * snd_soc_codec_get_dapm() - Returns the DAPM context for the CODEC - * @codec: The CODEC for which to get the DAPM context - * - * Note: Use this function instead of directly accessing the CODEC's dapm field - */ -static inline struct snd_soc_dapm_context *snd_soc_codec_get_dapm( - struct snd_soc_codec *codec) -{ - return snd_soc_component_get_dapm(&codec->component); -} - -/** - * snd_soc_dapm_init_bias_level() - Initialize CODEC DAPM bias level - * @codec: The CODEC for which to initialize the DAPM bias level - * @level: The DAPM level to initialize to - * - * Initializes the CODEC DAPM bias level. See snd_soc_dapm_init_bias_level(). - */ -static inline void snd_soc_codec_init_bias_level(struct snd_soc_codec *codec, - enum snd_soc_bias_level level) -{ - snd_soc_dapm_init_bias_level(snd_soc_codec_get_dapm(codec), level); -} - -/** * snd_soc_component_init_bias_level() - Initialize COMPONENT DAPM bias level * @component: The COMPONENT for which to initialize the DAPM bias level * @level: The DAPM level to initialize to @@ -1361,18 +1219,6 @@ static inline void snd_soc_codec_init_bias_level(struct snd_soc_codec *codec, } /** - * snd_soc_dapm_get_bias_level() - Get current CODEC DAPM bias level - * @codec: The CODEC for which to get the DAPM bias level - * - * Returns: The current DAPM bias level of the CODEC. - */ -static inline enum snd_soc_bias_level snd_soc_codec_get_bias_level( - struct snd_soc_codec *codec) -{ - return snd_soc_dapm_get_bias_level(snd_soc_codec_get_dapm(codec)); -} - -/** * snd_soc_component_get_bias_level() - Get current COMPONENT DAPM bias level * @component: The COMPONENT for which to get the DAPM bias level * @@ -1386,21 +1232,6 @@ static inline enum snd_soc_bias_level snd_soc_codec_get_bias_level( } /** - * snd_soc_codec_force_bias_level() - Set the CODEC DAPM bias level - * @codec: The CODEC for which to set the level - * @level: The level to set to - * - * Forces the CODEC bias level to a specific state. See - * snd_soc_dapm_force_bias_level(). - */ -static inline int snd_soc_codec_force_bias_level(struct snd_soc_codec *codec, - enum snd_soc_bias_level level) -{ - return snd_soc_dapm_force_bias_level(snd_soc_codec_get_dapm(codec), - level); -} - -/** * snd_soc_component_force_bias_level() - Set the COMPONENT DAPM bias level * @component: The COMPONENT for which to set the level * @level: The level to set to @@ -1418,19 +1249,6 @@ static inline int snd_soc_codec_force_bias_level(struct snd_soc_codec *codec, } /** - * snd_soc_dapm_kcontrol_codec() - Returns the codec associated to a kcontrol - * @kcontrol: The kcontrol - * - * This function must only be used on DAPM contexts that are known to be part of - * a CODEC (e.g. in a CODEC driver). Otherwise the behavior is undefined. - */ -static inline struct snd_soc_codec *snd_soc_dapm_kcontrol_codec( - struct snd_kcontrol *kcontrol) -{ - return snd_soc_dapm_to_codec(snd_soc_dapm_kcontrol_dapm(kcontrol)); -} - -/** * snd_soc_dapm_kcontrol_component() - Returns the component associated to a kcontrol * @kcontrol: The kcontrol * @@ -1443,22 +1261,6 @@ static inline struct snd_soc_component *snd_soc_dapm_kcontrol_component( return snd_soc_dapm_to_component(snd_soc_dapm_kcontrol_dapm(kcontrol)); } -/* codec IO */ -unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); -int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg, - unsigned int val); - -/** - * snd_soc_cache_sync() - Sync the register cache with the hardware - * @codec: CODEC to sync - * - * Note: This function will call regcache_sync() - */ -static inline int snd_soc_cache_sync(struct snd_soc_codec *codec) -{ - return regcache_sync(codec->component.regmap); -} - /** * snd_soc_component_cache_sync() - Sync the register cache with the hardware * @component: COMPONENT to sync @@ -1501,37 +1303,6 @@ void snd_soc_component_init_regmap(struct snd_soc_component *component, struct regmap *regmap); void snd_soc_component_exit_regmap(struct snd_soc_component *component); -/** - * snd_soc_codec_init_regmap() - Initialize regmap instance for the CODEC - * @codec: The CODEC for which to initialize the regmap instance - * @regmap: The regmap instance that should be used by the CODEC - * - * This function allows deferred assignment of the regmap instance that is - * associated with the CODEC. Only use this if the regmap instance is not yet - * ready when the CODEC is registered. The function must also be called before - * the first IO attempt of the CODEC. - */ -static inline void snd_soc_codec_init_regmap(struct snd_soc_codec *codec, - struct regmap *regmap) -{ - snd_soc_component_init_regmap(&codec->component, regmap); -} - -/** - * snd_soc_codec_exit_regmap() - De-initialize regmap instance for the CODEC - * @codec: The CODEC for which to de-initialize the regmap instance - * - * Calls regmap_exit() on the regmap instance associated to the CODEC and - * removes the regmap instance from the CODEC. - * - * This function should only be used if snd_soc_codec_init_regmap() was used to - * initialize the regmap instance. - */ -static inline void snd_soc_codec_exit_regmap(struct snd_soc_codec *codec) -{ - snd_soc_component_exit_regmap(&codec->component); -} - #endif /* device driver data */ @@ -1558,17 +1329,6 @@ static inline void *snd_soc_component_get_drvdata(struct snd_soc_component *c) return dev_get_drvdata(c->dev); } -static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec, - void *data) -{ - snd_soc_component_set_drvdata(&codec->component, data); -} - -static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec) -{ - return snd_soc_component_get_drvdata(&codec->component); -} - static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) { INIT_LIST_HEAD(&card->widgets); @@ -1620,11 +1380,6 @@ static inline bool snd_soc_component_is_active( return component->active != 0; } -static inline bool snd_soc_codec_is_active(struct snd_soc_codec *codec) -{ - return snd_soc_component_is_active(&codec->component); -} - /** * snd_soc_kcontrol_component() - Returns the component that registered the * control @@ -1641,20 +1396,6 @@ static inline struct snd_soc_component *snd_soc_kcontrol_component( return snd_kcontrol_chip(kcontrol); } -/** - * snd_soc_kcontrol_codec() - Returns the CODEC that registered the control - * @kcontrol: The control for which to get the CODEC - * - * Note: This function will only work correctly if the control has been - * registered with snd_soc_add_codec_controls() or via table based setup of - * snd_soc_codec_driver. Otherwise the behavior is undefined. - */ -static inline struct snd_soc_codec *snd_soc_kcontrol_codec( - struct snd_kcontrol *kcontrol) -{ - return snd_soc_component_to_codec(snd_soc_kcontrol_component(kcontrol)); -} - int snd_soc_util_init(void); void snd_soc_util_exit(void); diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f2e669a..19f6d07 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -56,7 +56,6 @@ #endif static DEFINE_MUTEX(client_mutex); -static LIST_HEAD(codec_list); static LIST_HEAD(component_list); /* @@ -162,44 +161,6 @@ static void soc_cleanup_component_debugfs(struct snd_soc_component *component) debugfs_remove_recursive(component->debugfs_root); } -static ssize_t codec_list_read_file(struct file *file, char __user *user_buf, - size_t count, loff_t *ppos) -{ - char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL); - ssize_t len, ret = 0; - struct snd_soc_codec *codec; - - if (!buf) - return -ENOMEM; - - mutex_lock(&client_mutex); - - list_for_each_entry(codec, &codec_list, list) { - len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n", - codec->component.name); - if (len >= 0) - ret += len; - if (ret > PAGE_SIZE) { - ret = PAGE_SIZE; - break; - } - } - - mutex_unlock(&client_mutex); - - if (ret >= 0) - ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret); - - kfree(buf); - - return ret; -} - -static const struct file_operations codec_list_fops = { - .read = codec_list_read_file, - .llseek = default_llseek,/* read accesses f_pos */ -}; - static ssize_t dai_list_read_file(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { @@ -314,10 +275,6 @@ static void snd_soc_debugfs_init(void) return; } - if (!debugfs_create_file("codecs", 0444, snd_soc_debugfs_root, NULL, - &codec_list_fops)) - pr_warn("ASoC: Failed to create CODEC list debugfs file\n"); - if (!debugfs_create_file("dais", 0444, snd_soc_debugfs_root, NULL, &dai_list_fops)) pr_warn("ASoC: Failed to create DAI list debugfs file\n"); @@ -602,8 +559,8 @@ int snd_soc_suspend(struct device *dev) } case SND_SOC_BIAS_OFF: - if (component->suspend) - component->suspend(component); + if (component->driver->suspend) + component->driver->suspend(component); component->suspended = 1; if (component->regmap) regcache_mark_dirty(component->regmap); @@ -674,8 +631,8 @@ static void soc_resume_deferred(struct work_struct *work) list_for_each_entry(component, &card->component_dev_list, card_list) { if (component->suspended) { - if (component->resume) - component->resume(component); + if (component->driver->resume) + component->driver->resume(component); component->suspended = 0; } } @@ -958,7 +915,6 @@ static int soc_bind_dai_link(struct snd_soc_card *card, /* Single codec links expect codec and codec_dai in runtime data */ rtd->codec_dai = codec_dais[0]; - rtd->codec = rtd->codec_dai->codec; /* if there's no platform we match on the empty platform */ platform_name = dai_link->platform_name; @@ -997,8 +953,8 @@ static void soc_remove_component(struct snd_soc_component *component) list_del(&component->card_list); - if (component->remove) - component->remove(component); + if (component->driver->remove) + component->driver->remove(component); snd_soc_dapm_free(snd_soc_component_get_dapm(component)); @@ -1321,8 +1277,8 @@ static int soc_probe_component(struct snd_soc_card *card, } } - if (component->probe) { - ret = component->probe(component); + if (component->driver->probe) { + ret = component->driver->probe(component); if (ret < 0) { dev_err(component->dev, "ASoC: failed to probe component %d\n", ret); @@ -2306,25 +2262,6 @@ int snd_soc_add_component_controls(struct snd_soc_component *component, EXPORT_SYMBOL_GPL(snd_soc_add_component_controls); /** - * snd_soc_add_codec_controls - add an array of controls to a codec. - * Convenience function to add a list of controls. Many codecs were - * duplicating this code. - * - * @codec: codec to add controls to - * @controls: array of controls to add - * @num_controls: number of elements in the array - * - * Return 0 for success, else error. - */ -int snd_soc_add_codec_controls(struct snd_soc_codec *codec, - const struct snd_kcontrol_new *controls, unsigned int num_controls) -{ - return snd_soc_add_component_controls(&codec->component, controls, - num_controls); -} -EXPORT_SYMBOL_GPL(snd_soc_add_codec_controls); - -/** * snd_soc_add_card_controls - add an array of controls to a SoC card. * Convenience function to add a list of controls. * @@ -2385,27 +2322,6 @@ int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, EXPORT_SYMBOL_GPL(snd_soc_dai_set_sysclk); /** - * snd_soc_codec_set_sysclk - configure CODEC system or master clock. - * @codec: CODEC - * @clk_id: DAI specific clock ID - * @source: Source for the clock - * @freq: new clock frequency in Hz - * @dir: new clock direction - input/output. - * - * Configures the CODEC master (MCLK) or system (SYSCLK) clocking. - */ -int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, - int source, unsigned int freq, int dir) -{ - if (codec->driver->set_sysclk) - return codec->driver->set_sysclk(codec, clk_id, source, - freq, dir); - else - return -ENOTSUPP; -} -EXPORT_SYMBOL_GPL(snd_soc_codec_set_sysclk); - -/** * snd_soc_component_set_sysclk - configure COMPONENT system or master clock. * @component: COMPONENT * @clk_id: DAI specific clock ID @@ -2419,8 +2335,8 @@ int snd_soc_component_set_sysclk(struct snd_soc_component *component, int clk_id int source, unsigned int freq, int dir) { /* will be removed */ - if (component->set_sysclk) - return component->set_sysclk(component, clk_id, source, + if (component->driver->set_sysclk) + return component->driver->set_sysclk(component, clk_id, source, freq, dir); if (component->driver->set_sysclk) @@ -2474,27 +2390,6 @@ int snd_soc_dai_set_pll(struct snd_soc_dai *dai, int pll_id, int source, EXPORT_SYMBOL_GPL(snd_soc_dai_set_pll); /* - * snd_soc_codec_set_pll - configure codec PLL. - * @codec: CODEC - * @pll_id: DAI specific PLL ID - * @source: DAI specific source for the PLL - * @freq_in: PLL input clock frequency in Hz - * @freq_out: requested PLL output clock frequency in Hz - * - * Configures and enables PLL to generate output clock based on input clock. - */ -int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, - unsigned int freq_in, unsigned int freq_out) -{ - if (codec->driver->set_pll) - return codec->driver->set_pll(codec, pll_id, source, - freq_in, freq_out); - else - return -EINVAL; -} -EXPORT_SYMBOL_GPL(snd_soc_codec_set_pll); - -/* * snd_soc_component_set_pll - configure component PLL. * @component: COMPONENT * @pll_id: DAI specific PLL ID @@ -2508,11 +2403,6 @@ int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id, int source, unsigned int freq_in, unsigned int freq_out) { - /* will be removed */ - if (component->set_pll) - return component->set_pll(component, pll_id, source, - freq_in, freq_out); - if (component->driver->set_pll) return component->driver->set_pll(component, pll_id, source, freq_in, freq_out); @@ -3015,13 +2905,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, component->dev = dev; component->driver = driver; - component->probe = component->driver->probe; - component->remove = component->driver->remove; - component->suspend = component->driver->suspend; - component->resume = component->driver->resume; - component->set_sysclk = component->driver->set_sysclk; - component->set_pll = component->driver->set_pll; - component->set_jack = component->driver->set_jack; dapm = snd_soc_component_get_dapm(component); dapm->dev = dev; @@ -3172,9 +3055,6 @@ int snd_soc_add_component(struct device *dev, if (ret) goto err_free; - component->ignore_pmdown_time = true; - component->registered_as_component = true; - if (component_driver->endianness) { for (i = 0; i < num_dai; i++) { convert_endianness_formats(&dai_drv[i].playback); @@ -3232,8 +3112,7 @@ static int __snd_soc_unregister_component(struct device *dev) mutex_lock(&client_mutex); list_for_each_entry(component, &component_list, list) { - if (dev != component->dev || - !component->registered_as_component) + if (dev != component->dev) continue; snd_soc_tplg_component_remove(component, SND_SOC_TPLG_INDEX_ALL); @@ -3283,185 +3162,6 @@ struct snd_soc_component *snd_soc_lookup_component(struct device *dev, } EXPORT_SYMBOL_GPL(snd_soc_lookup_component); -static int snd_soc_codec_drv_probe(struct snd_soc_component *component) -{ - struct snd_soc_codec *codec = snd_soc_component_to_codec(component); - - return codec->driver->probe(codec); -} - -static void snd_soc_codec_drv_remove(struct snd_soc_component *component) -{ - struct snd_soc_codec *codec = snd_soc_component_to_codec(component); - - codec->driver->remove(codec); -} - -static int snd_soc_codec_drv_suspend(struct snd_soc_component *component) -{ - struct snd_soc_codec *codec = snd_soc_component_to_codec(component); - - return codec->driver->suspend(codec); -} - -static int snd_soc_codec_drv_resume(struct snd_soc_component *component) -{ - struct snd_soc_codec *codec = snd_soc_component_to_codec(component); - - return codec->driver->resume(codec); -} - -static int snd_soc_codec_set_sysclk_(struct snd_soc_component *component, - int clk_id, int source, unsigned int freq, int dir) -{ - struct snd_soc_codec *codec = snd_soc_component_to_codec(component); - - return snd_soc_codec_set_sysclk(codec, clk_id, source, freq, dir); -} - -static int snd_soc_codec_set_pll_(struct snd_soc_component *component, - int pll_id, int source, unsigned int freq_in, - unsigned int freq_out) -{ - struct snd_soc_codec *codec = snd_soc_component_to_codec(component); - - return snd_soc_codec_set_pll(codec, pll_id, source, freq_in, freq_out); -} - -static int snd_soc_codec_set_jack_(struct snd_soc_component *component, - struct snd_soc_jack *jack, void *data) -{ - struct snd_soc_codec *codec = snd_soc_component_to_codec(component); - - return snd_soc_codec_set_jack(codec, jack, data); -} - -static int snd_soc_codec_set_bias_level(struct snd_soc_dapm_context *dapm, - enum snd_soc_bias_level level) -{ - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm); - - return codec->driver->set_bias_level(codec, level); -} - -/** - * snd_soc_register_codec - Register a codec with the ASoC core - * - * @dev: The parent device for this codec - * @codec_drv: Codec driver - * @dai_drv: The associated DAI driver - * @num_dai: Number of DAIs - */ -int snd_soc_register_codec(struct device *dev, - const struct snd_soc_codec_driver *codec_drv, - struct snd_soc_dai_driver *dai_drv, - int num_dai) -{ - struct snd_soc_dapm_context *dapm; - struct snd_soc_codec *codec; - struct snd_soc_dai *dai; - int ret, i; - - dev_dbg(dev, "codec register %s\n", dev_name(dev)); - - codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); - if (codec == NULL) - return -ENOMEM; - - codec->component.codec = codec; - - ret = snd_soc_component_initialize(&codec->component, - &codec_drv->component_driver, dev); - if (ret) - goto err_free; - - if (codec_drv->probe) - codec->component.probe = snd_soc_codec_drv_probe; - if (codec_drv->remove) - codec->component.remove = snd_soc_codec_drv_remove; - if (codec_drv->suspend) - codec->component.suspend = snd_soc_codec_drv_suspend; - if (codec_drv->resume) - codec->component.resume = snd_soc_codec_drv_resume; - if (codec_drv->set_sysclk) - codec->component.set_sysclk = snd_soc_codec_set_sysclk_; - if (codec_drv->set_pll) - codec->component.set_pll = snd_soc_codec_set_pll_; - if (codec_drv->set_jack) - codec->component.set_jack = snd_soc_codec_set_jack_; - codec->component.ignore_pmdown_time = codec_drv->ignore_pmdown_time; - - dapm = snd_soc_codec_get_dapm(codec); - dapm->idle_bias_off = codec_drv->idle_bias_off; - dapm->suspend_bias_off = codec_drv->suspend_bias_off; - if (codec_drv->seq_notifier) - dapm->seq_notifier = codec_drv->seq_notifier; - if (codec_drv->set_bias_level) - dapm->set_bias_level = snd_soc_codec_set_bias_level; - codec->dev = dev; - codec->driver = codec_drv; - - for (i = 0; i < num_dai; i++) { - convert_endianness_formats(&dai_drv[i].playback); - convert_endianness_formats(&dai_drv[i].capture); - } - - ret = snd_soc_register_dais(&codec->component, dai_drv, num_dai, false); - if (ret < 0) { - dev_err(dev, "ASoC: Failed to register DAIs: %d\n", ret); - goto err_cleanup; - } - - list_for_each_entry(dai, &codec->component.dai_list, list) - dai->codec = codec; - - mutex_lock(&client_mutex); - snd_soc_component_add_unlocked(&codec->component); - list_add(&codec->list, &codec_list); - mutex_unlock(&client_mutex); - - dev_dbg(codec->dev, "ASoC: Registered codec '%s'\n", - codec->component.name); - return 0; - -err_cleanup: - snd_soc_component_cleanup(&codec->component); -err_free: - kfree(codec); - return ret; -} -EXPORT_SYMBOL_GPL(snd_soc_register_codec); - -/** - * snd_soc_unregister_codec - Unregister a codec from the ASoC core - * - * @dev: codec to unregister - */ -void snd_soc_unregister_codec(struct device *dev) -{ - struct snd_soc_codec *codec; - - mutex_lock(&client_mutex); - list_for_each_entry(codec, &codec_list, list) { - if (dev == codec->dev) - goto found; - } - mutex_unlock(&client_mutex); - return; - -found: - list_del(&codec->list); - snd_soc_component_del_unlocked(&codec->component); - mutex_unlock(&client_mutex); - - dev_dbg(codec->dev, "ASoC: Unregistered codec '%s'\n", - codec->component.name); - - snd_soc_component_cleanup(&codec->component); - kfree(codec); -} -EXPORT_SYMBOL_GPL(snd_soc_unregister_codec); - /* Retrieve a card's name from device tree */ int snd_soc_of_parse_card_name(struct snd_soc_card *card, const char *propname) diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c index 508b297..1c9e716 100644 --- a/sound/soc/soc-io.c +++ b/sound/soc/soc-io.c @@ -177,61 +177,3 @@ int snd_soc_component_test_bits(struct snd_soc_component *component, return old != new; } EXPORT_SYMBOL_GPL(snd_soc_component_test_bits); - -unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg) -{ - unsigned int val; - int ret; - - ret = snd_soc_component_read(&codec->component, reg, &val); - if (ret < 0) - return -1; - - return val; -} -EXPORT_SYMBOL_GPL(snd_soc_read); - -int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg, - unsigned int val) -{ - return snd_soc_component_write(&codec->component, reg, val); -} -EXPORT_SYMBOL_GPL(snd_soc_write); - -/** - * snd_soc_update_bits - update codec register bits - * @codec: audio codec - * @reg: codec register - * @mask: register mask - * @value: new value - * - * Writes new register value. - * - * Returns 1 for change, 0 for no change, or negative error code. - */ -int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg, - unsigned int mask, unsigned int value) -{ - return snd_soc_component_update_bits(&codec->component, reg, mask, - value); -} -EXPORT_SYMBOL_GPL(snd_soc_update_bits); - -/** - * snd_soc_test_bits - test register for change - * @codec: audio codec - * @reg: codec register - * @mask: register mask - * @value: new value - * - * Tests a register with a new value and checks if the new value is - * different from the old value. - * - * Returns 1 for change else 0. - */ -int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg, - unsigned int mask, unsigned int value) -{ - return snd_soc_component_test_bits(&codec->component, reg, mask, value); -} -EXPORT_SYMBOL_GPL(snd_soc_test_bits); diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index 99902ae1..b2b16044 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c @@ -29,24 +29,6 @@ struct jack_gpio_tbl { }; /** - * snd_soc_codec_set_jack - configure codec jack. - * @codec: CODEC - * @jack: structure to use for the jack - * @data: can be used if codec driver need extra data for configuring jack - * - * Configures and enables jack detection function. - */ -int snd_soc_codec_set_jack(struct snd_soc_codec *codec, - struct snd_soc_jack *jack, void *data) -{ - if (codec->driver->set_jack) - return codec->driver->set_jack(codec, jack, data); - else - return -ENOTSUPP; -} -EXPORT_SYMBOL_GPL(snd_soc_codec_set_jack); - -/** * snd_soc_component_set_jack - configure component jack. * @component: COMPONENTs * @jack: structure to use for the jack @@ -57,10 +39,6 @@ int snd_soc_codec_set_jack(struct snd_soc_codec *codec, int snd_soc_component_set_jack(struct snd_soc_component *component, struct snd_soc_jack *jack, void *data) { - /* will be removed */ - if (component->set_jack) - return component->set_jack(component, jack, data); - if (component->driver->set_jack) return component->driver->set_jack(component, jack, data); diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 500063e..fa45188 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -135,7 +135,6 @@ bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_rtdcom_list *rtdcom; struct snd_soc_component *component; - int i; bool ignore = true; if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time) @@ -147,10 +146,6 @@ bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd) ignore &= !component->driver->pmdown_time; } - /* this will be removed */ - for (i = 0; i < rtd->num_codecs; i++) - ignore &= rtd->codec_dais[i]->component->ignore_pmdown_time; - return ignore; }