From patchwork Fri Jan 12 01:50:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10159477 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 E577A6029B for ; Fri, 12 Jan 2018 02:47:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE65E28900 for ; Fri, 12 Jan 2018 02:47:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C34CD2893F; Fri, 12 Jan 2018 02:47:19 +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 8C5C228917 for ; Fri, 12 Jan 2018 02:47:18 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6F8B526839D; Fri, 12 Jan 2018 03:37:53 +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 5FF76268395; Fri, 12 Jan 2018 03:37:50 +0100 (CET) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id 0F087267DB9 for ; Fri, 12 Jan 2018 02:50:36 +0100 (CET) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 12 Jan 2018 10:50:35 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 258466BB2C; Fri, 12 Jan 2018 10:50:35 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,346,1511794800"; d="scan'208";a="268011630" Received: from mail-sg2apc01lp0244.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.244]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 12 Jan 2018 10:50:34 +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=ydqMPPcFxnYB5cBQCR+Xs+nygl75sHQUY0MsT1bFE+0=; b=AftzSzgw/r6wxsU8HI5vKCU5cVn5EQysGkp/6x/2srH36WH/YmA5MUQzvpWiBcrtxazY5AQtMOfDLVFL0nI3nYH9ffIjHLpPNFJwIoQe0/s0WfOuqBLBX+NFRL+P+mVEHr3nl5ngNMweGas1mg0Chzsjy/vtu/nNVsVUgAYOVrI= 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 SG2PR0601MB1886.apcprd06.prod.outlook.com (2603:1096:3:9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 12 Jan 2018 01:50:32 +0000 Message-ID: <87fu7b6e3f.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:50:32 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: OS2PR01CA0116.jpnprd01.prod.outlook.com (2603:1096:602:1::34) To SG2PR0601MB1886.apcprd06.prod.outlook.com (2603:1096:3:9::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1b6ac834-28f2-476a-e182-08d5595eddfb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:SG2PR0601MB1886; X-Microsoft-Exchange-Diagnostics: 1; SG2PR0601MB1886; 3:f9WNUFkfLk9DpbdsRCEq+Q3f3JtPcF5lFCzlt5Stjx3R+tQFZO7XTbqFOCZL9YSUQq358YZ0TdbDoLDK+TEl8OKrhHtZ4ee6sGbl5+0VhQ7zlOmnTtNTZrTbVlOmVgF3eGTzmJ+qUBjKg55cyX0IJ6DWr4v+sE4tM4P1llpPdxEPw3O/BLxzyWFIwftA0sq5iWJRvgn/3iKwkTXr8i0e6AkvCw9SI2Y0K6KA1vyz73H9OebN9uTA0ApZao5YfIzX; 25:I43kVXqZuQ0GH4TGdO1+9njbrfS/hSkuccDJCTZoPBJo7BXrwS0QhnFNqLmfngsa73aOwtvPt0tm299d3gVxjP7Y2iA5CYzAL3UDvwbL15at+ugGTh0e//xytqEmEYrAD2p3vI6bNZRBQ13g7ohpomP6CDAXwi8lQ8qz8OT7vbhwOvRDrcmlMlQaqVzprSkrqOjC1Rls70LbgnqHsAJhZCShS9T5MbVekSaThWNWkUOG6Q3enbxGNHWL+6JnqGB0KqpNh+Xi6bHp9jd2+FkwaGK6a74zmu2N/u/RQ3kUVokXmCE/LK8zD2k/4+aLUuUkszx1KPMnBQCDMxualv/ohA==; 31:VIcU0xw8f7exfauTvSyJ8aXRkNrAxOVy6Jwjt5yFj631e4JegWRStqnuh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-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)(93006095)(93001095)(3002001)(3231023)(944501075)(10201501046)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:SG2PR0601MB1886; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SG2PR0601MB1886; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(39860400002)(39380400002)(346002)(396003)(376002)(189003)(199004)(16526018)(47776003)(25786009)(4326008)(478600001)(53416004)(66066001)(69596002)(7736002)(53936002)(83506002)(575784001)(6486002)(50466002)(8676002)(86362001)(81156014)(7696005)(52116002)(106356001)(76176011)(36756003)(59450400001)(68736007)(386003)(5660300001)(97736004)(105586002)(6116002)(305945005)(8936002)(23726003)(6916009)(58126008)(2950100002)(81166006)(3846002)(316002)(16586007)(2906002)(54906003)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR0601MB1886; 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; SG2PR0601MB1886; 23:2gVsaAVZH9GMr8RlaSaBahK4gfn99ciqnAPfgNH?= =?us-ascii?Q?dyYj3zJz1Eao3xvOUKAxekM8rkuHw5Jp5iqMTB74qwakLm2/6X7Qf8ltIJMG?= =?us-ascii?Q?67gED+xbPVOS7yn3eaC/LMaqnaqI6uCXv4Z5OKFqPEtsp1NwztlR+wy+D6AH?= =?us-ascii?Q?bg3CmYPQzwDJqvmNuHEe4MvosfEgyEaqNYDKmkOPBntwFTQtRZNcqNgIu0W6?= =?us-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ZitHO7OKmHQrfKxfPu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SG2PR0601MB1886; 20:LuBp8o5DGNg32zurXqsSnqPRhNQuvG7eScaOQxA6wA1Zpg9Y0QQsTGu11CbxljVN2VnIJk5/LIO2YsBknkcQXkKfFPKHH5TUSKyksYdwr+7EmcycgSlskwQI9AGfCswleyj1txCXL+prF0g+lLqMhbZiiKOqkikn14G4FsrJvbs= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 01:50:32.4019 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b6ac834-28f2-476a-e182-08d5595eddfb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR0601MB1886 Cc: Linux-ALSA , Simon Subject: [alsa-devel] [PATCH 147/187] ASoC: nau8824: 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/nau8824.c | 113 +++++++++++++++++++++------------------------ sound/soc/codecs/nau8824.h | 2 +- 2 files changed, 54 insertions(+), 61 deletions(-) diff --git a/sound/soc/codecs/nau8824.c b/sound/soc/codecs/nau8824.c index 088e0ce..96d4963 100644 --- a/sound/soc/codecs/nau8824.c +++ b/sound/soc/codecs/nau8824.c @@ -414,8 +414,8 @@ static bool nau8824_volatile_reg(struct device *dev, unsigned int reg) static int nau8824_output_dac_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); switch (event) { case SND_SOC_DAPM_PRE_PMU: @@ -437,8 +437,8 @@ static int nau8824_output_dac_event(struct snd_soc_dapm_widget *w, static int nau8824_spk_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); switch (event) { case SND_SOC_DAPM_PRE_PMU: @@ -461,8 +461,8 @@ static int nau8824_spk_event(struct snd_soc_dapm_widget *w, static int nau8824_pump_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); switch (event) { case SND_SOC_DAPM_POST_PMU: @@ -487,8 +487,8 @@ static int nau8824_pump_event(struct snd_soc_dapm_widget *w, static int system_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); if (SND_SOC_DAPM_EVENT_OFF(event)) { /* Set clock source to disable or internal clock before the @@ -509,8 +509,8 @@ static int system_clock_control(struct snd_soc_dapm_widget *w, static int dmic_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { - struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); int src; /* The DMIC clock is gotten from system clock (256fs) divided by @@ -988,8 +988,8 @@ static int nau8824_clock_check(struct nau8824 *nau8824, static int nau8824_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct snd_soc_codec *codec = dai->codec; - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); unsigned int val_len = 0, osr, ctrl_val, bclk_fs, bclk_div; nau8824_sema_acquire(nau8824, HZ); @@ -1072,8 +1072,8 @@ static int nau8824_hw_params(struct snd_pcm_substream *substream, static int nau8824_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { - struct snd_soc_codec *codec = dai->codec; - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); unsigned int ctrl1_val = 0, ctrl2_val = 0; nau8824_sema_acquire(nau8824, HZ); @@ -1149,8 +1149,8 @@ static int nau8824_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) static int nau8824_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) { - struct snd_soc_codec *codec = dai->codec; - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *component = dai->component; + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); unsigned int tslot_l = 0, ctrl_val = 0; if (slots > 4 || ((tx_mask & 0xf0) && (tx_mask & 0xf)) || @@ -1288,10 +1288,10 @@ static void nau8824_fll_apply(struct regmap *regmap, } /* freq_out must be 256*Fs in order to achieve the best performance */ -static int nau8824_set_pll(struct snd_soc_codec *codec, int pll_id, int source, +static int nau8824_set_pll(struct snd_soc_component *component, int pll_id, int source, unsigned int freq_in, unsigned int freq_out) { - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); struct nau8824_fll fll_param; int ret, fs; @@ -1374,10 +1374,10 @@ static int nau8824_config_sysclk(struct nau8824 *nau8824, return 0; } -static int nau8824_set_sysclk(struct snd_soc_codec *codec, +static int nau8824_set_sysclk(struct snd_soc_component *component, int clk_id, int source, unsigned int freq, int dir) { - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); return nau8824_config_sysclk(nau8824, clk_id, freq); } @@ -1403,10 +1403,10 @@ static void nau8824_resume_setup(struct nau8824 *nau8824) } } -static int nau8824_set_bias_level(struct snd_soc_codec *codec, +static int nau8824_set_bias_level(struct snd_soc_component *component, enum snd_soc_bias_level level) { - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); switch (level) { case SND_SOC_BIAS_ON: @@ -1416,7 +1416,7 @@ static int nau8824_set_bias_level(struct snd_soc_codec *codec, break; case SND_SOC_BIAS_STANDBY: - if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) { + if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { /* Setup codec configuration after resume */ nau8824_resume_setup(nau8824); } @@ -1434,23 +1434,23 @@ static int nau8824_set_bias_level(struct snd_soc_codec *codec, return 0; } -static int nau8824_codec_probe(struct snd_soc_codec *codec) +static int nau8824_component_probe(struct snd_soc_component *component) { - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); - struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); nau8824->dapm = dapm; return 0; } -static int __maybe_unused nau8824_suspend(struct snd_soc_codec *codec) +static int __maybe_unused nau8824_suspend(struct snd_soc_component *component) { - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); if (nau8824->irq) { disable_irq(nau8824->irq); - snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); + snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); } regcache_cache_only(nau8824->regmap, true); regcache_mark_dirty(nau8824->regmap); @@ -1458,9 +1458,9 @@ static int __maybe_unused nau8824_suspend(struct snd_soc_codec *codec) return 0; } -static int __maybe_unused nau8824_resume(struct snd_soc_codec *codec) +static int __maybe_unused nau8824_resume(struct snd_soc_component *component) { - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); regcache_cache_only(nau8824->regmap, false); regcache_sync(nau8824->regmap); @@ -1475,23 +1475,24 @@ static int __maybe_unused nau8824_resume(struct snd_soc_codec *codec) return 0; } -static const struct snd_soc_codec_driver nau8824_codec_driver = { - .probe = nau8824_codec_probe, - .set_sysclk = nau8824_set_sysclk, - .set_pll = nau8824_set_pll, - .set_bias_level = nau8824_set_bias_level, - .suspend = nau8824_suspend, - .resume = nau8824_resume, - .suspend_bias_off = true, - - .component_driver = { - .controls = nau8824_snd_controls, - .num_controls = ARRAY_SIZE(nau8824_snd_controls), - .dapm_widgets = nau8824_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(nau8824_dapm_widgets), - .dapm_routes = nau8824_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(nau8824_dapm_routes), - }, +static const struct snd_soc_component_driver nau8824_component_driver = { + .probe = nau8824_component_probe, + .set_sysclk = nau8824_set_sysclk, + .set_pll = nau8824_set_pll, + .set_bias_level = nau8824_set_bias_level, + .suspend = nau8824_suspend, + .resume = nau8824_resume, + .controls = nau8824_snd_controls, + .num_controls = ARRAY_SIZE(nau8824_snd_controls), + .dapm_widgets = nau8824_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(nau8824_dapm_widgets), + .dapm_routes = nau8824_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(nau8824_dapm_routes), + .suspend_bias_off = 1, + .idle_bias_on = 1, + .pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static const struct snd_soc_dai_ops nau8824_dai_ops = { @@ -1547,10 +1548,10 @@ static int __maybe_unused nau8824_resume(struct snd_soc_codec *codec) * events will be routed to the given jack. Jack can be null to stop * reporting. */ -int nau8824_enable_jack_detect(struct snd_soc_codec *codec, +int nau8824_enable_jack_detect(struct snd_soc_component *component, struct snd_soc_jack *jack) { - struct nau8824 *nau8824 = snd_soc_codec_get_drvdata(codec); + struct nau8824 *nau8824 = snd_soc_component_get_drvdata(component); int ret; nau8824->jack = jack; @@ -1838,15 +1839,8 @@ static int nau8824_i2c_probe(struct i2c_client *i2c, if (i2c->irq) nau8824_setup_irq(nau8824); - return snd_soc_register_codec(dev, - &nau8824_codec_driver, &nau8824_dai, 1); -} - - -static int nau8824_i2c_remove(struct i2c_client *client) -{ - snd_soc_unregister_codec(&client->dev); - return 0; + return devm_snd_soc_register_component(dev, + &nau8824_component_driver, &nau8824_dai, 1); } static const struct i2c_device_id nau8824_i2c_ids[] = { @@ -1878,7 +1872,6 @@ static int nau8824_i2c_remove(struct i2c_client *client) .acpi_match_table = ACPI_PTR(nau8824_acpi_match), }, .probe = nau8824_i2c_probe, - .remove = nau8824_i2c_remove, .id_table = nau8824_i2c_ids, }; module_i2c_driver(nau8824_i2c_driver); diff --git a/sound/soc/codecs/nau8824.h b/sound/soc/codecs/nau8824.h index 21eae24..6184a2b 100644 --- a/sound/soc/codecs/nau8824.h +++ b/sound/soc/codecs/nau8824.h @@ -471,7 +471,7 @@ struct nau8824_osr_attr { }; -int nau8824_enable_jack_detect(struct snd_soc_codec *codec, +int nau8824_enable_jack_detect(struct snd_soc_component *component, struct snd_soc_jack *jack); #endif /* _NAU8824_H */