Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166118
b: refs/heads/master
c: df1e052
h: refs/heads/master
v: v3
  • Loading branch information
Linus Walleij authored and Russell King committed Aug 15, 2009
1 parent 0b96087 commit 693f200
Show file tree
Hide file tree
Showing 5 changed files with 393 additions and 61 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: 5ad73d07173e7b76c16bcb8b6cf64d8386019689
refs/heads/master: df1e0520f9434b5b771c854a13dd928727d8673a
13 changes: 0 additions & 13 deletions trunk/arch/arm/mach-u300/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
#include <linux/platform_device.h>
#include <linux/gpio.h>

/* Need access to SYSCON registers for PADmuxing */
#include <mach/syscon.h>

#include "padmux.h"

/* Reference to GPIO block clock */
static struct clk *clk;

Expand Down Expand Up @@ -606,14 +601,6 @@ static int __init gpio_probe(struct platform_device *pdev)
writel(U300_GPIO_CR_BLOCK_CLKRQ_ENABLE, virtbase + U300_GPIO_CR);
#endif

/* Set up some padmuxing here */
#ifdef CONFIG_MMC
pmx_set_mission_mode_mmc();
#endif
#ifdef CONFIG_SPI_PL022
pmx_set_mission_mode_spi();
#endif

gpio_set_initial_values();

for (num_irqs = 0 ; num_irqs < U300_GPIO_NUM_PORTS; num_irqs++) {
Expand Down
16 changes: 16 additions & 0 deletions trunk/arch/arm/mach-u300/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <asm/mach/mmc.h>
#include "mmc.h"
#include "padmux.h"

struct mmci_card_event {
struct input_dev *mmc_input;
Expand Down Expand Up @@ -146,6 +147,7 @@ int __devinit mmc_init(struct amba_device *adev)
{
struct mmci_card_event *mmci_card;
struct device *mmcsd_device = &adev->dev;
struct pmx *pmx;
int ret = 0;

mmci_card = kzalloc(sizeof(struct mmci_card_event), GFP_KERNEL);
Expand Down Expand Up @@ -205,6 +207,20 @@ int __devinit mmc_init(struct amba_device *adev)

input_set_drvdata(mmci_card->mmc_input, mmci_card);

/*
* Setup padmuxing for MMC. Since this must always be
* compiled into the kernel, pmx is never released.
*/
pmx = pmx_get(mmcsd_device, U300_APP_PMX_MMC_SETTING);

if (IS_ERR(pmx))
pr_warning("Could not get padmux handle\n");
else {
ret = pmx_activate(mmcsd_device, pmx);
if (IS_ERR_VALUE(ret))
pr_warning("Could not activate padmuxing\n");
}

ret = gpio_register_callback(U300_GPIO_PIN_MMC_CD, mmci_callback,
mmci_card);

Expand Down
Loading

0 comments on commit 693f200

Please sign in to comment.