From patchwork Wed Dec 22 14:16:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 528141 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C180CC433EF for ; Sun, 26 Dec 2021 08:20:01 +0000 (UTC) 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 0AC1C17AA; Sun, 26 Dec 2021 09:19:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0AC1C17AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1640506799; bh=KfJQQMdDxr26ojHcr4AuYBjfMuA67Kd209WPPCVC5dk=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=Xfk3JaGmnbG0ei2cjQXn5QMXzT0d6osmLT+atoe+Hit8ZGr5I+YOkcKbu9zoPcdcQ j2luHXWTV/URNlm6lo7zSIf3Nkj0LfJge0x4fIC/IsEZwuAIvNdPX0Cop6Tz14fyOn PaTV7qUKBqNwjblSwvAYES4Q8DF4psdGDuphcShs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9D94FF800DA; Sun, 26 Dec 2021 09:19:08 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2B354F80111; Wed, 22 Dec 2021 15:17:11 +0100 (CET) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9A669F800B5 for ; Wed, 22 Dec 2021 15:17:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9A669F800B5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="qhF9RKJX" Received: from localhost.localdomain (unknown [IPv6:2804:14c:485:504a:4709:e1da:a7a:6d6e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: festevam@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 8F3D880F90; Wed, 22 Dec 2021 15:17:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1640182622; bh=XBKLSD9OEW4fASgxr249dHYUGNl4nXR2HQ3gTPE4hKM=; h=From:To:Cc:Subject:Date:From; b=qhF9RKJX/DTKLo0WdX19cvRHZrbeNQ/MsfXVFACa6mNVJH1KO2yKglCsfRE81hdsx w1583Lue9ovIEHUWNBFcUNVnzQQR9sZ9MIdO7m30k9cXplFQL5Isvqn12n93L52Hfn raaxKKBQ4FUWgzD6kM7rz+XCZpueag3GMqiTKUOEk2qId28WV1sKqkVtmWZyYr8N0B SQ/JLvhSxXAXkDDJLzqHjwCfv3ifNhUEg55slf0vUYLvC25C1dpcj4n60MePeBMjMy Lv8/fZ4Sju8qYe/QyoXG+vn2sXtG4un/akpRda2Yn/5wPJ/5mVBvNHIUeDjMJk+y9V DJ8Hmx0ugyJrg== From: Fabio Estevam To: broonie@kernel.org Subject: [PATCH 1/2] ASoC: cs4265: Fix part number ID error message Date: Wed, 22 Dec 2021 11:16:44 -0300 Message-Id: <20211222141645.1482267-1-festevam@denx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean X-Mailman-Approved-At: Sun, 26 Dec 2021 09:19:06 +0100 Cc: alsa-devel@alsa-project.org, Fabio Estevam , ckeepax@opensource.cirrus.com, Paul.Handrigan@cirrus.com, james.schulman@cirrus.com 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The Chip ID - Register 01h contains the following description as per the CS4265 datasheet: "Bits 7 through 4 are the part number ID, which is 1101b (0Dh)" The current error message is incorrect as it prints CS4265_CHIP_ID, which is the register number, instead of printing the expected part number ID value. To make it clearer, also do a shift by 4, so that the error message would become: [ 4.218083] cs4265 1-004f: CS4265 Part Number ID: 0x0 Expected: 0xd Signed-off-by: Fabio Estevam --- sound/soc/codecs/cs4265.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c index cffd6111afac..b89002189a2b 100644 --- a/sound/soc/codecs/cs4265.c +++ b/sound/soc/codecs/cs4265.c @@ -611,8 +611,8 @@ static int cs4265_i2c_probe(struct i2c_client *i2c_client, if (devid != CS4265_CHIP_ID_VAL) { ret = -ENODEV; dev_err(&i2c_client->dev, - "CS4265 Device ID (%X). Expected %X\n", - devid, CS4265_CHIP_ID); + "CS4265 Part Number ID: 0x%x Expected: 0x%x\n", + devid >> 4, CS4265_CHIP_ID_VAL >> 4); return ret; } dev_info(&i2c_client->dev, From patchwork Wed Dec 22 14:16:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 528719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E4313C433EF for ; Sun, 26 Dec 2021 08:20:33 +0000 (UTC) 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 E6A1917B6; Sun, 26 Dec 2021 09:19:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E6A1917B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1640506832; bh=W7Avty83up2t635WXsPjKKQoz3+TAcQiywLDV/AOfuY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VUt2RYEoQUV4cTz0oUCikBuBvzuVK950skz5xVmYwl0z776DAmJd3tASyOTrgt4Dt JphFq2E5ffRPQNDQKiPNhD3uyzmp8Axzg2dW6T1WgV2H0iq3D8KrbZgAR8DJM87hDM uJnRxV813WOB4KRbvi6NvsL7IJv/fk6AGzqRZTi8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 26E3CF802DF; Sun, 26 Dec 2021 09:19:09 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8287EF80111; Wed, 22 Dec 2021 15:17:13 +0100 (CET) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E2DECF80105 for ; Wed, 22 Dec 2021 15:17:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E2DECF80105 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="E4pPQ4NT" Received: from localhost.localdomain (unknown [IPv6:2804:14c:485:504a:4709:e1da:a7a:6d6e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: festevam@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 7A5BF83041; Wed, 22 Dec 2021 15:17:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1640182625; bh=xc/YzeXNS5PcYycmv53uZiNZPzlyAoLVQnzUYJiKDC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E4pPQ4NTw3nyQMfhu7dBhxlBzw1Rc79WbGfS1fKvIBAxq2/YYg1oVHZbPLp45pLmT GwMUO7vo4HU9tjngDS3hfJ19onKLFKwFSRTWxVueKtzgObzKQosQCM/XL1hskVPLn8 sHazVWas1jt/RqVBJrZSYwiy7TM8z38hptS8dqgkVZMpMp0WhCoXb7ZNb2F54DnOsT ILiVcUopts4+tymLiiw6ymYFpdql064F3d9suQy43eSh5cDA7gXWYhnGsefrdNhafo A/iqD/pfWLtv1GVPkysu3g6tTeu2TbDZ0Jln13Tywh802iHqFLovQwWV76oPvgJzOm m5YIVT03xx1zA== From: Fabio Estevam To: broonie@kernel.org Subject: [PATCH 2/2] ASoC: cs4265: Move reset_gpio to local scope Date: Wed, 22 Dec 2021 11:16:45 -0300 Message-Id: <20211222141645.1482267-2-festevam@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211222141645.1482267-1-festevam@denx.de> References: <20211222141645.1482267-1-festevam@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean X-Mailman-Approved-At: Sun, 26 Dec 2021 09:19:06 +0100 Cc: alsa-devel@alsa-project.org, Fabio Estevam , ckeepax@opensource.cirrus.com, Paul.Handrigan@cirrus.com, james.schulman@cirrus.com 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" There is no need to keep 'struct gpio_desc *reset_gpio' inside the private structure becase reset_gpio is only used inside the probe() function. Move it to a local scope. Signed-off-by: Fabio Estevam --- sound/soc/codecs/cs4265.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c index b89002189a2b..88d89366f816 100644 --- a/sound/soc/codecs/cs4265.c +++ b/sound/soc/codecs/cs4265.c @@ -29,7 +29,6 @@ struct cs4265_private { struct regmap *regmap; - struct gpio_desc *reset_gpio; u8 format; u32 sysclk; }; @@ -573,6 +572,7 @@ static int cs4265_i2c_probe(struct i2c_client *i2c_client, const struct i2c_device_id *id) { struct cs4265_private *cs4265; + struct gpio_desc *reset_gpio; int ret; unsigned int devid = 0; unsigned int reg; @@ -589,14 +589,14 @@ static int cs4265_i2c_probe(struct i2c_client *i2c_client, return ret; } - cs4265->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev, - "reset", GPIOD_OUT_LOW); - if (IS_ERR(cs4265->reset_gpio)) - return PTR_ERR(cs4265->reset_gpio); + reset_gpio = devm_gpiod_get_optional(&i2c_client->dev, "reset", + GPIOD_OUT_LOW); + if (IS_ERR(reset_gpio)) + return PTR_ERR(reset_gpio); - if (cs4265->reset_gpio) { + if (reset_gpio) { mdelay(1); - gpiod_set_value_cansleep(cs4265->reset_gpio, 1); + gpiod_set_value_cansleep(reset_gpio, 1); } i2c_set_clientdata(i2c_client, cs4265);