Commit 2f01a973 authored by Mike Rapoport's avatar Mike Rapoport Committed by Russell King

[ARM] 5103/2: CM-X270: update core platform support

Convert CM-X270 pin configuration to use MFP tables.
Make device initialization dependent on respective driver CONFIG_ value (like
in zylonite).
Cleanup includes
Signed-off-by: default avatarMike Rapoport <mike@compulab.co.il>
Acked-by: default avatarEric Miao <eric.miao@marvell.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 3c85bce6
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Bits taken from various places. * Bits taken from various places.
* *
* Copyright (C) 2007 Compulab, Ltd. * Copyright (C) 2007, 2008 Compulab, Ltd.
* Mike Rapoport <mike@compulab.co.il> * Mike Rapoport <mike@compulab.co.il>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/gpio.h>
#include <asm/mach/pci.h> #include <asm/mach/pci.h>
#include <asm/arch/cm-x270.h>
#include <asm/arch/pxa-regs.h> #include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa2xx-gpio.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/hardware/it8152.h> #include <asm/hardware/it8152.h>
unsigned long it8152_base_address = CMX270_IT8152_VIRT; unsigned long it8152_base_address;
static int cmx270_it8152_irq_gpio;
/* /*
* Only first 64MB of memory can be accessed via PCI. * Only first 64MB of memory can be accessed via PCI.
...@@ -42,7 +42,7 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size, ...@@ -42,7 +42,7 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size,
unsigned int sz = SZ_64M >> PAGE_SHIFT; unsigned int sz = SZ_64M >> PAGE_SHIFT;
if (machine_is_armcore()) { if (machine_is_armcore()) {
pr_info("Adjusting zones for CM-x270\n"); pr_info("Adjusting zones for CM-X270\n");
/* /*
* Only adjust if > 64M on current system * Only adjust if > 64M on current system
...@@ -60,19 +60,20 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size, ...@@ -60,19 +60,20 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size,
static void cmx270_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) static void cmx270_it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
{ {
/* clear our parent irq */ /* clear our parent irq */
GEDR(GPIO_IT8152_IRQ) = GPIO_bit(GPIO_IT8152_IRQ); GEDR(cmx270_it8152_irq_gpio) = GPIO_bit(cmx270_it8152_irq_gpio);
it8152_irq_demux(irq, desc); it8152_irq_demux(irq, desc);
} }
void __cmx270_pci_init_irq(void) void __cmx270_pci_init_irq(int irq_gpio)
{ {
it8152_init_irq(); it8152_init_irq();
pxa_gpio_mode(IRQ_TO_GPIO(GPIO_IT8152_IRQ));
set_irq_type(IRQ_GPIO(GPIO_IT8152_IRQ), IRQT_RISING);
set_irq_chained_handler(IRQ_GPIO(GPIO_IT8152_IRQ), cmx270_it8152_irq_gpio = irq_gpio;
cmx270_it8152_irq_demux);
set_irq_type(gpio_to_irq(irq_gpio), IRQT_RISING);
set_irq_chained_handler(gpio_to_irq(irq_gpio), cmx270_it8152_irq_demux);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -115,8 +116,8 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) ...@@ -115,8 +116,8 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
/* /*
Here comes the ugly part. The routing is baseboard specific, Here comes the ugly part. The routing is baseboard specific,
but defining a platform for each possible base of CM-x270 is but defining a platform for each possible base of CM-X270 is
unrealistic. Here we keep mapping for ATXBase and SB-x270. unrealistic. Here we keep mapping for ATXBase and SB-X270.
*/ */
/* ATXBASE PCI slot */ /* ATXBASE PCI slot */
if (slot == 7) if (slot == 7)
......
extern void __cmx270_pci_init_irq(void); extern void __cmx270_pci_init_irq(int irq_gpio);
extern void __cmx270_pci_suspend(void); extern void __cmx270_pci_suspend(void);
extern void __cmx270_pci_resume(void); extern void __cmx270_pci_resume(void);
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
#define cmx270_pci_init_irq __cmx270_pci_init_irq #define cmx270_pci_init_irq(x) __cmx270_pci_init_irq(x)
#define cmx270_pci_suspend __cmx270_pci_suspend #define cmx270_pci_suspend(x) __cmx270_pci_suspend(x)
#define cmx270_pci_resume __cmx270_pci_resume #define cmx270_pci_resume(x) __cmx270_pci_resume(x)
#else #else
#define cmx270_pci_init_irq() do {} while (0) #define cmx270_pci_init_irq(x) do {} while (0)
#define cmx270_pci_suspend() do {} while (0) #define cmx270_pci_suspend(x) do {} while (0)
#define cmx270_pci_resume() do {} while (0) #define cmx270_pci_resume(x) do {} while (0)
#endif #endif
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment