diff options
author | Julius Werner <jwerner@chromium.org> | 2015-02-19 14:51:15 -0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-04-21 08:22:28 +0200 |
commit | 2f37bd65518865688b9234afce0d467508d6f465 (patch) | |
tree | eba5ed799de966299602b30c70d51dd40eaadd73 /src/soc/samsung/exynos5250/gpio.c | |
parent | 1f60f971fc89ef841e81b978964b38278d597b1d (diff) |
arm(64): Globally replace writel(v, a) with write32(a, v)
This patch is a raw application of the following spatch to src/:
@@
expression A, V;
@@
- writel(V, A)
+ write32(A, V)
@@
expression A, V;
@@
- writew(V, A)
+ write16(A, V)
@@
expression A, V;
@@
- writeb(V, A)
+ write8(A, V)
@@
expression A;
@@
- readl(A)
+ read32(A)
@@
expression A;
@@
- readb(A)
+ read8(A)
BRANCH=none
BUG=chromium:444723
TEST=None (depends on next patch)
Change-Id: I5dd96490c85ee2bcbc669f08bc6fff0ecc0f9e27
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 64f643da95d85954c4d4ea91c34a5c69b9b08eb6
Original-Change-Id: I366a2eb5b3a0df2279ebcce572fe814894791c42
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/254864
Reviewed-on: http://review.coreboot.org/9836
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/samsung/exynos5250/gpio.c')
-rw-r--r-- | src/soc/samsung/exynos5250/gpio.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/soc/samsung/exynos5250/gpio.c b/src/soc/samsung/exynos5250/gpio.c index 203aa03a42..c7a84197d0 100644 --- a/src/soc/samsung/exynos5250/gpio.c +++ b/src/soc/samsung/exynos5250/gpio.c @@ -82,10 +82,10 @@ void gpio_cfg_pin(int gpio, int cfg) unsigned int value; struct gpio_bank *bank = gpio_get_bank(gpio); - value = readl(&bank->con); + value = read32(&bank->con); value &= ~CON_MASK(GPIO_BIT(gpio)); value |= CON_SFR(GPIO_BIT(gpio), cfg); - writel(value, &bank->con); + write32(&bank->con, value); } static int gpio_get_cfg(int gpio) @@ -93,7 +93,7 @@ static int gpio_get_cfg(int gpio) struct gpio_bank *bank = gpio_get_bank(gpio); int shift = GPIO_BIT(gpio) << 2; - return (readl(&bank->con) & CON_MASK(GPIO_BIT(gpio))) >> shift; + return (read32(&bank->con) & CON_MASK(GPIO_BIT(gpio))) >> shift; } void gpio_set_pull(int gpio, int mode) @@ -101,7 +101,7 @@ void gpio_set_pull(int gpio, int mode) unsigned int value; struct gpio_bank *bank = gpio_get_bank(gpio); - value = readl(&bank->pull); + value = read32(&bank->pull); value &= ~PULL_MASK(GPIO_BIT(gpio)); switch (mode) { @@ -113,7 +113,7 @@ void gpio_set_pull(int gpio, int mode) break; } - writel(value, &bank->pull); + write32(&bank->pull, value); } void gpio_set_drv(int gpio, int mode) @@ -121,7 +121,7 @@ void gpio_set_drv(int gpio, int mode) unsigned int value; struct gpio_bank *bank = gpio_get_bank(gpio); - value = readl(&bank->drv); + value = read32(&bank->drv); value &= ~DRV_MASK(GPIO_BIT(gpio)); switch (mode) { @@ -135,7 +135,7 @@ void gpio_set_drv(int gpio, int mode) return; } - writel(value, &bank->drv); + write32(&bank->drv, value); } void gpio_set_rate(int gpio, int mode) @@ -143,7 +143,7 @@ void gpio_set_rate(int gpio, int mode) unsigned int value; struct gpio_bank *bank = gpio_get_bank(gpio); - value = readl(&bank->drv); + value = read32(&bank->drv); value &= ~RATE_MASK(GPIO_BIT(gpio)); switch (mode) { @@ -155,7 +155,7 @@ void gpio_set_rate(int gpio, int mode) return; } - writel(value, &bank->drv); + write32(&bank->drv, value); } int gpio_direction_input(unsigned gpio) @@ -170,11 +170,11 @@ int gpio_direction_output(unsigned gpio, int value) unsigned int val; struct gpio_bank *bank = gpio_get_bank(gpio); - val = readl(&bank->dat); + val = read32(&bank->dat); val &= ~DAT_MASK(GPIO_BIT(gpio)); if (value) val |= DAT_SET(GPIO_BIT(gpio)); - writel(val, &bank->dat); + write32(&bank->dat, val); gpio_cfg_pin(gpio, GPIO_OUTPUT); @@ -186,7 +186,7 @@ int gpio_get_value(unsigned gpio) unsigned int value; struct gpio_bank *bank = gpio_get_bank(gpio); - value = readl(&bank->dat); + value = read32(&bank->dat); return !!(value & DAT_MASK(GPIO_BIT(gpio))); } @@ -195,11 +195,11 @@ int gpio_set_value(unsigned gpio, int value) unsigned int val; struct gpio_bank *bank = gpio_get_bank(gpio); - val = readl(&bank->dat); + val = read32(&bank->dat); val &= ~DAT_MASK(GPIO_BIT(gpio)); if (value) val |= DAT_SET(GPIO_BIT(gpio)); - writel(val, &bank->dat); + write32(&bank->dat, val); return 0; } |