Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d163b3f authored by Andrew Victor's avatar Andrew Victor Committed by Russell King
Browse files

[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: default avatarAndrew Victor <linux@maxim.org.za>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 457cd4f5
Loading
Loading
Loading
Loading
+10 −10
Original line number Original line Diff line number Diff line
@@ -72,7 +72,7 @@ int __init_or_module ks8695_gpio_interrupt(unsigned int pin, unsigned int type)


	/* set pin as input */
	/* set pin as input */
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
	x &= ~IOPM_(pin);
	x &= ~IOPM(pin);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);


	local_irq_restore(flags);
	local_irq_restore(flags);
@@ -108,7 +108,7 @@ int __init_or_module gpio_direction_input(unsigned int pin)


	/* set pin as input */
	/* set pin as input */
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
	x &= ~IOPM_(pin);
	x &= ~IOPM(pin);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);


	local_irq_restore(flags);
	local_irq_restore(flags);
@@ -136,14 +136,14 @@ int __init_or_module gpio_direction_output(unsigned int pin, unsigned int state)
	/* set line state */
	/* set line state */
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
	if (state)
	if (state)
		x |= (1 << pin);
		x |= IOPD(pin);
	else
	else
		x &= ~(1 << pin);
		x &= ~IOPD(pin);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD);


	/* set pin as output */
	/* set pin as output */
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
	x |= IOPM_(pin);
	x |= IOPM(pin);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);


	local_irq_restore(flags);
	local_irq_restore(flags);
@@ -168,9 +168,9 @@ void gpio_set_value(unsigned int pin, unsigned int state)
	/* set output line state */
	/* set output line state */
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
	if (state)
	if (state)
		x |= (1 << pin);
		x |= IOPD(pin);
	else
	else
		x &= ~(1 << pin);
		x &= ~IOPD(pin);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD);


	local_irq_restore(flags);
	local_irq_restore(flags);
@@ -189,7 +189,7 @@ int gpio_get_value(unsigned int pin)
		return -EINVAL;
		return -EINVAL;


	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
	return (x & (1 << pin)) != 0;
	return (x & IOPD(pin)) != 0;
}
}
EXPORT_SYMBOL(gpio_get_value);
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++) {
	for (i = KS8695_GPIO_0; i <= KS8695_GPIO_15 ; i++) {
		seq_printf(s, "%i:\t", 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 (i <= KS8695_GPIO_3) {
			if (ctrl & enable[i]) {
			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, "\t");


		seq_printf(s, "%i\n", (data & IOPD_(i)) ? 1 : 0);
		seq_printf(s, "%i\n", (data & IOPD(i)) ? 1 : 0);
	}
	}
	return 0;
	return 0;
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@




/* Port Mode Register */
/* 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 */
/* Port Control Register */
#define IOPC_IOTIM1EN		(1 << 17)	/* GPIO Pin for Timer1 Enable */
#define IOPC_IOTIM1EN		(1 << 17)	/* GPIO Pin for Timer1 Enable */
@@ -50,6 +50,6 @@
#define IOPC_TM_EDGE		(6)		/* Both Edge Detection */
#define IOPC_TM_EDGE		(6)		/* Both Edge Detection */


/* Port Data Register */
/* 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
#endif
+2 −2
Original line number Original line Diff line number Diff line
@@ -29,8 +29,8 @@
#define KS8695_LRDLB		(0x14)		/* Receive Descriptor List Base Address */
#define KS8695_LRDLB		(0x14)		/* Receive Descriptor List Base Address */
#define KS8695_LMAL		(0x18)		/* MAC Station Address Low */
#define KS8695_LMAL		(0x18)		/* MAC Station Address Low */
#define KS8695_LMAH		(0x1c)		/* MAC Station Address High */
#define KS8695_LMAH		(0x1c)		/* MAC Station Address High */
#define KS8695_LMAAL_(n)	(0x80 + ((n)*8))	/* MAC Additional Station Address (0..15) Low */
#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_LMAAH(n)		(0x84 + ((n)*8))	/* MAC Additional Station Address (0..15) High */




/* DMA Transmit Control Register */
/* DMA Transmit Control Register */
+2 −2
Original line number Original line Diff line number Diff line
@@ -29,8 +29,8 @@
#define KS8695_WRDLB		(0x14)		/* Receive Descriptor List Base Address */
#define KS8695_WRDLB		(0x14)		/* Receive Descriptor List Base Address */
#define KS8695_WMAL		(0x18)		/* MAC Station Address Low */
#define KS8695_WMAL		(0x18)		/* MAC Station Address Low */
#define KS8695_WMAH		(0x1c)		/* MAC Station Address High */
#define KS8695_WMAH		(0x1c)		/* MAC Station Address High */
#define KS8695_WMAAL_(n)	(0x80 + ((n)*8))	/* MAC Additional Station Address (0..15) Low */
#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_WMAAH(n)		(0x84 + ((n)*8))	/* MAC Additional Station Address (0..15) High */




/* DMA Transmit Control Register */
/* DMA Transmit Control Register */