From patchwork Wed Oct 15 08:38:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 399814 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 70AC814007B for ; Wed, 15 Oct 2014 19:40:11 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A92C1A7808; Wed, 15 Oct 2014 10:39:51 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I0KbpblC3mQD; Wed, 15 Oct 2014 10:39:51 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D8C4BA7824; Wed, 15 Oct 2014 10:39:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 68A8AA775D for ; Wed, 15 Oct 2014 10:39:06 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pmji0YY5t2xu for ; Wed, 15 Oct 2014 10:39:06 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-yk0-f201.google.com (mail-yk0-f201.google.com [209.85.160.201]) by theia.denx.de (Postfix) with ESMTPS id 0667EA7750 for ; Wed, 15 Oct 2014 10:39:01 +0200 (CEST) Received: by mail-yk0-f201.google.com with SMTP id 19so58363ykq.0 for ; Wed, 15 Oct 2014 01:39:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9qJiMn+ZRvUzv7SaHeUjpsaL5mrMaUzh+8zeOfGc8Oc=; b=aS0iZQwsCbiabw0rhWKWEe0bsmLai/q59g4qOEnxMc3yTAWvhJvASOQ3nwj1y8vL7b M1NQDKLvMSP9+LBpFvLZ5uH6SfXVCZzwwN+MzDcS3MZ5FzBi0qFLbRL/tHlVvA3xz/m7 aWcyoukAcn9Nk313Xi96k5/vouoORXX6OTcbtHhs3FHW9K5eOyH0Un9fBV2TVqrXWjyn nyC2HKGouUHIoozEB0Tx6rqdIp8IOLedNzGZSwEzErYEr7KaJbOCy3F11oLd23s0yDVe NPM6D3V7sh6OZy6OC8NYG6KN/wrY1/gHWxzFbUXBacZqba+2dUpBBHx1BJBNfwfxEQsP zrOw== X-Gm-Message-State: ALoCoQmGGOn0T8zDx6wzl052HJ98dmBCUTRY3IFC246PUdYyqURJmJMlm9KvdPP2lhLXCkQ9rBYy X-Received: by 10.236.4.106 with SMTP id 70mr7111365yhi.33.1413362340767; Wed, 15 Oct 2014 01:39:00 -0700 (PDT) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id n24si940258yha.6.2014.10.15.01.39.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Oct 2014 01:39:00 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id UyGOJS90.1; Wed, 15 Oct 2014 01:39:00 -0700 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id E442122086F; Wed, 15 Oct 2014 02:38:59 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 15 Oct 2014 02:38:00 -0600 Message-Id: <1413362282-25451-11-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1413362282-25451-1-git-send-email-sjg@chromium.org> References: <1413362282-25451-1-git-send-email-sjg@chromium.org> Cc: u-boot-review@google.com, Tom Warren Subject: [U-Boot] [PATCH v9 10/12] dm: exynos: Tidy up GPIO defines X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The defines at the top of the GPIO driver use single-character names for parameters which are not very descriptive. Improve these to use descriptive parameter names. Signed-off-by: Simon Glass --- Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None drivers/gpio/s5p_gpio.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c index aa60188..99f2dd8 100644 --- a/drivers/gpio/s5p_gpio.c +++ b/drivers/gpio/s5p_gpio.c @@ -11,19 +11,20 @@ #define S5P_GPIO_GET_PIN(x) (x % GPIO_PER_BANK) -#define CON_MASK(x) (0xf << ((x) << 2)) -#define CON_SFR(x, v) ((v) << ((x) << 2)) +#define CON_MASK(val) (0xf << ((val) << 2)) +#define CON_SFR(gpio, cfg) ((cfg) << ((gpio) << 2)) +#define CON_SFR_UNSHIFT(val, gpio) ((val) >> ((gpio) << 2)) -#define DAT_MASK(x) (0x1 << (x)) -#define DAT_SET(x) (0x1 << (x)) +#define DAT_MASK(gpio) (0x1 << (gpio)) +#define DAT_SET(gpio) (0x1 << (gpio)) -#define PULL_MASK(x) (0x3 << ((x) << 1)) -#define PULL_MODE(x, v) ((v) << ((x) << 1)) +#define PULL_MASK(gpio) (0x3 << ((gpio) << 1)) +#define PULL_MODE(gpio, pull) ((pull) << ((gpio) << 1)) -#define DRV_MASK(x) (0x3 << ((x) << 1)) -#define DRV_SET(x, m) ((m) << ((x) << 1)) -#define RATE_MASK(x) (0x1 << (x + 16)) -#define RATE_SET(x) (0x1 << (x + 16)) +#define DRV_MASK(gpio) (0x3 << ((gpio) << 1)) +#define DRV_SET(gpio, mode) ((mode) << ((gpio) << 1)) +#define RATE_MASK(gpio) (0x1 << (gpio + 16)) +#define RATE_SET(gpio) (0x1 << (gpio + 16)) #define name_to_gpio(n) s5p_name_to_gpio(n) static inline int s5p_name_to_gpio(const char *name)