From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751565AbcEKGGx (ORCPT ); Wed, 11 May 2016 02:06:53 -0400 Received: from sg-smtp01.263.net ([54.255.195.220]:48460 "EHLO sg-smtp01.263.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750954AbcEKGGv (ORCPT ); Wed, 11 May 2016 02:06:51 -0400 X-Greylist: delayed 9318 seconds by postgrey-1.27 at vger.kernel.org; Wed, 11 May 2016 02:06:50 EDT X-RL-SENDER: wxt@rock-chips.com X-FST-TO: dianders@chromium.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: wxt@rock-chips.com X-UNIQUE-TAG: <74402d8643b6bf15908bbac8b1186102> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <5732A78D.7040308@rock-chips.com> Date: Wed, 11 May 2016 11:31:25 +0800 From: Caesar Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Doug Anderson CC: Caesar Wang , David Wu , Heiko Stuebner , "linux-gpio@vger.kernel.org" , Linus Walleij , "linux-kernel@vger.kernel.org" , "open list:ARM/Rockchip SoC..." , Stephen Barber , Brian Norris , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] pinctrl: rockchip: fix pull setting error for rk3399 References: <1462878896-28956-1-git-send-email-wxt@rock-chips.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Doug, 于 2016年05月11日 05:07, Doug Anderson 写道: > Caesar / David, > > On Tue, May 10, 2016 at 4:14 AM, Caesar Wang wrote: >> From: David Wu >> >> This patch fixes the pinctrl pull bias setting, since the pull up/down >> setting is the contrary for gpio0. > Commit message only mentions gpio0, but gpio2 is also fixed in the > commit. Please mention gpio2 in the commit message. Fix it in next version. > >> From the TRM said, the gpio0 pull polarity setting: >> gpio0a_p (gpio0 ) >> GPIO0A PE/PS programmation section, every >> GPIO bit corresponding to 2bits[PS:PE] >> 2'b00: Z(Noraml operaton); >> 2'b11: weak 1(pull-up); >> 2'b01: weak 0(pull-down); >> 2'b10: Z(Noraml operaton); > Despite the fact that the typo (Noralm vs. Normal) is present in the > TRM, maybe we should fix it here? Yep, ditto. > > > + > + if (ret < 0) { > + dev_err(info->dev, "unknown pull setting %d\n", pull); > nit: why change the error message? Old message was "unsupported" > instead of your new "unknown". "unsupported" was better IMHO. Okay, sound resonable. > > >> - PIN_BANK_DRV_FLAGS(2, 32, "gpio2", DRV_TYPE_IO_1V8_OR_3V0, >> - DRV_TYPE_IO_1V8_OR_3V0, >> - DRV_TYPE_IO_1V8_ONLY, >> - DRV_TYPE_IO_1V8_ONLY >> - ), >> + PIN_BANK_DRV_FLAGS_PULL_FLAGS(2, 32, "gpio2", DRV_TYPE_IO_1V8_OR_3V0, >> + DRV_TYPE_IO_1V8_OR_3V0, >> + DRV_TYPE_IO_1V8_ONLY, >> + DRV_TYPE_IO_1V8_ONLY, >> + PULL_TYPE_IO_DEFAULT, >> + PULL_TYPE_IO_DEFAULT, >> > Are you certain that gpio2 behaves the same way? The TRM I have says > this for GPIO2C and GPIO2D: + PULL_TYPE_IO_1V8_ONLY, + PULL_TYPE_IO_1V8_ONLY Yep, so this just set the gpio2c&gpio2d in this function. > > 2'b00: pervious-state > 2'b01: weak 0(pull-down); > 2'b10: pervious-state > 2'b11: weak 1(pull-up); > > Assuming that "pervious-state" is a simple typo for "previous state" > that would imply that it was behaving as "bus hold" and _not_ "bias > disable". I will say that TRM made the mistake since this is *not* exist. Okay, fixes by the newer TRM. > > Note: if it actually is a "bus hold" state then we'll have to figure > out how this would work with existing device trees. I'd imagine that > they are currently specifying "bias disable" and technically that > might not be possible? > > > > -Doug > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip >