From patchwork Mon Apr 9 02:15:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10329741 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 512A5604D4 for ; Mon, 9 Apr 2018 02:16:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F23C2882A for ; Mon, 9 Apr 2018 02:16:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33BEE28893; Mon, 9 Apr 2018 02:16:18 +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=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham 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 E1E302882A for ; Mon, 9 Apr 2018 02:16:15 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AB2D82673E8; Mon, 9 Apr 2018 04:16:14 +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 7391D2673E8; Mon, 9 Apr 2018 04:16:12 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 42BBC2673F0 for ; Mon, 9 Apr 2018 04:16:01 +0200 (CEST) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 09 Apr 2018 11:15:59 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id EE4DD6F5AD; Mon, 9 Apr 2018 11:15:59 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.48,426,1517842800"; d="scan'208";a="276198890" Received: from mail-pu1apc01lp0024.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.24]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-GCM-SHA384; 09 Apr 2018 11:15:59 +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=scmj2tgxaWS3puZ0DqOk+FvGdeFkjWyME3HhdTXjW1w=; b=WuzLvZVo2q3mbnEHtoodPgra/YScLUgi9SeWiNvns4SKrlu0eYEbltQSN4rvmRbTtBJafcTWKxzdGFGsgsKwc0ZvRCnH/7Mnn/yCwGp+G1V73KZVDZ2tDpToK5H9RU+rMGPl4Mc3mtLcA1M7tgQz2L22sIUu4gZz191WeiZIx04= 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 TY2PR01MB2076.jpnprd01.prod.outlook.com (2603:1096:404:e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Mon, 9 Apr 2018 02:15:57 +0000 Message-ID: <87fu45f7pv.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Mark Brown In-Reply-To: <87muydf7t2.wl%kuninori.morimoto.gx@renesas.com> References: <87muydf7t2.wl%kuninori.morimoto.gx@renesas.com> Date: Mon, 9 Apr 2018 02:15:57 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: PS1PR0601CA0087.apcprd06.prod.outlook.com (2603:1096:803:1::13) To TY2PR01MB2076.jpnprd01.prod.outlook.com (2603:1096:404:e::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b622879c-e779-479e-9270-08d59dbfd4b7 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:TY2PR01MB2076; X-Microsoft-Exchange-Diagnostics: 1; TY2PR01MB2076; 3:iE8tq6C/Zo8htANYKga7HyjercuSwvXgDRpE9k4xiulpeCZE4j7J1xI5gNGTj/t/p9SvwCggkqYAxmUuUyGvchUeU7goPkYXBW9+Y+6OWAEiO0unlIOtBiHzOMJfao+lm9G5sL4RbkWU6eZ3DnlvJw77qj0Dvr8nJtTNY12UMGRvizTIAXaT/4yOhQbbTH9xeXj8h264U95Sb4C6h+H5jEZ0yoWt4Q40fT9SipyDbLB0VzhMzLVcBGTMC1TiiC0o; 25:88uUodJQRGacr7ALI7Ox26tUysYe0j7+prkEX9d4EU1xz5vxwUSP9P8Wpzy4QR+SZaosMytTM8aQWDb3J47JfBJZAKGU/Pxv5keTuHnUVchW+URyijqtKj49S35smDrCnPXeTUz8TH5cOqa+l/5qAUbpy1uB02zOM2ARr3Y6Jvi/sL+xJB+Q6vv19gHAndotuwnH4M5UMFCphU7nhID3JBMWb2TcGjG9JiG1sGbZ1LY3J2FkLTy1G1PbLq17XzRIn+/Wow5bx042hfURXdMUGGXVek3BJiCvj2KIolDDXAeSagjEwxsivwyZHF1x5wCYXFB4NrOQgLvlTQHR+H6AQQ==; 31:nxRTZ/Rwc+pHizhGCJYL5f+Z4vr5wNcqqTgoQgDViJY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3uWtQuyusiSz2fKKGia1NtFz X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(131327999870524); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231221)(944501327)(52105095)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:TY2PR01MB2076; BCL:0; PCL:0; RULEID:; SRVR:TY2PR01MB2076; X-Forefront-PRVS: 0637FCE711 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(376002)(39860400002)(346002)(366004)(39380400002)(396003)(189003)(199004)(288314003)(66066001)(6486002)(25786009)(186003)(47776003)(53936002)(4326008)(26005)(5660300001)(16586007)(316002)(58126008)(3846002)(36756003)(45080400002)(478600001)(486006)(86362001)(6116002)(53946003)(52116002)(76176011)(7736002)(386003)(81156014)(81166006)(8676002)(305945005)(105586002)(23726003)(106356001)(7696005)(2616005)(476003)(956004)(11346002)(446003)(2906002)(16526019)(6916009)(53416004)(68736007)(59450400001)(69596002)(50466002)(97736004)(8936002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:TY2PR01MB2076; H:morimoto-PC.renesas.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; TY2PR01MB2076; 23:Lwld5qV+8wUa04Rc8QiRbcyIYp9tfJSqL6DAkV5am?= =?us-ascii?Q?Np3QQLBar3t9mki/6MR/89zMN0GcI1odZrJ4KN2WKnBhLGGc0+P1bhqeDgIo?= =?us-ascii?Q?nwkLzO7EG6L7LshtdIDkhU1cTaaXWvP/Sv/JMMBOK0pL70nIlFQfwuhVwcLn?= =?us-ascii?Q?9fS4HVk6t54BKkSekrk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/8WtbfdSdCyKXK/eHO/3OpR+cJ4gYL0qQcppuhtjmx1+7hH9ezRicjs3oqbd2TDC4Bz55YcEy4rii/jnYdfF6sJe2vBB3/T8hAxDfGmcimh2LRxh6y5trasiEkMKU=; 24:dpDm5Co+mhzsByOTwMdvFfO9fvCVOWMeqeiSuisX7EkrbJYluJhr1ZN3Km7Ro0v905eFKZUl9WdXWbI8s9VLumW+dV5PTc3jhm7MkpVv+rw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; TY2PR01MB2076; 7:/j4J4TrhGh5I5Ax1xzMVz0Wne9NqLiCJOe/sm8RqcvWUbrkN8NzulD1qrilPtG+aYc+oORJ88FZUPhXplxD4RZxem2eP0QjyAmdl+lpQzWF7hWybHk1HOHllRJIynaXOsezSTXFdMVmB5Y+4Iy3qG9CFigPMRaZ/W+9nMDccdP+olq5r3MGiMKH/BM/jX54dixbo4pKz1hKs9hszqDsb8qWWtUGbyn1Z1U+/wPPWSGuZ9K6i/55eUd1g/p49Shd2; 20:nJdIYBoIYW1VmnUJD0ytpiIJKWgq/v/Op6sTQrJGFLWUT7ixQ8YE5Jj/isMC2trevnOR/SObwxhUJGRPYxmxaIQ/zDMuNNeEGmlVF6qMZ/5adlegmgqjB5QwCVuDTJgrCBr5DU0XNqBfr+qsmv4O5jHzX10iIB5Vu3P+0vwfd0A= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2018 02:15:57.1845 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b622879c-e779-479e-9270-08d59dbfd4b7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB2076 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 5/5][RFC] 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-dai.h | 1 - include/sound/soc.h | 265 -------------------------------------- sound/soc/soc-core.c | 331 ++---------------------------------------------- sound/soc/soc-io.c | 62 --------- sound/soc/soc-jack.c | 22 ---- sound/soc/soc-pcm.c | 5 - 6 files changed, 11 insertions(+), 675 deletions(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 8ad1166..9449525 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -313,7 +313,6 @@ struct snd_soc_dai { unsigned int sample_bits; /* parent platform/codec */ - struct snd_soc_codec *codec; struct snd_soc_component *component; /* CODEC TDM slot masks and params (for fixup) */ diff --git a/include/sound/soc.h b/include/sound/soc.h index e20eed3..b1bba9a 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, @@ -559,23 +546,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); @@ -609,8 +580,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, @@ -843,8 +812,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; @@ -856,9 +823,6 @@ struct snd_soc_component { struct list_head dai_list; int num_dai; - int (*read)(struct snd_soc_component *, unsigned int, unsigned int *); - int (*write)(struct snd_soc_component *, unsigned int, unsigned int); - struct regmap *regmap; int val_bytes; @@ -880,22 +844,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); @@ -916,50 +864,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); - - unsigned int (*read)(struct snd_soc_codec *, unsigned int); - int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); - - /* 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; @@ -1213,7 +1117,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; @@ -1282,19 +1185,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 @@ -1310,19 +1200,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 @@ -1334,31 +1211,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 @@ -1374,18 +1226,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 * @@ -1399,21 +1239,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 @@ -1431,19 +1256,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 * @@ -1456,22 +1268,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 @@ -1514,37 +1310,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 */ @@ -1571,17 +1336,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); @@ -1633,11 +1387,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 @@ -1654,20 +1403,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 f238a2c..6a88696 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); /* @@ -174,21 +173,6 @@ static void soc_cleanup_component_debugfs(struct snd_soc_component *component) debugfs_remove_recursive(component->debugfs_root); } -static int codec_list_show(struct seq_file *m, void *v) -{ - struct snd_soc_codec *codec; - - mutex_lock(&client_mutex); - - list_for_each_entry(codec, &codec_list, list) - seq_printf(m, "%s\n", codec->component.name); - - mutex_unlock(&client_mutex); - - return 0; -} -DEFINE_SHOW_ATTRIBUTE(codec_list); - static int dai_list_show(struct seq_file *m, void *v) { struct snd_soc_component *component; @@ -256,10 +240,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"); @@ -555,8 +535,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); @@ -627,8 +607,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; } } @@ -911,7 +891,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; @@ -950,8 +929,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)); @@ -1285,8 +1264,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); @@ -1677,8 +1656,7 @@ int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd, /* Flip the polarity for the "CPU" end of a CODEC<->CODEC link */ /* the component which has non_legacy_dai_naming is Codec */ - if (cpu_dai->codec || - cpu_dai->component->driver->non_legacy_dai_naming) { + if (cpu_dai->component->driver->non_legacy_dai_naming) { unsigned int inv_dai_fmt; inv_dai_fmt = dai_fmt & ~SND_SOC_DAIFMT_MASTER_MASK; @@ -2271,25 +2249,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. * @@ -2350,27 +2309,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 @@ -2383,11 +2321,6 @@ int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, 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, - freq, dir); - if (component->driver->set_sysclk) return component->driver->set_sysclk(component, clk_id, source, freq, dir); @@ -2439,27 +2372,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 @@ -2473,11 +2385,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); @@ -2978,13 +2885,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; @@ -3055,7 +2955,7 @@ void snd_soc_component_exit_regmap(struct snd_soc_component *component) static void snd_soc_component_add_unlocked(struct snd_soc_component *component) { - if (!component->write && !component->read) { + if (!component->driver->write && !component->driver->read) { if (!component->regmap) component->regmap = dev_get_regmap(component->dev, NULL); if (component->regmap) @@ -3137,9 +3037,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); @@ -3194,8 +3091,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); @@ -3244,211 +3140,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_drv_write(struct snd_soc_component *component, - unsigned int reg, unsigned int val) -{ - struct snd_soc_codec *codec = snd_soc_component_to_codec(component); - - return codec->driver->write(codec, reg, val); -} - -static int snd_soc_codec_drv_read(struct snd_soc_component *component, - unsigned int reg, unsigned int *val) -{ - struct snd_soc_codec *codec = snd_soc_component_to_codec(component); - - *val = codec->driver->read(codec, reg); - - return 0; -} - -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->write) - codec->component.write = snd_soc_codec_drv_write; - if (codec_drv->read) - codec->component.read = snd_soc_codec_drv_read; - 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; - -#ifdef CONFIG_DEBUG_FS - codec->component.debugfs_prefix = "codec"; -#endif - - 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 c92a04b..026cd53 100644 --- a/sound/soc/soc-io.c +++ b/sound/soc/soc-io.c @@ -32,8 +32,6 @@ int snd_soc_component_read(struct snd_soc_component *component, if (component->regmap) ret = regmap_read(component->regmap, reg, val); - else if (component->read) - ret = component->read(component, reg, val); else if (component->driver->read) { *val = component->driver->read(component, reg); ret = 0; @@ -72,8 +70,6 @@ int snd_soc_component_write(struct snd_soc_component *component, { if (component->regmap) return regmap_write(component->regmap, reg, val); - else if (component->write) - return component->write(component, reg, val); else if (component->driver->write) return component->driver->write(component, reg, val); else @@ -209,61 +205,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 6e6efa8..f53d452 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->use_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; }