From patchwork Wed Nov 20 13:17:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 179847 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2092177ilf; Wed, 20 Nov 2019 05:18:13 -0800 (PST) X-Google-Smtp-Source: APXvYqz1gt0jwJvNSbIXvA+dodoGAah+49eyKq8CvXqmoOhPC4JskzwKaMEL4gIvRGG6mWGrfrtY X-Received: by 2002:a17:906:194a:: with SMTP id b10mr5447403eje.123.1574255893606; Wed, 20 Nov 2019 05:18:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574255893; cv=none; d=google.com; s=arc-20160816; b=U9hZYObMoz5VU8DTiOxAveELnlyB+wTP7lZuLSePGgOOdJfBd5sZeGw09DIFuvpjyO APOJQ7gx8qBqItwb1mK6MEPhyC1IxtAcO8bq2u8l4VvmiCpgcWw1QHBn2ex55hQYa7f1 0p5lPgCEx1zfqk5/P7gf6XfDOVYNUSO/zegKSeWXqsAh324kcX2gJhwUZIK1TYCU83NJ JMLH+WM8ZGCyiCKq77REplA3ZdHBxgLfioo5q7UdJjWq/JUJ6gG6w5ZzegPKgGiql4Ry BTxuLAlAnXbXjBzidsUCt/hwOPbVd4bVP2Y3dwsJJ8IK/aThXF0zzKHpG1i5M2sPGqlX 9T9Q== 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=QdL1YZVRIl1y5ZM+krtIZH2b+YerFkdPDnlCsambCAw=; b=cjOapBAeJ0ORrvtMuBw63j8vnhTRS0TcgNhu6pDuY7l1OQk0CM1qLYgqnb2spWuvTT HS9DNO/w3ZtuvCvkEi6ts8CradfqyevSc3iu8rJesWGqoHEgYg750wBTzNeOfSSXJg39 WPdMCc2Eq2wR+VsRRue+4Gdh9zbk8eHOFFiH+OHr5oc1DmisJJuOhHQkAv8g8uiJn+qK F2uk/qzbn7BQi/YdIuuGvm5XHUA9gSvh7NGanMs3sKxmtIi//EnjamLb6yMyiGYvoKNP QrK0qb2v9K+lY7N6nvntyIOkDomicBQbTuDTxENmGAmVKaM7mETWYE9o9Vw1Jv9PmI0N +LIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=oOfGpnZu; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 k15si16106976ejc.331.2019.11.20.05.18.13; Wed, 20 Nov 2019 05:18:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=oOfGpnZu; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S1730055AbfKTNSM (ORCPT + 8 others); Wed, 20 Nov 2019 08:18:12 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:58940 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727958AbfKTNSM (ORCPT ); Wed, 20 Nov 2019 08:18:12 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xAKDI1bd078479; Wed, 20 Nov 2019 07:18:01 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1574255881; bh=QdL1YZVRIl1y5ZM+krtIZH2b+YerFkdPDnlCsambCAw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=oOfGpnZuNaxMlzBAFnrzC0CN+jHdu6oeUSUUkvJkWhleHKx6awSnorVpRul3LzHo6 910xGXWfqFK8LrcWjUMxgxCPs4tnMfVMWkBAweAgNoHtPPTqLWuOzAeyLErRMyX628 kElqi+xnZradkF/PyjtXYyZjCYroAe6Uqgo88V3g= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xAKDI1GO120842 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 20 Nov 2019 07:18:01 -0600 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE100.ent.ti.com (157.170.170.30) 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:17:59 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE113.ent.ti.com (157.170.170.24) 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:17:59 -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 xAKDHru6067880; Wed, 20 Nov 2019 07:17:57 -0600 From: Peter Ujfalusi To: , CC: , , , , , Subject: [PATCH 1/2] ASoC: dt-bindings: pcm3168a: Update the optional RST gpio for clarity Date: Wed, 20 Nov 2019 15:17:52 +0200 Message-ID: <20191120131753.6831-2-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 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Use the standard name for the gpion in DT: reset-gpios Document that the RST line is low active and update the example accordingly. Signed-off-by: Peter Ujfalusi --- Documentation/devicetree/bindings/sound/ti,pcm3168a.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/Documentation/devicetree/bindings/sound/ti,pcm3168a.txt b/Documentation/devicetree/bindings/sound/ti,pcm3168a.txt index f30aebc7603a..a02ecaab5183 100644 --- a/Documentation/devicetree/bindings/sound/ti,pcm3168a.txt +++ b/Documentation/devicetree/bindings/sound/ti,pcm3168a.txt @@ -27,9 +27,10 @@ For required properties on SPI/I2C, consult SPI/I2C device tree documentation Optional properties: - - rst-gpios : Optional RST gpio line for the codec - RST = low: device power-down - RST = high: device is enabled + - reset-gpios : Optional reset gpio line connected to RST pin of the codec. + The RST line is low active: + RST = low: device power-down + RST = high: device is enabled Examples: @@ -40,7 +41,7 @@ i2c0: i2c0@0 { pcm3168a: audio-codec@44 { compatible = "ti,pcm3168a"; reg = <0x44>; - rst-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; clocks = <&clk_core CLK_AUDIO>; clock-names = "scki"; VDD1-supply = <&supply3v3>; From patchwork Wed Nov 20 13:17:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 179848 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2092186ilf; Wed, 20 Nov 2019 05:18:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxiR1wWZ/p9ukOj493ul88bjsCmXkRBgOBKeyun8yQebU3+1RwSiIvirF13+gR1bucOM/TE X-Received: by 2002:a17:906:8319:: with SMTP id j25mr5186997ejx.170.1574255893957; Wed, 20 Nov 2019 05:18:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574255893; cv=none; d=google.com; s=arc-20160816; b=KRvcNyBZj22HA43Eg2g4oc7lziF8iTbUtYsJN0Ygpp8XJWMH8Ws3ZPeI4vggSH2LXH KMwX2TQrgLNvwXjo0g/XjChkTWd2azmJ0hRjCy7qI5TUxZmA96Wgxr5tRDKENAH0G0th EGaae9ZY1rai6rVXe3f8ml1kiczxhRa+PBHfaEQIYT5mggRkCDb89ADZhP7y1hMJFiMY RHFgXsiswADT97xhT0v0HZ54h76a0JPkXZxe715u9KFCSHIzRZa7yr/okH+zg4m9qPsc UmgVcBxJ4/kkmx5z3p2bb8zKZIRI+iOSGJ2Lmc2iv7s78pLcFJy2LjiIJXuFuzYN8Fte ey7w== 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=i4T3O9W6IT5+NpIchJ23gFSSeqLGN+FKPThroaxcWfWCDeiOrDIsqeCwxbosWit8/U u8V1S56dc8gzQte3e8wHvfkyLjc8qZef2ixel29m+pdkTM5+OTMcwwOes/eJ11PDBw0w kaNr+w0H+skm1uJyjnlK2rhfQ/VsJyoxYR3LVUCriGk0HhZvz5IIP7SHScBoiTFZmtU3 WYj/XicXas336A+NISMO8gvTNbDf8HRcdzh1F3SGh1OenU2in4sIH8jS6Hm6+PaKoiMG cMQh/HMnUWiaZq9++89Um72C/pAWDvZH0dLFLWDEMmPNaTlG+SSjPosBoitTNmFtjt0G 1g5g== 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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 k15si16106976ejc.331.2019.11.20.05.18.13; Wed, 20 Nov 2019 05:18:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S1730067AbfKTNSM (ORCPT + 8 others); Wed, 20 Nov 2019 08:18:12 -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 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki 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);