Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2087560imm; Sun, 12 Aug 2018 06:28:45 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxQTKi5qn29FRx/VufwUh5igZpvC5ssyiLNwza+av5vo/HHfY/YpD1jeAsvFmOEnor7b+zl X-Received: by 2002:a17:902:7c89:: with SMTP id y9-v6mr13086063pll.187.1534080525312; Sun, 12 Aug 2018 06:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534080525; cv=none; d=google.com; s=arc-20160816; b=R/P4sDCzT4S8xP7qNS3j9UoLaRgyhilAALiRbH66TVsOOtxF+zhm6Av7WNFWpRhnBc QQAtncwkflUnzyRjEmG4VWmY6GeohNmV22GP0W+zSxvS/cEdwgU04x4A3pQee9yjzDvw RjKihdeKGPj9e9rF1FSwiS5zilTm8cLZ0TFg2+PqslI10vxuTgkKOdtKkpU3lwEj6Plc /81Y/caKDS3cfwaFricG132B5qqvW97LbsrOCxCL2bEMAr6NqrT1HXerHvNjc1yZjI6m zbqUs902P/LdtMwbL2iA29UR4rWaH96YXeCl4+BRWUZMyW6ED6wi6Jv+K12Xw9agkvtz T3Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature:arc-authentication-results; bh=6cfmsNRCFp0gXEPgvc0uxju+p80nxJSqpsLV0+ja4UQ=; b=yNZVNoTT8bbYB2a0H3uaZVRGRe+SgTx2aV060k9hTQa0lwZzNGffbcnknRLyo6Tj8c rxpM4zulVHz2B7+R6HWGdRGyacXnw8nRgPWLLg9fznkscW30tXh6x4XGjR5hChQFytnL RltVTe/DcHruiA95p5LSljRENwSI901EAkSoLA5oFgdnKw4K4ySA6N7ByKUW7zK8IPho FhwcLlpdXL5Oz4uukmGiuq1NkkJfLR3MpeAiiTN/EE6GJ19IUpKdfd6RUDCnefsP49nk NWqfTj+Q7xULLWT+/5wfRkVy+0HB9/Y2UMHbM8Htim/a/vdva3DXwBLDwUrLh5OmlXBh LGmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=T5FoXUn7; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g92-v6si11700729plg.66.2018.08.12.06.28.30; Sun, 12 Aug 2018 06:28:45 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=T5FoXUn7; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728019AbeHLPmz (ORCPT + 99 others); Sun, 12 Aug 2018 11:42:55 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46908 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727748AbeHLPmz (ORCPT ); Sun, 12 Aug 2018 11:42:55 -0400 Received: by mail-wr1-f66.google.com with SMTP id h14-v6so11972996wrw.13; Sun, 12 Aug 2018 06:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:cc:from:message-id; bh=6cfmsNRCFp0gXEPgvc0uxju+p80nxJSqpsLV0+ja4UQ=; b=T5FoXUn7onpr7WADFpx8Zn/kXkd7hIdtVZLGj5bPNFX2fCdX+n5gakx6WFw4szBJUC clgC+1pvUBK3nfmFLbpsTXbyuelI856HY7NUFmokCrgYtZuBHZ9iwFc+kMf4VWzDKLXN U/DtxTxPPjvQCM/3+DZJfLgQlwrbFDKzidt7SMbct1DM6WiG7yIi4H47kvU+VPmkoIaL qS8idruzJfZ/ilKVxFNdSsSc2N4TJmzcVFX+2do9+V/LNP2hO6NkIym/E9ZjFIHg0hQh 10JGzywdLaPUwCfSsg8399zrsWclwjWvfkwZJo4IV/EjvXWpBup7sfxQexJOmmp4oHQo YwmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:cc:from :message-id; bh=6cfmsNRCFp0gXEPgvc0uxju+p80nxJSqpsLV0+ja4UQ=; b=AMNuXa9C+cjfWHfeJKaDR6UZ61FqjevnX+VAJ4DjQc0otxlKqCTGjeeRrHYaM8uiXD +YQEREln5GRXK7XgbTwel3DTYll56iTHtBbDUcxbhIi50m5EyYSpC1Bsna+Gv8cY12ef W8HzmVSRqx0XfxBSZ+2icE0T/ysBNyYCn0tjj+QVypgFAD+geOyso30KK5Z0biGsO8Nn LIAwPmw35diU2AQUlmW4ZxUV0I6xGuR8rW5EmgmdlKD6Z+50OiQaW5DwDfqvWXcd35rD oaTY56KLrGeVZKm2qsjOmVfIifziMx3cXAXsxIe1bLb5Vi0BG1jzzDkSBYwP3lZcJS+k vKow== X-Gm-Message-State: AOUpUlFbJkLJRRS7jYLyCYPtsjmtKSCHIcqASZDDR/kPnOgHUwH3t2wc uD+B5jFsDmadZ+BC7nQrUA== X-Received: by 2002:a5d:66c4:: with SMTP id k4-v6mr8483096wrw.154.1534079093804; Sun, 12 Aug 2018 06:04:53 -0700 (PDT) Received: from Helena.home (host86-141-127-107.range86-141.btcentralplus.com. [86.141.127.107]) by smtp.gmail.com with ESMTPSA id t15-v6sm18410503wrn.34.2018.08.12.06.04.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Aug 2018 06:04:53 -0700 (PDT) Date: Sun, 12 Aug 2018 14:04:49 +0100 User-Agent: K-9 Mail for Android In-Reply-To: <2710770.4cMFGZ35A3@debian64> References: <20180811162520.11641-1-ctatlor97@gmail.com> <2202961.SmUWKIdeCe@debian64> <4A3869BF-2069-409A-B291-427971AF89FA@gmail.com> <2710770.4cMFGZ35A3@debian64> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] pinctrl: qcom: Add sdm660 pinctrl driver To: Christian Lamparter CC: linux-arm-msm@vger.kernel.org, Bjorn Andersson , Linus Walleij , Rob Herring , Mark Rutland , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org From: Craig Tatlor Message-ID: <0EFAD5B6-835F-49A1-B99D-ACB84F82D06F@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12 August 2018 13:42:27 BST, Christian Lamparter = wrote: >On Sunday, August 12, 2018 9:18:19 AM CEST you wrote: >> On 11 August 2018 18:27:43 BST, Christian Lamparter > wrote: >> >On Saturday, August 11, 2018 6:25:19 PM CEST Craig Tatlor wrote: >> >> Add initial pinctrl driver to support pin configuration with >> >> pinctrl framework for sdm660=2E >> >> Based off CAF implementation=2E >> >>=20 >> >> Signed-off-by: Craig Tatlor >> >> --- >> >>=20 >> >> diff --git >> >a/Documentation/devicetree/bindings/pinctrl/qcom,sdm660-pinctrl=2Etxt >> >b/Documentation/devicetree/bindings/pinctrl/qcom,sdm660-pinctrl=2Etxt >> >> new file mode 100644 >> >> index 000000000000=2E=2E85e6c6c17c04 >> >> --- /dev/null >> >> +++ >> >b/Documentation/devicetree/bindings/pinctrl/qcom,sdm660-pinctrl=2Etxt >> >> @@ -0,0 +1,195 @@ >> >> +Qualcomm Technologies, Inc=2E SDM660 TLMM block >> >> + >> >> +This binding describes the Top Level Mode Multiplexer block found >in >> >the >> >> +SDM660 platform=2E >> >> + >> >> +- compatible: >> >> + Usage: required >> >> + Value type: >> >> + Definition: must be "qcom,sdm660-pinctrl" >> >> + >> >> +- reg: >> >> + Usage: required >> >> + Value type: >> >> + Definition: the base address and size of the TLMM register >space=2E >> >> + >> >> +- interrupts: >> >> + Usage: required >> >> + Value type: >> >> + Definition: should specify the TLMM summary IRQ=2E >> >> + >> >> +- interrupt-controller: >> >> + Usage: required >> >> + Value type: >> >> + Definition: identifies this node as an interrupt controller >> >> + >> >> +- #interrupt-cells: >> >> + Usage: required >> >> + Value type: >> >> + Definition: must be 2=2E Specifying the pin number and flags, as >> >defined >> >> + in >> >> + >> >> +- gpio-controller: >> >> + Usage: required >> >> + Value type: >> >> + Definition: identifies this node as a gpio controller >> >> + >> >> +- #gpio-cells: >> >> + Usage: required >> >> + Value type: >> >> + Definition: must be 2=2E Specifying the pin number and flags, as >> >defined >> >> + in >> >> + >> >> +Please refer to =2E=2E/gpio/gpio=2Etxt and >> >=2E=2E/interrupt-controller/interrupts=2Etxt for >> >> +a general description of GPIO and interrupt bindings=2E >> >You want to specify gpio-ranges here as well=2E The property is >explained >> >in Section "2=2E1) gpio- and pin-controller interaction" in >> >=2E=2E/gpio/gpio=2Etxt >> > >> >Without it, the gpio-hogs construct (part of =2E=2E/gpio/gpio=2Etxt) w= ill >> >cause >> >the driver to fail during boot=2E (try it, ;-) ) >> Would gpio-ranges make sense for this, as the gpio and pinctrl are in >same block? >Yes, it's part of the =2E=2E/gpio/gpio=2Etxt which you link=2E >Here's a copy of the relevant section that explains this >gpio- and pin-controller interaction=2E > > >|2=2E1) gpio- and pin-controller interaction >|----------------------------------------- >| >|Some or all of the GPIOs provided by a GPIO controller may be routed >to pins >|on the package via a pin controller=2E This allows muxing those pins >between >|GPIO and other functions=2E >|It is useful to represent which GPIOs correspond to which pins on >which pin >|controllers=2E The gpio-ranges property described below represents this, >and >|contains information structures as follows: >| >| gpio-range-list ::=3D [gpio-range-list] >| single-gpio-range ::=3D | >| numeric-gpio-range ::=3D >| > >| named-gpio-range ::=3D '<0 0>' >| pinctrl-phandle : phandle to pin controller node >| gpio-base : Base GPIO ID in the GPIO controller >| pinctrl-base : Base pinctrl pin ID in the pin controller >| count : The number of GPIOs/pins in this range >| >|The "pin controller node" mentioned above must conform to the bindings >|described in =2E=2E/pinctrl/pinctrl-bindings=2Etxt=2E >|=2E=2E=2E > >As for the reason why gpio-ranges is what it is, please look at the ML >discussion from the "pinctrl: msm: fix gpio-hog related boot issues" >thread >on and the posts by=20 >Linus Walleij: >and >Stephen Boyd: = =2E >(It's quite a bit to take in) Thanks for the links, makes sense now, I'll add in v2=2E > >> Seems no other qcom pinctrl drivers have it and I'm able to boot >without it=2E >Ok, let's run an experiment=2E Please remove the gpio-ranges property and >try >adding a test gpio-hog to your device's DTS: > >something like (I randomly selected GPIO5, but it shouldn't >matter which gpio you select here=2E If you know a unused/NC >pin/gpio, then you can use it instead): > >&tlmm { > test-hog { > gpio-hog; > gpios =3D <5 0>; > output-low; > line-name =3D "test hog"; > }; >}; > >compile&install it and then watch the kernel on the next boot: > >without the gpio-ranges present, it will spew out something along the >lines of: > >| requesting hog GPIO test hog (chip 3000000=2Epinctrl, offset 5) failed, >-517 >| gpiochip_add_data: GPIOs 0=2E=2E114 (3000000=2Epinctrl) failed to regis= ter >| sdm660-pinctrl 3000000=2Epinctrl: Failed register gpiochip > >The single gpio-hog causes havoc and takes down the sdm660-pinctrl with >it=2E >And every driver that depends on the pinctrl to setup the pin >muxing/config >will fail to load as well=2E (check out /sys/kernel/debug/pinctrl/, it >will be >empty=2E) Yup > >Regards, >Christian --