All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jérôme Carretero" <cJ-uboot@zougloub.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] davinci: reduce pimux_config size by storing register id instead of address
Date: Sun, 8 Apr 2012 17:02:03 -0400	[thread overview]
Message-ID: <20120408170203.7747fd34@Bidule> (raw)

This patch does nothing except saving a few bytes (makes a difference SPL)

Signed-off-by: J?r?me Carretero <cJ@zougloub.eu>
CC: Manjunathappa, Prakash <prakash.pm@ti.com>
---
 arch/arm/cpu/arm926ejs/davinci/pinmux.c          |    2 +-
 arch/arm/include/asm/arch-davinci/davinci_misc.h |    2 +-
 arch/arm/include/asm/arch-davinci/hardware.h     |    2 +-
 drivers/gpio/da8xx_gpio.c                        |    2 --
 4 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/pinmux.c b/arch/arm/cpu/arm926ejs/davinci/pinmux.c
index ce58f71..bf7bfbb 100644
--- a/arch/arm/cpu/arm926ejs/davinci/pinmux.c
+++ b/arch/arm/cpu/arm926ejs/davinci/pinmux.c
@@ -65,7 +65,7 @@ int davinci_configure_pin_mux(const struct pinmux_config *pins,
 		const int offset = pins[i].field * PIN_MUX_FIELD_SIZE;
 		const unsigned int value = pins[i].value << offset;
 		const unsigned int mask = PIN_MUX_FIELD_MASK << offset;
-		const dv_reg *mux = pins[i].mux;
+		const dv_reg *mux = &davinci_syscfg_regs->pinmux[pins[i].mux];
 
 		writel(value | (readl(mux) & (~mask)), mux);
 	}
diff --git a/arch/arm/include/asm/arch-davinci/davinci_misc.h b/arch/arm/include/asm/arch-davinci/davinci_misc.h
index 463cbde..64e799b 100644
--- a/arch/arm/include/asm/arch-davinci/davinci_misc.h
+++ b/arch/arm/include/asm/arch-davinci/davinci_misc.h
@@ -29,7 +29,7 @@
 
 /* pin definition */
 struct pinmux_config {
-	dv_reg		*mux;		/* Address of mux register */
+	char		mux;		/* Mux register */
 	unsigned char	value;		/* Value to set in field */
 	unsigned char	field;		/* field number */
 };
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h b/arch/arm/include/asm/arch-davinci/hardware.h
index 994657a..601c6f5 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -486,7 +486,7 @@ struct davinci_syscfg_regs {
 #define davinci_syscfg_regs \
 	((struct davinci_syscfg_regs *)DAVINCI_BOOTCFG_BASE)
 
-#define pinmux(x)	(&davinci_syscfg_regs->pinmux[x])
+#define pinmux(x)	(x)
 
 /* Emulation suspend bits */
 #define DAVINCI_SYSCFG_SUSPSRC_EMAC		(1 << 5)
diff --git a/drivers/gpio/da8xx_gpio.c b/drivers/gpio/da8xx_gpio.c
index 4c30fa3..ab05201 100644
--- a/drivers/gpio/da8xx_gpio.c
+++ b/drivers/gpio/da8xx_gpio.c
@@ -31,8 +31,6 @@ static struct gpio_registry {
 	char name[GPIO_NAME_SIZE];
 } gpio_registry[MAX_NUM_GPIOS] = {};
 
-#define pinmux(x)       (&davinci_syscfg_regs->pinmux[x])
-
 static const struct pinmux_config gpio_pinmux[] = {
 	{ pinmux(1), 8, 7 },	/* GP0[0] */
 	{ pinmux(1), 8, 6 },
-- 
1.7.9.4

             reply	other threads:[~2012-04-08 21:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-08 21:02 Jérôme Carretero [this message]
2012-07-09 13:02 ` [U-Boot] [PATCH] davinci: reduce pimux_config size by storing register id instead of address Tom Rini

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=20120408170203.7747fd34@Bidule \
    --to=cj-uboot@zougloub.eu \
    --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.