Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1881734ybc; Wed, 20 Nov 2019 05:40:06 -0800 (PST) X-Google-Smtp-Source: APXvYqyvCkw8H3QFhuEX5YOTWrQgXMFkA3QvNkQY1xNXcSuay3Law6GvLhy+8CpHVWkxoK62ov/E X-Received: by 2002:a17:906:5786:: with SMTP id k6mr5506651ejq.294.1574257206696; Wed, 20 Nov 2019 05:40:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574257206; cv=none; d=google.com; s=arc-20160816; b=h+rC7T+UeDPuh8es5u1XidY7Uf9X2LQ4DJngyBiCge/lfnQ3r8xyj+I6oCUY6Tcss9 mRhrL+NAYiPzYtmT8uCAvF/UKgyqvbuPxK6L9YEgA5cN3Q39uZVwltD8ZqV6gN8jkxVq br9V9Y9zmgZAsgqSUXGyn3CFiyvzDfkrkMKGEIanvQwATiJ6ZNdGYtvdZD0b3NxrBs/l nNR/FO8APVB/VxNFeKQPhu6Mx/oFZaPTHTnvxpHzmzqZD1AzKb0jh6fDFc3RvXQWYZwF 51t1I7k8ZrWB/Hb/HNTKfrFu30JOpvNHAkGLxDoMWfd+fcftqR8yk+wEUyaPESwnvIGc pItg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=D7ZpGl2GOQVl1LRPY+tj5e7FhNzsNfXiSHrb52YKorU=; b=qBvz01yUXXpJIlDB+U9lREPFdtPcgKpO3xLNZsh1iJnwLFwpbKcKUBrTnntNvWLAbc umzMUTO3O9b1gLK1/tXqNzzrXML9CHTTpg4mkjWzPR0NA+xEs0YrCwtc3OlbZEfxl5U8 jHcJe6ip6gqYJ9oxq6AErx6FTV7P6H9pXO4zRRyDlSE3ptHTCWuX4zY0FdRg7/LzyYy8 ThBLovNKAZYzpQkHxgFo9rqbDLdXuJahAjYfwbNS1T7Gl/eT8OOtG0rXlDFlK5RjN3SX fDHWghHjCqAm/2uCqrrQ2Unq6JT9pIza/euhv3Q/8YIZbNPARxmOGVvC0DphgTCyB0bt Uj1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="idf7kk/S"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2si16494931ejd.369.2019.11.20.05.39.42; Wed, 20 Nov 2019 05:40:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="idf7kk/S"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730120AbfKTNSP (ORCPT + 99 others); Wed, 20 Nov 2019 08:18:15 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:32916 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730053AbfKTNSM (ORCPT ); Wed, 20 Nov 2019 08:18:12 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id xAKDI4AL033449; Wed, 20 Nov 2019 07:18:04 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1574255884; bh=D7ZpGl2GOQVl1LRPY+tj5e7FhNzsNfXiSHrb52YKorU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=idf7kk/SKW+n+VPi6VHNfUmXqbu9DunvBJm74dYACuYsioLK7uY7gjc0QrJTTvGQV 6awdD6aj6/IarAZvQTEXJmushWd5CIxh7TH5nklx43Q20QnZcvwMVUXCVAFpTmwSar mqhEZNWAqWqKLE8iYTa/VvjaUBhlx3LIhpN7NTkU= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xAKDI4OI092105 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 Nov 2019 07:18:04 -0600 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Wed, 20 Nov 2019 07:18:02 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Wed, 20 Nov 2019 07:18:02 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id xAKDHru7067880; Wed, 20 Nov 2019 07:17:59 -0600 From: Peter Ujfalusi To: , CC: , , , , , Subject: [PATCH 2/2] ASoC: pcm3168a: Update the RST gpio handling to align with documentation Date: Wed, 20 Nov 2019 15:17:53 +0200 Message-ID: <20191120131753.6831-3-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191120131753.6831-1-peter.ujfalusi@ti.com> References: <20191120131753.6831-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The RST (reset-gpios) is low active so the driver must handle it accordingly. Add comments to explain clearly how the line is used. Signed-off-by: Peter Ujfalusi --- sound/soc/codecs/pcm3168a.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/pcm3168a.c b/sound/soc/codecs/pcm3168a.c index f3475134b519..9711fab296eb 100644 --- a/sound/soc/codecs/pcm3168a.c +++ b/sound/soc/codecs/pcm3168a.c @@ -707,11 +707,15 @@ int pcm3168a_probe(struct device *dev, struct regmap *regmap) dev_set_drvdata(dev, pcm3168a); /* - * Request the RST gpio line as non exclusive as the same reset line - * might be connected to multiple pcm3168a codec + * Request the reset (connected to RST pin) gpio line as non exclusive + * as the same reset line might be connected to multiple pcm3168a codec + * + * The RST is low active, we want the GPIO line to be high initially, so + * request the initial level to LOW which in practice means DEASSERTED: + * The deasserted level of GPIO_ACTIVE_LOW is HIGH. */ - pcm3168a->gpio_rst = devm_gpiod_get_optional(dev, "rst", - GPIOD_OUT_HIGH | + pcm3168a->gpio_rst = devm_gpiod_get_optional(dev, "reset", + GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE); if (IS_ERR(pcm3168a->gpio_rst)) { ret = PTR_ERR(pcm3168a->gpio_rst); @@ -814,7 +818,13 @@ void pcm3168a_remove(struct device *dev) { struct pcm3168a_priv *pcm3168a = dev_get_drvdata(dev); - gpiod_set_value_cansleep(pcm3168a->gpio_rst, 0); + /* + * The RST is low active, we want the GPIO line to be low when the + * driver is removed, so set level to 1 which in practice means + * ASSERTED: + * The asserted level of GPIO_ACTIVE_LOW is LOW. + */ + gpiod_set_value_cansleep(pcm3168a->gpio_rst, 1); pm_runtime_disable(dev); #ifndef CONFIG_PM pcm3168a_disable(dev); -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki