All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v8 10/12] dm: exynos: Tidy up GPIO defines
Date: Sun, 14 Sep 2014 16:29:29 -0600	[thread overview]
Message-ID: <1410733771-5182-11-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1410733771-5182-1-git-send-email-sjg@chromium.org>

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 <sjg@chromium.org>
---

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)
-- 
2.1.0.rc2.206.gedb03e5

  parent reply	other threads:[~2014-09-14 22:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-14 22:29 [U-Boot] [PATCH v8 0/12] Enable driver model for GPIOs on Tegra and Exynos Simon Glass
2014-09-14 22:29 ` [U-Boot] [PATCH v8 01/12] dm: exynos: dts: Convert /include/ to #include Simon Glass
2014-09-14 22:29 ` [U-Boot] [PATCH v8 02/12] dm: exynos: Bring in pinctrl dts files from Linux kernel Simon Glass
2014-09-14 22:29 ` [U-Boot] [PATCH v8 03/12] dm: exynos: dts: Remove unused pinctrl information to save space Simon Glass
2014-09-14 22:29 ` [U-Boot] [PATCH v8 04/12] dm: exynos: dts: Adjust device tree files for U-Boot Simon Glass
2014-09-14 22:29 ` [U-Boot] [PATCH v8 05/12] dm: exynos: Add pinctrl settings for smdkc100 Simon Glass
2014-09-14 22:29 ` [U-Boot] [PATCH v8 06/12] dm: exynos: Add pinctrl settings for s5p_goni Simon Glass
2014-09-14 22:29 ` [U-Boot] [PATCH v8 07/12] dm: exynos: Move smdkc100 to generic board Simon Glass
2014-09-14 22:29 ` [U-Boot] [PATCH v8 08/12] dm: exynos: Move s5p_goni " Simon Glass
2014-09-29  6:06   ` Robert Baldyga
2014-10-08 11:36     ` Minkyu Kang
2014-10-08 12:21       ` Robert Baldyga
2014-09-14 22:29 ` [U-Boot] [PATCH v8 09/12] dm: exynos: Tidy up GPIO headers Simon Glass
2014-09-14 22:29 ` Simon Glass [this message]
2014-09-14 22:29 ` [U-Boot] [PATCH v8 11/12] dm: exynos: Make sure that GPIOs are requested Simon Glass
2014-09-14 22:29 ` [U-Boot] [PATCH v8 12/12] dm: exynos: gpio: Convert to driver model Simon Glass
2014-10-09  6:00 ` [U-Boot] [PATCH v8 0/12] Enable driver model for GPIOs on Tegra and Exynos Simon Glass
2014-10-14  5:04   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410733771-5182-11-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.