From patchwork Fri Jan 12 01:53:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10159499 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 2933A6029B for ; Fri, 12 Jan 2018 02:50:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1238628979 for ; Fri, 12 Jan 2018 02:50:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03AA92897D; Fri, 12 Jan 2018 02:50:03 +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 CD40C28979 for ; Fri, 12 Jan 2018 02:50:01 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3C7D8268286; Fri, 12 Jan 2018 03:38:12 +0100 (CET) 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 BF7E72683F5; Fri, 12 Jan 2018 03:38:10 +0100 (CET) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id 4D8462680FF for ; Fri, 12 Jan 2018 02:53:50 +0100 (CET) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 12 Jan 2018 10:53:44 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 32E056BE82; Fri, 12 Jan 2018 10:53:44 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,346,1511794800"; d="scan'208";a="269312834" Received: from mail-hk2apc01lp0212.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.212]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 12 Jan 2018 10:53:43 +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=sz4r/3YraZt9beZ2OmrbEaKw9XgL6avBW1+vx5UmZ1A=; b=KEejy4L26/lwftLXFuYnP7qpJjzaVi08ZGBQAiEx5N6ewrZn0zcPpvI0z4TrhB+nf7zOEg/hwis7AJ3VBtEOR+EKchjRIuqBuKlRde0UhZkox4xl6GF43Lc+h1y1q1Q4bnGED3VR5Cx37K4PicoQehuFadlM4+fLrBkcdKjR/IQ= 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 PS1PR0601MB1884.apcprd06.prod.outlook.com (2603:1096:803:8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Fri, 12 Jan 2018 01:53:41 +0000 Message-ID: <87y3l34zdx.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: <87bmhzevk9.wl%kuninori.morimoto.gx@renesas.com> References: <87bmhzevk9.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 12 Jan 2018 01:53:41 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: KAWPR01CA0069.jpnprd01.prod.outlook.com (2603:1096:402:b::29) To PS1PR0601MB1884.apcprd06.prod.outlook.com (2603:1096:803:8::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dccbcb43-c2e5-4ab1-b889-08d5595f4e83 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020074)(4652020)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:PS1PR0601MB1884; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1884; 3:JRt+HG9goHrujY3To5fvco/0KHwNfvwFR7VjYS7QsOqy9V49qUewV/1pr+y3DLgTXwrqsuQSIZ7j63P9J30wuT321tPZS+rUHYw3aqQf0UQZVlSxFXBGKyrI/GW2VeL7ec+OTjEkgymozpwK4dXkhQVxTk3PFivN3WG0cblzwUzzN7wwfzZVWFAqYcI2bNYiFpirToKgttnefXKbq6fiU45dsL1MM/vyOuLvlwV2BF3eJq//e8aeoXhIYCq9J3QW; 25:CY1ATkNBc9NxroqAuOp1v0ujKkzcdrYCHHVR4HinHg+fOy8B+6z8Qv7W0OoU0/ToEGXGTglnN+IQIHBZyoYTeo7WhsaD28zhQFR4sKA8VCkN0rU3P0Dt3ioazZcV9UAxaJUldKJ9EeoJr1lyRaWpCV2fHsHICykj4MhveYYBLldRfV0L0UlvIUYTcdf8+KO0WOe9x+lXCrnHFGC4cEZLSoqEhnnN5QVv4N7/NlqcQ/WWMKfIduTBzQ29IqkNVBXIidxZgQ0DcBZLSLrg31E2kE2yf+utZopAVoKqJbG+pheLQlAs6nB9+0ewOWKkW7RuSGqdv2YVheg0VJlCQ1ECdw==; 31:3ZuCjntpmUNfDdP/me53Ebn01njgGnzVQ5SscQUOijzLiMuG0fVaWp5uxoPTNoKpa138LrIndPZ7JH+QSeiqogySzNaU1B0ncIpAjII0mYKjJPmqlrhEz4lL6Tcwy29InC7WmI3ldNEeuohuKJIEtySTsTHyTFLp/mD8B55R7ccqtkyaNMLXCvA+AZJJzY8OQwmEMVwkxMw2HbZAkFUgzPdGWrvaYVcv3SjkJxdYB40= X-MS-TrafficTypeDiagnostic: PS1PR0601MB1884: X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1884; 20:DhDJsZu2AAi3XfnGBSpHDPFysaIob80qye7uKyUc8cNtSnogyzI6wRPfpjxoqrwuYFvkpn8HLI2JsEOSyUE61igZEV096gBuklX0PhTg6KxpLw3HZhHbGBxUBzlqe2O7iqwGsN846Gw75LAUP2danOcqUzYBY8E2LjjwKPo1DWfSfCHmxD7jucTL0wtvhcplxclv86eZAmczKVxZMw+I2hKCUBHFTsKGnOeEp/8odwQbr3TE4rph3HBbS87+Rt0lvu+03LMV7zyng9EIhJIOpZEv8wv8zscudbM0/VzYkLeq07+OCtdqJaKtcowZ7cgkC0PACm6oQMaKduJ9O9cj/QcimOi9aisv+uxRfm08XWKZEJHi61Kv8J2lNDlKUu0wbgzoj0TvW5d2p9CHlDmv/dGQ/VMnp+3Gc/0IdtUccOEns0AWZKzI4yVO6/qPqjkgPEso0b16xB0wSVJIfebvzFF1IVtuRg9c6DF69cLfwmQqybvjoi5oN2HXItHOxgdt; 4:dAipk/cS7h6APHka/8x9l/MP71msoZ02C6WuRnYQhmISuaWfNnS5M5guWLU/TjY9SYGWKI1qgpeWEzpavpeMA1cqU3h2hoiiRtEGxRJKsKeDcld8UglTeZOb6A8nqJH06axqz2oGYYGKvCrBTsa1+XTW7mdnUJGlZx4gew8tV65UuQQpEiWC8EqU1yuF3uwK+XIa6HmWlDMguESwOsxou6yj484PGVVo+QmRv+9x8+6/8bf9U29znhHqpe6mljv2cgfzrFny3yDWAVvYIcyk0/S7CmmVByHaYFWu+DHPpGV/rlnjwQ1e3UgV41RKv1as X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3231023)(944501138)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041268)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:PS1PR0601MB1884; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:PS1PR0601MB1884; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(376002)(366004)(39860400002)(346002)(39380400002)(199004)(189003)(106356001)(50466002)(69596002)(58126008)(54906003)(25786009)(4326008)(316002)(16586007)(36756003)(83506002)(68736007)(53936002)(97736004)(6486002)(66066001)(86362001)(478600001)(53416004)(23726003)(8936002)(81166006)(81156014)(8676002)(2906002)(6116002)(3846002)(386003)(305945005)(76176011)(52116002)(105586002)(16526018)(7736002)(6916009)(2950100002)(47776003)(7696005)(5660300001)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR0601MB1884; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; PS1PR0601MB1884; 23:mMR9UEydoTZq8A/ZVCwgPwNg9/LkMWiwONVCBYR?= =?us-ascii?Q?fOUF+D1Na0NFNLcBbl4KlrKGikC1rAYcax3e/5fp4aascwNPH3Cry1F0/oCS?= =?us-ascii?Q?+jivxLS5nymqD1/bHOPsYHERFO2Dc4o17nIUiNNvMrGbhNp4/fDxpJkOphmC?= =?us-ascii?Q?NHG2e5tlSff9n0mKvtL+cbFJgE7oFh/iIs/bakSuolP8EW2MhdbCejFdyGC9?= =?us-ascii?Q?VycZFQxe8E+JvSOT1VeWVnIf2GlioXlLLC4izmwGh9rEAEBsxoGdTlemncaF?= =?us-ascii?Q?KHE2+f/TVWZpKzOv8Q+bZDCDU5tPR0JlAtj1YUFT/W4bc3l+MrzJbA5asvnE?= =?us-ascii?Q?rab/0wnzcomu1SUsLNyopNYXFldj6ThtXCogABVhgWUrG1wVs1eG/6iG2MkA?= =?us-ascii?Q?SmZR1+bCIccsOugacBuIUqNjHcdRpI3fXfwqNFHKlIKwqeKLYuVUWIc3RZH9?= =?us-ascii?Q?u78KCecU+xQO8KO6e36259rdGFsXq9rvOaw3aVs2qa58UX5/xj+mq1pTfq1+?= =?us-ascii?Q?yfquqPC9IBKNjA5mW5nh5PJZPaRjhTcSVNg1Y9gPtf2Hy+F8rdaUlfxRgLaw?= =?us-ascii?Q?6qdyREv9wpU/AwrcAmWSqExWTGs7Aeq3Hd2gG/Kgr3ZFOWdaBRKU5WJepKSr?= =?us-ascii?Q?pOmCTT1lLzwa6aozpHdXSa25TDw9aP1+fH/2jTT7fqKqWZL2c7C54XGHXz1T?= =?us-ascii?Q?jQeMnj4MaDd85/XeP0aWzKtFqhIDILf/Y3kXrnKZ6smNvFxzUgnrAKstBz/S?= =?us-ascii?Q?p53kigYkHs++U4VzyvYJq+Iqy89VR/CZehMO7ipTX/8nEZT6hjHsLZERwuPN?= =?us-ascii?Q?E3DRTdmPyh+a2qOwl6D4hJjS4ZlimHudt3n+mkprht8cuGzGXxCb804osl8i?= =?us-ascii?Q?lmR+A+4ZCtnANd3IMA5lUF5ZrecziDB6I5f8Az478c7xwelAwjSc6FFLKYjI?= =?us-ascii?Q?bDKWLq6QS1K9yd5vJ8bKmF8LwiZVB3t4MeknAaybX3tW3+HXazrjLdnMkHqU?= =?us-ascii?Q?ykkAVuZ0zOd/+WjtRKTXX2S83obQ/XZ2BGOgiDK2v0AYLlmzevdQEtgEYDqM?= =?us-ascii?Q?vzvr3P9kCEbLnLBA4DbZ95Sntgg1biUvPdZxBrhN28ucZmH+YAlw98r+CNJ7?= =?us-ascii?Q?Zsc+JPx/iJR8qJFZL6wDRx+C1hSovF2+d?= X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1884; 6:EZbWseSYAV0348xznbUOuPjy1ABBXv2uMd2FHkxremI3WnPnmfxIca0Si8s6P5ZiutYwLfSWp3wfnwdLlBeJvaRU19Zb0RoZPtpzAlfcANf/PmT8UwhtyGbWlU+cX4k9HMDgaXAf6JoAUK+g0CtWCaOMOU5nw9RNvffE0OsKSFdjoa956gWONijwb3qMQ59d4mgM12kRbWcIB8IbA4xtkDQXBnBqpE856ZM9zhAw/4OASgzLfTcenhvqE3pqANwh3prZl3O6W9UXAiC+TaTA3ugtx1PJOyoih7Or/sB9pkUNs0MQCXsgimKBrznFkk6zobPEWCICyzZx3ElslGr4C9zJQIDMz1boDs7yyyEO6IM=; 5:IdcbRsR5oQKYWQJ6sJD7kBtOQR6m+L+h6+i0EXvbWD2pT8VC+BeZbwRak72KPdC+cqugai5d3oXFIDQ9tnGs+6DI3QCDJ4RYcdxvVdMsJWy9QKffC86+0Sb43BCgRCeRe9ZYc+R8ngEvOQnucCaYViHfSaSJ9KyBVXagBiXlZgQ=; 24:IZqgo3B6jkEycR/7BQ1A8ynGxK/QRxHPV4b7Sp/1s5qX4g3M0H6BQzI/SgNSIKyDAvPgC7w5OacuekxqGZJMPEhAsOEtdiKl1cFvejmOqGA=; 7:6cgF2Ifvvhay69YqjisjjB5iHvvhNN0UsCHg4v/7QTj2fVHQLONVkgSOoHv/Y7HfAp4aXwsyTXgEC4YZSbpxQNp8eZV8sDPvO76McSV9n+Xhc+nUhtvWZDRqwn84IcchKHv6DBmuYu1rlc4fcAlQ54JDeKL9ofEOWmsJXRMozieVCVyy1KGA9vevjZ06bYATsFdj7heWVbkUrDqjzEKukuMp2H3Cdp3yWUFIgzNmUkXw6jXIKFZCZkf+LJ3ZIYUH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; PS1PR0601MB1884; 20:l34eOV7rw0zjfBwDE958sOOvVjQipkxxLt5v8zjlj9kcVMK39nQYB4vuj0BBUJBH0prCVHP9hC7Qz2MOy4tQHgcDqSFIEfH7WhgkTsmeYSG3TMG5pNiCCZmLlCbXvOgVHNS48V6e8SDoPsZrm99NP0v1KY0bvOlJl5/4fHm2uhQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 01:53:41.3844 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dccbcb43-c2e5-4ab1-b889-08d5595f4e83 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR0601MB1884 Cc: Linux-ALSA , Simon Subject: [alsa-devel] [PATCH 159/187] ASoC: wl1273: replace codec to component 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 From: Kuninori Morimoto Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 0 -> .idle_bias_on = 1 .ignore_pmdown_time = 0 -> .pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/wl1273.c | 93 +++++++++++++++++++++++------------------------ sound/soc/codecs/wl1273.h | 2 +- 2 files changed, 47 insertions(+), 48 deletions(-) diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c index 942f164..a9cd85c 100644 --- a/sound/soc/codecs/wl1273.c +++ b/sound/soc/codecs/wl1273.c @@ -172,8 +172,8 @@ static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core, static int snd_wl1273_get_audio_route(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct wl1273_priv *wl1273 = snd_soc_component_get_drvdata(component); ucontrol->value.enumerated.item[0] = wl1273->mode; @@ -190,14 +190,14 @@ static int snd_wl1273_get_audio_route(struct snd_kcontrol *kcontrol, static int snd_wl1273_set_audio_route(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct wl1273_priv *wl1273 = snd_soc_component_get_drvdata(component); if (wl1273->mode == ucontrol->value.enumerated.item[0]) return 0; /* Do not allow changes while stream is running */ - if (snd_soc_codec_is_active(codec)) + if (snd_soc_component_is_active(component)) return -EPERM; if (ucontrol->value.enumerated.item[0] >= ARRAY_SIZE(wl1273_audio_route)) @@ -213,10 +213,10 @@ static int snd_wl1273_set_audio_route(struct snd_kcontrol *kcontrol, static int snd_wl1273_fm_audio_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct wl1273_priv *wl1273 = snd_soc_component_get_drvdata(component); - dev_dbg(codec->dev, "%s: enter.\n", __func__); + dev_dbg(component->dev, "%s: enter.\n", __func__); ucontrol->value.enumerated.item[0] = wl1273->core->audio_mode; @@ -226,11 +226,11 @@ static int snd_wl1273_fm_audio_get(struct snd_kcontrol *kcontrol, static int snd_wl1273_fm_audio_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct wl1273_priv *wl1273 = snd_soc_component_get_drvdata(component); int val, r = 0; - dev_dbg(codec->dev, "%s: enter.\n", __func__); + dev_dbg(component->dev, "%s: enter.\n", __func__); val = ucontrol->value.enumerated.item[0]; if (wl1273->core->audio_mode == val) @@ -250,10 +250,10 @@ static int snd_wl1273_fm_audio_put(struct snd_kcontrol *kcontrol, static int snd_wl1273_fm_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct wl1273_priv *wl1273 = snd_soc_component_get_drvdata(component); - dev_dbg(codec->dev, "%s: enter.\n", __func__); + dev_dbg(component->dev, "%s: enter.\n", __func__); ucontrol->value.integer.value[0] = wl1273->core->volume; @@ -263,11 +263,11 @@ static int snd_wl1273_fm_volume_get(struct snd_kcontrol *kcontrol, static int snd_wl1273_fm_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); - struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct wl1273_priv *wl1273 = snd_soc_component_get_drvdata(component); int r; - dev_dbg(codec->dev, "%s: enter.\n", __func__); + dev_dbg(component->dev, "%s: enter.\n", __func__); r = wl1273->core->set_volume(wl1273->core, ucontrol->value.integer.value[0]); @@ -301,8 +301,8 @@ static int snd_wl1273_fm_volume_put(struct snd_kcontrol *kcontrol, static int wl1273_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct wl1273_priv *wl1273 = snd_soc_component_get_drvdata(component); switch (wl1273->mode) { case WL1273_MODE_BT: @@ -335,7 +335,7 @@ static int wl1273_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(dai->codec); + struct wl1273_priv *wl1273 = snd_soc_component_get_drvdata(dai->component); struct wl1273_core *core = wl1273->core; unsigned int rate, width, r; @@ -415,14 +415,14 @@ static int wl1273_hw_params(struct snd_pcm_substream *substream, }; /* Audio interface format for the soc_card driver */ -int wl1273_get_format(struct snd_soc_codec *codec, unsigned int *fmt) +int wl1273_get_format(struct snd_soc_component *component, unsigned int *fmt) { struct wl1273_priv *wl1273; - if (codec == NULL || fmt == NULL) + if (component == NULL || fmt == NULL) return -EINVAL; - wl1273 = snd_soc_codec_get_drvdata(codec); + wl1273 = snd_soc_component_get_drvdata(component); switch (wl1273->mode) { case WL1273_MODE_FM_RX: @@ -446,15 +446,15 @@ int wl1273_get_format(struct snd_soc_codec *codec, unsigned int *fmt) } EXPORT_SYMBOL_GPL(wl1273_get_format); -static int wl1273_probe(struct snd_soc_codec *codec) +static int wl1273_probe(struct snd_soc_component *component) { - struct wl1273_core **core = codec->dev->platform_data; + struct wl1273_core **core = component->dev->platform_data; struct wl1273_priv *wl1273; - dev_dbg(codec->dev, "%s.\n", __func__); + dev_dbg(component->dev, "%s.\n", __func__); if (!core) { - dev_err(codec->dev, "Platform data is missing.\n"); + dev_err(component->dev, "Platform data is missing.\n"); return -EINVAL; } @@ -465,44 +465,43 @@ static int wl1273_probe(struct snd_soc_codec *codec) wl1273->mode = WL1273_MODE_BT; wl1273->core = *core; - snd_soc_codec_set_drvdata(codec, wl1273); + snd_soc_component_set_drvdata(component, wl1273); return 0; } -static int wl1273_remove(struct snd_soc_codec *codec) +static void wl1273_remove(struct snd_soc_component *component) { - struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec); + struct wl1273_priv *wl1273 = snd_soc_component_get_drvdata(component); - dev_dbg(codec->dev, "%s\n", __func__); + dev_dbg(component->dev, "%s\n", __func__); kfree(wl1273); - - return 0; } -static const struct snd_soc_codec_driver soc_codec_dev_wl1273 = { - .probe = wl1273_probe, - .remove = wl1273_remove, - - .component_driver = { - .controls = wl1273_controls, - .num_controls = ARRAY_SIZE(wl1273_controls), - .dapm_widgets = wl1273_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(wl1273_dapm_widgets), - .dapm_routes = wl1273_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(wl1273_dapm_routes), - }, +static const struct snd_soc_component_driver soc_component_dev_wl1273 = { + .probe = wl1273_probe, + .remove = wl1273_remove, + .controls = wl1273_controls, + .num_controls = ARRAY_SIZE(wl1273_controls), + .dapm_widgets = wl1273_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(wl1273_dapm_widgets), + .dapm_routes = wl1273_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(wl1273_dapm_routes), + .idle_bias_on = 1, + .pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static int wl1273_platform_probe(struct platform_device *pdev) { - return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wl1273, + return devm_snd_soc_register_component(&pdev->dev, + &soc_component_dev_wl1273, &wl1273_dai, 1); } static int wl1273_platform_remove(struct platform_device *pdev) { - snd_soc_unregister_codec(&pdev->dev); return 0; } diff --git a/sound/soc/codecs/wl1273.h b/sound/soc/codecs/wl1273.h index 43ec7e6..43a81d5 100644 --- a/sound/soc/codecs/wl1273.h +++ b/sound/soc/codecs/wl1273.h @@ -25,6 +25,6 @@ #ifndef __WL1273_CODEC_H__ #define __WL1273_CODEC_H__ -int wl1273_get_format(struct snd_soc_codec *codec, unsigned int *fmt); +int wl1273_get_format(struct snd_soc_component *component, unsigned int *fmt); #endif /* End of __WL1273_CODEC_H__ */