From patchwork Wed Mar 28 01:46:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10311987 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 C140560386 for ; Wed, 28 Mar 2018 01:46:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD08929E65 for ; Wed, 28 Mar 2018 01:46:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1C8E29E70; Wed, 28 Mar 2018 01:46:55 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08E4A29E65 for ; Wed, 28 Mar 2018 01:46:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752643AbeC1Bq1 (ORCPT ); Tue, 27 Mar 2018 21:46:27 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:8595 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752628AbeC1BqZ (ORCPT ); Tue, 27 Mar 2018 21:46:25 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 28 Mar 2018 10:46:23 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 1DA8373F5F; Wed, 28 Mar 2018 10:46:23 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.48,368,1517842800"; d="scan'208";a="275055620" Received: from mail-sg2apc01lp0245.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.245]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 28 Mar 2018 10:46:21 +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=DUJCSqUWH9AeYpukuUsVA8E2qKSmwyOuiTwaLcohWYg=; b=Kst27B/ybPPuCVcCB96jqMH2yRZ2LE4sa5ciqg+of8Ku3ht3p1kgfOeJcxB4GYHay7Zc+MLQ1IE6nPyL1ExQAo3mRw8s0DLFH7R4i1YkxSk+61dxg3qPFRRclV2DMe09MQRd0/oLRG48q4jC3TDQ4oRLJFYZ9g3yMk4h5ntL7VM= 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 TY2PR01MB2075.jpnprd01.prod.outlook.com (2603:1096:404:e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Wed, 28 Mar 2018 01:46:17 +0000 Message-ID: <87370l560w.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH] media: i2c: wm9090: replace codec to component User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown , Tim Harvey , Mauro Carvalho Chehab Cc: Linux-ALSA , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Wed, 28 Mar 2018 01:46:17 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: SG2PR01CA0094.apcprd01.prod.exchangelabs.com (2603:1096:3:15::20) To TY2PR01MB2075.jpnprd01.prod.outlook.com (2603:1096:404:e::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d8d241aa-e77c-45a9-6e69-08d5944db3dc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:TY2PR01MB2075; X-Microsoft-Exchange-Diagnostics: 1; TY2PR01MB2075; 3:Yg9LtetuTx/NeBEgUh7Zr9TIP5CrMkbiEY6z3/tS0pBMp4prAqbOrSBZCKusibyJRborsHBXw3gC8ohjtgT3QqVxIm0tHJsGJrJG6FkHzG6IcSr7N4t+OWryTMNJyJZoPBMAb52mI63l10w2VOs2/+mM/PjSvaE07zERBb2OrhWHPMxFkTAyT9kHD2vgJ32R7fXQ4IINSF3GOOvkmIFZOgRZGXFkNA2OGVPKbGtp8NlUjwYcVnsErx5vPp7eck+i; 25:KtNWGqZZJdAIxQwsqhpODipEbFJzKKzWMVbbIioqPQ2uVDjLdIhFWlK8KQxn1whGcluk1nLp2W/P8xxf6KnG3RkUzcD+xRmE1IZxj6k5JkYoZnk8TQKqG4JDzf1QwNjtYJmcEhwTYWzlzfw698bTXYBu3kzyxORAf+Vj7yN4BcKPTbqHKeLxy8tg8hPp81ztaVBXfZghpMLeGZ4PR75QyVO++gqbKnp0Ghgt/Z8VnpjkX+0eVqASzjEKBaTPAHhcjr3PyHI6+vxOuS2vGO2vWH6sCzJSUI6jzeDYnb2RN125ZbUQox9rqgzy2TXF5YdCkJUTgPJRhGe+6O0z9CKCLw==; 31:fOQpCV3mKc1D4D8KOr0HL5Pe03lbMdH9ed94HfMoi53ZsnOKHXYGFWOBsr7CNzBObtJNVQkyrOfxuRxweBLrP0G+avthmzJROiGPsd4uGgSPMP+yh45ZZLDKDgCZG9WlgYWz40Vl6gd3bcfnd/XqBXA2RbxQztPSfBxqfzoFkfBmbb/yS49TXswLKVpwk7Tw9PQvGkVaTCembzBufhKiP7RJPkVHDO7qPCNed8MwnQg= X-MS-TrafficTypeDiagnostic: TY2PR01MB2075: X-Microsoft-Exchange-Diagnostics: 1; TY2PR01MB2075; 20:Bsw5i9kZD6FWLNw2eZxBBbZBGPCPFXTchHEtBZFEgaFDS4/kq9frUo7Q954vwQHDPU5y53m0JHTgsd8LgTnOzs9fymbgldVnsCMyKpTaTi6bNSJVzNJ8nJGhDQUafCxairsJRKtNGrKu9ZxK3a+zOxxoEAkb84g9FVKWZtfqTa6x9axtIbnz9MJTl01Ua2AZv25O0AQbKXAoWDsxnavvf6b2pR9W/INie0DhRfzkf6RoFK4D3pUwtujLRtKx/BZdBE7re6nKCc0j4ik+kz0aKv+Me8j9/sHF2F3gqI8ty17QCE+chRT1gFQ2KDcgMc0UpSf+lQNOXNUG6LHVAH9fn1wLHu/nL2mXV+bnBDjb2tXgBMSaHuSrzkyBzKLEXcA4ol8Tm1r6+POoB0Pe4rnpWArG4tqtFxmSPuuk6MoelIaRy11Jbj++JEFpjla1hP/560LGhPtEM70seZ+SBhrpZ6wKVnUSw8ptVvpbUis076dRGc2iyfbrN3CJPPczldPb; 4:VJYnL7dgAoHSt4X5F5TJsrbZGItOgB5pjjcF4jK+dw4L+r090joCCEv0KTTN1+y8oOffh8ezZk7T/OlSz+lr74w4XPqESf9E0yUHjoijDhm5SSMwKCsxGBG/zM1A0WTf3G+yd++xZ6bFW9II20WOZkoPtgtHwUp5A1nI6hPkLUqFOkbgH5BTQ9VVAUhnOWF+xYU1j9N7dL3qXUX92DfKo1R39d0flE4TSUq8AMG5O/XNGJEXX83709mpMvb952EkXpxnIYnDK1k8w0/bAd5JsrVJoCI58N6klmTJrzyNf2tUFEUXmzfpa1e1jy1/Fimo X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231221)(944501327)(52105095)(6055026)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:TY2PR01MB2075; BCL:0; PCL:0; RULEID:; SRVR:TY2PR01MB2075; X-Forefront-PRVS: 06259BA5A2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(376002)(346002)(39380400002)(39860400002)(396003)(366004)(199004)(189003)(68736007)(110136005)(6486002)(8676002)(3846002)(8936002)(26005)(81166006)(81156014)(305945005)(106356001)(23726003)(50466002)(476003)(69596002)(47776003)(97736004)(52116002)(386003)(478600001)(105586002)(58126008)(316002)(6116002)(53416004)(59450400001)(16586007)(7696005)(1857600001)(86362001)(4326008)(53936002)(2906002)(956004)(66066001)(5660300001)(7736002)(16526019)(2616005)(36756003)(186003)(25786009)(486005)(486005)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:TY2PR01MB2075; 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; TY2PR01MB2075; 23:33Quc9USj3OUy4IJXNCDPOUYsvBGN0MhL4ebxqQpM?= =?us-ascii?Q?MAafVulpI4Eeykla7g6pgUJSVYKJSMyZAFRzXAvqw/MAdfZUNDf5TjvJ1zbv?= =?us-ascii?Q?TA/B7tHKVmQIRQcq9R2ceuYfZ+NAuB5oOYxIFWVeyx5TBdbLq7NCKKjvhrXW?= =?us-ascii?Q?HnS67NwljdSOQG7yL7e1xdiK3q9ZdbYSVNK0N8dJ2+lj0LqaBzgOqQpJwMwM?= =?us-ascii?Q?rvqeVRSPyrvU9wVNxagsc3L17L2xIeKFDQp22v35Pyq+PkGFCDmeindcPykX?= =?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axuDo2d0BYCVX+fGS679SsK+EtcSAtKJHfB0Sxg+k0sw4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; TY2PR01MB2075; 7:rufXSlrm4gP9WG9a8BE4uCsummJ3RTnxENwVQ96EEgGsyIpniv+nPPg+LSm25ekrDtzQ+LVmTnrBkrcHJJMf4FxJ6JZI/SSrLO4g/PBro4ZFS9tUPNG7K3QCx/HGM7rDmrvlG3AXM/kTXZlP/jfdRDenEnWb+qg1Zuqtlu1QgyeeP6LlltW6FkT+31OBvjj7WUp3Qwr+s1qF/TQyMqZxAj46FB8hEWRbesV5xB4r5wpNjgkxWGhsTiasYikaUYJK; 20:QMV6xaQELsC9fN/KR0vVB5xM/eLDDjHbkX8PMBbWRy9vESA4M0EgIFy8H8SoymRRzkD7yherdkA++TzDQuJdGdc0Q2hYYsDa0nT4F0dCWnbdWXKbaGjQRZTlz/mhmyeVXCuyZJY8gUNY5HExGXp7nBgWJZq6mY/q61/cohZOhOM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2018 01:46:17.7972 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d8d241aa-e77c-45a9-6e69-08d5944db3dc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR01MB2075 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.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 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto --- Hi Mark, Tim, Mauro ALSA SoC had replaced codec to component, thus, we can't use it anymore. This patch fixes it. But, I don't know who/how can handle it. drivers/media/i2c/tda1997x.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 3021913..5c5de3e 100644 --- a/drivers/media/i2c/tda1997x.c +++ b/drivers/media/i2c/tda1997x.c @@ -2444,7 +2444,7 @@ static int tda1997x_pcm_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct tda1997x_state *state = snd_soc_dai_get_drvdata(dai); - struct snd_soc_codec *codec = dai->codec; + struct snd_soc_component *component = dai->component; struct snd_pcm_runtime *rtd = substream->runtime; int rate, err; @@ -2452,11 +2452,11 @@ static int tda1997x_pcm_startup(struct snd_pcm_substream *substream, err = snd_pcm_hw_constraint_minmax(rtd, SNDRV_PCM_HW_PARAM_RATE, rate, rate); if (err < 0) { - dev_err(codec->dev, "failed to constrain samplerate to %dHz\n", + dev_err(component->dev, "failed to constrain samplerate to %dHz\n", rate); return err; } - dev_info(codec->dev, "set samplerate constraint to %dHz\n", rate); + dev_info(component->dev, "set samplerate constraint to %dHz\n", rate); return 0; } @@ -2479,20 +2479,23 @@ static int tda1997x_pcm_startup(struct snd_pcm_substream *substream, .ops = &tda1997x_dai_ops, }; -static int tda1997x_codec_probe(struct snd_soc_codec *codec) +static int tda1997x_codec_probe(struct snd_soc_component *component) { return 0; } -static int tda1997x_codec_remove(struct snd_soc_codec *codec) +static int tda1997x_codec_remove(struct snd_soc_component *component) { return 0; } -static struct snd_soc_codec_driver tda1997x_codec_driver = { +static struct snd_soc_component_driver tda1997x_codec_driver = { .probe = tda1997x_codec_probe, .remove = tda1997x_codec_remove, - .reg_word_size = sizeof(u16), + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, }; static int tda1997x_probe(struct i2c_client *client, @@ -2737,7 +2740,7 @@ static int tda1997x_probe(struct i2c_client *client, else formats = SNDRV_PCM_FMTBIT_S16_LE; tda1997x_audio_dai.capture.formats = formats; - ret = snd_soc_register_codec(&state->client->dev, + ret = devm_snd_soc_register_component(&state->client->dev, &tda1997x_codec_driver, &tda1997x_audio_dai, 1); if (ret) { @@ -2782,7 +2785,6 @@ static int tda1997x_remove(struct i2c_client *client) struct tda1997x_platform_data *pdata = &state->pdata; if (pdata->audout_format) { - snd_soc_unregister_codec(&client->dev); mutex_destroy(&state->audio_lock); }