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

Commit 99ae9953 authored by Ben Dooks's avatar Ben Dooks
Browse files

[ARM] S3C24XX: Merge devel-gpio

Merge branch 'devel-gpio' into for-rmk-devel
parents bcb8a0d6 7a05a2cb
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
+3 −3
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)
		return -1;  /* not valid interrupts */
	if (pin < S3C2410_GPE(0) || pin > S3C2400_GPE(7))
		return -EINVAL;  /* not valid interrupts */

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

EXPORT_SYMBOL(s3c2400_gpio_getirq);
+3 −3
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)
		return -1;
	if (pin < S3C2410_GPG(8) || pin > S3C2410_GPG(15))
		return -EINVAL;

	config &= 0xff;

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

	local_irq_save(flags);
+14 −12
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/leds.h>
#include <linux/gpio.h>

#include <mach/regs-gpio.h>
#include <mach/hardware.h>
#include <mach/h1940-latch.h>
@@ -41,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;
	}
@@ -52,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);

@@ -87,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_GPH1_OUTP);
	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