|
@@ -21,7 +21,6 @@
|
|
#include <asm/gpio.h>
|
|
#include <asm/gpio.h>
|
|
#include <mach/hardware.h>
|
|
#include <mach/hardware.h>
|
|
#include <mach/pxa-regs.h>
|
|
#include <mach/pxa-regs.h>
|
|
-#include <mach/pxa2xx-gpio.h>
|
|
|
|
|
|
|
|
#include "generic.h"
|
|
#include "generic.h"
|
|
|
|
|
|
@@ -45,36 +44,6 @@ struct pxa_gpio_chip {
|
|
|
|
|
|
int pxa_last_gpio;
|
|
int pxa_last_gpio;
|
|
|
|
|
|
-/*
|
|
|
|
- * Configure pins for GPIO or other functions
|
|
|
|
- */
|
|
|
|
-int pxa_gpio_mode(int gpio_mode)
|
|
|
|
-{
|
|
|
|
- unsigned long flags;
|
|
|
|
- int gpio = gpio_mode & GPIO_MD_MASK_NR;
|
|
|
|
- int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8;
|
|
|
|
- int gafr;
|
|
|
|
-
|
|
|
|
- if (gpio > pxa_last_gpio)
|
|
|
|
- return -EINVAL;
|
|
|
|
-
|
|
|
|
- local_irq_save(flags);
|
|
|
|
- if (gpio_mode & GPIO_DFLT_LOW)
|
|
|
|
- GPCR(gpio) = GPIO_bit(gpio);
|
|
|
|
- else if (gpio_mode & GPIO_DFLT_HIGH)
|
|
|
|
- GPSR(gpio) = GPIO_bit(gpio);
|
|
|
|
- if (gpio_mode & GPIO_MD_MASK_DIR)
|
|
|
|
- GPDR(gpio) |= GPIO_bit(gpio);
|
|
|
|
- else
|
|
|
|
- GPDR(gpio) &= ~GPIO_bit(gpio);
|
|
|
|
- gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2));
|
|
|
|
- GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2));
|
|
|
|
- local_irq_restore(flags);
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-EXPORT_SYMBOL(pxa_gpio_mode);
|
|
|
|
-
|
|
|
|
static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
|
|
static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
|
|
{
|
|
{
|
|
unsigned long flags;
|
|
unsigned long flags;
|