All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@csie.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 01/10] ARM: sunxi: Use macro values for setting UART GPIO pull-ups
Date: Wed, 24 Sep 2014 16:01:04 +0800	[thread overview]
Message-ID: <1411545673-5591-2-git-send-email-wens@csie.org> (raw)
In-Reply-To: <1411545673-5591-1-git-send-email-wens@csie.org>

We have already defined macros for pull-up/down values in the
GPIO header. Use them instead of magic numbers when configuring
the UART pins.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/cpu/armv7/sunxi/board.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index f2cedbb..95a74c5 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -53,15 +53,15 @@ int gpio_init(void)
 #if CONFIG_CONS_INDEX == 1 && (defined(CONFIG_SUN4I) || defined(CONFIG_SUN7I))
 	sunxi_gpio_set_cfgpin(SUNXI_GPB(22), SUN4I_GPB22_UART0_TX);
 	sunxi_gpio_set_cfgpin(SUNXI_GPB(23), SUN4I_GPB23_UART0_RX);
-	sunxi_gpio_set_pull(SUNXI_GPB(23), 1);
+	sunxi_gpio_set_pull(SUNXI_GPB(23), SUNXI_GPIO_PULL_UP);
 #elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_SUN5I)
 	sunxi_gpio_set_cfgpin(SUNXI_GPB(19), SUN5I_GPB19_UART0_TX);
 	sunxi_gpio_set_cfgpin(SUNXI_GPB(20), SUN5I_GPB20_UART0_RX);
-	sunxi_gpio_set_pull(SUNXI_GPB(20), 1);
+	sunxi_gpio_set_pull(SUNXI_GPB(20), SUNXI_GPIO_PULL_UP);
 #elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_SUN5I)
 	sunxi_gpio_set_cfgpin(SUNXI_GPG(3), SUN5I_GPG3_UART1_TX);
 	sunxi_gpio_set_cfgpin(SUNXI_GPG(4), SUN5I_GPG4_UART1_RX);
-	sunxi_gpio_set_pull(SUNXI_GPG(4), 1);
+	sunxi_gpio_set_pull(SUNXI_GPG(4), SUNXI_GPIO_PULL_UP);
 #else
 #error Unsupported console port number. Please fix pin mux settings in board.c
 #endif
-- 
2.1.0

  reply	other threads:[~2014-09-24  8:01 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24  8:01 [U-Boot] [PATCH v2 00/10] ARM: sunxi: Add basic support for Allwinner A31 (sun6i) Chen-Yu Tsai
2014-09-24  8:01 ` Chen-Yu Tsai [this message]
2014-09-25 18:45   ` [U-Boot] [PATCH v2 01/10] ARM: sunxi: Use macro values for setting UART GPIO pull-ups Ian Campbell
2014-09-24  8:01 ` [U-Boot] [PATCH v2 02/10] ARM: sunxi: Fix build break when CONFIG_USB_EHCI is not defined Chen-Yu Tsai
2014-09-24  8:01 ` [U-Boot] [PATCH v2 03/10] ARM: sun6i: Add base address for the new controllers in A31 Chen-Yu Tsai
2014-09-24  8:01 ` [U-Boot] [PATCH v2 04/10] ARM: sun6i: Add support for the power reset control module found on the A31 Chen-Yu Tsai
2014-09-25 18:47   ` Ian Campbell
2014-09-24  8:01 ` [U-Boot] [PATCH v2 05/10] ARM: sun6i: Add clock support Chen-Yu Tsai
2014-09-25 18:51   ` Ian Campbell
2014-09-24  8:01 ` [U-Boot] [PATCH v2 06/10] ARM: sunxi-mmc: Add mmc support for sun6i / A31 Chen-Yu Tsai
2014-09-25 18:52   ` Ian Campbell
2014-10-31 15:03     ` Pantelis Antoniou
2014-09-24  8:01 ` [U-Boot] [PATCH v2 07/10] ARM: sun6i: Define UART0 pins for A31 Chen-Yu Tsai
2014-09-25 18:54   ` Ian Campbell
2014-09-24  8:01 ` [U-Boot] [PATCH v2 08/10] ARM: sun6i: Setup the A31 UART0 muxing Chen-Yu Tsai
2014-09-25 18:54   ` Ian Campbell
2014-09-24  8:01 ` [U-Boot] [PATCH v2 09/10] ARM: sunxi: Add basic A31 support Chen-Yu Tsai
2014-09-25 18:56   ` Ian Campbell
2014-09-24  8:01 ` [U-Boot] [PATCH v2 10/10] ARM: sun6i: Add Colombus board defconfig Chen-Yu Tsai
2014-09-25 19:09   ` Ian Campbell
2014-09-28 15:33     ` Ian Campbell
2014-09-28 15:37       ` Chen-Yu Tsai
2014-09-28 15:43         ` Ian Campbell
2014-09-28 16:39           ` Maxime Ripard
2014-09-28 15:40       ` Hans de Goede
2014-09-28 16:20         ` [U-Boot] [linux-sunxi] " Ian Campbell
2014-09-28 17:03           ` Iain Paton
2014-09-28 18:10           ` Hans de Goede
2014-09-28 21:36             ` Ian Campbell
2014-09-29 18:08               ` Hans de Goede
2014-09-30  7:06                 ` Ian Campbell

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=1411545673-5591-2-git-send-email-wens@csie.org \
    --to=wens@csie.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.