From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomasz Figa Subject: Re: [PATCH] pinctrl: samsung: Allow pin value to be initialized using pinfunc. Date: Wed, 20 Nov 2013 15:57:45 +0100 Message-ID: <2071510.uxGIu18IfS@amdc1227> References: <1384881351-10782-1-git-send-email-t.figa@samsung.com> <528BB1F2.4080107@wwwdotorg.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Return-path: In-reply-to: Sender: linux-kernel-owner@vger.kernel.org To: Doug Anderson Cc: Stephen Warren , "linux-arm-kernel@lists.infradead.org" , linux-samsung-soc , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Linus Walleij , Thomas Abraham , Kukjin Kim , Heiko =?ISO-8859-1?Q?St=FCbner?= , Kyungmin Park , Marek Szyprowski List-Id: devicetree@vger.kernel.org On Tuesday 19 of November 2013 10:59:39 Doug Anderson wrote: > On Tue, Nov 19, 2013 at 10:46 AM, Stephen Warren wrote: > > On 11/19/2013 10:15 AM, Tomasz Figa wrote: > >> This patch extends the range of settings configurable via pinfunc API > >> to cover pin value as well. This allows configuration of default values > >> of pins. > > > > Shouldn't there be a driver that acquires the GPIO that's output to the > > pin, and configures the output value? IIRC there have been previous > > discussions re: having a list of e.g. initial GPIO output values in DT, > > and that was rejected, and this patch seems to be doing almost the exact > > same thing, just at the pinctrl level rather than GPIO level. > > > > That all said, I admit this could be a useful feature... > > I haven't followed all of the previous discussions, but I know I've > run into scenarios where something like this would be useful. The one > that comes to mind is: > > * We've got GPIOs that default at bootup to a pulled up input since > the default state of the pin should be "high". > > * These pins are really intended to be outputs, like an "enable", > "reset", or "power down" line for a peripheral. The pullup is strong > enough to give us a good default state but we really want outputs. > > * We'd like to provide this GPIO to a peripheral through device tree. > ...and we'd like all the pinmux to be setup automatically so we use > pinctrl-names = "default". > > * If we set the pinmux up as "output" then there's a chance that the > line will glitch at bootup since the pinmux happens (changing the pin > to output) before the driver has a chance to run. > > > Does that sound like the same scenario you're trying to solve Tomasz? Yes. That's one of the use cases I had in my mind. Best regards, Tomasz