1 Index: linux-3.7-rc8/arch/mips/lantiq/xway/Makefile
2 ===================================================================
3 --- linux-3.7-rc8.orig/arch/mips/lantiq/xway/Makefile 2012-12-13 13:40:23.000000000 +0100
4 +++ linux-3.7-rc8/arch/mips/lantiq/xway/Makefile 2012-12-13 13:40:49.788556963 +0100
6 obj-y := prom.o sysctrl.o clk.o reset.o dma.o timer.o dcdc.o
8 -obj-y += ath_eep.o rt_eep.o eth_mac.o
9 +obj-y += ath_eep.o rt_eep.o eth_mac.o vmmc.o
11 obj-$(CONFIG_XRX200_PHY_FW) += xrx200_phy_fw.o
12 Index: linux-3.7-rc8/arch/mips/lantiq/xway/vmmc.c
13 ===================================================================
14 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
15 +++ linux-3.7-rc8/arch/mips/lantiq/xway/vmmc.c 2012-12-13 13:40:30.520556476 +0100
18 + * This program is free software; you can redistribute it and/or modify it
19 + * under the terms of the GNU General Public License version 2 as published
20 + * by the Free Software Foundation.
22 + * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
25 +#include <linux/module.h>
26 +#include <linux/of_platform.h>
27 +#include <linux/of_gpio.h>
28 +#include <linux/dma-mapping.h>
30 +#include <lantiq_soc.h>
32 +static unsigned int *cp1_base = 0;
33 +unsigned int* ltq_get_cp1_base(void)
36 + panic("no cp1 base was set\n");
39 +EXPORT_SYMBOL(ltq_get_cp1_base);
41 +static int __devinit vmmc_probe(struct platform_device *pdev)
43 +#define CP1_SIZE (1 << 20)
47 + (void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC));
49 + gpio_count = of_gpio_count(pdev->dev.of_node);
50 + while (gpio_count) {
51 + enum of_gpio_flags flags;
52 + int gpio = of_get_gpio_flags(pdev->dev.of_node, --gpio_count, &flags);
53 + if (gpio_request(gpio, "vmmc-relay"))
55 + dev_info(&pdev->dev, "requested GPIO %d\n", gpio);
56 + gpio_direction_output(gpio, (flags & OF_GPIO_ACTIVE_LOW) ? (0) : (1));
59 + dev_info(&pdev->dev, "reserved %dMB at 0x%p", CP1_SIZE >> 20, cp1_base);
64 +static const struct of_device_id vmmc_match[] = {
65 + { .compatible = "lantiq,vmmc" },
68 +MODULE_DEVICE_TABLE(of, vmmc_match);
70 +static struct platform_driver vmmc_driver = {
71 + .probe = vmmc_probe,
73 + .name = "lantiq,vmmc",
74 + .owner = THIS_MODULE,
75 + .of_match_table = vmmc_match,
79 +module_platform_driver(vmmc_driver);