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: 40025 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AB3F221894 for ; Mon, 3 Nov 2014 14:30:32 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id r20sf2820171wiv.6 for ; Mon, 03 Nov 2014 06:30:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :references:mime-version:in-reply-to:user-agent:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type:content-disposition; bh=FqmRKvMUMaqx2DEY0ow7/AfIe0605LwMi5poO1cjR6g=; b=L3P69kI8Xzz1uJ1Fo0Gpp6njCRd1Iec48n7FHoZ8JX+JjUpyzYRY7yM+ImDW0Q2M83 qjir3c9Qzck1wQ3ng3u3OdnHPTxB0NiiFzMP7wnF75v8rG5b1RzHYBrjIuaa4FsnL+82 /3OIigwA2DjmMPapItaUWhG+x01Fq7FKOe9orRfk7zG8IUDCbToYCkqlCdEDJIQTjpTU 2qNuSjzE6P5idAXJ9pLUZlJp2ktqQJdgrMUGQWYzQQyivVSec3BrDrLF8Ogk8MkvEtY8 6Qp7LK7PQP2dfP7o6vtMnChaDTO4I5hMKt8zb+L9oIWaXx2B9iZXjcESi/5bHM9Ubl/a 4R6A== X-Gm-Message-State: ALoCoQmDSFv8eW0aq4SX75ErVHMBMXmzurYl2/SwGetXSbcbqiJduT/nM5tFO5crNm7EAnBFf2nR X-Received: by 10.181.8.194 with SMTP id dm2mr2947306wid.2.1415025031517; Mon, 03 Nov 2014 06:30:31 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.2 with SMTP id g2ls215989lag.35.gmail; Mon, 03 Nov 2014 06:30:31 -0800 (PST) X-Received: by 10.112.148.199 with SMTP id tu7mr51904911lbb.7.1415025030991; Mon, 03 Nov 2014 06:30:30 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id j5si32733702lam.25.2014.11.03.06.30.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 06:30:30 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id hz20so7065733lab.37 for ; Mon, 03 Nov 2014 06:30:30 -0800 (PST) X-Received: by 10.112.218.101 with SMTP id pf5mr15107455lbc.46.1415025030536; Mon, 03 Nov 2014 06:30:30 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp242714lbz; Mon, 3 Nov 2014 06:30:29 -0800 (PST) X-Received: by 10.68.135.229 with SMTP id pv5mr14732643pbb.23.1415025028848; Mon, 03 Nov 2014 06:30:28 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fb7si15510032pab.30.2014.11.03.06.30.28 for ; Mon, 03 Nov 2014 06:30:28 -0800 (PST) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256AbaKCOa1 (ORCPT + 4 others); 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 In-Reply-To: <1415009392-6627-1-git-send-email-rogerq@ti.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nm@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-Disposition: inline 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)