ARM: pxa: change gpio to platform device
Remove most gpio macros and change gpio driver to platform driver. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
This commit is contained in:

committed by
Haojian Zhuang

parent
9bf448c66d
commit
157d2644cb
@@ -12,6 +12,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/mach/time.h>
|
||||
#include <mach/addr-map.h>
|
||||
@@ -19,7 +20,6 @@
|
||||
#include <mach/regs-apmu.h>
|
||||
#include <mach/cputype.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/gpio-pxa.h>
|
||||
#include <mach/dma.h>
|
||||
#include <mach/mfp.h>
|
||||
#include <mach/devices.h>
|
||||
@@ -77,20 +77,12 @@ static struct mfp_addr_map pxa910_mfp_addr_map[] __initdata =
|
||||
MFP_ADDR_END,
|
||||
};
|
||||
|
||||
#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c)
|
||||
|
||||
static void __init pxa910_init_gpio(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* enable GPIO clock */
|
||||
__raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_PXA910_GPIO);
|
||||
|
||||
/* unmask GPIO edge detection for all 4 banks - APMASKx */
|
||||
for (i = 0; i < 4; i++)
|
||||
__raw_writel(0xffffffff, APMASK(i));
|
||||
|
||||
pxa_init_gpio(IRQ_PXA910_AP_GPIO, 0, 127, NULL);
|
||||
}
|
||||
|
||||
void __init pxa910_init_irq(void)
|
||||
@@ -179,3 +171,22 @@ PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 0x10);
|
||||
PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10);
|
||||
PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10);
|
||||
PXA910_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x80, 97, 99);
|
||||
|
||||
struct resource pxa910_resource_gpio[] = {
|
||||
{
|
||||
.start = 0xd4019000,
|
||||
.end = 0xd4019fff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}, {
|
||||
.start = IRQ_PXA910_AP_GPIO,
|
||||
.end = IRQ_PXA910_AP_GPIO,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
struct platform_device pxa910_device_gpio = {
|
||||
.name = "pxa-gpio",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(pxa910_resource_gpio),
|
||||
.resource = pxa910_resource_gpio,
|
||||
};
|
||||
|
Reference in New Issue
Block a user