From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 487D9C43603 for ; Fri, 20 Dec 2019 12:11:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1472524679 for ; Fri, 20 Dec 2019 12:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576843917; bh=K04Kd/JIgIwx8J931dev25po0GvaN0DUsXPBGFUx8jk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=nLao5FHnpvOlXrgxCHd/aSbB4QK0A6MpEr0lADraaw50j9ck3L26I6CgP1X8etHn+ 70EEeHvnt0ULgtU++5TKgdog0lV/ZawrhKwoiLuahHaBYwSXXuN2CHzGg8ZdM/pSij 2wg3w3t6QytcvV9Z84dYUn3yMovkDDC1XZ6MiwA8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727298AbfLTML4 (ORCPT ); Fri, 20 Dec 2019 07:11:56 -0500 Received: from foss.arm.com ([217.140.110.172]:50244 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727191AbfLTMLz (ORCPT ); Fri, 20 Dec 2019 07:11:55 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EA40830E; Fri, 20 Dec 2019 04:11:54 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 683BC3F719; Fri, 20 Dec 2019 04:11:54 -0800 (PST) Date: Fri, 20 Dec 2019 12:11:52 +0000 From: Mark Brown To: Jeff Chang Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, jeff_chang@richtek.com Subject: Re: [PATCH] ASoC: Add MediaTek MT6660 Speaker Amp Driver Message-ID: <20191220121152.GC4790@sirena.org.uk> References: <1576836934-5370-1-git-send-email-richtek.jeff.chang@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Y5rl02BVI9TCfPar" Content-Disposition: inline In-Reply-To: <1576836934-5370-1-git-send-email-richtek.jeff.chang@gmail.com> X-Cookie: I think we're in trouble. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Y5rl02BVI9TCfPar Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 20, 2019 at 06:15:34PM +0800, Jeff Chang wrote: > +++ b/sound/soc/codecs/mt6660.c > @@ -0,0 +1,653 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (c) 2019 MediaTek Inc. > + */ Please make the entire comment a C++ one so things look more intentional. > + { MT6660_REG_DEVID, 2}, > + { MT6660_REG_TDM_CFG3, 2}, > + { MT6660_REG_HCLIP_CTRL, 2}, > + { MT6660_REG_DA_GAIN, 2}, Missing space before the } (the same thing happens in some of the other tables). > +static int mt6660_component_get_volsw(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_value *ucontrol) > +{ > + struct snd_soc_component *component = > + snd_soc_kcontrol_component(kcontrol); > + struct mt6660_chip *chip = (struct mt6660_chip *) > + snd_soc_component_get_drvdata(component); > + int ret = -EINVAL; > + > + if (!strcmp(kcontrol->id.name, "Chip_Rev")) { Why would this be used on a different control? > + SOC_SINGLE_EXT("BoostMode", MT6660_REG_BST_CTRL, 0, 3, 0, > + snd_soc_get_volsw, snd_soc_put_volsw), Boost Mode. You've also got a lot of these controls that are _EXT but you then just use standard operations so it's not clear why you're using _EXT. > + SOC_SINGLE_EXT("audio input selection", MT6660_REG_DATAO_SEL, 6, 3, 0, > + snd_soc_get_volsw, snd_soc_put_volsw), Audio Input Selection, but this looks like it should be a DAPM control if it's controlling audio routing. A simple numerical setting definitely doesn't seem like the right thing. > + SOC_SINGLE_EXT("AUD LOOP BACK Switch", MT6660_REG_PATH_BYPASS, 4, 1, 0, > + snd_soc_get_volsw, snd_soc_put_volsw), This sounds like it should be a DAPM thing too. > +static int mt6660_component_probe(struct snd_soc_component *component) > +{ > + struct mt6660_chip *chip = snd_soc_component_get_drvdata(component); > + int ret = 0; > + > + dev_info(component->dev, "%s\n", __func__); dev_dbg() at most but probably better to remove this and the other similar dev_info()s. > +static inline int _mt6660_chip_id_check(struct mt6660_chip *chip) > +{ > + u8 id[2] = {0}; > + int ret = 0; > + > + ret = i2c_smbus_read_i2c_block_data(chip->i2c, MT6660_REG_DEVID, 2, id); > + if (ret < 0) > + return ret; > + ret = (id[0] << 8) + id[1]; > + ret &= 0x0ff0; > + if (ret != 0x00e0 && ret != 0x01e0) > + return -ENODEV; It'd be better to print an error message saying we don't recognize the device to help people doing debugging. > + if (of_property_read_u32(np, "rt,init_setting_num", &val)) { > + dev_info(dev, "no init setting\n"); > + chip->plat_data.init_setting_num = 0; You should be adding a DT binding document for any new DT bindings. --Y5rl02BVI9TCfPar Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl38uogACgkQJNaLcl1U h9B+kQf6AzhZSat7mqBSwJVubwAXZcJ6ApJ29GlB2ypbTdOhUOTKKR8ytA2kMg6l Ifw88ajLzpL4jAIHwwS3NOMonMD/9KgNLfQVgMxzuzsYyRYBmj7p9lXsYICNIvoe nSn2nPJfw5g5PlMZ+qwxyNNMTOkui6qKCFoFS77TJq0hsbTh+x6azMfn8VVRwrL+ VRXPN2C9mAdyrVPw/XPjkTyCrXw8P6brXK6qW23Y14FRQ8dXke0rhMumWytquybM ebURG75CUEXyykGbNGHoJa4ycypd5AA/LYR86mzRbs7Mxiqlmw3co8/C44n4XKM0 QungC3A3a98p1kNSIiBM9g2Ie+cgBw== =pOxx -----END PGP SIGNATURE----- --Y5rl02BVI9TCfPar-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85379C43603 for ; Fri, 20 Dec 2019 12:12:53 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F77524680 for ; Fri, 20 Dec 2019 12:12:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="npqkPWGa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F77524680 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F20E7165E; Fri, 20 Dec 2019 13:12:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F20E7165E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1576843971; bh=l4SiG5Do3taU62ejND4qgS2G7guRCbgUiLHqs/lNcuo=; h=Date:From:To:References:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=npqkPWGamsvw6sGai/p5KOO6BksfCpzyDID0IUhjuyO9bvrU7PI4uvLl/kIWQWaSG Nhv5PMPkGNMzbJjBnELzQwOqLWPoxBvwxo/ctHdiehDHYArRNFyOh1B3VVseEHQ9DJ 2KUzC2lY784sKiE+z8kIecNRAlcBmn9mIlYkWgZQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 80A9AF8014C; Fri, 20 Dec 2019 13:12:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6ED01F8014F; Fri, 20 Dec 2019 13:11:59 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by alsa1.perex.cz (Postfix) with ESMTP id E5D5FF80059 for ; Fri, 20 Dec 2019 13:11:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E5D5FF80059 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EA40830E; Fri, 20 Dec 2019 04:11:54 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 683BC3F719; Fri, 20 Dec 2019 04:11:54 -0800 (PST) Date: Fri, 20 Dec 2019 12:11:52 +0000 From: Mark Brown To: Jeff Chang Message-ID: <20191220121152.GC4790@sirena.org.uk> References: <1576836934-5370-1-git-send-email-richtek.jeff.chang@gmail.com> MIME-Version: 1.0 In-Reply-To: <1576836934-5370-1-git-send-email-richtek.jeff.chang@gmail.com> X-Cookie: I think we're in trouble. User-Agent: Mutt/1.10.1 (2018-07-13) Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.com, lgirdwood@gmail.com, jeff_chang@richtek.com, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org Subject: Re: [alsa-devel] [PATCH] ASoC: Add MediaTek MT6660 Speaker Amp Driver X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Content-Type: multipart/mixed; boundary="===============1051287562156117635==" Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" --===============1051287562156117635== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Y5rl02BVI9TCfPar" Content-Disposition: inline --Y5rl02BVI9TCfPar Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 20, 2019 at 06:15:34PM +0800, Jeff Chang wrote: > +++ b/sound/soc/codecs/mt6660.c > @@ -0,0 +1,653 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (c) 2019 MediaTek Inc. > + */ Please make the entire comment a C++ one so things look more intentional. > + { MT6660_REG_DEVID, 2}, > + { MT6660_REG_TDM_CFG3, 2}, > + { MT6660_REG_HCLIP_CTRL, 2}, > + { MT6660_REG_DA_GAIN, 2}, Missing space before the } (the same thing happens in some of the other tables). > +static int mt6660_component_get_volsw(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_value *ucontrol) > +{ > + struct snd_soc_component *component = > + snd_soc_kcontrol_component(kcontrol); > + struct mt6660_chip *chip = (struct mt6660_chip *) > + snd_soc_component_get_drvdata(component); > + int ret = -EINVAL; > + > + if (!strcmp(kcontrol->id.name, "Chip_Rev")) { Why would this be used on a different control? > + SOC_SINGLE_EXT("BoostMode", MT6660_REG_BST_CTRL, 0, 3, 0, > + snd_soc_get_volsw, snd_soc_put_volsw), Boost Mode. You've also got a lot of these controls that are _EXT but you then just use standard operations so it's not clear why you're using _EXT. > + SOC_SINGLE_EXT("audio input selection", MT6660_REG_DATAO_SEL, 6, 3, 0, > + snd_soc_get_volsw, snd_soc_put_volsw), Audio Input Selection, but this looks like it should be a DAPM control if it's controlling audio routing. A simple numerical setting definitely doesn't seem like the right thing. > + SOC_SINGLE_EXT("AUD LOOP BACK Switch", MT6660_REG_PATH_BYPASS, 4, 1, 0, > + snd_soc_get_volsw, snd_soc_put_volsw), This sounds like it should be a DAPM thing too. > +static int mt6660_component_probe(struct snd_soc_component *component) > +{ > + struct mt6660_chip *chip = snd_soc_component_get_drvdata(component); > + int ret = 0; > + > + dev_info(component->dev, "%s\n", __func__); dev_dbg() at most but probably better to remove this and the other similar dev_info()s. > +static inline int _mt6660_chip_id_check(struct mt6660_chip *chip) > +{ > + u8 id[2] = {0}; > + int ret = 0; > + > + ret = i2c_smbus_read_i2c_block_data(chip->i2c, MT6660_REG_DEVID, 2, id); > + if (ret < 0) > + return ret; > + ret = (id[0] << 8) + id[1]; > + ret &= 0x0ff0; > + if (ret != 0x00e0 && ret != 0x01e0) > + return -ENODEV; It'd be better to print an error message saying we don't recognize the device to help people doing debugging. > + if (of_property_read_u32(np, "rt,init_setting_num", &val)) { > + dev_info(dev, "no init setting\n"); > + chip->plat_data.init_setting_num = 0; You should be adding a DT binding document for any new DT bindings. --Y5rl02BVI9TCfPar Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl38uogACgkQJNaLcl1U h9B+kQf6AzhZSat7mqBSwJVubwAXZcJ6ApJ29GlB2ypbTdOhUOTKKR8ytA2kMg6l Ifw88ajLzpL4jAIHwwS3NOMonMD/9KgNLfQVgMxzuzsYyRYBmj7p9lXsYICNIvoe nSn2nPJfw5g5PlMZ+qwxyNNMTOkui6qKCFoFS77TJq0hsbTh+x6azMfn8VVRwrL+ VRXPN2C9mAdyrVPw/XPjkTyCrXw8P6brXK6qW23Y14FRQ8dXke0rhMumWytquybM ebURG75CUEXyykGbNGHoJa4ycypd5AA/LYR86mzRbs7Mxiqlmw3co8/C44n4XKM0 QungC3A3a98p1kNSIiBM9g2Ie+cgBw== =pOxx -----END PGP SIGNATURE----- --Y5rl02BVI9TCfPar-- --===============1051287562156117635== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel --===============1051287562156117635==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D607C43603 for ; Fri, 20 Dec 2019 12:12:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E49124679 for ; Fri, 20 Dec 2019 12:12:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rDIjU6q2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E49124679 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bwN5iI5nKi4YABJs1AEDf7vh1A5VpnsoJggh+S52gNo=; b=rDIjU6q2LF1GUTYgavNgN4nRw D1t2U8Npef96eUr9E1gOE/vHnllnBsRz0j0JmQvcmvcYGIyFNh1VLC4OL9HRWTPEj9d67eah/rJz7 0tGSHoebVOzf41nVBilZpUUtbFQPttkfAwtxEasOIx5lUEfRl8jeN9MX2h7JYMbqL61rp0c1tL/6h /swPvGZjWfL+/3uT6dR6rmL6NxNnOs/Di54ku/ag278rYnxCREMTNV0Ab/91rTZvWgfe2BuyC4PEO BTcIyUJOOek/hbMZYQq2eHKgYV/mwYfP7Icdf8PtFddG4KFOTo/zFtGTrLf0G9JTC5/oRvCwn8ETQ r6P1Mirzw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iiH8T-00032w-Qf; Fri, 20 Dec 2019 12:12:01 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iiH8P-00031V-3w for linux-arm-kernel@lists.infradead.org; Fri, 20 Dec 2019 12:12:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EA40830E; Fri, 20 Dec 2019 04:11:54 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 683BC3F719; Fri, 20 Dec 2019 04:11:54 -0800 (PST) Date: Fri, 20 Dec 2019 12:11:52 +0000 From: Mark Brown To: Jeff Chang Subject: Re: [PATCH] ASoC: Add MediaTek MT6660 Speaker Amp Driver Message-ID: <20191220121152.GC4790@sirena.org.uk> References: <1576836934-5370-1-git-send-email-richtek.jeff.chang@gmail.com> MIME-Version: 1.0 In-Reply-To: <1576836934-5370-1-git-send-email-richtek.jeff.chang@gmail.com> X-Cookie: I think we're in trouble. User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191220_041157_241884_0D8A1A5F X-CRM114-Status: GOOD ( 17.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.com, lgirdwood@gmail.com, jeff_chang@richtek.com, matthias.bgg@gmail.com, perex@perex.cz, linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============5739087664045095893==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5739087664045095893== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Y5rl02BVI9TCfPar" Content-Disposition: inline --Y5rl02BVI9TCfPar Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 20, 2019 at 06:15:34PM +0800, Jeff Chang wrote: > +++ b/sound/soc/codecs/mt6660.c > @@ -0,0 +1,653 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (c) 2019 MediaTek Inc. > + */ Please make the entire comment a C++ one so things look more intentional. > + { MT6660_REG_DEVID, 2}, > + { MT6660_REG_TDM_CFG3, 2}, > + { MT6660_REG_HCLIP_CTRL, 2}, > + { MT6660_REG_DA_GAIN, 2}, Missing space before the } (the same thing happens in some of the other tables). > +static int mt6660_component_get_volsw(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_value *ucontrol) > +{ > + struct snd_soc_component *component = > + snd_soc_kcontrol_component(kcontrol); > + struct mt6660_chip *chip = (struct mt6660_chip *) > + snd_soc_component_get_drvdata(component); > + int ret = -EINVAL; > + > + if (!strcmp(kcontrol->id.name, "Chip_Rev")) { Why would this be used on a different control? > + SOC_SINGLE_EXT("BoostMode", MT6660_REG_BST_CTRL, 0, 3, 0, > + snd_soc_get_volsw, snd_soc_put_volsw), Boost Mode. You've also got a lot of these controls that are _EXT but you then just use standard operations so it's not clear why you're using _EXT. > + SOC_SINGLE_EXT("audio input selection", MT6660_REG_DATAO_SEL, 6, 3, 0, > + snd_soc_get_volsw, snd_soc_put_volsw), Audio Input Selection, but this looks like it should be a DAPM control if it's controlling audio routing. A simple numerical setting definitely doesn't seem like the right thing. > + SOC_SINGLE_EXT("AUD LOOP BACK Switch", MT6660_REG_PATH_BYPASS, 4, 1, 0, > + snd_soc_get_volsw, snd_soc_put_volsw), This sounds like it should be a DAPM thing too. > +static int mt6660_component_probe(struct snd_soc_component *component) > +{ > + struct mt6660_chip *chip = snd_soc_component_get_drvdata(component); > + int ret = 0; > + > + dev_info(component->dev, "%s\n", __func__); dev_dbg() at most but probably better to remove this and the other similar dev_info()s. > +static inline int _mt6660_chip_id_check(struct mt6660_chip *chip) > +{ > + u8 id[2] = {0}; > + int ret = 0; > + > + ret = i2c_smbus_read_i2c_block_data(chip->i2c, MT6660_REG_DEVID, 2, id); > + if (ret < 0) > + return ret; > + ret = (id[0] << 8) + id[1]; > + ret &= 0x0ff0; > + if (ret != 0x00e0 && ret != 0x01e0) > + return -ENODEV; It'd be better to print an error message saying we don't recognize the device to help people doing debugging. > + if (of_property_read_u32(np, "rt,init_setting_num", &val)) { > + dev_info(dev, "no init setting\n"); > + chip->plat_data.init_setting_num = 0; You should be adding a DT binding document for any new DT bindings. --Y5rl02BVI9TCfPar Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl38uogACgkQJNaLcl1U h9B+kQf6AzhZSat7mqBSwJVubwAXZcJ6ApJ29GlB2ypbTdOhUOTKKR8ytA2kMg6l Ifw88ajLzpL4jAIHwwS3NOMonMD/9KgNLfQVgMxzuzsYyRYBmj7p9lXsYICNIvoe nSn2nPJfw5g5PlMZ+qwxyNNMTOkui6qKCFoFS77TJq0hsbTh+x6azMfn8VVRwrL+ VRXPN2C9mAdyrVPw/XPjkTyCrXw8P6brXK6qW23Y14FRQ8dXke0rhMumWytquybM ebURG75CUEXyykGbNGHoJa4ycypd5AA/LYR86mzRbs7Mxiqlmw3co8/C44n4XKM0 QungC3A3a98p1kNSIiBM9g2Ie+cgBw== =pOxx -----END PGP SIGNATURE----- --Y5rl02BVI9TCfPar-- --===============5739087664045095893== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5739087664045095893==--