From patchwork Mon Apr 23 02:10:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10355987 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 BD76B6019C for ; Mon, 23 Apr 2018 02:10:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A117928A38 for ; Mon, 23 Apr 2018 02:10:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95C4C28A35; Mon, 23 Apr 2018 02:10:38 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 E39F528A31 for ; Mon, 23 Apr 2018 02:10:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753841AbeDWCKc (ORCPT ); Sun, 22 Apr 2018 22:10:32 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:52480 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753791AbeDWCKa (ORCPT ); Sun, 22 Apr 2018 22:10:30 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 23 Apr 2018 11:10:28 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id E87596FD32; Mon, 23 Apr 2018 11:10:28 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.49,315,1520866800"; d="scan'208";a="277553150" Received: from mail-os2jpn01lp0147.outbound.protection.outlook.com (HELO JPN01-OS2-obe.outbound.protection.outlook.com) ([23.103.139.147]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 23 Apr 2018 11:10:28 +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=d9DSw6Lse7OeGe3DdYqu2Bmdh0NM+hqdKahAqtVTvnU=; b=U7lXg8wv6MfLo/dROZ/Y3YQFTP9WL7F3AVCj3NuHGTcEAqv3n2XefbucS+URxRqkhl2juljKGmPP5gM2EgAlcuzraOGipsD49R6eBbgApkw6Uq0tg+0vCG0zzllAnMiUX269p3w4Qa0gsJprxbBRT8M//SBxdaCEhjWUrT/eOYg= 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 OSBPR01MB2071.jpnprd01.prod.outlook.com (2603:1096:603:22::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Mon, 23 Apr 2018 02:10:26 +0000 Message-ID: <87in8ibrql.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Mark Brown , Tim Harvey , Mauro Carvalho Chehab Cc: Linux-ALSA , , Subject: [PATCH v3][RESEND] media: i2c: tda1997: replace codec to component User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Mon, 23 Apr 2018 02:10:26 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: OSAPR01CA0029.jpnprd01.prod.outlook.com (2603:1096:603:14::17) To OSBPR01MB2071.jpnprd01.prod.outlook.com (2603:1096:603:22::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:OSBPR01MB2071; X-Microsoft-Exchange-Diagnostics: 1; OSBPR01MB2071; 3:L2+1z2a9ipiJDwsPnERTFeKB8vOHqG9QZnxVyWO1tVQbWJVuImYRycKsEusUMevsL26aFc/aCLo5IkuwKUpNGsnozXZCOOeRAmMYSqTakXPA67icDZTQM6rYpNd8JW7pYM+qnQlK4VE6nSTH9vONCIX5cx4Ah9I08tCdL2C2OsqhVuENRGd9oRX8IlqmEdfOAlCW0YjuGen8cCp/Y3ITdwngsafwTeayFjw3pBvQh6fzRRWci9HA/BzffZpfZeWi; 25:7wvmxL51cCf67sVKMdsiy9o+YJ8imCA2+T/4jhAaiPPlPGL4QumJ78iTemtoMuRpwZgMGr461SHFKeL0SmR9guHWSkA5jEXCiOpRPbY0nsuAAxii7FalQAGtZYwfebsa/Vzvl25TafTR/3YPaC2lB7sUs3LDU4FnRox2SclCpBYEZnfdJqMnIB7wV+pF3hYegyF44clVRhPQiblhTSWO6FvY7kmIBs4L0jtwU4NnlUCDahoxb/GIgptM93tXrH5tmdWxkth5k5j/cDY3K9lM4ACNiMUMLDjN1Gwlc34W7Eo/hSfJV01Lqn21oRYD+DGHSELFKEbF23MGXb3bM7u1Xw==; 31:2pqth+OxZyGJnAlbDWSIj4ZXmqD3rLzNHpmO1T64XjZV7rD4sswMz3bt79Ys5mEg04AWffzJ9XRn+6crzchOJ6EyfyZ+Bxlxst1+5wcRPFI/Uj/mn3PhJtvIs+4ozCRZ/iqn4SB/Xzsgj9TQvIeouqgdOHadR7TrC76R6gkQfAPgZOadSPNqR8Ktl6O4p0JHew/9tbsQ/Tofj6Z3rGNT/wr/ck+14MpSwhl6VzUuwso= X-MS-TrafficTypeDiagnostic: OSBPR01MB2071: X-Microsoft-Exchange-Diagnostics: 1; OSBPR01MB2071; 20:I4xeuLDAxzz9l/wEVKV1QLUteDrJ3yON13Y9zlYKV1fjlzqdApyUzR6dLJu9P9nwnafAS8L7Wk4mnyZ0usLpnfHA4rKiiHEaRVp+VkglFAm9JUifBvXnydec9tvOcM1VY/0TPzzR2FXFtPe16wqjgYmYLjnfdxdGahNBBbxR1rRTiM39TXWELg6m289tv0p4r20nDGT8i+RadfL/+3yFIrFuJsQxtaUXuyJVpmuvm7VgYaecQIFxUVwThrOOvHBEtSCAoEoFQ9wYY5YK8+0kewJ0dQ9zDgGq9GZQJJHSPwRvQl12imSVYef3ZoyhYIQ7j0Ueo55kLrIFvmgu8sDFR+hk5cNHtVL4N5Lvrt82nLJgMktb2QSpJYEpkbeh5bMlt9LYVgFXogbrg8C86PO9HBtkr1cPuLsaXjBBGwFeVSI03fdYZN1yRsPsl6jR6JykIjmEUpwB9x2wNxpitn4+4nC5b8vWTm5O1WR3sD7WLDhi0+jfSB7oza9WpzIR2AFA; 4:dsyMxdro/wrQbRWkKhRIvUIarAZQInQ5ov/Z289dI2PGxD6vnKJxdskhxBwOLNwmsx7pAU51DMK6zYQlQKL3B+NQQnMBqpZZy9ycKExxbgxc+xlviQ+eGGbxFf/V3tlIdRSXtLq6QlNXIpo6G+DNhd/TJyzKoKpDPXMkTmbwW+nelRWKWR3UqedTAPBxGhz7E/94JJiiAJVM63AXI+gtexHkrDqUkPcjLT4oTLm47CrNwBOqPwP1lZKj46UFCLgrQ+G2C5Bhfug09wKmPsXk8Q0dMM/gn/RfAbZAQVOzrO+gK2x+PoTgcSVYzqdQT/xy 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)(8121501046)(5005006)(3231232)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:OSBPR01MB2071; BCL:0; PCL:0; RULEID:; SRVR:OSBPR01MB2071; X-Forefront-PRVS: 06515DA04B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39860400002)(346002)(376002)(39380400002)(396003)(366004)(478600001)(25786009)(36756003)(4326008)(81166006)(8676002)(1720100001)(86362001)(8936002)(53416004)(66066001)(966005)(5660300001)(6306002)(6116002)(7736002)(6486002)(3846002)(956004)(2616005)(50466002)(7696005)(52116002)(316002)(26005)(305945005)(23726003)(53936002)(47776003)(58126008)(16586007)(16526019)(2906002)(386003)(476003)(186003)(59450400001)(110136005)(54906003)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:OSBPR01MB2071; H:morimoto-PC.renesas.com; FPR:; SPF:None; LANG:en; MLV:nov; PTR:InfoNoRecords; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; OSBPR01MB2071; 23:xjPAncEd02+8HP+XPGJoFFXRXOT8ol9ZRVwy8cXTR?= =?us-ascii?Q?X2ZSuXmHYQl1QduZ8geEelwu2oINgjGymsppkLZk1VWnnS7ncv+qNZvsrOA8?= =?us-ascii?Q?zpt3Q9NF7Z5RW3fUbGIm6eEv+D8JMS+liXnTfK1fU1Zotde5FRKmpJ+dQBZ+?= =?us-ascii?Q?foizJVsUNV76FPKrSLIzvOEuwCS0CebBkIlMCkqReb45BHKgkcV/A7/+bBxm?= =?us-ascii?Q?2b/ks2NfHtZYL0/6pXsrqW+5JxcsPMSh2R17txsFuPCW7Xkh6U/RW7MK7QG+?= =?us-ascii?Q?ftG8JbDVJqRM3tppEeS9iluH+4zMEBCGZ7WG11bMC16P3yIWtf6+P5qUM9Ue?= =?us-ascii?Q?g9dOdgbi5vPzAwrP8SfX0HSApE9knqHsJP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LHk80kZ6EJ X-Microsoft-Exchange-Diagnostics: 1; OSBPR01MB2071; 6:2Z3Q2tQvbFb1ar7IagqDoNsSdioogZEe7j1TISv8tPhi/aQFFC4D0aSaV8mHBXGabtNEU2Qui+gnRxYqHHdeH2LVrhfimzcAVRTnU5G1OgwCIo+AL7qVQMy1+w9HFKyA5orUADZYIOtSlrhL+E7uwTZW1OotZnrVeDJswZB3nI6yFazR0zzWr5v/3lIMftyAwTqPhphoOrxydNXJtcZPFsMBqy26RRmdPiCb7r19RqzjqmkhaKHIyTHRkme2PpobxxpgD0oUsfeLGMwykBgUk1uJ3GiuXbcjn+I51O+V4dh1AorB5ksg2oXiU9wwKlacYP2tZgHbV0slVCRnx8vfMCydEEUGNBcYaKPpNi8D97rRLUWcZ7gV2AGjTV4f2My9qgEfiU3hf25lAFfxx4w4bm5T5JiDYfV/dflHNanwIfkpJ6LOEues0XR3w7bIkfi3xDnzWrCmVf9ukdsADtgrHQ==; 5:joBAeFMQYqZGviVDh4b3HV56ruAWHY+9WBjN+sDon/MMkYi3xm0VLMbio5vwxvuBydOhTr3SZ+SIdftKzPCNm2hHgTKhebp/TG9HJA3mQfhCTDf+XoX9ux5SyBPPyg6nCbacCk+IzyNXwtWO3lQrNLNuBto1RowJpb8XC5UR3n4=; 24:RH5l9XUZI0+mKqXq8tYcIr+VJmqKF2y1fD6eH+M2HSeAxXuQMQzjEmex833Tx6rU0Yw7o3TO1NfvdDmbRD64guIEd0c8XQ9y3aQBGr/+njs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; OSBPR01MB2071; 7:unByvcyAZDYLqONk99wu5hYHIWW7vDNwfVn141z75FXmmvcyEn9joBV/7gsaOMeW1SDKubUjxx5uG7kruLANqsM2eRafUhUqLazAVConRyYJhk/IwrkWj4hMi8P+Db/gi2lo0mhO3vUTgsvgdogHQaJkoPnxbjnAGvujB0M8XHWF42KtKr5/nQqHELYHBntjSiBrEXH29IrP7A1nptWlu8iIp6GinuZ5Z0ONqKLjHpDkteiN0s+SIW5zCY7j6aRL; 20:iTI0esNyX29j0oCGpWhohnHIAvZFskAEC9hhbocZqE3YoZyQKPDhz4qP2oXKNZ8weLhdNMtW9ecH6d/VftByplq9rhWnun6Kw9afumVCtVwSTegFe02vPRsYEFR+Kt9mkwItUwrwnZWRb7qGXEWzX0ZQHpZO1L1MEwKk/oX6Xqg= X-MS-Office365-Filtering-Correlation-Id: e644183d-5f63-40d7-e411-08d5a8bf6178 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2018 02:10:26.8450 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e644183d-5f63-40d7-e411-08d5a8bf6178 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSBPR01MB2071 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 Tested-by: Tim Harvey Acked-by: Tim Harvey Acked-by: Mauro Carvalho Chehab --- Tim, Mauro 2 weeks passed. I re-send. This replace patch is needed for ALSA SoC, otherwise it can't probe anymore. v2 -> v3 - fixup driver name (= tda1997) drivers/media/i2c/tda1997x.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 3021913..33d7fcf 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,22 @@ 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 void tda1997x_codec_remove(struct snd_soc_component *component) { - return 0; } -static struct snd_soc_codec_driver tda1997x_codec_driver = { - .probe = tda1997x_codec_probe, - .remove = tda1997x_codec_remove, - .reg_word_size = sizeof(u16), +static struct snd_soc_component_driver tda1997x_codec_driver = { + .probe = tda1997x_codec_probe, + .remove = tda1997x_codec_remove, + .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 +2739,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 +2784,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); }