[ARM] 5296/1: [KS8695] Replace macro's with trailing underscores.

Replace Macro names that have trailing underscores.
Also use the IOPD() macro instead of a hard-coded bit-shift (for
better readability).

Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Andrew Victor 2008-10-07 20:20:15 +01:00 committed by Russell King
parent 457cd4f5e3
commit 8d163b3fa5
4 changed files with 16 additions and 16 deletions

View File

@ -72,7 +72,7 @@ int __init_or_module ks8695_gpio_interrupt(unsigned int pin, unsigned int type)
/* set pin as input */
x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
x &= ~IOPM_(pin);
x &= ~IOPM(pin);
__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
local_irq_restore(flags);
@ -108,7 +108,7 @@ int __init_or_module gpio_direction_input(unsigned int pin)
/* set pin as input */
x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
x &= ~IOPM_(pin);
x &= ~IOPM(pin);
__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
local_irq_restore(flags);
@ -136,14 +136,14 @@ int __init_or_module gpio_direction_output(unsigned int pin, unsigned int state)
/* set line state */
x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
if (state)
x |= (1 << pin);
x |= IOPD(pin);
else
x &= ~(1 << pin);
x &= ~IOPD(pin);
__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD);
/* set pin as output */
x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
x |= IOPM_(pin);
x |= IOPM(pin);
__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
local_irq_restore(flags);
@ -168,9 +168,9 @@ void gpio_set_value(unsigned int pin, unsigned int state)
/* set output line state */
x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
if (state)
x |= (1 << pin);
x |= IOPD(pin);
else
x &= ~(1 << pin);
x &= ~IOPD(pin);
__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD);
local_irq_restore(flags);
@ -189,7 +189,7 @@ int gpio_get_value(unsigned int pin)
return -EINVAL;
x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
return (x & (1 << pin)) != 0;
return (x & IOPD(pin)) != 0;
}
EXPORT_SYMBOL(gpio_get_value);
@ -240,7 +240,7 @@ static int ks8695_gpio_show(struct seq_file *s, void *unused)
for (i = KS8695_GPIO_0; i <= KS8695_GPIO_15 ; i++) {
seq_printf(s, "%i:\t", i);
seq_printf(s, "%s\t", (mode & IOPM_(i)) ? "Output" : "Input");
seq_printf(s, "%s\t", (mode & IOPM(i)) ? "Output" : "Input");
if (i <= KS8695_GPIO_3) {
if (ctrl & enable[i]) {
@ -273,7 +273,7 @@ static int ks8695_gpio_show(struct seq_file *s, void *unused)
seq_printf(s, "\t");
seq_printf(s, "%i\n", (data & IOPD_(i)) ? 1 : 0);
seq_printf(s, "%i\n", (data & IOPD(i)) ? 1 : 0);
}
return 0;
}

View File

@ -24,7 +24,7 @@
/* Port Mode Register */
#define IOPM_(x) (1 << (x)) /* Mode for GPIO Pin x */
#define IOPM(x) (1 << (x)) /* Mode for GPIO Pin x */
/* Port Control Register */
#define IOPC_IOTIM1EN (1 << 17) /* GPIO Pin for Timer1 Enable */
@ -50,6 +50,6 @@
#define IOPC_TM_EDGE (6) /* Both Edge Detection */
/* Port Data Register */
#define IOPD_(x) (1 << (x)) /* Signal Level of GPIO Pin x */
#define IOPD(x) (1 << (x)) /* Signal Level of GPIO Pin x */
#endif

View File

@ -29,8 +29,8 @@
#define KS8695_LRDLB (0x14) /* Receive Descriptor List Base Address */
#define KS8695_LMAL (0x18) /* MAC Station Address Low */
#define KS8695_LMAH (0x1c) /* MAC Station Address High */
#define KS8695_LMAAL_(n) (0x80 + ((n)*8)) /* MAC Additional Station Address (0..15) Low */
#define KS8695_LMAAH_(n) (0x84 + ((n)*8)) /* MAC Additional Station Address (0..15) High */
#define KS8695_LMAAL(n) (0x80 + ((n)*8)) /* MAC Additional Station Address (0..15) Low */
#define KS8695_LMAAH(n) (0x84 + ((n)*8)) /* MAC Additional Station Address (0..15) High */
/* DMA Transmit Control Register */

View File

@ -29,8 +29,8 @@
#define KS8695_WRDLB (0x14) /* Receive Descriptor List Base Address */
#define KS8695_WMAL (0x18) /* MAC Station Address Low */
#define KS8695_WMAH (0x1c) /* MAC Station Address High */
#define KS8695_WMAAL_(n) (0x80 + ((n)*8)) /* MAC Additional Station Address (0..15) Low */
#define KS8695_WMAAH_(n) (0x84 + ((n)*8)) /* MAC Additional Station Address (0..15) High */
#define KS8695_WMAAL(n) (0x80 + ((n)*8)) /* MAC Additional Station Address (0..15) Low */
#define KS8695_WMAAH(n) (0x84 + ((n)*8)) /* MAC Additional Station Address (0..15) High */
/* DMA Transmit Control Register */