From patchwork Mon Dec 3 18:00:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlo Caione X-Patchwork-Id: 1007229 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="AM6nE6Fl"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 437yg02rfzz9s47 for ; Tue, 4 Dec 2018 08:24:12 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id F1CE4C2255C; Mon, 3 Dec 2018 21:23:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 96A54C224ED; Mon, 3 Dec 2018 21:21:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A638DC22283; Mon, 3 Dec 2018 18:00:46 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by lists.denx.de (Postfix) with ESMTPS id 52136C2202A for ; Mon, 3 Dec 2018 18:00:45 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id p4so13154610wrt.7 for ; Mon, 03 Dec 2018 10:00:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8GYFZVKEoV1u0t3Un4re0T4FZIx9+bJ5HodyPYwcQHQ=; b=AM6nE6FlssOsFIden1NX0pCwe3z3hcDPyvSAPwxboJphZTOO72dmo9K8toQGXXzAMx a/uS4HVWnFpgBjVtMYtevm52lZ131exg4qywJkVWIBS4VNOyONuGV+cxtiF/2IFWEbg+ Y5H8n1JA+dN7/LUVohrcsDAM7bt6DCYr+/2qklGsuD22W0OEFwiADKRu1/AxYCQq9fcQ huFu1MGfCnLiRP7hbfwvEUegtOrQYhx8dEdlFr4P5Wv8+Xgik0R3nmVh2bVJemoVpRH4 RQGZoJCVILJG0mBrkmFKLhhbBVF888eJXoSfkFBog8QxDro8sgjxy7Ca3cti8rfEzqiF 9ewA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8GYFZVKEoV1u0t3Un4re0T4FZIx9+bJ5HodyPYwcQHQ=; b=Gr5htyyUWqVC4uT8tNcdjF5kKKqMBOxluSoRQiQDeS/zHW5uYQNPWV2fPbwwBhtLzB IFxF0c2jnwIaGtte7Qz0c2/bH/vE16hqPH4Fian8Jz6T2IDVEqBumX5H2OXO8p/h2Aq2 9IE0Cy9OflD8gmPjQGHmRo1WozrO2A9KhAIFs2k76liLI6SMXomc415B+fLdUvSKSXsR yKSo4HS60G9VjIbgxQlVoMdnBuOzEaHqFqoiy2hWDyv/uHWq47TX5IU+PzbWy95kKNzp 2e/SITpDqf+xVgbZ2iWMaGnv96/wfH1bcK9et0wqhnMTCCaAO8enNSazFLGHB/qe9cp+ EbNw== X-Gm-Message-State: AA+aEWaWWHNqYms8WBMzn1d0WxFh38c8xxXthmzx0cZZeIGw2GeTzR5m rA/Mjs55IxVgItpsyR1j6GM1JQ== X-Google-Smtp-Source: AFSGD/UIN1rlZx/gxjBd8YxAun+89oKT6sXsuM47uUp53Qyke+JYdkeyu67mkggVgUi3hx34Fi94PQ== X-Received: by 2002:adf:edc1:: with SMTP id v1mr15434695wro.105.1543860044894; Mon, 03 Dec 2018 10:00:44 -0800 (PST) Received: from xps.expressvpn ([2a00:23c4:f7a1:ce00:a88f:2a3:2045:f5d5]) by smtp.gmail.com with ESMTPSA id n17sm3812901wmc.5.2018.12.03.10.00.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Dec 2018 10:00:44 -0800 (PST) From: Carlo Caione To: jbrunet@baylibre.com, narmstrong@baylibre.com, u-boot@lists.denx.de Date: Mon, 3 Dec 2018 18:00:42 +0000 Message-Id: <20181203180042.18278-1-ccaione@baylibre.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 03 Dec 2018 21:21:43 +0000 Cc: Carlo Caione Subject: [U-Boot] [PATCH] pinctrl: meson: Fix GPIO direction registers access X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The macros used to set the direction of the GPIO pins are misused, resulting in a wrong behavior when trying to read the GPIO input level from U-Boot. A better macro is also used when setting the output direction. Signed-off-by: Carlo Caione Reviewed-by: Jerome Brunet --- drivers/pinctrl/meson/pinctrl-meson.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index 0bd6152803..b539749752 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c @@ -136,7 +136,7 @@ int meson_gpio_direction_input(struct udevice *dev, unsigned int offset) if (ret) return ret; - clrsetbits_le32(priv->reg_gpio + reg, BIT(bit), 1); + setbits_le32(priv->reg_gpio + reg, BIT(bit)); return 0; } @@ -152,7 +152,7 @@ int meson_gpio_direction_output(struct udevice *dev, if (ret) return ret; - clrsetbits_le32(priv->reg_gpio + reg, BIT(bit), 0); + clrbits_le32(priv->reg_gpio + reg, BIT(bit)); ret = meson_gpio_calc_reg_and_bit(dev, offset, REG_OUT, ®, &bit); if (ret)