Commit 070276d5 authored by Ben Dooks's avatar Ben Dooks
Browse files

[ARM] S3C24XX: GPIO: Change to macros for GPIO numbering



Prepare to remove the large number of S3C2410_GPxn defines
by moving to S3C2410_GPx(n) in arch/arm.

The following perl was used to change the files:

    perl -pi~ -e 's/S3C2410_GP([A-Z])([0-9]+)([^_^0-9])/S3C2410_GP\1\(\2\)\3/g'

Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 75cbcff3
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ PIN Numbers
-----------

  Each pin has an unique number associated with it in regs-gpio.h,
  eg S3C2410_GPA0 or S3C2410_GPF1. These defines are used to tell
  eg S3C2410_GPA(0) or S3C2410_GPF(1). These defines are used to tell
  the GPIO functions which pin is to be used.


@@ -65,11 +65,11 @@ Configuring a pin

  Eg:

     s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
     s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
     s3c2410_gpio_cfgpin(S3C2410_GPA(0), S3C2410_GPA0_ADDR0);
     s3c2410_gpio_cfgpin(S3C2410_GPE(8), S3C2410_GPE8_SDDAT1);

   which would turn GPA0 into the lowest Address line A0, and set
   GPE8 to be connected to the SDIO/MMC controller's SDDAT1 line.
   which would turn GPA(0) into the lowest Address line A0, and set
   GPE(8) to be connected to the SDIO/MMC controller's SDDAT1 line.


Reading the current configuration
+2 −2
Original line number Diff line number Diff line
@@ -33,10 +33,10 @@

int s3c2400_gpio_getirq(unsigned int pin)
{
	if (pin < S3C2410_GPE0 || pin > S3C2400_GPE7_EINT7)
	if (pin < S3C2410_GPE(0) || pin > S3C2400_GPE7_EINT7)
		return -1;  /* not valid interrupts */

	return (pin - S3C2410_GPE0) + IRQ_EINT0;
	return (pin - S3C2410_GPE(0)) + IRQ_EINT0;
}

EXPORT_SYMBOL(s3c2400_gpio_getirq);
+2 −2
Original line number Diff line number Diff line
@@ -39,12 +39,12 @@ int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
	unsigned long flags;
	unsigned long val;

	if (pin < S3C2410_GPG8 || pin > S3C2410_GPG15)
	if (pin < S3C2410_GPG(8) || pin > S3C2410_GPG(15))
		return -1;

	config &= 0xff;

	pin -= S3C2410_GPG8;
	pin -= S3C2410_GPG(8);
	reg += pin & ~3;

	local_irq_save(flags);
+12 −12
Original line number Diff line number Diff line
@@ -43,9 +43,9 @@ static void h1940bt_enable(int on)
		h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER);
		/* Reset the chip */
		mdelay(10);
		s3c2410_gpio_setpin(S3C2410_GPH1, 1);
		s3c2410_gpio_setpin(S3C2410_GPH(1), 1);
		mdelay(10);
		s3c2410_gpio_setpin(S3C2410_GPH1, 0);
		s3c2410_gpio_setpin(S3C2410_GPH(1), 0);

		state = 1;
	}
@@ -54,9 +54,9 @@ static void h1940bt_enable(int on)
		led_trigger_event(bt_led_trigger, 0);
#endif

		s3c2410_gpio_setpin(S3C2410_GPH1, 1);
		s3c2410_gpio_setpin(S3C2410_GPH(1), 1);
		mdelay(10);
		s3c2410_gpio_setpin(S3C2410_GPH1, 0);
		s3c2410_gpio_setpin(S3C2410_GPH(1), 0);
		mdelay(10);
		h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0);

@@ -89,14 +89,14 @@ static DEVICE_ATTR(enable, 0644,
static int __init h1940bt_probe(struct platform_device *pdev)
{
	/* Configures BT serial port GPIOs */
	s3c2410_gpio_cfgpin(S3C2410_GPH0, S3C2410_GPH0_nCTS0);
	s3c2410_gpio_pullup(S3C2410_GPH0, 1);
	s3c2410_gpio_cfgpin(S3C2410_GPH1, S3C2410_GPIO_OUTPUT);
	s3c2410_gpio_pullup(S3C2410_GPH1, 1);
	s3c2410_gpio_cfgpin(S3C2410_GPH2, S3C2410_GPH2_TXD0);
	s3c2410_gpio_pullup(S3C2410_GPH2, 1);
	s3c2410_gpio_cfgpin(S3C2410_GPH3, S3C2410_GPH3_RXD0);
	s3c2410_gpio_pullup(S3C2410_GPH3, 1);
	s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0);
	s3c2410_gpio_pullup(S3C2410_GPH(0), 1);
	s3c2410_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT);
	s3c2410_gpio_pullup(S3C2410_GPH(1), 1);
	s3c2410_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0);
	s3c2410_gpio_pullup(S3C2410_GPH(2), 1);
	s3c2410_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0);
	s3c2410_gpio_pullup(S3C2410_GPH(3), 1);

#ifdef CONFIG_LEDS_H1940
	led_trigger_register_simple("h1940-bluetooth", &bt_led_trigger);
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
{
	struct s3c_gpio_chip *chip;

	if (pin > S3C2410_GPG10)
	if (pin > S3C2410_GPG(10))
		return NULL;

	chip = &s3c24xx_gpios[pin/32];
Loading