From patchwork Wed Dec 29 11:44:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 528815 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 A1301C433F5 for ; Wed, 29 Dec 2021 11:46:36 +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 CF9591739; Wed, 29 Dec 2021 12:45:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CF9591739 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1640778393; bh=8hewVM7vU+XUWPtGt6tGEotMq2xdiD+RK3NBsy2xbwg=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=KYbkFgaTfd3oBru28R//LjahZduTwNDE7Y6cGUL6VWg994sl5jMnRIYCZ3WshkGVm ZZeKGfKAZxYnuWl1eaApdXGT62Ww+DylqAbd0OVCAICzXJRdVCkdbrZFC5OTp0zolf sHwyquTtAY6XZl7o/cv4UQApM4R7o7MQl6+sYIYw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6005FF800D3; Wed, 29 Dec 2021 12:45:43 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 80680F80236; Wed, 29 Dec 2021 12:45:38 +0100 (CET) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (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 02613F800CE for ; Wed, 29 Dec 2021 12:45:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 02613F800CE Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KSKnc49D" Received: by mail-qk1-x72e.google.com with SMTP id de30so19686949qkb.0 for ; Wed, 29 Dec 2021 03:45:29 -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=5tJ+orUquZC7dXXCYq+qNFqhYoTDrb9wSj8plGLuOu8=; b=KSKnc49DufZLkNDb46tKQsHG0iHG+2ESW5x9r1LnmukjFPRAKNafz1g7Yqajm7/0Ik nOjFZe80LUGJGTbeXdM0V2FNoflx53LkCIsCtwll3RUSDvq/XWb/xYz7nczjZVr/kzz1 nf7AQ9hU6B8HW0kdKJHjYWQbs+h+Udzb1od/IP8FZxOO3VUPUOhj3b58Dsak80JYPxAf 6aBcyBvDMZ9VCe/l7WT3hkwrFqEnxO0HSzqyytjoq7Bmh2pdBo5x8sTRxBj78QVcdw52 wjDpg5k3EkMSotWMgAjK5st8EZrmc3qv5vygEaNSUXim7qei45dxbA0qFjk2ZUNdYG2P yt+Q== 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=5tJ+orUquZC7dXXCYq+qNFqhYoTDrb9wSj8plGLuOu8=; b=E4hF0rsYrTLsR1gX84YdmD9uKtMiTyh7/LPwDCtw+m7nCU+Bmk4JUbRaBJKq9oX5H9 ZmYh9J1ULvaC442k1c//5VjBt39U6WC0NdkVzut7SZu4SCaa8B4tUQf0SyIKDty5utDX YSHGI3ew/g19bVZXxrHwBkXIYJH3cNnZQPkc9j7ukKyg+G+aeqEbYOTX7x1subO0LoOU dhyHjnhK5l05A+p+cHS2HfJWNSUCrIufSzJVioHMwdQz2QJ3X9wvVeDI+N1RxzjF3p4p gHMXd4V8XJxcYRhYP/aDSIszoScZ1Uy4/r10Y/asOkPJ/tZw4drCviCciG293p5gaCYY Q6EQ== X-Gm-Message-State: AOAM533IPSEySe3cc/E+X35bR4IQaW0pRTPl7Ne6f4/Kf8BJrSAHKEsa IWsaDTKW2hsHhut0Qco8AYY= X-Google-Smtp-Source: ABdhPJyPJzA19ye8gIdI38NOAMDC3LSOZ8QZEHRdts0SyuTBGfJKDu7aTlmMDM2+0YC+zsK/wJoCaw== X-Received: by 2002:a05:620a:4087:: with SMTP id f7mr17519909qko.639.1640778327314; Wed, 29 Dec 2021 03:45:27 -0800 (PST) Received: from localhost.localdomain ([2804:14c:485:504a:4bbe:5997:2c6c:1a08]) by smtp.gmail.com with ESMTPSA id g14sm18085936qko.55.2021.12.29.03.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Dec 2021 03:45:26 -0800 (PST) From: Fabio Estevam To: broonie@kernel.org Subject: [PATCH v2 1/3] ASoC: cs4265: Fix part number ID error message Date: Wed, 29 Dec 2021 08:44:55 -0300 Message-Id: <20211229114457.4101989-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 --- Changes since v1: - None 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 29 11:44:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 528973 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 B100EC433EF for ; Wed, 29 Dec 2021 11:47:11 +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 BD7D61752; Wed, 29 Dec 2021 12:46:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BD7D61752 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1640778429; bh=rL8ZPfVzmsXb/rhU9/SbTtonaQKFrbJNem8w3xo3P/8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Z64tuS2VoVMLkCNDCdQ+uHcFBjwp+TH6sbfaJePaXQ7bcwboHL5tlymPK+UMgCiul QZIq318HLhAV8qen6bPBzQUkmDuVbaVsZF2qhByraHZcOt9asCwYOW+uahL7H+I9lH vucB4rNk9i8UAJOQmVBsdC8Rc5CbObM6+FtL7aq8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 097F6F80238; Wed, 29 Dec 2021 12:45:44 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 018A4F80224; Wed, 29 Dec 2021 12:45:40 +0100 (CET) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (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 AF099F800D3 for ; Wed, 29 Dec 2021 12:45:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AF099F800D3 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QaaWm25I" Received: by mail-qv1-xf31.google.com with SMTP id q4so18931558qvh.9 for ; Wed, 29 Dec 2021 03:45:32 -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=J7SHaD+qL+xn75BeM0wQMqzoBEdIIKU7LvXPDFvW+jc=; b=QaaWm25IggmxfkFg2/z8xvRZVa73/4M7wtoBQShr1BcOtS7P3cEq0Qob/Ehmeb4FHl Jn1QUi0kx0s4dJKgNUESPwf+SiPFj7ae4oRmrakAMFOMMQ6QSutw1CY1EpAO5AUCHkGb lyee0fNv5LyN75+GXtUWvJgpa5bKXWIpO3fNcQcnkKKu3jr/XUG6YluU+AnMfh0S/X3v OSKyboeOL+9rxO5+PtwamXGEhg/5LnsBUUc4CQg/vWOkTiPYrOsiIqaCYBmkk4EDt1s8 R/DtqXZugREVbabyPyLqVhkGUSR2kxjge2goAwAsNKoBfvC9zCoGczZ50+oI7L7tLiOD 3j+Q== 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=J7SHaD+qL+xn75BeM0wQMqzoBEdIIKU7LvXPDFvW+jc=; b=45kZ5ExDD2pTl4UR6azoUxZY00g7UVg2Mk1mUbKLrauAcvvQajHPviDzi1V5dW/X7v f4S9Xay8hMdNzXH+jAWUHDZhX1Day2EO/X6+yNKcZMcj8wxJZWD6+37NccvUBQGDVikH Ao4Jh5nyc55CJfHdMjKiE1HSS1/TVWU69XtpO0REI7kI1LYVJe8NuplUdI9FBBnGyYKA vMA7ARtWSA2Qsr+HSt+IqqUxNchtWS53j6D15LgY/CTj1bQN3uGY+uaki7kdAQgVOOD6 cz5XcHQe+cEXaJe0cJtWz3JJYWstSInovlq7nSuaf1IDriQIAVyaGhm1cRr9aURDrou2 yr2Q== X-Gm-Message-State: AOAM531xsWvKXlSuKJrEHP0wtud2p9mn3geOUKflkxo2WfsxkLJYwrtP 5YBAQGTxRBcoYQojCXewFRE= X-Google-Smtp-Source: ABdhPJz7VPC+hv4I1hqv8iuFoZXBuJL3mMGIOO0SQ8v9vDvurZwAU7I0NTFCd8z/zOw2s1lEG7XZZA== X-Received: by 2002:ad4:5969:: with SMTP id eq9mr22885803qvb.108.1640778329786; Wed, 29 Dec 2021 03:45:29 -0800 (PST) Received: from localhost.localdomain ([2804:14c:485:504a:4bbe:5997:2c6c:1a08]) by smtp.gmail.com with ESMTPSA id g14sm18085936qko.55.2021.12.29.03.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Dec 2021 03:45:29 -0800 (PST) From: Fabio Estevam To: broonie@kernel.org Subject: [PATCH v2 2/3] ASoC: cs4265: Fix the reset_gpio polarity Date: Wed, 29 Dec 2021 08:44:56 -0300 Message-Id: <20211229114457.4101989-2-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211229114457.4101989-1-festevam@gmail.com> References: <20211229114457.4101989-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 Currently, the reset_gpio polarity handling is done backwards. The gpiod API takes the logic value of the GPIO, not the physical one. As per the CS4265 datasheet: "When RESET is low, the CS4265 enters a low-power mode and all internal states are reset" If a devicetree describes reset_gpio as active-low, the correct behaviour would be to retrieve the GPIO and put in its active state (GPIOD_OUT_HIGH) and then move it to its inactive state so that it can be operational (logic level 0). Fix it accordingly. Fixes: fb6f806967f6 ("ASoC: Add support for the CS4265 CODEC") Signed-off-by: Fabio Estevam --- Changes since v1: - Newly introduced patch. 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 b89002189a2b..294fa7ac16cb 100644 --- a/sound/soc/codecs/cs4265.c +++ b/sound/soc/codecs/cs4265.c @@ -590,13 +590,13 @@ static int cs4265_i2c_probe(struct i2c_client *i2c_client, } cs4265->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev, - "reset", GPIOD_OUT_LOW); + "reset", GPIOD_OUT_HIGH); if (IS_ERR(cs4265->reset_gpio)) return PTR_ERR(cs4265->reset_gpio); if (cs4265->reset_gpio) { mdelay(1); - gpiod_set_value_cansleep(cs4265->reset_gpio, 1); + gpiod_set_value_cansleep(cs4265->reset_gpio, 0); } i2c_set_clientdata(i2c_client, cs4265); From patchwork Wed Dec 29 11:44:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 528814 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 A8D96C433EF for ; Wed, 29 Dec 2021 11:47:26 +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 7FDAA1765; Wed, 29 Dec 2021 12:46:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7FDAA1765 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1640778444; bh=D+VOmzJw+4IVUx2BVHJKl/iLlia+5SOU7L7MbTspZ9Y=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rSLvHdw62PwArFf2FNTmMMIm9H0hqO4aJ7j6TGqy/uS08frifFEpz3/4U5pxhQuyn xQgz0YRh8zdnVJdV4/TWFhNK02XoNkJ5M0VCLObGK+0q3d/Lh4IAPTUWmxD88nxrp7 Diy2+XIi9cZtSfhgHdmKTaa3RH+uKVQe+X1rwbMw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9996BF80246; Wed, 29 Dec 2021 12:45:46 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1E22EF80248; Wed, 29 Dec 2021 12:45:44 +0100 (CET) Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) (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 4263FF801EC for ; Wed, 29 Dec 2021 12:45:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4263FF801EC Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gChk0OqJ" Received: by mail-qv1-xf32.google.com with SMTP id kc16so19005499qvb.3 for ; Wed, 29 Dec 2021 03:45: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:in-reply-to:references :mime-version:content-transfer-encoding; bh=AJA9uCUXVXnOgOewB0X1cMRPQwNxuz9DMojdOZD+C78=; b=gChk0OqJwq3L9/j24PqGARaC67qJebktVLVMRBr2cRMQybPJKmsJFvyV1XlylrPZCm xaPPZdOYultZkAqpuaIBGQe44K4uesrpxACYkOVxh4k42393XenSV4vlYemLReC4VeUm vWM6kCPOLh7Q59Tgc0iM+Thro+LWAQnQxVyWk+ts5YlEEGuOollm3EH7X0rPIFgYLn8l gtW+HAkDco9P6xoK/kOYckSjJRU4nmO07G5cWxaGlzyzIiyoWSs+f8eEzAkjw+CwchYi XxECi81i7fcnTZ9T6WJTsQE2G4rla1oBmS6a0nWvOAg+4jPDPuNNYkMwHnWBuVtyxykB WHqA== 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=AJA9uCUXVXnOgOewB0X1cMRPQwNxuz9DMojdOZD+C78=; b=6tGQVXHpRdeFhlLwuRV95tI4vFkNRmMw83cl1oLu0Cj35wm0cP2qEv7RdtgzB8yGvW 1wH91gi9yBh0NLwrhapS9F3KHC3pp0V1U4z6RCde8wzLERn0cb7OvDGbdXWmXqWQC6R5 cQqrW9lInr4anpSTZ0QT7iISTy73e1fHbhIaeeRa7bNx187JW8wOv02CyskvuvEn11QA yHbtr2IXrNk6wpYNKa/Hs/MVW9Llt9Ln+MW16p7p5KnmGRYfAmu5cKGm54gUvBkW3woG OQgAe8/mtd7lE9hTvcpHQgur2d+4Bdf2gfaKAD40qyp1gkZ56S6H6Ec3sJFdAQ5Zs0oF fC8Q== X-Gm-Message-State: AOAM532v4WM5nramfeM8fKiofegHdZGJt4C/7REHdJpJ2ChXK7I8dzQ1 P7qxgRITLLmwPxsdxN5gFkQ= X-Google-Smtp-Source: ABdhPJwraN8OZtkPAMF0oXH3c22r01052ORrXFqcdRZtkvwUfmP+WGCsP9FGUGxMTtyUfPWLGS2I9A== X-Received: by 2002:a05:6214:76a:: with SMTP id f10mr23178921qvz.8.1640778332253; Wed, 29 Dec 2021 03:45:32 -0800 (PST) Received: from localhost.localdomain ([2804:14c:485:504a:4bbe:5997:2c6c:1a08]) by smtp.gmail.com with ESMTPSA id g14sm18085936qko.55.2021.12.29.03.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Dec 2021 03:45:31 -0800 (PST) From: Fabio Estevam To: broonie@kernel.org Subject: [PATCH v2 3/3] ASoC: cs4265: Add a remove() function Date: Wed, 29 Dec 2021 08:44:57 -0300 Message-Id: <20211229114457.4101989-3-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211229114457.4101989-1-festevam@gmail.com> References: <20211229114457.4101989-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 When the reset_gpio GPIO is used, it is better to put the codec back into reset state when the driver unbinds. Add a remove() function to accomplish that. Suggested-by: Charles Keepax Signed-off-by: Fabio Estevam --- Changes since v1: - Newly introduced patch. sound/soc/codecs/cs4265.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c index 294fa7ac16cb..8fa166e4b2a9 100644 --- a/sound/soc/codecs/cs4265.c +++ b/sound/soc/codecs/cs4265.c @@ -626,6 +626,16 @@ static int cs4265_i2c_probe(struct i2c_client *i2c_client, ARRAY_SIZE(cs4265_dai)); } +static int cs4265_i2c_remove(struct i2c_client *i2c) +{ + struct cs4265_private *cs4265 = i2c_get_clientdata(i2c); + + if (cs4265->reset_gpio) + gpiod_set_value_cansleep(cs4265->reset_gpio, 1); + + return 0; +} + static const struct of_device_id cs4265_of_match[] = { { .compatible = "cirrus,cs4265", }, { } @@ -645,6 +655,7 @@ static struct i2c_driver cs4265_i2c_driver = { }, .id_table = cs4265_id, .probe = cs4265_i2c_probe, + .remove = cs4265_i2c_remove, }; module_i2c_driver(cs4265_i2c_driver);