Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28106
b: refs/heads/master
c: 8866035
h: refs/heads/master
v: v3
  • Loading branch information
Richard Purdie authored and Russell King committed Jun 19, 2006
1 parent b474551 commit 5564882
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 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: 74617fb6b825ea370ae72565f7543306bc08ef6e
refs/heads/master: 88660351cb6daa85baf9700f12dff3af564dc14a
22 changes: 18 additions & 4 deletions trunk/arch/arm/mach-pxa/poodle.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/platform_device.h>
#include <linux/fb.h>
#include <linux/pm.h>
#include <linux/delay.h>

#include <asm/hardware.h>
#include <asm/mach-types.h>
Expand Down Expand Up @@ -143,7 +144,9 @@ static int poodle_mci_init(struct device *dev, irqreturn_t (*poodle_detect_int)(
pxa_gpio_mode(GPIO6_MMCCLK_MD);
pxa_gpio_mode(GPIO8_MMCCS0_MD);
pxa_gpio_mode(POODLE_GPIO_nSD_DETECT | GPIO_IN);
pxa_gpio_mode(POODLE_GPIO_nSD_WP | GPIO_IN);
pxa_gpio_mode(POODLE_GPIO_SD_PWR | GPIO_OUT);
pxa_gpio_mode(POODLE_GPIO_SD_PWR1 | GPIO_OUT);

poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250);

Expand All @@ -162,12 +165,22 @@ static void poodle_mci_setpower(struct device *dev, unsigned int vdd)
{
struct pxamci_platform_data* p_d = dev->platform_data;

if (( 1 << vdd) & p_d->ocr_mask)
GPSR1 = GPIO_bit(POODLE_GPIO_SD_PWR);
else
GPCR1 = GPIO_bit(POODLE_GPIO_SD_PWR);
if (( 1 << vdd) & p_d->ocr_mask) {
GPSR(POODLE_GPIO_SD_PWR) = GPIO_bit(POODLE_GPIO_SD_PWR);
mdelay(2);
GPSR(POODLE_GPIO_SD_PWR1) = GPIO_bit(POODLE_GPIO_SD_PWR1);
} else {
GPCR(POODLE_GPIO_SD_PWR1) = GPIO_bit(POODLE_GPIO_SD_PWR1);
GPCR(POODLE_GPIO_SD_PWR) = GPIO_bit(POODLE_GPIO_SD_PWR);
}
}

static int poodle_mci_get_ro(struct device *dev)
{
return GPLR(POODLE_GPIO_nSD_WP) & GPIO_bit(POODLE_GPIO_nSD_WP);
}


static void poodle_mci_exit(struct device *dev, void *data)
{
free_irq(POODLE_IRQ_GPIO_nSD_DETECT, data);
Expand All @@ -176,6 +189,7 @@ static void poodle_mci_exit(struct device *dev, void *data)
static struct pxamci_platform_data poodle_mci_platform_data = {
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
.init = poodle_mci_init,
.get_ro = poodle_mci_get_ro,
.setpower = poodle_mci_setpower,
.exit = poodle_mci_exit,
};
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-arm/arch-pxa/poodle.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define POODLE_GPIO_CF_CD (14)
#define POODLE_GPIO_CF_STSCHG (14)
#define POODLE_GPIO_SD_PWR (33)
#define POODLE_GPIO_SD_PWR1 (3)
#define POODLE_GPIO_nSD_CLK (6)
#define POODLE_GPIO_nSD_WP (7)
#define POODLE_GPIO_nSD_INT (8)
Expand All @@ -42,6 +43,7 @@
#define POODLE_GPIO_BYPASS_ON (36)
#define POODLE_GPIO_CHRG_ON (38)
#define POODLE_GPIO_CHRG_FULL (16)
#define POODLE_GPIO_DISCHARGE_ON (42) /* Enable battery discharge */

/* PXA GPIOs */
#define POODLE_IRQ_GPIO_ON_KEY IRQ_GPIO(0)
Expand Down

0 comments on commit 5564882

Please sign in to comment.