Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423906AbdD1Phl (ORCPT ); Fri, 28 Apr 2017 11:37:41 -0400 Received: from mail-qt0-f176.google.com ([209.85.216.176]:33850 "EHLO mail-qt0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164711AbdD1Phf (ORCPT ); Fri, 28 Apr 2017 11:37:35 -0400 MIME-Version: 1.0 In-Reply-To: References: <1493281194-5200-1-git-send-email-jacopo+renesas@jmondi.org> <1493281194-5200-2-git-send-email-jacopo+renesas@jmondi.org> From: Andy Shevchenko Date: Fri, 28 Apr 2017 18:37:33 +0300 Message-ID: Subject: Re: [PATCH v5 01/10] pinctrl: generic: Add bi-directional and output-enable To: Chris Brandt Cc: Linus Walleij , Jacopo Mondi , Geert Uytterhoeven , Laurent Pinchart , Rob Herring , Mark Rutland , Russell King - ARM Linux , Linux-Renesas , "linux-gpio@vger.kernel.org" , devicetree , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3SFbkIB002018 Content-Length: 2208 Lines: 52 On Fri, Apr 28, 2017 at 6:16 PM, Chris Brandt wrote: > On Friday, April 28, 2017, Andy Shevchenko wrote: >> Had you read the following, esp. Note there? >> >> * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does >> not >> * affect the pin's ability to drive output. 1 enables input, 0 >> disables >> * input. >> >> For me manual is clearly tells about this settings: >> "This register enables or disables the input buffer while the output >> buffer is enabled." > > > But, then if we use "input-enable" to get bi-directional functionality, It seems you are missing the point from electrical prospective. Standard pin buffers (electrically) means input buffer and output buffer that are driven independently in most cases. Here is one example: https://electronics.stackexchange.com/questions/96932/internal-circuitry-of-io-ports-in-mcu/96953#96953 (That's what I asked before as a schematic) > now we need something to replace what we were using "input-enable" for. No. > We were using "input-enable" to signal when the pin function that we set also needs to be forcible set to input by the software (once again, because the HW is not smart enough to do it on its own), but is different than the bi-directional functionality (ie, a different register setting). You are trying to introduce an abstraction, called BiDi, which is *not* a separate thing from a set of pin properties. > So, if we replace "bi-directional" with "input-enable" (since logically internally that is what is going on), what do we use for the special pins that the HW manual says "hey, you need to manually set these pins to input with SW because the pin selection HW can't do it correctly)". Yes. BiDi is an alias to output + input enable + other pin configuration parameters (a set depends on real HW needs). > Note that we added a enable-output for the same reason. > See RZ/A1H HW Manual section "Table 54.7 Alternative Functions that PIPCn.PIPCnm Bit Should be Set to 0" Perhaps needs to be revisited as well. P.S. It looks like more and more software engineers are going far from real hardware when developing drivers... -- With Best Regards, Andy Shevchenko