From patchwork Wed Dec 22 14:19:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 12691765 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 3B424C433EF for ; Wed, 22 Dec 2021 14:21:12 +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 666731761; Wed, 22 Dec 2021 15:20:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 666731761 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1640182870; bh=DKWn9cfttcYvnpF3WW22bTe4YUUlN+AIwOlHrKwDGo8=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=piluZQyXArMlZlqVyaQqpe4XpFs+XGeumEf6n72kmEcTKxLTqzJOxJpUYB0JkOSIa O7AFbZChb9ZZOpKp4DYv3ickw3CP293X0KyU7I6ok4s0D1I+mNZKgQmymHhJf73oix YEOBtRDsMIrJ9I97+HZVeUCeh0MU8DwGOU3ZXhKo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 92326F80109; Wed, 22 Dec 2021 15:19:47 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6D5E6F8020D; Wed, 22 Dec 2021 15:19:46 +0100 (CET) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (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 31B2BF80107 for ; Wed, 22 Dec 2021 15:19:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 31B2BF80107 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PptDHFwo" Received: by mail-qt1-x82f.google.com with SMTP id 8so2020435qtx.5 for ; Wed, 22 Dec 2021 06:19:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bWJVoPrU62uuuz7n9/V3GlTG969KN0vv6pvLIa8XuJQ=; b=PptDHFwo3D7/SctsLtS8NYL/a8NwRe9tEkuFt/GslNgvfSWUtDlt+TQIpPcaHUC9fi +8Kbia4J3L5HLKzzZXVDNg5sdy1/u8lox7VZVSWb2+XuaaqstKS2cll375KUJjK6wzCV 42fO6mzgJ9QwWLlYgELLGwskPj0NjkE/8qSp/WfK0iAK8PREtESBRhiOlDhF5EdHgkr+ LNKaA5p9fch52CriyHZv4y3vu5H49RVCrZ5K+J+Iwyb7qt85AWy9aOPyXMUzRv6LjeRz rGPuxAFEGPTN+jaGinuhJcZcjNlcfv3Eyf0h86J2joMe6MV1t5TbdaE32h+ThLUEYL71 0qbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bWJVoPrU62uuuz7n9/V3GlTG969KN0vv6pvLIa8XuJQ=; b=rL/OgZWM4Twup7JmWJc/7Z5dbHppaHtsqI42NPopXnddmfBeNhPWqoBro1WO8+4uRW VsedqBCfJ1XcLdrQhIM9GZKVy+GcfYVu+uPzkGWvaJpKq4l9EA5z9mFP5U/c2tt+QPuj hyvlpCKttKoki1C5EbxWC1GIaiBKtY7oKjW5284YtpM+OwP4dlIyPkjdddh/u18vxMlu khmqzSknT2np1pldpKADWSfk5ClzO52fQaT2LTQDzK0O+DfPCwHXSfJUnmKeAyUaGwfs 2uv3RcE7P5NJW4Et4PrfwcWBuGAZ+AZb1aE/4ZZ0HpIwEz9bTXwJGRyS2bEgRLG6G9/T +uWQ== X-Gm-Message-State: AOAM533lCnfKvg76B1JScehxu7RF19OyEa83G3bkzTR994eejV2qye/y tYYXY8KsSBxxSVflJfjeKhU= X-Google-Smtp-Source: ABdhPJyteWmlWO5Q7SKOTpJhwTKZbvmEi+avJuqHYJNAfAAOyQTZ6LgaUvCeG0hOAOCpvSdUK+1vkg== X-Received: by 2002:ac8:584a:: with SMTP id h10mr2195396qth.615.1640182772049; Wed, 22 Dec 2021 06:19:32 -0800 (PST) Received: from localhost.localdomain ([2804:14c:485:504a:4709:e1da:a7a:6d6e]) by smtp.gmail.com with ESMTPSA id b9sm1803990qtb.53.2021.12.22.06.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Dec 2021 06:19:31 -0800 (PST) From: Fabio Estevam To: broonie@kernel.org Subject: [PATCH RESEND 1/2] ASoC: cs4265: Fix part number ID error message Date: Wed, 22 Dec 2021 11:19:19 -0300 Message-Id: <20211222141920.1482451-1-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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" From: Fabio Estevam 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 Acked-by: Charles Keepax --- Sorry, I am resending because I was not subscribed in the alsa-list from the other e-mail account. 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:19:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 12691764 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 BB4FFC433F5 for ; Wed, 22 Dec 2021 14:20:37 +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 750A9173E; Wed, 22 Dec 2021 15:19:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 750A9173E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1640182835; bh=slJUjsdML78x+OhS7JlbpojLz49K2SAgZauT90+J3eU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=F4mZb+AxwX/3tz9K6xN3hABaijx27ILr9EtT9LUtAphZryK7hmjeFEqMZHLYPLAj5 N31436IDyuUCpTOiqIKhUHnzp5FFJjdfORJO+3tRAbDVDcjXdjSA/JtwbdHdDw9izd Y0wptikiEpG4MXqrbwA54f/t1i8Zw0ZP9s4w7MeI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 16F7BF800B5; Wed, 22 Dec 2021 15:19:45 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E6AE1F80111; Wed, 22 Dec 2021 15:19:43 +0100 (CET) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 B5E0DF80105 for ; Wed, 22 Dec 2021 15:19:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B5E0DF80105 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m7uhfmjB" Received: by mail-qt1-x836.google.com with SMTP id 8so2020541qtx.5 for ; Wed, 22 Dec 2021 06:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i5ZIY4065lAUAEWLLFizJmNYttH1lhQoJWZCwlRqXS4=; b=m7uhfmjBWlbMAdVXWg1ZmJoUM9qOot3symJR95YagQv3VORKtniNYS/m6YkvRwrlJ4 /09rZpYcy9boxzXO/W11nRZAdfMTQrF6ei3G7DyeQzR85YzpWo1LDf/qj6U2egZWQPvM Effk9omq/ZTgqllaMy3SfZyvZVTzEXlbdV4jXqzd9rynHVkfY0OZ0jVA5/QQfT9IzTq7 qXbiqQdczWqBkoPy2Mh+aGW8/zSaqrzGBu4bZhQHg3A9gCqvO34BXMAVHTq9U3j6xh5v 0eKZ5yTidxsgTvti8SFgU0YGEhi48zfN3bYQvURoli7npEqb+HaZBhnH55FPVPLfRJYP KABA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=i5ZIY4065lAUAEWLLFizJmNYttH1lhQoJWZCwlRqXS4=; b=jUyWojvOcqIvWmgxci7f8C9RORjIwr+2yuEDpYopXigj/f9jYZbI7vhobZdgvWZmoO 88i5FecX3J+2Yj+7GkoIAqZNIXP7Q9bwMmGjl6LVIvoBSFtLlOuDaGOr9vn9cCo857Z2 EV3zcFytguxb2NF3tq2t318n3SYxH6+i886chtCPYEED1Q+Rbn55PYKiWIrWYcvZq5sC vdEGG0Fp80C3nXoGc+wwtlXUvdstQUYo4J7ZEAevaerSMfl1Wg9EXyzfX1qoGikY4Cz+ rEohe+V4jKmw1FxczBr0LIGIif3ExqPsQ3OCsEfDod+L1ni4bwoV46zpNHRDtkP/XzxL wGTA== X-Gm-Message-State: AOAM532+/LvHwSSRPsQO6SBLWIU6kNCnwkMdluCveZX6mMM9wLWQDoV4 0E2uGPvXttZmQAmtm8II8SU= X-Google-Smtp-Source: ABdhPJzjKcfRlZoMTt4B+KzFSxE9OtwiliOOTNLxH0Rdp3oRuakJFSZU+qTS9HD+iC53R8HDKBqSgQ== X-Received: by 2002:ac8:7dcd:: with SMTP id c13mr2241175qte.133.1640182774512; Wed, 22 Dec 2021 06:19:34 -0800 (PST) Received: from localhost.localdomain ([2804:14c:485:504a:4709:e1da:a7a:6d6e]) by smtp.gmail.com with ESMTPSA id b9sm1803990qtb.53.2021.12.22.06.19.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Dec 2021 06:19:34 -0800 (PST) From: Fabio Estevam To: broonie@kernel.org Subject: [PATCH RESEND 2/2] ASoC: cs4265: Move reset_gpio to local scope Date: Wed, 22 Dec 2021 11:19:20 -0300 Message-Id: <20211222141920.1482451-2-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211222141920.1482451-1-festevam@gmail.com> References: <20211222141920.1482451-1-festevam@gmail.com> MIME-Version: 1.0 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" From: Fabio Estevam 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);