From patchwork Mon Nov 3 14:30:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 5216931 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B427A9F380 for ; Mon, 3 Nov 2014 14:30:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EF432015A for ; Mon, 3 Nov 2014 14:30:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A3ED420125 for ; Mon, 3 Nov 2014 14:30:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752353AbaKCOa1 (ORCPT ); Mon, 3 Nov 2014 09:30:27 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:52278 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838AbaKCOa0 (ORCPT ); Mon, 3 Nov 2014 09:30:26 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id sA3EUOgs016206; Mon, 3 Nov 2014 08:30:24 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA3EUOEQ009693; Mon, 3 Nov 2014 08:30:24 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Mon, 3 Nov 2014 08:30:23 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA3EUNoF030737; Mon, 3 Nov 2014 08:30:23 -0600 Date: Mon, 3 Nov 2014 08:30:23 -0600 From: Nishanth Menon To: Roger Quadros CC: , , , Subject: Re: [PATCH v2] pinctrl: dra: dt-bindings: Fix output pull up/down Message-ID: <20141103143023.GA8260@kahuna> References: <1414752745-13696-1-git-send-email-rogerq@ti.com> <1415009392-6627-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1415009392-6627-1-git-send-email-rogerq@ti.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 12:09-20141103, Roger Quadros wrote: > For PIN_OUTPUT_PULLUP and PIN_OUTPUT_PULLDOWN we must not set the > PULL_DIS bit which disables the PULLs. > > PULL_ENA is a 0 and using it in an OR operation is a NOP, so don't > use it in the PIN_OUTPUT_PULLUP/DOWN macros. > > Fixes: 23d9cec07c58 ("pinctrl: dra: dt-bindings: Fix pull enable/disable") > > Signed-off-by: Roger Quadros > --- > include/dt-bindings/pinctrl/dra.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/dt-bindings/pinctrl/dra.h b/include/dt-bindings/pinctrl/dra.h > index 3d33794..7448edf 100644 > --- a/include/dt-bindings/pinctrl/dra.h > +++ b/include/dt-bindings/pinctrl/dra.h > @@ -40,8 +40,8 @@ > > /* Active pin states */ > #define PIN_OUTPUT (0 | PULL_DIS) > -#define PIN_OUTPUT_PULLUP (PIN_OUTPUT | PULL_ENA | PULL_UP) > -#define PIN_OUTPUT_PULLDOWN (PIN_OUTPUT | PULL_ENA) > +#define PIN_OUTPUT_PULLUP (PULL_UP) > +#define PIN_OUTPUT_PULLDOWN (0) > #define PIN_INPUT (INPUT_EN | PULL_DIS) > #define PIN_INPUT_SLEW (INPUT_EN | SLEWCONTROL) > #define PIN_INPUT_PULLUP (PULL_ENA | INPUT_EN | PULL_UP) You are right, we do have an issue with using PIN_OUTPUT along with remaining setting. For a moment, I wondered why input was not impacted - then I realized that INPUT_EN was being used instead of PIN_INPUT - following that convention. With the intent being explicitly using macros that clearly indicate what each setting combination is is, how about the following? diff --git a/include/dt-bindings/pinctrl/dra.h b/include/dt-bindings/pinctrl/dra.h index 3d33794..d4037e7 100644 --- a/include/dt-bindings/pinctrl/dra.h +++ b/include/dt-bindings/pinctrl/dra.h @@ -34,14 +34,15 @@ #define PULL_DIS (1 << 16) #define PULL_UP (1 << 17) #define INPUT_EN (1 << 18) +#define OUTPUT_EN (0 << 18) #define SLEWCONTROL (1 << 19) #define WAKEUP_EN (1 << 24) #define WAKEUP_EVENT (1 << 25) /* Active pin states */ -#define PIN_OUTPUT (0 | PULL_DIS) -#define PIN_OUTPUT_PULLUP (PIN_OUTPUT | PULL_ENA | PULL_UP) -#define PIN_OUTPUT_PULLDOWN (PIN_OUTPUT | PULL_ENA) +#define PIN_OUTPUT (OUTPUT_EN | PULL_DIS) +#define PIN_OUTPUT_PULLUP (OUTPUT_EN | PULL_ENA | PULL_UP) +#define PIN_OUTPUT_PULLDOWN (OUTPUT_EN | PULL_ENA) #define PIN_INPUT (INPUT_EN | PULL_DIS) #define PIN_INPUT_SLEW (INPUT_EN | SLEWCONTROL) #define PIN_INPUT_PULLUP (PULL_ENA | INPUT_EN | PULL_UP)