-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] pxa: Refactor Colibri board support code
- Move common function for all Colibri PXA3xx boards to the newly added colibri-pxa3xx.c - Drop some unnecessary defines from colibri.h - Make Kconfig reflect the fact that code for colibri 300 module does also work for the 310 model - Give up on the huge pin config table which was messed up with lots of #ifdefs and switch over to locally defined tables for configured functions Cc: Matthias Meier <matthias.j.meier@gmx.net> Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Eric Miao <eric.miao@marvell.com>
- Loading branch information
Daniel Mack
authored and
Eric Miao
committed
Mar 23, 2009
1 parent
626806d
commit acb3655
Showing
5 changed files
with
119 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* arch/arm/mach-pxa/colibri-pxa3xx.c | ||
* | ||
* Common functions for all Toradex PXA3xx modules | ||
* | ||
* Daniel Mack <daniel@caiaq.de> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/gpio.h> | ||
#include <asm/mach-types.h> | ||
#include <mach/hardware.h> | ||
#include <asm/sizes.h> | ||
#include <asm/mach/arch.h> | ||
#include <asm/mach/irq.h> | ||
#include <mach/pxa3xx-regs.h> | ||
#include <mach/mfp-pxa300.h> | ||
#include <mach/colibri.h> | ||
#include <mach/mmc.h> | ||
|
||
#include "generic.h" | ||
#include "devices.h" | ||
|
||
#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | ||
static int mmc_detect_pin; | ||
|
||
static int colibri_pxa3xx_mci_init(struct device *dev, | ||
irq_handler_t colibri_mmc_detect_int, | ||
void *data) | ||
{ | ||
int ret; | ||
|
||
ret = gpio_request(mmc_detect_pin, "mmc card detect"); | ||
if (ret) | ||
return ret; | ||
|
||
gpio_direction_input(mmc_detect_pin); | ||
ret = request_irq(gpio_to_irq(mmc_detect_pin), colibri_mmc_detect_int, | ||
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | ||
"MMC card detect", data); | ||
if (ret) { | ||
gpio_free(mmc_detect_pin); | ||
return ret; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
static void colibri_pxa3xx_mci_exit(struct device *dev, void *data) | ||
{ | ||
free_irq(mmc_detect_pin, data); | ||
gpio_free(gpio_to_irq(mmc_detect_pin)); | ||
} | ||
|
||
static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = { | ||
.detect_delay = 20, | ||
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | ||
.init = colibri_pxa3xx_mci_init, | ||
.exit = colibri_pxa3xx_mci_exit, | ||
}; | ||
|
||
void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin) | ||
{ | ||
pxa3xx_mfp_config(pins, len); | ||
mmc_detect_pin = detect_pin; | ||
pxa_set_mci_info(&colibri_pxa3xx_mci_platform_data); | ||
} | ||
#endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters