Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178787
b: refs/heads/master
c: f91e490
h: refs/heads/master
i:
  178785: f6b3566
  178783: 491a6db
v: v3
  • Loading branch information
Haojian Zhuang authored and Eric Miao committed Dec 29, 2009
1 parent d4fbb54 commit 9ccb3d0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 95 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c57b9343437a801f0a93b272df8eabf1df102034
refs/heads/master: f91e4906e26c053ab2ea6067c6354e49b71d8fa9
7 changes: 0 additions & 7 deletions trunk/arch/arm/mach-pxa/include/mach/zylonite.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
/* the following variables are processor specific and initialized
* by the corresponding zylonite_pxa3xx_init()
*/
struct platform_mmc_slot {
int gpio_cd;
int gpio_wp;
};

extern struct platform_mmc_slot zylonite_mmc_slot[];

extern int gpio_eth_irq;
extern int gpio_debug_led1;
extern int gpio_debug_led2;
Expand Down
87 changes: 14 additions & 73 deletions trunk/arch/arm/mach-pxa/zylonite.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
#include "devices.h"
#include "generic.h"

#define MAX_SLOTS 3
struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS];

int gpio_eth_irq;
int gpio_debug_led1;
int gpio_debug_led2;
Expand Down Expand Up @@ -220,92 +217,36 @@ static inline void zylonite_init_lcd(void) {}
#endif

#if defined(CONFIG_MMC)
static int zylonite_mci_ro(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);

return gpio_get_value(zylonite_mmc_slot[pdev->id].gpio_wp);
}

static int zylonite_mci_init(struct device *dev,
irq_handler_t zylonite_detect_int,
void *data)
{
struct platform_device *pdev = to_platform_device(dev);
int err, cd_irq, gpio_cd, gpio_wp;

cd_irq = gpio_to_irq(zylonite_mmc_slot[pdev->id].gpio_cd);
gpio_cd = zylonite_mmc_slot[pdev->id].gpio_cd;
gpio_wp = zylonite_mmc_slot[pdev->id].gpio_wp;

/*
* setup GPIO for Zylonite MMC controller
*/
err = gpio_request(gpio_cd, "mmc card detect");
if (err)
goto err_request_cd;
gpio_direction_input(gpio_cd);

err = gpio_request(gpio_wp, "mmc write protect");
if (err)
goto err_request_wp;
gpio_direction_input(gpio_wp);

err = request_irq(cd_irq, zylonite_detect_int,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
"MMC card detect", data);
if (err) {
printk(KERN_ERR "%s: MMC/SD/SDIO: "
"can't request card detect IRQ\n", __func__);
goto err_request_irq;
}

return 0;

err_request_irq:
gpio_free(gpio_wp);
err_request_wp:
gpio_free(gpio_cd);
err_request_cd:
return err;
}

static void zylonite_mci_exit(struct device *dev, void *data)
{
struct platform_device *pdev = to_platform_device(dev);
int cd_irq, gpio_cd, gpio_wp;

cd_irq = gpio_to_irq(zylonite_mmc_slot[pdev->id].gpio_cd);
gpio_cd = zylonite_mmc_slot[pdev->id].gpio_cd;
gpio_wp = zylonite_mmc_slot[pdev->id].gpio_wp;

free_irq(cd_irq, data);
gpio_free(gpio_cd);
gpio_free(gpio_wp);
}

static struct pxamci_platform_data zylonite_mci_platform_data = {
.detect_delay = 20,
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
.init = zylonite_mci_init,
.exit = zylonite_mci_exit,
.get_ro = zylonite_mci_ro,
.gpio_card_detect = -1,
.gpio_card_ro = -1,
.gpio_card_detect = EXT_GPIO(0),
.gpio_card_ro = EXT_GPIO(2),
.gpio_power = -1,
};

static struct pxamci_platform_data zylonite_mci2_platform_data = {
.detect_delay = 20,
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
.gpio_card_detect = EXT_GPIO(1),
.gpio_card_ro = EXT_GPIO(3),
.gpio_power = -1,
};

static struct pxamci_platform_data zylonite_mci3_platform_data = {
.detect_delay = 20,
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
.gpio_card_detect = EXT_GPIO(30),
.gpio_card_ro = EXT_GPIO(31),
.gpio_power = -1,
};

static void __init zylonite_init_mmc(void)
{
pxa_set_mci_info(&zylonite_mci_platform_data);
pxa3xx_set_mci2_info(&zylonite_mci2_platform_data);
if (cpu_is_pxa310())
pxa3xx_set_mci3_info(&zylonite_mci_platform_data);
pxa3xx_set_mci3_info(&zylonite_mci3_platform_data);
}
#else
static inline void zylonite_init_mmc(void) {}
Expand Down
12 changes: 2 additions & 10 deletions trunk/arch/arm/mach-pxa/zylonite_pxa300.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ static mfp_cfg_t common_mfp_cfg[] __initdata = {
GPIO22_I2C_SDA,

/* GPIO */
GPIO18_GPIO, /* GPIO Expander #0 INT_N */
GPIO19_GPIO, /* GPIO Expander #1 INT_N */
GPIO18_GPIO | MFP_PULL_HIGH, /* GPIO Expander #0 INT_N */
GPIO19_GPIO | MFP_PULL_HIGH, /* GPIO Expander #1 INT_N */
};

static mfp_cfg_t pxa300_mfp_cfg[] __initdata = {
Expand Down Expand Up @@ -258,10 +258,6 @@ void __init zylonite_pxa300_init(void)
/* detect LCD panel */
zylonite_detect_lcd_panel();

/* MMC card detect & write protect for controller 0 */
zylonite_mmc_slot[0].gpio_cd = EXT_GPIO(0);
zylonite_mmc_slot[0].gpio_wp = EXT_GPIO(2);

/* WM9713 IRQ */
wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO26);

Expand All @@ -276,10 +272,6 @@ void __init zylonite_pxa300_init(void)
if (cpu_is_pxa310()) {
pxa3xx_mfp_config(ARRAY_AND_SIZE(pxa310_mfp_cfg));
gpio_eth_irq = mfp_to_gpio(MFP_PIN_GPIO102);

/* MMC card detect & write protect for controller 2 */
zylonite_mmc_slot[2].gpio_cd = EXT_GPIO(30);
zylonite_mmc_slot[2].gpio_wp = EXT_GPIO(31);
}

/* GPIOs for Debug LEDs */
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/arm/mach-pxa/zylonite_pxa320.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ void __init zylonite_pxa320_init(void)
gpio_debug_led1 = mfp_to_gpio(MFP_PIN_GPIO1_2);
gpio_debug_led2 = mfp_to_gpio(MFP_PIN_GPIO4_2);

/* MMC card detect & write protect for controller 0 */
zylonite_mmc_slot[0].gpio_cd = mfp_to_gpio(MFP_PIN_GPIO1);
zylonite_mmc_slot[0].gpio_wp = mfp_to_gpio(MFP_PIN_GPIO5);

/* WM9713 IRQ */
wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO15);
}
Expand Down

0 comments on commit 9ccb3d0

Please sign in to comment.